syslog-ng source
cfg-lexer.c File Reference
#include "cfg-lexer.h"
#include "cfg-lexer-subst.h"
#include "cfg-block-generator.h"
#include "cfg-grammar.h"
#include "cfg.h"
#include "block-ref-parser.h"
#include "pragma-parser.h"
#include "messages.h"
#include "pathutils.h"
#include "plugin.h"
#include "plugin-types.h"
#include <string.h>
#include <glob.h>
#include <sys/stat.h>
#include "cfg-lex.h"
Include dependency graph for cfg-lexer.c:

Classes

struct  CfgTokenBlock
 
struct  CfgLexerContext
 
struct  GeneratorPlugin
 

Macros

#define YYSTYPE   CFG_STYPE
 
#define YYLTYPE   CFG_LTYPE
 
#define GLOB_NOMAGIC   0
 

Enumerations

enum  CfgLexerPreprocessResult { CLPR_ERROR , CLPR_OK , CLPR_LEX_AGAIN }
 

Functions

void cfg_lexer_push_context (CfgLexer *self, gint type, CfgLexerKeyword *keywords, const gchar *desc)
 
void cfg_lexer_pop_context (CfgLexer *self)
 
gint cfg_lexer_get_context_type (CfgLexer *self)
 
const gchar * cfg_lexer_get_context_description (CfgLexer *self)
 
const gchar * cfg_lexer_format_location (CfgLexer *self, const CFG_LTYPE *yylloc, gchar *buf, gsize buf_len)
 
EVTTAG * cfg_lexer_format_location_tag (CfgLexer *self, const CFG_LTYPE *yylloc)
 
void cfg_lexer_set_file_location (CfgLexer *self, const gchar *filename, gint line, gint column)
 
int cfg_lexer_map_word_to_token (CfgLexer *self, CFG_STYPE *yylval, const CFG_LTYPE *yylloc, const char *token)
 
void cfg_lexer_init_include_level_file (CfgLexer *self, CfgIncludeLevel *level)
 
void cfg_lexer_include_level_file_add (CfgLexer *self, CfgIncludeLevel *level, const gchar *filename)
 
gboolean cfg_lexer_include_level_file_open_buffer (CfgLexer *self, CfgIncludeLevel *level)
 
void cfg_lexer_include_level_file_close_buffer (CfgLexer *self, CfgIncludeLevel *level)
 
void cfg_lexer_init_include_level_buffer (CfgLexer *self, CfgIncludeLevel *level, const gchar *name, const gchar *buffer, gsize length)
 
gboolean cfg_lexer_include_level_buffer_open_buffer (CfgLexer *self, CfgIncludeLevel *level)
 
gboolean cfg_lexer_include_level_open_buffer (CfgLexer *self, CfgIncludeLevel *level)
 
void cfg_lexer_include_level_close_buffer (CfgLexer *self, CfgIncludeLevel *level)
 
void cfg_lexer_include_level_resume_from_buffer (CfgLexer *self, CfgIncludeLevel *level)
 
void cfg_lexer_include_level_clear (CfgLexer *self, CfgIncludeLevel *level)
 
CfgIncludeLevel * cfg_lexer_alloc_include_level (CfgLexer *self, const gchar *include_target)
 
void cfg_lexer_drop_include_level (CfgLexer *self, CfgIncludeLevel *level)
 
gboolean cfg_lexer_start_next_include (CfgLexer *self)
 
int __glob_pattern_p (const char *pattern)
 
gboolean cfg_lexer_include_file (CfgLexer *self, const gchar *filename_)
 
gboolean cfg_lexer_include_buffer_without_backtick_substitution (CfgLexer *self, const gchar *name, const gchar *buffer, gsize length)
 
gboolean cfg_lexer_include_buffer (CfgLexer *self, const gchar *name, const gchar *buffer, gssize length)
 
void cfg_lexer_inject_token_block (CfgLexer *self, CfgTokenBlock *block)
 
void cfg_lexer_register_generator_plugin (PluginContext *context, CfgBlockGenerator *gen)
 
void cfg_lexer_unput_token (CfgLexer *self, CFG_STYPE *yylval)
 
