// luaL_loadstring
498648
func (L *State) LoadString(s string) int {
	Cs := C.CString(s)
	defer C.free(unsafe.Pointer(Cs))
	return int(C.luaL_loadstring(L.s, Cs))
}
665325
func (ut *URLTransformer) LoadPath(path string) error {
	path = ut.rxStripQuery.ReplaceAllString(path, "")
	i1 := strings.Index(path, "{")
	i2 := strings.Index(path, "}")
	if i1 < 0 && i2 < 0 {
		ut.ExactPaths = append(ut.ExactPaths, path)
		return nil
	}
	linkPattern := ut.rxMatchPattern.ReplaceAllString(path, rxMatchParameterActual)
	linkPattern = `^` + linkPattern + `$`
	rx, err := regexp.Compile(linkPattern)
	if err != nil {
		return err
	}
	ut.RegexpPaths[path] = rx
	return nil
}
1130601
func loadFileContent(v string) ([]byte, error) {
	filename, err := homedir.Expand(v)
	if err != nil {
		return nil, err
	}
	fileContent, err := ioutil.ReadFile(filename)
	if err != nil {
		return nil, err
	}
	return fileContent, nil
}
1291259
func (b *builtinSubTimeStringNullSig) evalString(row chunk.Row) (string, bool, error) {
	return "", true, nil
}
705373
func (handle SharedObject) LoadFunction(name string) unsafe.Pointer {
	_name := C.CString(name)
	defer C.free(unsafe.Pointer(_name))
	return (unsafe.Pointer)(C.SDL_LoadFunction((unsafe.Pointer)(handle), _name))
}
1094200
func URLString(ustring string) RequestOption {
	return func(req *http.Request) (*http.Request, error) {
		u, err := url.Parse(ustring)
		if err != nil {
			return nil, err
		}

		req.URL = u
		return req, nil
	}
}
928380
func (L *State) CheckString(narg int) string {
	var length C.size_t
	return C.GoString(C.luaL_checklstring(L.s, C.int(narg), &length))
}
823533
func (t TokenMap) LoadFile(filename string) error {
	data, err := ioutil.ReadFile(filename)
	if err != nil {
		return err
	}
	return t.LoadBytes(data)
}
1270352
func (b *builtinRowSig) evalString(row chunk.Row) (string, bool, error) {
	panic("builtinRowSig.evalString() should never be called.")
}
583833
func NewStringLexer(input string, fn LexFn) *StringLexer {
	return &StringLexer{
		input:       input,
		inputLength: len(input),
		start:       0,
		pos:         0,
		line:        1,
		width:       0,
		items:       make(chan LexItem, 1),
		entryPoint:  fn,
	}
}
798936
func (l *List) LoadString(src string, options *ParserOption) ([]Rule, error) {
	r := strings.NewReader(src)
	return l.parse(r, options)
}
239656
func (inst *DenseInstances) RowString(row int) string {
	var buffer bytes.Buffer
	first := true
	for _, p := range inst.ags {
		if first {
			first = false
		} else {
			buffer.WriteString(" ")
		}
		p.appendToRowBuf(row, &buffer)
	}
	return buffer.String()
}
317430
func LvlFromString(lvlString string) (Lvl, error) {
	switch lvlString {
	case "trace", "trce":
		return LvlTrace, nil
	case "debug", "dbug":
		return LvlDebug, nil
	case "info":
		return LvlInfo, nil
	case "warn":
		return LvlWarn, nil
	case "error", "eror":
		return LvlError, nil
	case "crit":
		return LvlCrit, nil
	default:
		return LvlDebug, fmt.Errorf("Unknown level: %v", lvlString)
	}
}
1307609
func (ls *LState) LoadFile(path string) (*LFunction, error) {
	var file *os.File
	var err error
	if len(path) == 0 {
		file = os.Stdin
	} else {
		file, err = os.Open(path)
		defer file.Close()
		if err != nil {
			return nil, newApiErrorE(ApiErrorFile, err)
		}
	}

	reader := bufio.NewReader(file)
	// get the first character.
	c, err := reader.ReadByte()
	if err != nil && err != io.EOF {
		return nil, newApiErrorE(ApiErrorFile, err)
	}
	if c == byte('#') {
		// Unix exec. file?
		// skip first line
		_, err, _ = readBufioLine(reader)
		if err != nil {
			return nil, newApiErrorE(ApiErrorFile, err)
		}
	}

	if err != io.EOF {
		// if the file is not empty,
		// unread the first character of the file or newline character(readBufioLine's last byte).
		err = reader.UnreadByte()
		if err != nil {
			return nil, newApiErrorE(ApiErrorFile, err)
		}
	}

	return ls.Load(reader, path)
}
825910
func (b *builtinHexStrArgSig) evalString(row chunk.Row) (string, bool, error) {
	d, isNull, err := b.args[0].EvalString(b.ctx, row)
	if isNull || err != nil {
		return d, isNull, err
	}
	return strings.ToUpper(hex.EncodeToString(hack.Slice(d))), false, nil
}
990226
func LoadFile(path string) error {
	return Load(file.NewSource(
		file.WithPath(path),
	))
}
881239
func (b *builtinFormatSig) evalString(row chunk.Row) (string, bool, error) {
	x, d, isNull, err := evalNumDecArgsForFormat(b, row)
	if isNull || err != nil {
		return "", isNull, err
	}
	formatString, err := mysql.GetLocaleFormatFunction("en_US")(x, d)
	return formatString, false, err
}