Chapter 16. Automagically generated reference

Table of Contents
write_config_str
write_config_bool
write_config_int
get_config_str
get_config_bool
get_config_int
field_get_property
table_get_field_no
subtable_get_field_no
format_plugin_can_do
get_plugin_options
free_everything
gaby_perror_in_a_box
new_view_create
select_subtable_dialog
actions_menu_for_table
page_select_fields
page_select_fields_get_info
get_record_no
get_table_stringed_field
get_table_stringed_field_id
get_subtable_stringed_field
get_subtable_stringed_field_id
get_related_records
get_conditional_records_list
get_value_for_that_string
set_table_stringed_field
set_subtable_stringed_field
record_add
record_free
record_remove_id
record_remove
record_modify
record_defaults
record_duplicate
table_search_record
subtable_search_record
table_next
table_prev
table_first
table_last
table_next_with_conditions
table_prev_with_conditions
table_first_with_conditions
table_last_with_conditions
table_get_records_count
update_windows
get_window_by_name
update_bound_windows

This chapter is automagically generated from the source code and shouldn't be outdated.

write_config_str

gboolean write_config_str (gchar * type, gchar * name, gchar * item, gchar * str);

This function saves in the config file (usually Gabyrc) the option item with the value str under a section which will be named type:name.

Returns: TRUE if ok

write_config_bool

gboolean write_config_bool (gchar * type, gchar * name, gchar * item, gboolean val);

This function saves in the config file (usually Gabyrc) the option item with the boolean value val under a section which will be named type:name. The option will be written as 'TRUE' or 'FALSE' in the config file.

Returns: TRUE if ok

write_config_int

gboolean write_config_int (gchar * type, gchar * name, gchar * item, gint val);

This function saves in the config file (usually Gabyrc) the option item with the integer value val under a section which will be named type:name.

Returns: TRUE if ok

get_config_str

gchar* get_config_str (gchar * type, gchar * name, gchar * item, gchar * def);

This function gets from the config file (usually Gabyrc) the option item under a section which will be named type:name.

Returns: the value of the option, def if it was not present (the caller has to g_free the allocated string)

get_config_bool

gboolean get_config_bool (gchar * type, gchar * name, gchar * item, gboolean def);

This function gets from the config file (usually Gabyrc) the option item under a section which will be named type:name.

Returns: the value of the option, def if it was not present

get_config_int

gint get_config_int (gchar * type, gchar * name, gchar * item, gint def);

This function gets from the config file (usually Gabyrc) the option item under a section which will be named type:name.

Returns: the value of the option, def if it was not present

field_get_property

property* field_get_property (field * f, gchar * ident);

This functions allows you to get values for any property the user (or the creator of the desc file) has defined for the field.

Returns: the property you want, NULL if not found

table_get_field_no

int table_get_field_no (table * t, char * st);

This functions returns the number of the field named str in the table t.

Returns: field number

subtable_get_field_no

int subtable_get_field_no (subtable * st, char * str);

This functions returns the number of the field named str in the subtable st.

Returns: field number (-2 if not found)

format_plugin_can_do

gboolean format_plugin_can_do (FILE * f, char * name, table * t, gint way);

this function looks if a given plug-in is able to load (or save) a file for a given table.

Returns: TRUE, FALSE, not much choice

get_plugin_options

GList* get_plugin_options (char * section);

This function load a given section from the 'plugins_options' section of the current desc file.

Returns: A Glist filled with g_malloc'ed gchar* (please free them)

free_everything

void free_everything (void);

This function will free every little structure allocated by Gaby. Its use should be very limited but is mandatory for PyApache. (actually it only frees records, tables and subtables)

This function will free every little structure allocated by Gaby. Its use should be very limited but is mandatory for PyApache. (actually it only frees records, tables and subtables)

gaby_perror_in_a_box

void gaby_perror_in_a_box (void);

