--- parser3/src/include/pa_string.h 2001/03/24 19:12:18 1.50 +++ parser3/src/include/pa_string.h 2001/03/25 08:52:34 1.52 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_string.h,v 1.50 2001/03/24 19:12:18 paf Exp $ + $Id: pa_string.h,v 1.52 2001/03/25 08:52:34 paf Exp $ */ #ifndef PA_STRING_H @@ -29,21 +29,29 @@ #ifndef NO_STRING_ORIGIN # define STRING_APPEND_PARAMS \ const char *src, size_t size, \ - bool tainted, \ + String::Untaint_lang lang, \ const char *file, uint line /// appends clean piece to String @see String::real_append -# define APPEND(src, size, file, line) real_append(src, size, false, file, line) +# define APPEND(src, size, file, line) \ + real_append(src, size, String::UL_NO, file, line) /// appends tainted piece to String @see String::real_append -# define APPEND_TAINTED(src, size, file, line) real_append(src, size, true, file, line) +# define APPEND_TAINTED(src, size, file, line) \ + real_append(src, size, String::UL_YES, file, line) +# define APPEND_SPECIFIC_TAINTED(src, size, lang, file, line) \ + real_append(src, size, lang, file, line) #else # define STRING_APPEND_PARAMS \ const char *src, \ size_t size, \ - bool tainted + String::Untaint_lang lang /// appends clean piece to String @see String::real_append -# define APPEND(src, size, file, line) real_append(src, size, false) +# define APPEND(src, size, file, line) \ + real_append(src, size, String::UL_NO) /// appends tainted piece to String @see String::real_append -# define APPEND_TAINTED(src, size, file, line) real_append(src, size, true) +# define APPEND_TAINTED(src, size, file, line) \ + real_append(src, size, String::UL_YES) +# define APPEND_SPECIFIC_TAINTED(src, size, lang, file, line) \ + real_append(src, size, lang) #endif /// handy: appends const char* piece to String @see String::real_append #define APPEND_CONST(src) APPEND(src, 0, 0, 0) @@ -130,8 +138,10 @@ public: /** @param partial returns partial match status. - -1 means @c this starts @c src - +2 means @src starts @this + - -1: strings too different + - 0: full match + - 1: means @c this starts @c src + - 2: means @src starts @this */ int cmp(const char* src_ptr, int& partial, size_t src_size=0) const; bool operator == (const char* src_ptr) const {