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:
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. |
|
For internal use only.
This helper macro accumulates the character
Definition at line 95 of file tc_load.c. Referenced by tc_load(). |
|
For internal use only.
This helper macro clears the buffer named by the
Definition at line 109 of file tc_load.c. Referenced by tc_load(). |
|
For internal use only.
This macro puts the character
Definition at line 129 of file tc_load.c. Referenced by tc_load(). |
|
For internal use only.
This helper macro terminates the buffer named by the
Definition at line 119 of file tc_load.c. Referenced by tc_load(). |
|
For internal use only. If set, this flag indicates that the character has been quoted. |
|
For internal use only. If set, this flag indicates that the character is part of a double-quoted string. |
|
For internal use only. If set, this flag indicates that the character is part of a hexadecimal escape sequence. |
|
For internal use only. If set, this flag indicates that the character is part of an octal escape sequence. |
|
For internal use only. If any of the flags in this mask are set, any special meaning for the character is ignored. |
|
For internal use only. If this flag is set, spaces are accepted and discarded. |
|
For internal use only. If set, this flag indicates that the character is part of a single-quoted string. |
|
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(). |
|
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(). |
|
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(). |
|
For internal use only. This macro is used to determine if a character is quoted.
Definition at line 200 of file tc_load.c. Referenced by tc_load(). |
|
For internal use only.
This macro utilizes the xform array to determine what character the escaped
Definition at line 82 of file tc_load.c. Referenced by tc_load(). |
|
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. |