//export golua_callgofunction
355511
func golua_callgofunction(gostateindex uintptr, fid uint) int {
	L1 := getGoState(gostateindex)
	if fid < 0 {
		panic(&LuaError{0, "Requested execution of an unknown function", L1.StackTrace()})
	}
	f := L1.registry[fid].(LuaGoFunction)
	return f(L1)
}
407249
func (l *State) call(function int, resultCount int, allowYield bool) {
	if l.nestedGoCallCount++; l.nestedGoCallCount == maxCallCount {
		l.runtimeError("Go stack overflow")
	} else if l.nestedGoCallCount >= maxCallCount+maxCallCount>>3 {
		l.throw(ErrorError) // error while handling stack error
	}
	if !allowYield {
		l.nonYieldableCallCount++
	}
	if !l.preCall(function, resultCount) { // is a Lua function?
		l.execute() // call it
	}
	if !allowYield {
		l.nonYieldableCallCount--
	}
	l.nestedGoCallCount--
}
215097
func caller() string {
	pc, file, _, ok := runtime.Caller(2)
	if ok && filepath.Base(file) == "current.go" {
		pc, _, _, ok = runtime.Caller(3)
	}
	if !ok {
		return "<unknown>"
	}

	return runtime.FuncForPC(pc).Name()
}
492237
func GetCallObject(n ast.Node, ctx *Context) (*ast.CallExpr, types.Object) {
	switch node := n.(type) {
	case *ast.CallExpr:
		switch fn := node.Fun.(type) {
		case *ast.Ident:
			return node, ctx.Info.Uses[fn]
		case *ast.SelectorExpr:
			return node, ctx.Info.Uses[fn.Sel]
		}
	}
	return nil, nil
}
21712
func (obj *fakeObject) Call(method string, flags godbus.Flags, args ...interface{}) Call {
	ret, err := obj.handler(method, args...)
	return &fakeCall{ret, err}
}
352221
func (self *_object) isCall() bool {
	switch fn := self.value.(type) {
	case _nativeFunctionObject:
		return fn.call != nil
	case _bindFunctionObject:
		return true
	case _nodeFunctionObject:
		return true
	}
	return false
}
852590
func (f UnaryOutboundFunc) Call(ctx context.Context, request *transport.Request, out transport.UnaryOutbound) (*transport.Response, error) {
	return f(ctx, request, out)
}
902995
func (c *Client) CallCloudFunction(functionName string, arguments map[string]interface{}) ([]byte, error) {
	if arguments == nil {
		arguments = map[string]interface{}{}
	}
	payload, err := json.Marshal(arguments)
	if err != nil {
		return nil, err
	}
	uri := fmt.Sprintf("/1/functions/%s", functionName)
	resp, err := c.doWithBody("POST", uri, bytes.NewReader(payload))
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		c.trace("CallCloudFunction err", uri, string(body))
		return nil, err
	}
	c.trace("CallCloudFunction", uri, string(body))
	return body, err
}
526148
func makeFunction(attributes []string) func(interface{}) string {
	return func(text interface{}) string {
		return fmt.Sprintf("\033[%sm%s\033[0m", strings.Join(attributes, ";"), text)
	}
}
921094
func _go_call_sort_func(gsfi *C._gtk_sort_func_info) {
	if gsfi == nil {
		return
	}
	gots := *(pointer.Restore(unsafe.Pointer(gsfi.gots)).(**TreeSortable))
	if gots.sortFuncs[int(gsfi.columnNum)].fun == nil {
		return
	}
	var a, b TreeIter
	a.GTreeIter = gsfi.a
	b.GTreeIter = gsfi.b
	fun := gots.sortFuncs[int(gsfi.columnNum)].fun
	userData := gots.sortFuncs[int(gsfi.columnNum)].userData
	gsfi.ret = C.int(fun(&TreeModel{gsfi.model}, &a, &b, userData))
}
269864
func goFunctionCall(cCtx *C.duk_context) C.duk_ret_t {
	d := contextFromPointer(cCtx)

	funPtr, ctx := d.getFunctionPtrs()
	d.transmute(unsafe.Pointer(ctx))

	result := d.fnIndex.get(funPtr)(d)

	return C.duk_ret_t(result)
}
444488
func CallFunc(getFuncByName func(string) (interface{}, bool), funcName string, params ...interface{}) ([]reflect.Value, error) {
	fn, ok := getFuncByName(funcName)
	if !ok {
		return nil, errors.New("no func found: " + funcName)
	}
	f := reflect.ValueOf(fn)
	if len(params) != f.Type().NumIn() {
		return nil, errors.New("parameter mismatched")
	}
	in := make([]reflect.Value, len(params))
	for k, param := range params {
		in[k] = reflect.ValueOf(param)
	}
	return f.Call(in), nil
}
389294
func (L *State) PushGoClosure(f LuaGoFunction) {
	L.PushGoFunction(f)      // leaves Go function userdata on stack
	C.clua_pushcallback(L.s) // wraps the userdata object with a closure making it into a function
}
185327
func go_msg_callback(msgID C.uint16_t, data unsafe.Pointer, size C.size_t) {
	// convert unsafe.Pointer to byte slice
	sliceHeader := &reflect.SliceHeader{Data: uintptr(data), Len: int(size), Cap: int(size)}
	byteSlice := *(*[]byte)(unsafe.Pointer(sliceHeader))

	globalVppClient.msgCallback(uint16(msgID), byteSlice)
}
1303225
func GenerateGFunction(rm rbac.RoleManager) func(args ...interface{}) (interface{}, error) {
	return func(args ...interface{}) (interface{}, error) {
		name1 := args[0].(string)
		name2 := args[1].(string)

		if rm == nil {
			return name1 == name2, nil
		} else if len(args) == 2 {
			res, _ := rm.HasLink(name1, name2)
			return res, nil
		} else {
			domain := args[2].(string)
			res, _ := rm.HasLink(name1, name2, domain)
			return res, nil
		}
	}
}
575507
func formatCall(format string, c stack.Call) string {
	return fmt.Sprintf(format, c)
}
1211826
func getCallerInfo() (funcName, file string, line int, err error) {
	const callDepth = 2 // user code calls q.Q() which calls std.log().
	pc, file, line, ok := runtime.Caller(callDepth)
	if !ok {
		return "", "", 0, errors.New("failed to get info about the function calling q.Q")
	}

	funcName = runtime.FuncForPC(pc).Name()
	return funcName, file, line, nil
}