libgeda
|
Parse configuration files. More...
#include <config.h>
#include <missing.h>
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>
#include <ctype.h>
#include "libgeda_priv.h"
Go to the source code of this file.
Defines | |
#define | HANDLER_DISPATCH |
#define | FUNC_NAME "world-size" |
Functions | |
int | vstbl_lookup_str (const vstbl_entry *table, int size, const char *str) |
int | vstbl_get_val (const vstbl_entry *table, int index) |
SCM | g_rc_mode_general (SCM scmmode, const char *rc_name, int *mode_var, const vstbl_entry *table, int table_size) |
gboolean | g_rc_parse_system (TOPLEVEL *toplevel, const gchar *rcname, GError **err) |
Load a system configuration file. | |
gboolean | g_rc_parse_user (TOPLEVEL *toplevel, const gchar *rcname, GError **err) |
Load a user configuration file. | |
gboolean | g_rc_parse_local (TOPLEVEL *toplevel, const gchar *rcname, const gchar *path, GError **err) |
Load a local configuration file. | |
static gboolean | g_rc_try_mark_read (TOPLEVEL *toplevel, gchar *filename, GError **err) |
Mark a configuration file as read. | |
gboolean | g_rc_parse_file (TOPLEVEL *toplevel, const gchar *rcfile, GError **err) |
Load a configuration file. | |
static void | g_rc_parse__process_error (GError **err, const gchar *pname) |
void | g_rc_parse (TOPLEVEL *toplevel, const gchar *pname, const gchar *rcname, const gchar *rcfile) |
General RC file parsing function. | |
void | g_rc_parse_handler (TOPLEVEL *toplevel, const gchar *rcname, const gchar *rcfile, ConfigParseErrorFunc handler, void *user_data) |
General RC file parsing function. | |
SCM | g_rc_component_library (SCM path, SCM name) |
SCM | g_rc_component_library_command (SCM listcmd, SCM getcmd, SCM name) |
Guile callback for adding library commands. | |
SCM | g_rc_component_library_funcs (SCM listfunc, SCM getfunc, SCM name) |
Guile callback for adding library functions. | |
SCM | g_rc_source_library (SCM path) |
SCM | g_rc_source_library_search (SCM path) |
SCM | g_rc_rc_filename () |
Get the name of the RC filename being evaluated. | |
SCM | g_rc_world_size (SCM width, SCM height, SCM border) |
SCM | g_rc_untitled_name (SCM name) |
SCM | g_rc_scheme_directory (SCM s_path) |
Add a directory to the Guile load path. | |
SCM | g_rc_bitmap_directory (SCM path) |
SCM | g_rc_bus_ripper_symname (SCM scmsymname) |
SCM | g_rc_postscript_prolog (SCM scmsymname) |
SCM | g_rc_reset_component_library (void) |
SCM | g_rc_reset_source_library (void) |
SCM | g_rc_attribute_promotion (SCM mode) |
SCM | g_rc_promote_invisible (SCM mode) |
SCM | g_rc_keep_invisible (SCM mode) |
SCM | g_rc_always_promote_attributes (SCM attrlist) |
SCM | g_rc_make_backup_files (SCM mode) |
Enable the creation of backup files when saving. | |
SCM | g_rc_print_color_map (SCM scm_map) |
Variables | |
COLOR | print_colors [MAX_COLORS] |
Contains functions to open, parse and manage gEDA configuration (RC) files.
Definition in file g_rc.c.
#define HANDLER_DISPATCH |
do { if (err == NULL) break; handler (&err, user_data); \ g_error_free (err); err = NULL; } while (0)
#define FUNC_NAME "world-size" |
int vstbl_lookup_str | ( | const vstbl_entry * | table, |
int | size, | ||
const char * | str | ||
) |
int vstbl_get_val | ( | const vstbl_entry * | table, |
int | index | ||
) |
SCM g_rc_mode_general | ( | SCM | scmmode, |
const char * | rc_name, | ||
int * | mode_var, | ||
const vstbl_entry * | table, | ||
int | table_size | ||
) |
gboolean g_rc_parse_system | ( | TOPLEVEL * | toplevel, |
const gchar * | rcname, | ||
GError ** | err | ||
) |
toplevel | The current TOPLEVEL structure. |
rcfile | The basename of the configuration file to load, or NULL. |
err | Return location for errors, or NULL. |
Definition at line 128 of file g_rc.c.
gboolean g_rc_parse_user | ( | TOPLEVEL * | toplevel, |
const gchar * | rcname, | ||
GError ** | err | ||
) |
toplevel | The current TOPLEVEL structure. |
rcfile | The basename of the configuration file to load, or NULL. |
err | Return location for errors, or NULL. |
Definition at line 154 of file g_rc.c.
gboolean g_rc_parse_local | ( | TOPLEVEL * | toplevel, |
const gchar * | rcname, | ||
const gchar * | path, | ||
GError ** | err | ||
) |
toplevel | The current TOPLEVEL structure. |
rcname | The basename of the configuration file to load, or NULL. |
path | The path to load a configuration file for, or NULL. |
err | Return location for errors, or NULL. |
Definition at line 179 of file g_rc.c.
static gboolean g_rc_try_mark_read | ( | TOPLEVEL * | toplevel, |
gchar * | filename, | ||
GError ** | err | ||
) | [static] |
toplevel | The current TOPLEVEL structure. |
filename | The config file name to test. |
err | Return location for errors, or NULL. |
gboolean g_rc_parse_file | ( | TOPLEVEL * | toplevel, |
const gchar * | rcfile, | ||
GError ** | err | ||
) |
toplevel | The current TOPLEVEL structure. |
rcfile | The filename of the configuration file to load. |
err | Return location for errors, or NULL; |
Definition at line 252 of file g_rc.c.
static void g_rc_parse__process_error | ( | GError ** | err, |
const gchar * | pname | ||
) | [static] |
void g_rc_parse | ( | TOPLEVEL * | toplevel, |
const gchar * | pname, | ||
const gchar * | rcname, | ||
const gchar * | rcfile | ||
) |
[in] | toplevel | The current TOPLEVEL structure. |
[in] | pname | The name of the application (usually argv[0]). |
[in] | rcname | Config file basename, or NULL. |
[in] | rcfile | Specific config file path, or NULL. |
Definition at line 341 of file g_rc.c.
void g_rc_parse_handler | ( | TOPLEVEL * | toplevel, |
const gchar * | rcname, | ||
const gchar * | rcfile, | ||
ConfigParseErrorFunc | handler, | ||
void * | user_data | ||
) |
If an error occurs, calls handler with the provided user_data and a GError.
toplevel | The current TOPLEVEL structure. |
rcname | Config file basename, or NULL. |
rcfile | Specific config file path, or NULL. |
handler | Handler function for config parse errors. |
user_data | Data to be passed to handler. |
Definition at line 369 of file g_rc.c.
SCM g_rc_component_library | ( | SCM | path, |
SCM | name | ||
) |
SCM g_rc_component_library_command | ( | SCM | listcmd, |
SCM | getcmd, | ||
SCM | name | ||
) |
[in] | listcmd | command to get a list of symbols |
[in] | getcmd | command to get a symbol from the library |
[in] | name | Optional descriptive name for component source. |
Definition at line 466 of file g_rc.c.
SCM g_rc_component_library_funcs | ( | SCM | listfunc, |
SCM | getfunc, | ||
SCM | name | ||
) |
[in] | listfunc | A Scheme procedure which takes no arguments and returns a Scheme list of component names. |
[in] | getfunc | A Scheme procedure which takes a component name as an argument and returns a symbol encoded in a string in gEDA format, or the #f if the component name is unknown. |
[in] | name | A descriptive name for this component source. |
Definition at line 525 of file g_rc.c.
SCM g_rc_source_library | ( | SCM | path | ) |
SCM g_rc_source_library_search | ( | SCM | path | ) |
SCM g_rc_rc_filename | ( | ) |
SCM g_rc_world_size | ( | SCM | width, |
SCM | height, | ||
SCM | border | ||
) |
SCM g_rc_untitled_name | ( | SCM | name | ) |
SCM g_rc_scheme_directory | ( | SCM | s_path | ) |
SCM g_rc_bitmap_directory | ( | SCM | path | ) |
SCM g_rc_bus_ripper_symname | ( | SCM | scmsymname | ) |
SCM g_rc_postscript_prolog | ( | SCM | scmsymname | ) |
SCM g_rc_reset_component_library | ( | void | ) |
SCM g_rc_reset_source_library | ( | void | ) |
SCM g_rc_attribute_promotion | ( | SCM | mode | ) |
SCM g_rc_promote_invisible | ( | SCM | mode | ) |
SCM g_rc_keep_invisible | ( | SCM | mode | ) |
SCM g_rc_always_promote_attributes | ( | SCM | attrlist | ) |
SCM g_rc_make_backup_files | ( | SCM | mode | ) |
SCM g_rc_print_color_map | ( | SCM | scm_map | ) |
COLOR print_colors[MAX_COLORS] |