void cfg_lexer_free_token (CFG_STYPE *token)
 
int cfg_lexer_lex (CfgLexer *self, CFG_STYPE *yylval, CFG_LTYPE *yylloc)
 
CfgLexer * cfg_lexer_new (GlobalConfig *cfg, FILE *file, const gchar *filename, GString *preprocess_output)
 
CfgLexer * cfg_lexer_new_buffer (GlobalConfig *cfg, const gchar *buffer, gsize length)
 
void cfg_lexer_free (CfgLexer *self)
 
gint cfg_lexer_lookup_context_type_by_name (const gchar *name)
 
const gchar * cfg_lexer_lookup_context_name_by_type (gint type)
 
void cfg_token_block_add_and_consume_token (CfgTokenBlock *self, CFG_STYPE *token)
 
void cfg_token_block_add_token (CfgTokenBlock *self, CFG_STYPE *token)
 
CFG_STYPEcfg_token_block_get_token (CfgTokenBlock *self)
 
CfgTokenBlock * cfg_token_block_new (void)
 
void cfg_token_block_free (CfgTokenBlock *self)
 
GQuark cfg_lexer_error_quark (void)
 

Macro Definition Documentation

◆ GLOB_NOMAGIC

#define GLOB_NOMAGIC   0

◆ YYLTYPE

#define YYLTYPE   CFG_LTYPE

◆ YYSTYPE

#define YYSTYPE   CFG_STYPE

Enumeration Type Documentation

◆ CfgLexerPreprocessResult

Enumerator
CLPR_ERROR 
CLPR_OK 
CLPR_LEX_AGAIN 

Function Documentation

◆ __glob_pattern_p()

int __glob_pattern_p ( const char *  pattern)

◆ cfg_lexer_alloc_include_level()

CfgIncludeLevel* cfg_lexer_alloc_include_level ( CfgLexer *  self,
const gchar *  include_target 
)

◆ cfg_lexer_drop_include_level()

void cfg_lexer_drop_include_level ( CfgLexer *  self,
CfgIncludeLevel *  level 
)

◆ cfg_lexer_error_quark()

GQuark cfg_lexer_error_quark ( void  )

◆ cfg_lexer_format_location()

const gchar* cfg_lexer_format_location ( CfgLexer *  self,
const CFG_LTYPE yylloc,
gchar *  buf,
gsize  buf_len 
)

◆ cfg_lexer_format_location_tag()

EVTTAG* cfg_lexer_format_location_tag ( CfgLexer *  self,
const CFG_LTYPE yylloc 
)

◆ cfg_lexer_free()

void cfg_lexer_free ( CfgLexer *  self)

◆ cfg_lexer_free_token()

void cfg_lexer_free_token ( CFG_STYPE token)

◆ cfg_lexer_get_context_description()

const gchar* cfg_lexer_get_context_description ( CfgLexer *  self)

◆ cfg_lexer_get_context_type()

gint cfg_lexer_get_context_type ( CfgLexer *  self)

◆ cfg_lexer_include_buffer()

gboolean cfg_lexer_include_buffer ( CfgLexer *  self,
const gchar *  name,
const gchar *  buffer,
gssize  length 
)

◆ cfg_lexer_include_buffer_without_backtick_substitution()

gboolean cfg_lexer_include_buffer_without_backtick_substitution ( CfgLexer *  self,
const gchar *  name,
const gchar *  buffer,
gsize  length 
)

◆ cfg_lexer_include_file()

gboolean cfg_lexer_include_file ( CfgLexer *  self,
const gchar *  filename_ 
)

◆ cfg_lexer_include_level_buffer_open_buffer()

gboolean cfg_lexer_include_level_buffer_open_buffer ( CfgLexer *  self,
CfgIncludeLevel *  level 
)

◆ cfg_lexer_include_level_clear()

void cfg_lexer_include_level_clear ( CfgLexer *  self,
CfgIncludeLevel *  level 
)

◆ cfg_lexer_include_level_close_buffer()

void cfg_lexer_include_level_close_buffer ( CfgLexer *  self,
CfgIncludeLevel *  level 
)

