From 00c363ba9d2c98af518ff94900bddc38b909b081 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 4 Sep 2020 15:24:53 +0200 Subject: [PATCH] REORG: tools: move PARSE_OPT_* from tools.h to tools-t.h These would better be placed into the low-level type files with other similar macros. --- include/haproxy/tools-t.h | 17 +++++++++++++++++ include/haproxy/tools.h | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/haproxy/tools-t.h b/include/haproxy/tools-t.h index bb99a23737..91363d93dc 100644 --- a/include/haproxy/tools-t.h +++ b/include/haproxy/tools-t.h @@ -50,6 +50,23 @@ #define DEFNULL(...) _FIRST_ARG(NULL, ##__VA_ARGS__, NULL) #define _FIRST_ARG(a, b, ...) b +/* options flags for parse_line() */ +#define PARSE_OPT_SHARP 0x00000001 // '#' ends the line +#define PARSE_OPT_BKSLASH 0x00000002 // '\' escapes chars +#define PARSE_OPT_SQUOTE 0x00000004 // "'" encloses a string +#define PARSE_OPT_DQUOTE 0x00000008 // '"' encloses a string +#define PARSE_OPT_ENV 0x00000010 // '$' is followed by environment variables +#define PARSE_OPT_INPLACE 0x00000020 // parse and tokenize in-place (src == dst) + +/* return error flags from parse_line() */ +#define PARSE_ERR_TOOLARGE 0x00000001 // result is too large for initial outlen +#define PARSE_ERR_TOOMANY 0x00000002 // more words than initial nbargs +#define PARSE_ERR_QUOTE 0x00000004 // unmatched quote (offending one at errptr) +#define PARSE_ERR_BRACE 0x00000008 // unmatched brace (offending one at errptr) +#define PARSE_ERR_HEX 0x00000010 // unparsable hex sequence (at errptr) +#define PARSE_ERR_VARNAME 0x00000020 // invalid variable name (at errptr) +#define PARSE_ERR_OVERLAP 0x00000040 // output overlaps with input, need to allocate + /* special return values for the time parser (parse_time_err()) */ #define PARSE_TIME_UNDER ((char *)1) #define PARSE_TIME_OVER ((char *)2) diff --git a/include/haproxy/tools.h b/include/haproxy/tools.h index 0cf6053528..068c13483b 100644 --- a/include/haproxy/tools.h +++ b/include/haproxy/tools.h @@ -55,23 +55,6 @@ #define SWAP(a, b) do { typeof(a) t; t = a; a = b; b = t; } while(0) -/* options flags for parse_line() */ -#define PARSE_OPT_SHARP 0x00000001 // '#' ends the line -#define PARSE_OPT_BKSLASH 0x00000002 // '\' escapes chars -#define PARSE_OPT_SQUOTE 0x00000004 // "'" encloses a string -#define PARSE_OPT_DQUOTE 0x00000008 // '"' encloses a string -#define PARSE_OPT_ENV 0x00000010 // '$' is followed by environment variables -#define PARSE_OPT_INPLACE 0x00000020 // parse and tokenize in-place (src == dst) - -/* return error flags from parse_line() */ -#define PARSE_ERR_TOOLARGE 0x00000001 // result is too large for initial outlen -#define PARSE_ERR_TOOMANY 0x00000002 // more words than initial nbargs -#define PARSE_ERR_QUOTE 0x00000004 // unmatched quote (offending one at errptr) -#define PARSE_ERR_BRACE 0x00000008 // unmatched brace (offending one at errptr) -#define PARSE_ERR_HEX 0x00000010 // unparsable hex sequence (at errptr) -#define PARSE_ERR_VARNAME 0x00000020 // invalid variable name (at errptr) -#define PARSE_ERR_OVERLAP 0x00000040 // output overlaps with input, need to allocate - /* * copies at most chars from to . Last char is always * set to 0, unless is 0. The number of chars copied is returned