head 1.2; access; symbols last-version-before-change-to-ossp-style:1.1.1.1 VAR_0_0_0:1.1.1.1 VENDOR:1.1.1; locks; strict; comment @ * @; 1.2 date 2001.11.13.12.08.30; author simons; state dead; branches; next 1.1; 1.1 date 2001.11.09.17.01.37; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.11.09.17.01.37; author rse; state Exp; branches; next ; desc @@ 1.2 log @- Moved all routines into a single source file var.c. - Renamed varexp.h to var.h. - Removed odin-based build system. - Moved test cases into var_test.c. - Adapted build system. @ text @#ifndef INTERNAL_H #define INTERNAL_H #include #include #include #include #include #include "varexp.h" #ifdef DMALLOC # define DMALLOC_FUNC_CHECK # include #endif /* Turn character class descriptions into a lookup-array. */ var_rc_t expand_character_class(const char* desc, char class[256]); /* The tokenbuf structure is used by the parser routines. If buffer_size is >0, it means that the buffer has been allocated by malloc(3) and must be free(3)ed when not used anymore. */ typedef struct { const char* begin; const char* end; size_t buffer_size; } tokenbuf; int append_to_tokenbuf(tokenbuf* output, const char* begin, size_t rc); void free_tokenbuf(tokenbuf* buf); void init_tokenbuf(tokenbuf* buf); int assign_to_tokenbuf(tokenbuf* buf, const char* data, size_t len); void move_tokenbuf(tokenbuf* src, tokenbuf* dst); var_rc_t input(const char* begin, const char* end, const var_config_t* config, const char nameclass[256], var_cb_t lookup, void* lookup_context, int force_expand, tokenbuf* output); int variable(const char* begin, const char* end, const var_config_t* config, const char nameclass[256], var_cb_t lookup, void* lookup_context, int force_expand, tokenbuf* result); int command(const char* begin, const char* end, const var_config_t* config, const char nameclass[256], var_cb_t lookup, void* lookup_context, int force_expand, tokenbuf* result); int exptext(const char* begin, const char* end, const var_config_t* config); int exptext_or_variable(const char* begin, const char* end, const var_config_t* config, const char nameclass[256], var_cb_t lookup, void* lookup_context, int force_expand, tokenbuf* result); int substext_or_variable(const char* begin, const char* end, const var_config_t* config, const char nameclass[256], var_cb_t lookup, void* lookup_context, int force_expand, tokenbuf* result); int substext(const char* begin, const char* end, const var_config_t* config); int search_and_replace(tokenbuf* data, tokenbuf* search, tokenbuf* replace, tokenbuf* flags); int varname(const char* begin, const char* end, const char nameclass[256]); int expression(const char* begin, const char* end, const var_config_t* config, const char nameclass[256], var_cb_t lookup, void* lookup_context, int force_expand, tokenbuf* result); int text(const char* begin, const char* end, char varinit, char escape); int number(const char* begin, const char* end); int cut_out_offset(tokenbuf* data, tokenbuf* number1, tokenbuf* number2, int isrange); int transpose(tokenbuf* data, tokenbuf* search, tokenbuf* replace); int padding(tokenbuf* data, tokenbuf* width, tokenbuf* fill, char position); size_t tokenbuf2int(tokenbuf* number); #endif /* !defined(INTERNAL_H) */ @ 1.1 log @Initial revision @ text @@ 1.1.1.1 log @import first cut of OSSP var @ text @@