[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Conf4CReader

Conf4CReader - A convenience object used to easily read a parsed Conf4CFile

Synopsis

#include "conf4cfile.h"

struct Conf4CReader;

Conf4CReader *	conf4c_reader_new			(Conf4CFile *c4cf);
Conf4CReader *	conf4c_reader_get_named_value		(Conf4CReader *c4cr,
							 const char *type,
							 const char *stor,
							 const char *name);

/* Conf4CSection manipulation functions */
int		conf4c_reader_get_section_count		(Conf4CReader *c4cr);
int		conf4c_reader_set_current_section	(Conf4CReader *c4cr,
							 const unsigned int sect_index);
int		conf4c_reader_set_typed_section	(Conf4CReader *c4cr,
							 const char *type);
int		conf4c_reader_next_section		(Conf4CReader *c4cr);
char *		conf4c_reader_get_section_type		(Conf4CReader *c4cr);

/* Conf4CStor manipulation functions */
int		conf4c_reader_get_stor_count		(Conf4CReader *c4cr);
int		conf4c_reader_set_current_stor		(Conf4CReader *c4cr,
							 const unsigned int stor_index);
int		conf4c_reader_set_named_stor	(Conf4CReader *c4cr,
							 const char *name);
int		conf4c_reader_next_stor			(Conf4CReader *c4cr);
char *		conf4c_reader_get_stor_name		(Conf4CReader *c4cr);

/* name / value manipulation functions */
int		conf4c_reader_get_name_value_count	(Conf4CReader *c4cr);
int		conf4c_reader_set_current_name_value	(Conf4CReader *c4cr,
							 const unsigned int nv_index);
int		conf4c_reader_set_named_value	(Conf4CReader *c4cr,
							 const char *name);
int		conf4c_reader_next_name_value 		(Conf4CReader *c4cr);
char *		conf4c_reader_get_value_name		(Conf4CReader *c4cr);
char *		conf4c_reader_get_value			(Conf4CReader *c4cr);

Description

The Conf4CReader allows an application to easily traverse an already parsed Conf4CFile, providing simple sequential access to all name / value pairs obtained from a configuration file.

Details

struct Conf4CReader

struct Conf4CReader;
This should not be accessed directly. Use the accessor functions below.

conf4c_reader_new ()

Conf4CReader * conf4c_reader_new (Conf4CFile *c4cf);
Creates a new Conf4CReader.

 
c4cf : an initialized and parsed (see conf4c_file_parse ()) Conf4CFile
Returns : a new Conf4CReader

conf4c_reader_get_named_value ()

int conf4c_reader_get_named_value 	(Conf4CReader *c4cr,
					 const char *type,
					 const char *stor,
					 const char *name);
Retrieves the specified value.

 
c4cr : a Conf4CReader
type : the name of the section-type containing the desired value
stor : the name of the section instance containing the desired value
name : the name of the desired value
Returns : the desired value or NULL if the value is not found

conf4c_reader_get_section_count ()

int conf4c_reader_get_section_count (Conf4CReader *c4cr);
Returns the number of section types captured from the parsed configuration file.

 
c4cr : a Conf4CReader

conf4c_reader_set_current_section ()

int conf4c_reader_set_current_section	(Conf4CReader *c4cr,
					 const unsigned int sect_index);
Points the Conf4CReader to the Conf4CSection at sect_index.

 
c4cr : a Conf4CReader
sect_index : the index of the desired Conf4CSection
Returns : a 0 if the sect_index is invalid

conf4c_reader_next_section ()

int conf4c_reader_next_section	(Conf4CReader *c4cr);
Moves the Conf4CReader on to the next Conf4CSection.

 
Returns : a 0 if the end of the Conf4CSection array has been reached

conf4c_reader_get_section_type ()

char * conf4c_reader_get_section_type	(Conf4CReader *c4cr);
Returns the section type of the current section.

conf4c_reader_set_typed_section ()

int conf4c_reader_set_typed_section	(Conf4CReader *c4cr,
					 const char *type);
Points the Conf4CReader to the Conf4CSection instances of type type.

 
c4cr : a Conf4CReader
type : the type of the desired section
Returns : a 0 if the section type is not found

conf4c_reader_get_stor_count ()

int conf4c_reader_get_stor_count	(Conf4CReader *c4cr);
Returns the number of Conf4CStor instances held within the current Conf4CSection.

conf4c_reader_set_current_stor ()

int conf4c_reader_set_current_stor 	(Conf4CReader *c4cr,
					 const unsigned int stor_index);
Sets the current Conf4CStor to that of the stor_index'th instance.

 
Returns : a 0 if the stor_index is invalid

conf4c_reader_set_named_stor ()

int conf4c_reader_set_named_stor	(Conf4CReader *c4cr,
					 const char *name);
Points the Conf4CReader to the Conf4CStor with name name.

 
c4cr : a Conf4CReader
name : the name of the desired section
Returns : a 0 if the section instance is not found

conf4c_reader_next_stor ()

int conf4c_reader_next_stor (Conf4CReader *c4cr);
Moves the Conf4CReader on to the next Conf4CStor instance within the current Conf4CSection.

 
Returns : 0 if no more Conf4CStor instances exist

conf4c_reader_get_stor_name ()

char * conf4c_reader_get_stor_name (Conf4CReader *c4cr);
Returns the name of the current Conf4CStor (the name of the current section instance).

conf4c_reader_get_name_value_count ()

int conf4c_reader_get_name_value_count (Conf4CReader *c4cr);
Returns the number of name / value pairs within the current Conf4CStor.

conf4c_reader_set_current_name_value ()

int conf4c_reader_set_current_name_value	(Conf4CReader *c4cr,
						 const unsigned int nv_index);
Points Conf4CReader at the nv_index'th name / value pair.

 
Returns : 0 if the specified nv_index is invalid (greater than the number of available name / value pairs)

conf4c_reader_set_named_value ()

int conf4c_reader_set_named_value	(Conf4CReader *c4cr,
					 const char *name);
Points Conf4CReader at the name / value pair with name name.

 
Returns : 0 if the specified name / value pair is not found

conf4c_reader_next_name_value ()

int conf4c_reader_next_name_value (Conf4CReader *c4cr);
Moves the Conf4CReader on to the next name / value pair.

 
Returns : 0 if the available name / value pairs have been exceeded

conf4c_reader_get_value_name ()

char * conf4c_reader_get_value_name (Conf4CReader *c4cr);
Returns the name portion of the current name / value pair.

conf4c_reader_get_value ()

char * conf4c_reader_get_value (Conf4CReader *c4cr);
Returns the value portion of the current name / value pair.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated on October, 29 2004 using texi2html 1.70.