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 ,
  sCFGLINES ,
  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.

◆ _PATH_SQUID_CONF

#define _PATH_SQUID_CONF   "squid.conf.documented"

Definition at line 49 of file cf_gen.cc.

◆ _PATH_SQUID_CONF_SHORT

#define _PATH_SQUID_CONF_SHORT   "squid.conf.default"

Definition at line 50 of file cf_gen.cc.

◆ MAX_LINE

#define MAX_LINE   1024 /* longest configuration line */

Definition at line 47 of file cf_gen.cc.

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 106 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 117 of file cf_gen.cc.

Enumeration Type Documentation

◆ State

enum State
Enumerator
sSTART 
s1 
sDOC 
sCFGLINES 
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 742 of file cf_gen.cc.

References assert.

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 132 of file cf_gen.cc.

Referenced by main().

◆ errorMsg()

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

Definition at line 162 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 755 of file cf_gen.cc.

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

Referenced by main().

◆ gen_default()

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

Definition at line 463 of file cf_gen.cc.

References assert, gen_quote_escape(), and head.

Referenced by main().

◆ gen_default_if_none()

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

Definition at line 524 of file cf_gen.cc.

References assert, gen_quote_escape(), and head.

Referenced by main().

◆ gen_default_postscriptum()

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

Definition at line 564 of file cf_gen.cc.

References assert, and head.

Referenced by main().

◆ gen_dump()

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

Definition at line 665 of file cf_gen.cc.

References head.

Referenced by main().

◆ gen_free()

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

Definition at line 697 of file cf_gen.cc.

References head.

Referenced by main().

◆ gen_parse()

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

Definition at line 645 of file cf_gen.cc.

References head.

Referenced by main().

◆ gen_quote_escape()

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

Definition at line 844 of file cf_gen.cc.

Referenced by gen_default(), and gen_default_if_none().

◆ isDefined()

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

Definition at line 728 of file cf_gen.cc.

Referenced by gen_conf(), and main().

◆ main()

◆ usage()

static void usage ( const char *  program_name)
static

Definition at line 155 of file cf_gen.cc.

References program_name.

Referenced by main().

Variable Documentation

◆ WS

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

Definition at line 119 of file cf_gen.cc.

Referenced by main().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors