File src/gnome/call.c

Functions

local _call_build_parameters (L, index, ci) Prepare to call the Gtk function by converting all the parameters into the required format as required by libffi.
local _call_return_values (L, index, ci) After completing a call to a Gtk function, push the return values on the Lua stack.
call_info_alloc () Provide an unused call_info structure.
call_info_alloc_item (ci, size) Allocate space for an extra parameter.
call_info_check_argcount (ci, n) Make sure that the given number of arguments are allocated for the function call.
call_info_free (ci) Release a call_info structure.
call_info_free_pool () At program exit (library close), free the pool.
call_info_msg (L, ci, level) Display a warning or an error about a function call.
call_info_warn (ci) Before showing a warning message, call this function, which shows the function call, but only for the first warning.
get_next_argument (L, p, ar) Retrieve the next argument spec from the binary representation (data from the hash table).
lg_call (L, fi, index) Call a library function from Lua.
lg_call_byname (L, mi, func_name) Call the given function by name, and use the current Lua stack as parameters.
lg_call_function (L, mod_name, func_name) Similar to lg_call_byname, but when the module of the function is provided as name and not directly.


Functions

local _call_build_parameters (L, index, ci)
Prepare to call the Gtk function by converting all the parameters into the required format as required by libffi.

Parameters

  • L: lua_State
  • index: Lua stack position of first parameter
  • ci: call_info structure with lots more data Returns 0 on error, 1 otherwise.
local _call_return_values (L, index, ci)
After completing a call to a Gtk function, push the return values on the Lua stack.

Parameters

  • L: Lua State
  • index: Stack position of the function's first argument.
  • ci: Call Info of the called function.
call_info_alloc ()
Provide an unused call_info structure. It may be taken from the pool, or newly allocated. In both cases, it is initialized to 0.
call_info_alloc_item (ci, size)
Allocate space for an extra parameter. These memory blocks are kept in a singly linked list and are freed in call_info_free.

Parameters

  • ci: The call_info this memory is allocated for
  • size: How many bytes to allocate

Return value:

A pointer to the newly allocated memory.
call_info_check_argcount (ci, n)
Make sure that the given number of arguments are allocated for the function call. The additional space must be zeroed.

Parameters

  • ci:
  • n:
call_info_free (ci)
Release a call_info structure. The attached extra parameters are freed, then the stucture is put into the pool. If a warning has been displayed, output a newline. Note that ci->warnings may be set to 2, this means that an unconditional trace caused the function call to be printed; in this case, no extra newline is desired.

Parameters

  • ci: The structure to be freed
call_info_free_pool ()
At program exit (library close), free the pool. This is not really required but may help spotting memory leaks.
call_info_msg (L, ci, level)
Display a warning or an error about a function call. The message is on top of the Lua stack.

Parameters

  • L:
  • ci:
  • level: Error level; 0=debug, 1=info, 2=warning, 3=error
call_info_warn (ci)
Before showing a warning message, call this function, which shows the function call, but only for the first warning. If full tracing is enabled, then the function signature has already been shown.

Parameters

  • ci:
get_next_argument (L, p, ar)
Retrieve the next argument spec from the binary representation (data from the hash table). Only native types are returned. The types are sorted by descending frequency, so that lower type numbers are more common. If the type number is less than 128, it is encoded in one byte; if more, two bytes are required. A type number can be preceded by flags (zero byte + flag byte). The caller must take care not to read past the end of the data. The caller must set ar->ts.module_idx.

Parameters

  • L:
  • p: Pointer to the pointer to the current position (will be updated)
  • ar: Argument conversion structure. It has the fields arg_flags, ts
lg_call (L, fi, index)
Call a library function from Lua. The information about parameters and return values is compiled in (automatically generated).

Parameters

  • L: Lua State
  • fi: Description of the library function to call
  • index: Lua stack position where the first argument is

Return value:

The number of results on the Lua stack
lg_call_byname (L, mi, func_name)
Call the given function by name, and use the current Lua stack as parameters. Note: this does NOT consider overrides, which is intentional as some override functions use this to call into Gtk.

Parameters

  • L:
  • mi:
  • func_name:
lg_call_function (L, mod_name, func_name)
Similar to lg_call_byname, but when the module of the function is provided as name and not directly.

Parameters

  • L:
  • mod_name:
  • func_name:

Valid XHTML 1.0!