Main Page | Modules | Data Structures | File List | Data Fields | Globals

Configuration handling


Functions

void discover_conf_load (discover_error_t *status)
int discover_conf_name_to_bus (char *name, discover_error_t *status)
discover_bus_map_tdiscover_conf_get_full_bus_map (discover_error_t *status)
discover_bus_map_tdiscover_conf_get_bus_map_by_name (char *name, discover_error_t *status)
discover_bus_map_tdiscover_conf_get_bus_map (discover_bus_t bus, discover_error_t *status)
void discover_conf_insert_url (char *url, discover_error_t *status)
void discover_conf_append_url (char *url, discover_error_t *status)
discover_xml_url_tdiscover_conf_get_urls (discover_error_t *status)
void discover_conf_free (void)
char * discover_conf_get_bus_name (discover_bus_t bus)
char * discover_conf_get_filetype_name (discover_filetype_t filetype)

Function Documentation

void discover_conf_append_url char *  url,
discover_error_t status
 

Append the URL specified in url at the tail of the list of URLs where Discover data will be retrieved.

Parameters:
url URL to append
status Address in which to place status report

Definition at line 509 of file conf.c.

References discover_error::code, discover_conf_load(), and discover_error_t.

void discover_conf_free void   ) 
 

Free configuration data. This is mainly useful so that the next call to discover_conf_load will reload the configuration data.

Definition at line 580 of file conf.c.

References discover_xml_url_free().

discover_bus_map_t* discover_conf_get_bus_map discover_bus_t  bus,
discover_error_t status
 

Get the bus map for a single bus.

Parameters:
bus Name of the bus whose map to get
status Address in which to place status report

Definition at line 445 of file conf.c.

References BUS_COUNT, discover_error::code, discover_bus_map_t, discover_conf_load(), DISCOVER_EBUSNOTFOUND, and discover_error_t.

Referenced by discover_get_devices().

discover_bus_map_t* discover_conf_get_bus_map_by_name char *  name,
discover_error_t status
 

Get the bus map by name for a single bus.

Parameters:
name Name of the bus whose map to get
status Address in which to place status report

Definition at line 422 of file conf.c.

References _real_discover_conf_get_bus_map_by_name(), discover_error::code, discover_conf_load(), and discover_error_t.

char* discover_conf_get_bus_name discover_bus_t  bus  ) 
 

Translate an enum bus value into a string.

Parameters:
bus Bus type in enumerated form

Definition at line 596 of file conf.c.

References BUS_COUNT, and discover_bus_map::name.

Referenced by discover_xml_get_data_urls().

char* discover_conf_get_filetype_name discover_filetype_t  filetype  ) 
 

Translate an enum filetype value into a string.

Parameters:
filetype Filetype in enumerated form

Definition at line 612 of file conf.c.

Referenced by discover_xml_get_data_urls().

discover_bus_map_t* discover_conf_get_full_bus_map discover_error_t status  ) 
 

Get the full bus map, listing all buses.

Parameters:
status Address in which to place status report

Definition at line 409 of file conf.c.

References discover_conf_load(), and discover_error_t.

Referenced by discover_device_find().

discover_xml_url_t* discover_conf_get_urls discover_error_t status  ) 
 

Get the list of URLs from which XML data will be retrieved.

Parameters:
status Address in which to place status report

Definition at line 529 of file conf.c.

References discover_error::code, discover_conf_load(), discover_error_t, discover_xml_url_new(), and discover_xml_url_t.

Referenced by discover_xml_get_urls().

void discover_conf_insert_url char *  url,
discover_error_t status
 

Insert the URL specified in url at the head of the list of URLs where Discover data will be retrieved.

Parameters:
url URL to insert
status Address in which to place status report

Definition at line 470 of file conf.c.

References discover_error::code, discover_conf_load(), discover_error_t, discover_xml_url_new(), and discover_xml_url_t.

void discover_conf_load discover_error_t status  ) 
 

Ensure that the configuration file is loaded. Repeated calls to this function will not change anything, unless you call discover_conf_free.

Technically, this function will lie to you if there is no conf file. Even though no configuration was loaded, repeated calls still will not change anything. However, if we don't do this and a config file is created between the time some long-lived caller first calls discover_conf_load and the time it calls it again, it will be loaded. This doesn't strike me as idempotent behavior. So, repeated calls even in this case will not change anything unless you call discover_conf_free.

Parameters:
status Address in which to place status report

Definition at line 319 of file conf.c.

References discover_error::code, discover_error::create_message, discover_error_t, and DISCOVER_EXML.

Referenced by discover_conf_append_url(), discover_conf_get_bus_map(), discover_conf_get_bus_map_by_name(), discover_conf_get_full_bus_map(), discover_conf_get_urls(), and discover_conf_insert_url().

int discover_conf_name_to_bus char *  name,
discover_error_t status
 

Get the bus enumeration for a bus name.

Parameters:
name Name of the bus
status Address in which to place status report

Definition at line 390 of file conf.c.

References discover_error::code, DISCOVER_EBUSNOTFOUND, discover_error_t, and discover_bus_map::name.

Referenced by _real_discover_conf_get_bus_map_by_name().


Generated on Sat Jan 31 14:39:18 2004 for discover by doxygen 1.3.4