◆ cfg_lexer_include_level_file_add()

void cfg_lexer_include_level_file_add ( CfgLexer *  self,
CfgIncludeLevel *  level,
const gchar *  filename 
)

◆ cfg_lexer_include_level_file_close_buffer()

void cfg_lexer_include_level_file_close_buffer ( CfgLexer *  self,
CfgIncludeLevel *  level 
)

◆ cfg_lexer_include_level_file_open_buffer()

gboolean cfg_lexer_include_level_file_open_buffer ( CfgLexer *  self,
CfgIncludeLevel *  level 
)

◆ cfg_lexer_include_level_open_buffer()

gboolean cfg_lexer_include_level_open_buffer ( CfgLexer *  self,
CfgIncludeLevel *  level 
)

◆ cfg_lexer_include_level_resume_from_buffer()

void cfg_lexer_include_level_resume_from_buffer ( CfgLexer *  self,
CfgIncludeLevel *  level 
)

◆ cfg_lexer_init_include_level_buffer()

void cfg_lexer_init_include_level_buffer ( CfgLexer *  self,
CfgIncludeLevel *  level,
const gchar *  name,
const gchar *  buffer,
gsize  length 
)

◆ cfg_lexer_init_include_level_file()

void cfg_lexer_init_include_level_file ( CfgLexer *  self,
CfgIncludeLevel *  level 
)

◆ cfg_lexer_inject_token_block()

void cfg_lexer_inject_token_block ( CfgLexer *  self,
CfgTokenBlock *  block 
)

◆ cfg_lexer_lex()

int cfg_lexer_lex ( CfgLexer *  self,
CFG_STYPE yylval,
CFG_LTYPE yylloc 
)

◆ cfg_lexer_lookup_context_name_by_type()

const gchar* cfg_lexer_lookup_context_name_by_type ( gint  type)

◆ cfg_lexer_lookup_context_type_by_name()

gint cfg_lexer_lookup_context_type_by_name ( const gchar *  name)

◆ cfg_lexer_map_word_to_token()

int cfg_lexer_map_word_to_token ( CfgLexer *  self,
CFG_STYPE yylval,
const CFG_LTYPE yylloc,
const char *  token 
)

◆ cfg_lexer_new()

CfgLexer* cfg_lexer_new ( GlobalConfig *  cfg,
FILE *  file,
const gchar *  filename,
GString *  preprocess_output 
)

◆ cfg_lexer_new_buffer()

CfgLexer* cfg_lexer_new_buffer ( GlobalConfig *  cfg,
const gchar *  buffer,
gsize  length 
)

◆ cfg_lexer_pop_context()

void cfg_lexer_pop_context ( CfgLexer *  self)

◆ cfg_lexer_push_context()

void cfg_lexer_push_context ( CfgLexer *  self,
gint  type,
CfgLexerKeyword keywords,
const gchar *  desc 
)

◆ cfg_lexer_register_generator_plugin()

void cfg_lexer_register_generator_plugin ( PluginContext *  context,
CfgBlockGenerator *  gen 
)

◆ cfg_lexer_set_file_location()

void cfg_lexer_set_file_location ( CfgLexer *  self,
const gchar *  filename,
gint  line,
gint  column 
)

◆ cfg_lexer_start_next_include()

gboolean cfg_lexer_start_next_include ( CfgLexer *  self)

◆ cfg_lexer_unput_token()

void cfg_lexer_unput_token ( CfgLexer *  self,
CFG_STYPE yylval 
)

◆ cfg_token_block_add_and_consume_token()

void cfg_token_block_add_and_consume_token ( CfgTokenBlock *  self,
CFG_STYPE token 
)

◆ cfg_token_block_add_token()

void cfg_token_block_add_token ( CfgTokenBlock *  self,
CFG_STYPE token 
)

◆ cfg_token_block_free()

void cfg_token_block_free ( CfgTokenBlock *  self)

◆ cfg_token_block_get_token()

CFG_STYPE* cfg_token_block_get_token ( CfgTokenBlock *  self)

◆ cfg_token_block_new()

CfgTokenBlock* cfg_token_block_new ( void  )