cf_gen.cc File Reference
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <stack>
#include "cf_gen_defines.cci"
Include dependency graph for cf_gen.cc:

Go to the source code of this file.

Classes

class  DefaultValues
 
class  Entry
 
class  Type
 

Macros

#define MAX_LINE   1024 /* longest configuration line */
 
#define _PATH_PARSER   "cf_parser.cci"
 
#define _PATH_SQUID_CONF   "squid.conf.documented"
 
#define _PATH_SQUID_CONF_SHORT   "squid.conf.default"
 
#define _PATH_CF_DEPEND   "cf.data.depend"
 

Typedefs

typedef std::list< std::string > LineList
 
typedef std::list< std::string > TypeDepList
 
typedef std::list< std::string > EntryAliasList
 
typedef std::list< class EntryEntryList
 
typedef std::list< class TypeTypeList
 

Enumerations

enum  State {
  sSTART,
  s1,
  sDOC,
  sNOCOMMENT,
  sEXIT
}
 

Functions

static int gen_default (const EntryList &, std::ostream &)
 
static void gen_parse (const EntryList &, std::ostream &)
 
static void gen_dump (const EntryList &, std::ostream &)
 
static void gen_free (const EntryList &, std::ostream &)
 
static void gen_conf (const EntryList &, std::ostream &, bool verbose_output)
 
static void gen_default_if_none (const EntryList &, std::ostream &)
 
static void gen_default_postscriptum (const EntryList &head, std::ostream &fout)
 append configuration options specified by POSTSCRIPTUM lines More...
 
static bool isDefined (const std::string &name)
 
static const char * available_if (const std::string &name)
 
static const char * gen_quote_escape (const std::string &var)
 
static void checkDepend (const std::string &directive, const char *name, const TypeList &types, const EntryList &entries)
 
static void usage (const char *program_name)
 
static void errorMsg (const char *filename, int line, const char *detail)
 
int main (int argc, char *argv[])
 

Variables

static const char WS [] = " \t\n"
 

Macro Definition Documentation

◆ _PATH_CF_DEPEND

#define _PATH_CF_DEPEND   "cf.data.depend"

Definition at line 51 of file cf_gen.cc.

◆ _PATH_PARSER

#define _PATH_PARSER   "cf_parser.cci"

Definition at line 48 of file cf_gen.cc.

Referenced by main().

◆ _PATH_SQUID_CONF

#define _PATH_SQUID_CONF   "squid.conf.documented"

Definition at line 49 of file cf_gen.cc.

Referenced by main().

◆ _PATH_SQUID_CONF_SHORT

#define _PATH_SQUID_CONF_SHORT   "squid.conf.default"

Definition at line 50 of file cf_gen.cc.

Referenced by main().

◆ MAX_LINE

#define MAX_LINE   1024 /* longest configuration line */

Definition at line 47 of file cf_gen.cc.

Referenced by main().

Typedef Documentation

◆ EntryAliasList

typedef std::list<std::string> EntryAliasList

Definition at line 63 of file cf_gen.cc.

◆ EntryList

typedef std::list<class Entry> EntryList

Definition at line 113 of file cf_gen.cc.

◆ LineList

typedef std::list<std::string> LineList

Definition at line 61 of file cf_gen.cc.

◆ TypeDepList

typedef std::list<std::string> TypeDepList

Definition at line 62 of file cf_gen.cc.

◆ TypeList

typedef std::list<class Type> TypeList

Definition at line 125 of file cf_gen.cc.

Enumeration Type Documentation

◆ State

enum State
Enumerator
sSTART 
s1 
sDOC 
sNOCOMMENT 
sEXIT 

Definition at line 53 of file cf_gen.cc.

Function Documentation

◆ available_if()

static const char * available_if ( const std::string &  name)
static

Definition at line 747 of file cf_gen.cc.

References assert, and i.

Referenced by gen_conf(), and Entry::genParseAlias().

◆ checkDepend()

static void checkDepend ( const std::string &  directive,
const char *  name,
const TypeList types,
const EntryList entries 
)
static

Definition at line 140 of file cf_gen.cc.

Referenced by main().

◆ errorMsg()

static void errorMsg ( const char *  filename,
int  line,
const char *  detail 
)
static

Definition at line 170 of file cf_gen.cc.

Referenced by main().

◆ gen_conf()

static void gen_conf ( const EntryList head,
std::ostream &  fout,
bool  verbose_output 
)
static

Definition at line 760 of file cf_gen.cc.

References available_if(), buf, and isDefined().

Referenced by main().

◆ gen_default()

static int gen_default ( const EntryList head,
std::ostream &  fout 
)
static

Definition at line 475 of file cf_gen.cc.

References assert, and gen_quote_escape().

Referenced by main().

◆ gen_default_if_none()

static void gen_default_if_none ( const EntryList head,
std::ostream &  fout 
)
static

Definition at line 537 of file cf_gen.cc.

References assert, and gen_quote_escape().

Referenced by main().

◆ gen_default_postscriptum()

static void gen_default_postscriptum ( const EntryList head,
std::ostream &  fout 
)
static

Definition at line 577 of file cf_gen.cc.

References assert.

Referenced by main().

◆ gen_dump()

static void gen_dump ( const EntryList head,
std::ostream &  fout 
)
static

Definition at line 676 of file cf_gen.cc.

Referenced by main().

◆ gen_free()

static void gen_free ( const EntryList head,
std::ostream &  fout 
)
static

Definition at line 705 of file cf_gen.cc.

Referenced by main().

◆ gen_parse()

static void gen_parse ( const EntryList head,
std::ostream &  fout 
)
static

Definition at line 656 of file cf_gen.cc.

Referenced by main().

◆ gen_quote_escape()

static const char * gen_quote_escape ( const std::string &  var)
static

Definition at line 849 of file cf_gen.cc.

References i.

Referenced by gen_default(), and gen_default_if_none().

◆ isDefined()

static bool isDefined ( const std::string &  name)
static

Definition at line 733 of file cf_gen.cc.

References i.

Referenced by gen_conf(), and main().

◆ main()

◆ usage()

static void usage ( const char *  program_name)
static

Definition at line 163 of file cf_gen.cc.

Referenced by main().

Variable Documentation

◆ WS

const char WS[] = " \t\n"
static

Definition at line 127 of file cf_gen.cc.

Referenced by main().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors