Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

tc_load.c File Reference


Detailed Description

For internal use only.

This file contains the implementation of the tc_load() function, used to load a configuration from a file.

Definition in file tc_load.c.

#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "treeconf_int.h"

Include dependency graph for tc_load.c:

Include dependency graph

Go to the source code of this file.

Defines

#define Q_O
 Quote octal.
#define Q_X
 Quote hexadecimal.
#define Q_S
 Quote self.
#define xlate(c)
 Character code translation.
#define accum(buf, c)
 String accumulator.
#define clear(buf)
 Clear string buffer.
#define finish(buf)
 Finish string buffer.
#define cunget(chr)
 Push back a character.
#define FL_DQUOTE
 Double quote mode.
#define FL_SQUOTE
 Single quote mode.
#define FL_CQUOTE
 Character quote.
#define FL_OCTCHR
 Octal character.
#define FL_HEXCHR
 Hexadecimal character.
#define FL_QUOTEMASK
 Quote mask.
#define FL_SPACE
 Space flag.
#define quoted()
 Quoted helper macro.

Functions

unsigned int tc_load (const char *file, void *v_ctx)
 Load a configuration file.

Variables

int xform []
 Character code transform.


Define Documentation

#define accum buf,
 ) 
 

For internal use only.

This helper macro accumulates the character c into the buffer named by the buf argument.

Parameters:
buf The name (as a bare word) of the buffer into which to accumulate the character.
c The character to accumulate.

Definition at line 95 of file tc_load.c.

Referenced by tc_load().

#define clear buf   ) 
 

For internal use only.

This helper macro clears the buffer named by the buf argument.

Parameters:
buf The name (as a bare word) of the buffer to clear.

Definition at line 109 of file tc_load.c.

Referenced by tc_load().

#define cunget chr   ) 
 

For internal use only.

This macro puts the character chr back, to be read on the next pass through the state loop.

Parameters:
chr The character to put back.

Definition at line 129 of file tc_load.c.

Referenced by tc_load().

#define finish buf   ) 
 

For internal use only.

This helper macro terminates the buffer named by the buf argument.

Parameters:
buf The name (as a bare word) of the buffer to terminate.

Definition at line 119 of file tc_load.c.

Referenced by tc_load().

#define FL_CQUOTE
 

For internal use only.

If set, this flag indicates that the character has been quoted.

Definition at line 158 of file tc_load.c.

#define FL_DQUOTE
 

For internal use only.

If set, this flag indicates that the character is part of a double-quoted string.

Definition at line 143 of file tc_load.c.

#define FL_HEXCHR
 

For internal use only.

If set, this flag indicates that the character is part of a hexadecimal escape sequence.

Definition at line 174 of file tc_load.c.

#define FL_OCTCHR
 

For internal use only.

If set, this flag indicates that the character is part of an octal escape sequence.

Definition at line 166 of file tc_load.c.

#define FL_QUOTEMASK
 

For internal use only.

If any of the flags in this mask are set, any special meaning for the character is ignored.

Definition at line 182 of file tc_load.c.

#define FL_SPACE
 

For internal use only.

If this flag is set, spaces are accepted and discarded.

Definition at line 190 of file tc_load.c.

#define FL_SQUOTE
 

For internal use only.

If set, this flag indicates that the character is part of a single-quoted string.

Definition at line 151 of file tc_load.c.

#define Q_O
 

For internal use only.

Used to indicate that a sequence denotes octal quoting.

Definition at line 43 of file tc_load.c.

Referenced by tc_load().

#define Q_S
 

For internal use only.

Used to indicate that a sequence denotes self-insertion.

Definition at line 57 of file tc_load.c.

Referenced by tc_load().

#define Q_X
 

For internal use only.

Used to indicate that a sequence denotes hexadecimal quoting.

Definition at line 50 of file tc_load.c.

Referenced by tc_load().

 
#define quoted  ) 
 

For internal use only.

This macro is used to determine if a character is quoted.

Returns:
Boolean true if the current character is quoted, false otherwise.

Definition at line 200 of file tc_load.c.

Referenced by tc_load().

#define xlate  ) 
 

For internal use only.

This macro utilizes the xform array to determine what character the escaped c parameter maps to.

Parameters:
c The character to translate.
Returns:
The translated character.

Definition at line 82 of file tc_load.c.

Referenced by tc_load().


Variable Documentation

int xform[] [static]
 

For internal use only.

This array is used to indicate character code translations and their functions. For instance, 'f' maps to the '\f' element in the array.

Definition at line 66 of file tc_load.c.


Generated on Wed Jun 8 09:18:33 2005 for treeconf by  doxygen 1.3.9.1