Gaby's documentation | ||
---|---|---|
Prev |
This chapter is automagically generated from the source code and shouldn't be outdated.
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
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
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
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)
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
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
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
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
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)
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
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)
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)
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.
gabywindow* new_view_create
(struct window_info * wi);This function creates a new window holding a view plug-in
Returns: the window (gabywindow*) created
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)
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)
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
void page_select_fields_get_info
(subtable * st, GtkWidget * page, gboolean * active, int * selected);this returns the info from a select_fields page
record* get_record_no
(table * t, int id);Search for a given record.
Returns: Pointer to a record (NULL if not found)
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)
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
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)
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
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)
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
void get_value_for_that_string
(union data * val, field_type type, gchar * str);This functions converts a given str according its gaby type
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.
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)
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
void record_free
(table * t, record * r);This function frees memory allocated for the record r's fields.
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.
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.
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* record_defaults
(table * t);Description This function returns a record filled with the default value for the table t.
Returns: the record (record*)
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*)
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
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
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.
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.
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.
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.
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.
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.
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.
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.
int table_get_records_count
(table * t);This function counts the number of records in a given table.
void update_windows
(gabywindow * window);This function update every windows after a change (usually a new, modified or deleted record) which happens in window.
gabywindow* get_window_by_name
(gchar * st);This functions searchs for a window named st ( "s [s]", subtable name, view name).
Returns: the window
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.