configfile.c File Reference

#include <sys/types.h>
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <time.h>
#include <sys/stat.h>
#include <ctype.h>
#include <configfile.h>

Include dependency graph for configfile.c:

Go to the source code of this file.

Data Structures

struct  configfile
struct  firstconfig

Defines

#define nil   ((void*)0)
#define fstat   _fstat
#define stat   _stat
#define _c
#define configfilesize(len)   (offsetof(configfile_t, name) + 1 + (len))
#define config0size()   (offsetof(config_t, word))
#define configsize(len)   (config0size() + 1 + (len))
#define firstconfigsize(len)   (offsetof(firstconfig_t, config1) + configsize(len))
#define cfg2fcfg(p)   ((firstconfig_t *) ((char *) (p) - offsetof(firstconfig_t, config1)))
#define fcfg2cfg(p)   (&(p)->config1)
#define deallocate(mem)   free(mem)

Typedefs

typedef configfile configfile_t
typedef firstconfig firstconfig_t

Functions

static void * allocate (void *mem, size_t size)
static void delete_filelist (configfile_t *cfgf)
static void delete_config (config_t *cfg)
void config_delete (config_t *cfg1)
static void nextc (void)
static void skipwhite (void)
static void parse_err (void)
static config_tread_word (void)
static config_tread_file (const char *file)
static config_tread_list (void)
static config_tread_line (void)
config_tconfig_read (const char *file, int flags, config_t *cfg)
int config_renewed (config_t *cfg)
size_t config_length (config_t *cfg)

Variables

static configfile_tc_files
static int c_flags
static FILEc_fp
static char * c_file
static unsigned c_line
static int c


Define Documentation

#define _c
 

Definition at line 25 of file configfile.c.

#define cfg2fcfg p   )     ((firstconfig_t *) ((char *) (p) - offsetof(firstconfig_t, config1)))
 

Definition at line 50 of file configfile.c.

Referenced by config_delete(), config_read(), and config_renewed().

 
#define config0size  )     (offsetof(config_t, word))
 

Definition at line 44 of file configfile.c.

Referenced by read_list().

#define configfilesize len   )     (offsetof(configfile_t, name) + 1 + (len))
 

Definition at line 35 of file configfile.c.

Referenced by read_file().

#define configsize len   )     (config0size() + 1 + (len))
 

Definition at line 45 of file configfile.c.

Referenced by config_read(), and read_word().

#define deallocate mem   )     free(mem)
 

Definition at line 72 of file configfile.c.

Referenced by cache_reply(), chop_dlist(), close_relay(), config_delete(), dec(), del_asm86(), del_expr(), delete_filelist(), deltemp(), execjob(), explode(), file2cache(), force_expire(), forget(), get_prog(), get_query(), getattributes(), insert_query(), job_connect(), job_setup_connect(), linked(), pop_name(), set_file(), skip_token(), and tab_purge().

#define fcfg2cfg p   )     (&(p)->config1)
 

Definition at line 52 of file configfile.c.

Referenced by config_read().

#define firstconfigsize len   )     (offsetof(firstconfig_t, config1) + configsize(len))
 

Definition at line 46 of file configfile.c.

Referenced by config_read().

#define fstat   _fstat
 

Definition at line 9 of file configfile.c.

Referenced by allocbuf(), allowed(), ar_close(), ar_open(), cdiff(), comp_inodes(), copy(), cp_file(), diff(), do_login(), doit(), file_size(), file_time(), Find_Inode(), format_device(), fpathconf(), freopen(), from_cu(), geometry(), getch(), getzrxinit(), install_master(), main(), opendir(), rd_wrfile(), read_file(), sbx_fdlen(), SimpleFileOpen(), sizeup(), special(), strip(), test19e(), test26a(), test27a(), test27b(), test27c(), test39f(), test39g(), test39i(), test7c(), ttyname(), visitfile(), wall(), wcs(), wctxpn(), and wr_rdfile().

#define nil   ((void*)0)
 

Definition at line 5 of file configfile.c.

static NODE * stat   _stat
 

Definition at line 10 of file configfile.c.

Referenced by add(), add_file(), announce(), AnyMail(), cdcmd(), cgiexec(), check_ln(), check_mknod(), check_mtab(), chkmail(), cmd_read(), cnvtfile(), compare(), config_read(), copy(), copylink(), copymeta(), copystat(), crash_check(), delete(), deliver(), descend(), dodo(), dofdet(), dofor(), doif(), doit(), doMDTM(), doSIZE(), dowait(), dowhile(), execvp(), explode(), expr1(), expr_operator(), extract_image(), fetchname(), file(), File_Device(), filesize(), filetime(), find_command(), Find_Deleted_Entry(), find_device(), Find_Inode(), findidle(), fsize(), fts_stat(), get_link(), get_mode(), get_times(), getcwd(), gettynames(), globname(), isdir(), iwritfile(), job(), lock_device(), main(), make_image(), makedir(), makepath(), maketree(), makeUnixDir(), mformat(), mkpath(), modtime(), move_file(), mpBuildUnixFilename(), my_getcwd(), newaccess(), newdevice(), open_mcwd(), opendir(), OpenDir(), out_header(), ownername(), parse(), pastat(), plan_a(), police(), process(), read_file(), readmtab(), recover(), rl_add_slash(), run_job(), searchtab(), showpage(), sink(), stat_all(), test11d(), test16a(), test19e(), test21a(), test21b(), test25c(), test27a(), test27b(), test27c(), test28a(), test32a(), test32b(), test32c(), test38a(), test38b(), test39f(), test39g(), test39j(), test40a(), test6c(), tmpstart(), ttyname(), uniqname(), unix_write(), verifydir(), and writedata().


