--- var.h 2001/11/13 14:36:55 1.4
+++ var.h 2001/11/13 14:42:57 1.5
@@ -34,46 +34,44 @@
/* Error codes returned by the varexp library. */
-typedef enum
- {
- VAR_CALLBACK_ERROR = -64,
- VAR_SUBMATCH_OUT_OF_RANGE = -34,
+typedef enum {
+ VAR_CALLBACK_ERROR = -64,
+ VAR_SUBMATCH_OUT_OF_RANGE = -34,
VAR_UNKNOWN_QUOTED_PAIR_IN_REPLACE = -33,
- VAR_EMPTY_PADDING_FILL_STRING = -32,
- VAR_MISSING_PADDING_WIDTH = -31,
- VAR_MALFORMATTED_PADDING = -30,
+ VAR_EMPTY_PADDING_FILL_STRING = -32,
+ VAR_MISSING_PADDING_WIDTH = -31,
+ VAR_MALFORMATTED_PADDING = -30,
VAR_INCORRECT_TRANSPOSE_CLASS_SPEC = -29,
- VAR_EMPTY_TRANSPOSE_CLASS = -28,
- VAR_TRANSPOSE_CLASSES_MISMATCH = -27,
- VAR_MALFORMATTED_TRANSPOSE = -26,
- VAR_OFFSET_LOGIC_ERROR = -25,
- VAR_OFFSET_OUT_OF_BOUNDS = -24,
- VAR_RANGE_OUT_OF_BOUNDS = -23,
- VAR_INVALID_OFFSET_DELIMITER = -22,
- VAR_MISSING_START_OFFSET = -21,
- VAR_EMPTY_SEARCH_STRING = -20,
- VAR_MISSING_PARAMETER_IN_COMMAND = -19,
- VAR_INVALID_REGEX_IN_REPLACE = -18,
- VAR_UNKNOWN_REPLACE_FLAG = -17,
- VAR_MALFORMATTED_REPLACE = -16,
- VAR_UNKNOWN_COMMAND_CHAR = -14,
- VAR_INPUT_ISNT_TEXT_NOR_VARIABLE = -13,
- VAR_UNDEFINED_VARIABLE = -12,
- VAR_INCOMPLETE_VARIABLE_SPEC = -11,
- VAR_OUT_OF_MEMORY = -10,
- VAR_INVALID_CONFIGURATION = -9,
- VAR_INCORRECT_CLASS_SPEC = -8,
- VAR_INCOMPLETE_GROUPED_HEX = -7,
- VAR_INCOMPLETE_OCTAL = -6,
- VAR_INVALID_OCTAL = -5,
- VAR_OCTAL_TOO_LARGE = -4,
- VAR_INVALID_HEX = -3,
- VAR_INCOMPLETE_HEX = -2,
- VAR_INCOMPLETE_NAMED_CHARACTER = -1,
- VAR_INCOMPLETE_QUOTED_PAIR = -1,
- VAR_OK = 0
- }
-var_rc_t;
+ VAR_EMPTY_TRANSPOSE_CLASS = -28,
+ VAR_TRANSPOSE_CLASSES_MISMATCH = -27,
+ VAR_MALFORMATTED_TRANSPOSE = -26,
+ VAR_OFFSET_LOGIC_ERROR = -25,
+ VAR_OFFSET_OUT_OF_BOUNDS = -24,
+ VAR_RANGE_OUT_OF_BOUNDS = -23,
+ VAR_INVALID_OFFSET_DELIMITER = -22,
+ VAR_MISSING_START_OFFSET = -21,
+ VAR_EMPTY_SEARCH_STRING = -20,
+ VAR_MISSING_PARAMETER_IN_COMMAND = -19,
+ VAR_INVALID_REGEX_IN_REPLACE = -18,
+ VAR_UNKNOWN_REPLACE_FLAG = -17,
+ VAR_MALFORMATTED_REPLACE = -16,
+ VAR_UNKNOWN_COMMAND_CHAR = -14,
+ VAR_INPUT_ISNT_TEXT_NOR_VARIABLE = -13,
+ VAR_UNDEFINED_VARIABLE = -12,
+ VAR_INCOMPLETE_VARIABLE_SPEC = -11,
+ VAR_OUT_OF_MEMORY = -10,
+ VAR_INVALID_CONFIGURATION = -9,
+ VAR_INCORRECT_CLASS_SPEC = -8,
+ VAR_INCOMPLETE_GROUPED_HEX = -7,
+ VAR_INCOMPLETE_OCTAL = -6,
+ VAR_INVALID_OCTAL = -5,
+ VAR_OCTAL_TOO_LARGE = -4,
+ VAR_INVALID_HEX = -3,
+ VAR_INCOMPLETE_HEX = -2,
+ VAR_INCOMPLETE_NAMED_CHARACTER = -1,
+ VAR_INCOMPLETE_QUOTED_PAIR = -1,
+ VAR_OK = 0
+} var_rc_t;
/*
Expand the following named characters to their binary
@@ -89,7 +87,8 @@
Any other character quoted by a backslash is copied verbatim.
*/
-var_rc_t var_unescape(const char* src, size_t len, char* dst, int unescape_all);
+var_rc_t var_unescape(const char *src, size_t len, char *dst,
+ int unescape_all);
/*
The callback will be called by variable_expand(), providing the
@@ -115,9 +114,10 @@
<0 - error
*/
-typedef int (*var_cb_t)(void* context,
- const char* varname, size_t name_len,
- const char** data, size_t* data_len, size_t* buffer_size);
+typedef int (*var_cb_t) (void *context,
+ const char *varname, size_t name_len,
+ const char **data, size_t * data_len,
+ size_t * buffer_size);
/*
This structure configures the parser's specials. I think, the fields
@@ -131,15 +131,13 @@
The comments after each field show the default configuration.
*/
-typedef struct
- {
- char varinit; /* '$' */
- char startdelim; /* '{' */
- char enddelim; /* '}' */
- char escape; /* '\' */
- char* namechars; /* 'a-zA-Z0-9_' */
- }
-var_config_t;
+typedef struct {
+ char varinit; /* '$' */
+ char startdelim; /* '{' */
+ char enddelim; /* '}' */
+ char escape; /* '\' */
+ char *namechars; /* 'a-zA-Z0-9_' */
+} var_config_t;
extern const var_config_t var_config_default;
/*
@@ -151,9 +149,9 @@
by the caller.
*/
-var_rc_t var_expand(const char* input, size_t input_len,
- char** result, size_t* result_len,
- var_cb_t lookup, void* lookup_context,
- const var_config_t* config, int force_expand);
+var_rc_t var_expand(const char *input, size_t input_len,
+ char **result, size_t * result_len,
+ var_cb_t lookup, void *lookup_context,
+ const var_config_t * config, int force_expand);
-#endif /* !defined(LIB_OSSP_VAR_H) */
+#endif /* !defined(LIB_OSSP_VAR_H) */
|