If gaby_errno is set (to something else than 0), this function shows a box with a message explaining the error gaby_errno (if the GUI isn't currently available the message is simply printed on console). Note that with some value of gaby_errno (CUSTOM_*) it will use the text which is in gaby_message.

new_view_create

gabywindow* new_view_create (struct window_info * wi);

This function creates a new window holding a view plug-in

Returns: the window (gabywindow*) created

select_subtable_dialog

gboolean* select_subtable_dialog (char * text, void (* callback);

This function creates a dialog with a list filled with subtable names.

Returns: a gboolean pointer you can use together with wait_dialog_to_finish (don't forget to g_free it if you don't use this function)

actions_menu_for_table

GtkWidget* actions_menu_for_table (table * table, gabywindow * window);

This functions creates a menu (GtkMenu) filled with the actions available for the given table, win is used to get the current view and id (it may be NULL if _no_ actions need them)

Returns: GtkWidget* menu (NULL if there were no actions)

page_select_fields

static GtkWidget* page_select_fields (subtable * st, char * checkbox, int selected);

this creates a standard field selection page to use in print plug-ins

Returns: the widget to put in the page

page_select_fields_get_info

void page_select_fields_get_info (subtable * st, GtkWidget * page, gboolean * active, int * selected);

this returns the info from a select_fields page

get_record_no

record* get_record_no (table * t, int id);

Search for a given record.

Returns: Pointer to a record (NULL if not found)

get_table_stringed_field

GString* get_table_stringed_field (table * t, record * r, int field_no);

This function returns a string with the information of the field field_no form the record r whatever the type of the field is. This allows plug-ins to not worry about dates, number, ... (doesn't include T_RECORD).

Returns: Pointer to a string with the information (you have to g_string_free it)

get_table_stringed_field_id

GString* get_table_stringed_field_id (table * t, int id, int field_no);

This functions does the same job that get_subtable_record_field() does excepted that the second parameter is a int. This is useful when you don't have a faster way to acceed the record structure than get_record_no() (which is used in this function).

Returns: a string with the information you want, you have to free it

get_subtable_stringed_field

GString* get_subtable_stringed_field (subtable * st, record * r, int field_no);

This function returns a string with the information of the field field_no form the record r whatever the type of the field is. This allows plug-ins to not worry about dates, integer and (important) links to other tables (type 'record'). (this is a wrapper for get_table_stringed_field)

Returns: Pointer to a string with the information (you have to free it)

get_subtable_stringed_field_id

GString* get_subtable_stringed_field_id (subtable * st, int id, int field_no);

This functions does the same job that get_subtable_record_field() does excepted that the second parameter is a int. This is useful when you don't have a faster way to acceed the record structure than get_record_no() (which is used in this function).

Returns: a string with the information you want, you have to free it

get_related_records

GList* get_related_records (st_field * sf, int id);

This functions searchs in a table for the record related to the given one.

Returns: a GList filled with positions (not id !) of records in the related table (or filled with -1 if no related records)

get_conditional_records_list

GList* get_conditional_records_list (subtable * st, condition * other);

This functions searchs for records matching the subtable's conditions as well as other conditions (eventually).

Returns: a GList filled with positions (not id !) of records

get_value_for_that_string

void get_value_for_that_string (union data * val, field_type type, gchar * str);

This functions converts a given str according its gaby type

set_table_stringed_field

void set_table_stringed_field (table * t, record * r, int field_no, gchar * str);

This function set the field field_no of the record r to the value given by the string str whatever the type of the field is.

set_subtable_stringed_field

void set_subtable_stringed_field (subtable * st, record * r, int field_no, gchar * str);

This function set the field field_no of the record r to the value given by the string str whatever the type of the field is. (this is a wrapper for set_table_stringed_field)

record_add

int record_add (table * t, record * r, gboolean check, gboolean loading);

This function append the record r to the table t, if check is TRUE, the record is checked against the rules specified in the description file.

Returns: id of the new record, -1 if failed

record_free

void record_free (table * t, record * r);

This function frees memory allocated for the record r's fields.

record_remove_id

gboolean record_remove_id (table * t, int id);

This function delete the record with the id id from the table t.

Returns: TRUE if it worked, FALSE if it didn't.

record_remove

gboolean record_remove (table * t, record * r);

This function delete the record r from the table t.

Returns: TRUE if this works, FALSE if it doesn't.

record_modify

gboolean record_modify (table * t, record * r);

This functions modifies a record in the table t according to the record r (its id and its contents)

Returns: TRUE if ok

record_defaults

record* record_defaults (table * t);

Description This function returns a record filled with the default value for the table t.

Returns: the record (record*)

record_duplicate

record* record_duplicate (table * t, record * r);

Description This function returns a new record filled with the values previously in r

Returns: the new record (record*)

table_search_record

int table_search_record (table * t, int nf, char* what, int from);

This functions searchs for a record whose field nf matches (actually starts with) what in table t

Returns: record position in table->records, -1 if not found

subtable_search_record

int subtable_search_record (subtable * st, int nf, char* what, int from);

This functions searchs for a record whose field nf matches (actually starts with) what in subtable st. (this is actually a stupid wrapper for table_search_record)

Returns: record position in subtable->table->records, -1 if not found

table_next

record* table_next (table * t, record * r, int no_field);

This function returns the record directly following the record you gave as second parameter. no_field allows you to specify a field on which the table is sorted (or -1 if you don't want the table to be sorted). Note that the first time you specify a field number Gaby will have to create an index for this field and this may be long but this will only happens once (by session). Note that if you were on the last record you will stay there.

Returns: the record you want to go to.

table_prev

record* table_prev (table * t, record * r, int no_field);

This function returns the record directly preceding the record you gave as second parameter. no_field allows you to specify a field on which the table is sorted (or -1 if you don't want the table to be sorted). Note that the first time you specify a field number Gaby will have to create an index for this field and this may be long but this will only happens once (by session). Note that if you were on the first record you will stay there.

Returns: the record you want to go to.

table_first

record* table_first (table * t, int no_field);

This function returns the first record of the table t. no_field allows you to specify a field on which the table is sorted (or -1 if you don't want the table to be sorted). Note that the first time you specify a field number Gaby will have to create an index for this field and this may be long but this will only happens once (by session). Note that if you were on the first record you will stay there.

Returns: the record you want to go to.

table_last

record* table_last (table * t, int no_field);

This function returns the last record of the table t. no_field allows you to specify a field on which the table is sorted (or -1 if you don't want the table to be sorted). Note that the first time you specify a field number Gaby will have to create an index for this field and this may be long but this will only happens once (by session). Note that if you were on the last record you will stay there.

Returns: the record you want to go to.

table_next_with_conditions

record* table_next_with_conditions (table * t, record * r, int no_field, condition * c);

same as table_next but only stops on records fulfilling the given conditions

Returns: the record you want to go to.

table_prev_with_conditions

record* table_prev_with_conditions (table * t, record * r, int no_field, condition * c);

same as table_prev but only stops on records fulfilling the given conditions

Returns: the record you want to go to.

table_first_with_conditions

record* table_first_with_conditions (table * t, int no_field, condition * c);

same as table_first but goes to the first record fulfilling the given conditions

Returns: the record you want to go to.

table_last_with_conditions

record* table_last_with_conditions (table * t, int no_field, condition * c);

same as table_last but goes to the last record fulfilling the given conditions

Returns: the record you want to go to.

table_get_records_count

int table_get_records_count (table * t);

This function counts the number of records in a given table.

update_windows

void update_windows (gabywindow * window);

This function update every windows after a change (usually a new, modified or deleted record) which happens in window.

get_window_by_name

gabywindow* get_window_by_name (gchar * st);

This functions searchs for a window named st ( "s [s]", subtable name, view name).

Returns: the window

update_bound_windows

void update_bound_windows (gabywindow * window);

This function sets the record id of every windows bound to win to the value it has in win.