Typedef Documentation

typedef struct configfile configfile_t
 

typedef struct firstconfig firstconfig_t
 


Function Documentation

static void* allocate void *  mem,
size_t  size
[static]
 

Definition at line 62 of file configfile.c.

References c_file, c_line, exit(), fprintf(), nil, realloc(), and stderr.

void config_delete config_t cfg1  ) 
 

Definition at line 118 of file configfile.c.

References cfg2fcfg, firstconfig::config1, deallocate, delete_config(), delete_filelist(), and firstconfig::filelist.

Referenced by config_read().

size_t config_length config_t cfg  ) 
 

Definition at line 498 of file configfile.c.

References nil.

Referenced by configtag(), and makedhcp().

config_t* config_read const char *  file,
int  flags,
config_t cfg
 

Definition at line 441 of file configfile.c.

References allocate(), c_files, c_flags, cfg2fcfg, firstconfig::config1, config_delete(), configsize, configfile::ctime, delete_config(), delete_filelist(), ENOENT, errno, fcfg2cfg, firstconfig::filelist, firstconfigsize, memmove(), configfile::name, firstconfig::new, configfile::next, nil, read_file(), st, stat::st_ctime, stat, and strlen().

Referenced by initdhcpconf().

int config_renewed config_t cfg  ) 
 

Definition at line 485 of file configfile.c.

References cfg2fcfg, and nil.

Referenced by initdhcpconf().

static void delete_config config_t cfg  )  [static]
 

Definition at line 86 of file configfile.c.

References list, next, and nil.

Referenced by config_delete(), config_read(), and read_list().

static void delete_filelist configfile_t cfgf  )  [static]
 

Definition at line 74 of file configfile.c.

References deallocate, configfile::next, and nil.

Referenced by config_delete(), and config_read().

static void nextc void   )  [static]
 

Definition at line 129 of file configfile.c.

References c, c_file, c_fp, c_line, EOF, errno, exit(), ferror, fprintf(), getc, stderr, and strerror().

static void parse_err void   )  [static]
 

Definition at line 152 of file configfile.c.

References c, c_file, c_line, EOF, exit(), fprintf(), and stderr.

static config_t * read_file const char *  file  )  [static]
 

Definition at line 386 of file configfile.c.

References allocate(), c, c_file, c_files, c_fp, c_line, configfilesize, configfile::ctime, ENOENT, EOF, errno, exit(), fclose(), fileno(), fopen(), fprintf(), fstat, memcpy(), configfile::name, configfile::next, nil, parse_err(), read_list(), slash(), st, stat::st_ctime, stderr, strcpy(), strerror(), strlen(), and strrchr().

static config_t* read_line void   )  [static]
 

Definition at line 301 of file configfile.c.

References c, EOF, nil, parse_err(), and skipwhite().

static config_t * read_list void   )  [static]
 

Definition at line 341 of file configfile.c.

References allocate(), c_file, CFG_SUBLIST, config0size, config_isatom, delete_config(), exit(), fprintf(), config::next, nil, p, read_file(), read_line(), stderr, and strcmp.

Referenced by read_file().

static config_t* read_word void   )  [static]
 

Definition at line 164 of file configfile.c.

References allocate(), c, c_file, c_line, configsize, i, nextc(), and nil.

static void skipwhite void   )  [static]
 

Definition at line 141 of file configfile.c.

References c, EOF, isspace, and nextc().

Referenced by read_line().


Variable Documentation

int c [static]
 

Definition at line 60 of file configfile.c.

char* c_file [static]
 

Definition at line 58 of file configfile.c.

Referenced by allocate(), nextc(), parse_err(), read_file(), read_list(), and read_word().

configfile_t* c_files [static]
 

Definition at line 55 of file configfile.c.

Referenced by config_read(), and read_file().

int c_flags [static]
 

Definition at line 56 of file configfile.c.

Referenced by compile(), config_read(), and processfiles().

FILE* c_fp [static]
 

Definition at line 57 of file configfile.c.

Referenced by nextc(), and read_file().

unsigned c_line [static]
 

Definition at line 59 of file configfile.c.

Referenced by allocate(), copy_text(), copy_union(), nextc(), parse_err(), read_file(), and read_word().


Generated on Fri Apr 14 23:17:24 2006 for minix by  doxygen 1.4.6