syslog-ng source
cfg-lexer.h File Reference
#include "syslog-ng.h"
#include "cfg-args.h"
#include "cfg-block-generator.h"
#include "messages.h"
#include <stdio.h>
#include <setjmp.h>
Include dependency graph for cfg-lexer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CFG_LTYPE
 
struct  CFG_STYPE
 
struct  CfgLexerKeyword
 
struct  CfgIncludeLevel
 
struct  CfgLexer
 

Macros

#define MAX_INCLUDE_DEPTH   256
 
#define KWS_NORMAL   0
 
#define KWS_OBSOLETE   1
 
#define CFG_KEYWORD_STOP   "@!#?"
 
#define CFG_LEXER_ERROR   cfg_lexer_error_quark()
 

Enumerations

enum  CfgLexerError { CFG_LEXER_MISSING_BACKTICK_PAIR , CFG_LEXER_CANNOT_REPRESENT_APOSTROPHES_IN_QSTRINGS , CFG_LEXER_BACKTICKS_CANT_BE_SUBSTITUTED_AFTER_BACKSLASH }
 

Functions

void cfg_lexer_unput_token (CfgLexer *self, CFG_STYPE *yylval)
 
void cfg_lexer_start_block_state (CfgLexer *self, const gchar block_boundary[2])
 
void cfg_lexer_start_block_arg_state (CfgLexer *self)
 
void cfg_lexer_append_string (CfgLexer *self, int length, char *str)
 
void cfg_lexer_append_char (CfgLexer *self, char c)
 
void cfg_lexer_set_current_keywords (CfgLexer *self, CfgLexerKeyword *keywords)
 
char * cfg_lexer_get_keyword_string (CfgLexer *self, int kw)
 
int cfg_lexer_map_word_to_token (CfgLexer *self, CFG_STYPE *yylval, const CFG_LTYPE *yylloc, const char *token)
 
gboolean cfg_lexer_start_next_include (CfgLexer *self)
 
gboolean cfg_lexer_include_file (CfgLexer *self, const gchar *filename)
 
gboolean cfg_lexer_include_buffer (CfgLexer *self, const gchar *name, const gchar *buffer, gssize length)
 
gboolean cfg_lexer_include_buffer_without_backtick_substitution (CfgLexer *self, const gchar *name, const gchar *buffer, gsize length)
 
const gchar * cfg_lexer_format_location (CfgLexer *self, const CFG_LTYPE *yylloc, gchar *buf, gsize buf_len)
 
void cfg_lexer_set_file_location (CfgLexer *self, const gchar *filename, gint line, gint column)
 
EVTTAG * cfg_lexer_format_location_tag (CfgLexer *self, const CFG_LTYPE *yylloc)
 
void cfg_lexer_push_context (CfgLexer *self, gint context, CfgLexerKeyword *keywords, const gchar *desc)
 
void cfg_lexer_pop_context (CfgLexer *self)
 
const gchar * cfg_lexer_get_context_description (CfgLexer *self)
 
gint cfg_lexer_get_context_type (CfgLexer *self)
 
void cfg_lexer_inject_token_block (CfgLexer *self, CfgTokenBlock *block)
 
int cfg_lexer_lex (CfgLexer *self, CFG_STYPE *yylval, CFG_LTYPE *yylloc)
 
void cfg_lexer_free_token (CFG_STYPE *token)
 
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 id)
 
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)
 
void cfg_lexer_register_generator_plugin (PluginContext *context, CfgBlockGenerator *gen)
 
GQuark cfg_lexer_error_quark (void)
 

Macro Definition Documentation

◆ CFG_KEYWORD_STOP

#define CFG_KEYWORD_STOP   "@!#?"

◆ CFG_LEXER_ERROR

#define CFG_LEXER_ERROR   cfg_lexer_error_quark()

◆ KWS_NORMAL

#define KWS_NORMAL   0

◆ KWS_OBSOLETE

#define KWS_OBSOLETE   1

◆ MAX_INCLUDE_DEPTH

#define MAX_INCLUDE_DEPTH   256

Enumeration Type Documentation

◆ CfgLexerError

Enumerator
CFG_LEXER_MISSING_BACKTICK_PAIR 
CFG_LEXER_CANNOT_REPRESENT_APOSTROPHES_IN_QSTRINGS 
CFG_LEXER_BACKTICKS_CANT_BE_SUBSTITUTED_AFTER_BACKSLASH 

Function Documentation

◆ cfg_lexer_append_char()

void cfg_lexer_append_char ( CfgLexer *  self,
char  c 
)

◆ cfg_lexer_append_string()

void cfg_lexer_append_string ( CfgLexer *  self,
int  length,
char *  str 
)

◆ 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_get_keyword_string()

char* cfg_lexer_get_keyword_string ( CfgLexer *  self,
int  kw 
)

◆ 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_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  id)

◆ 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  context,
CfgLexerKeyword keywords,
const gchar *  desc 
)

◆ cfg_lexer_register_generator_plugin()

void cfg_lexer_register_generator_plugin ( PluginContext *  context,
CfgBlockGenerator *  gen 
)

◆ cfg_lexer_set_current_keywords()

void cfg_lexer_set_current_keywords ( CfgLexer *  self,
CfgLexerKeyword keywords 
)

◆ cfg_lexer_set_file_location()

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

◆ cfg_lexer_start_block_arg_state()

void cfg_lexer_start_block_arg_state ( CfgLexer *  self)

◆ cfg_lexer_start_block_state()

void cfg_lexer_start_block_state ( CfgLexer *  self,
const gchar  block_boundary[2] 
)

◆ 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  )