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

Conf4CFile

Conf4CFile - A logical construction of a configuration file

Synopsis

#include "conf4csection.h"
#include "conf4cvector.h"

struct Conf4CFile;

Conf4CFile *	conf4c_file_new				(const char *fname,
							 const char *comment,
							 const char *delim,
							 Conf4CDelimType dtype,
							 const unsigned int type_capacity,
							 const unsigned int instance_capacity,
							 const unsigned int entry_capacity,
					 		 const unsigned int base_entry_capacity);
int		conf4c_file_add_section			(Conf4CFile *c4cf,
					 		 Conf4CSection *csect);
char *		conf4c_file_get_filename		(Conf4CFile *c4cf);
int		conf4c_file_get_section_count		(const Conf4CFile *c4cf);
char *		conf4c_file_get_section_type		(const Conf4CFile *c4cf,
							 const unsigned int index);
int 		conf4c_file_get_section_index		(const Conf4CFile *c4cf,
							 const char *type);
Conf4CSection *	conf4c_file_get_section_by_index	(const Conf4CFile *c4cf,
							 const unsigned int index);
Conf4CSection * conf4c_file_get_section_by_type		(const Conf4CFile *c4cf,
							 const char *type);

Description

Conf4CFile maintains a logical view of a configuration file's contents in terms of sections, section-instances, and name / value pairs.

struct Conf4CFile

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

conf4c_file_new ()

Conf4CFile * conf4c_file_new 	(const char *fname,
				 const char *comment,
				 const char *delim,
				 Conf4CDelimType dtype,
				 const unsigned int type_capacity,
				 const unsigned int instance_capacity,
				 const unsigned int entry_capacity,
				 const unsigned int base_entry_capacity);
Creates a new Conf4CFile.

 
Returns : a newly created Conf4CFile, unparsed

conf4c_file_add_section ()

int	conf4c_file_add_section	(Conf4CFile *c4cf,
				 Conf4CSection *csect);
Adds a Conf4CSection instance to the Conf4CFile.

 
c4cf : a Conf4CFile
csect : the Conf4CSection instance to add to c4cf
Returns : an int value indicating success or failure; 1 = success, 0 = failure

conf4c_file_get_filename ()

char *	conf4c_file_get_filename	(const Conf4CFile *c4cf);
Returns the filename of the Conf4CFile instance's configuration file.

 
c4cf : a Conf4CFile

conf4c_file_get_section_count ()

int	conf4c_file_get_section_count	(const Conf4CFile *c4cf);
Returns the number of Conf4CSections contained within the Conf4CFile.

 
c4cf : a Conf4CFile

conf4c_file_get_section_type ()

char *	conf4c_file_get_section_type	(const Conf4CFile *c4cf,
					 const unsigned int index);
Returns the type of the Conf4CSection indicated by the specified index.

 
c4cf : a Conf4CFile
index : a positive index indicating which Conf4CSection to reference
Returns : a NULL value if the index is invalid

conf4c_file_get_section_index ()

int	conf4c_file_get_section_index	(const Conf4CFile *c4cf,
					 const char *type);
Locates a Conf4CSection by its type and returns the index of the specified section.

 
c4cf : a Conf4CFile
type : a string specifying the section type
Returns : a -1 if the specified section type is not found

conf4c_file_get_section_by_index ()

Conf4CSection *	conf4c_file_get_section_by_index	(const Conf4CFile *c4cf
								 const unsigned int index);
Returns a pointer to the indexed Conf4CSection.

 
c4cf : a Conf4CFile
index : the index of the desired Conf4CSection
Returns : NULL is the index is invalid

conf4c_file_get_section_by_type ()

Conf4CSection	conf4c_file_get_section_by_type	(const Conf4CFile *c4cf,
							 const char *type);
Returns a pointer to the identified Conf4CSection.

 
c4cf : a Conf4CFile
type : a string identifying the section type
Returns : NULL if the specified section type is not found

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

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