File src/glib/override.c

Functions

local g_iconv (converter, inbuf) Streaming capable converter.
local g_object_get_class (object) Perform the G_OBJECT_GET_CLASS on an object.
local g_object_set_property (object, property_name, value) Set a property of an object.
local g_type_from_name (name) g_type_from_name fails unless the type has been initialized before.
local l_g_atexit (L) The function g_atexit cannot be used.
local l_g_dir_close (L) This function frees the structure; don't do it again on GC
local l_g_list_free (L) Handle the call to g_list_free.
local l_g_object_get (L) Get one or more properties of the object.
local l_g_object_set (L) When calling g_object_set directly, the values are sometimes not converted correctly, e.g. int versus float.
local l_g_slist_free (L) Override for g_slist_free: if the "data" part of each list element is to be freed, do it automatically.
local l_g_tree_destroy (L) This function actually frees the object.
local l_g_utf8_next_char (L) This function is a macro and therefore is missing from the function list.


Functions

local g_iconv (converter, inbuf)
Streaming capable converter. It will convert as much as possible from the input buffer; it may leave some bytes unused, which you should prepend to any data read later.

Parameters

  • converter: GIConv as returned from g_iconv_open
  • inbuf: The string to convert
local g_object_get_class (object)
Perform the G_OBJECT_GET_CLASS on an object. Try all possible *Class structures in the hierarchy until one is found.

Parameters

  • object:

Return values:

  1. The class object (GObjectClass) of the object, or nil on error.
local g_object_set_property (object, property_name, value)
Set a property of an object. The difficulty is to first convert the value to a GValue of the correct type, because that is what the GLib function expects.

Parameters

  • object: Object derived from GObject
  • property_name:
  • value: The value to set the property to
local g_type_from_name (name)
g_type_from_name fails unless the type has been initialized before. Use my wrapper that handles the initialization when required.

Parameters

  • name: The type name to look up.

Return values:

  1. The type number, or nil on error.
local l_g_atexit (L)
The function g_atexit cannot be used. The reason is that before such atexit routines are called by libc, shared libraries may already have been unloaded, or the memory containing the closure may have been freed. This all can lead to SEGV on program exit. Disallow usage of atexit.

Parameters

  • L:
local l_g_dir_close (L)
This function frees the structure; don't do it again on GC

Parameters

  • L:
local l_g_list_free (L)
Handle the call to g_list_free. A GList is usually freed automatically, so this is just to prevent the second, automatic freeing which would cause a SEGV.

Parameters

  • L:
local l_g_object_get (L)
Get one or more properties of the object. The API differs from the C API, as each requested value is returned; no need to provide a pointer for each property where to store the result.

Parameters

  • L:

Return value:

val... - for each name, one value.
local l_g_object_set (L)
When calling g_object_set directly, the values are sometimes not converted correctly, e.g. int versus float. Additionally, this override allows to omit the last argument (nil).

Parameters

  • L:
local l_g_slist_free (L)
Override for g_slist_free: if the "data" part of each list element is to be freed, do it automatically. After calling g_slist_free, the list doesn't exist anymore. This is shown by setting w->p to NULL and w->is_deleted to 1.

Parameters

  • L:
local l_g_tree_destroy (L)
This function actually frees the object. Don't do that again when collecting garbage.

Parameters

  • L:
local l_g_utf8_next_char (L)
This function is a macro and therefore is missing from the function list. It can therefore not be called via call_byname. It uses the symbol g_utf8_skip, which is a "const char*".

Parameters

  • L:

Valid XHTML 1.0!