]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/format/Token.h
1 #ifndef _SQUID_FORMAT_TOKEN_H
2 #define _SQUID_FORMAT_TOKEN_H
4 //#include "format/TokenTableEntry.h"
5 #include "format/ByteCode.h"
8 * Squid configuration allows users to define custom formats in
11 * - external ACL input
14 * These enumerations and classes define the API for parsing of
15 * format directives to define these patterns. Along with output
16 * functionality to produce formatted buffers.
22 class TokenTableEntry
;
24 #define LOG_BUF_SZ (MAX_URL<<2)
26 // XXX: inherit from linked list
30 Token() : type(LFT_NONE
),
34 quote(LOG_QUOTE_NONE
),
40 { data
.string
= NULL
; }
44 /// Initialize the format token registrations
47 /** parses a single token. Returns the token length in characters,
48 * and fills in this item with the token information.
49 * def is for sure null-terminated.
51 int parse(const char *def
, enum Quoting
*quote
);
65 int widthMin
; ///< minimum field width
66 int widthMax
; ///< maximum field width
71 int divisor
; // class invariant: MUST NOT be zero.
72 Token
*next
; /* todo: move from linked list to array */
75 const char *scanForToken(TokenTableEntry
const table
[], const char *cur
);
80 #endif /* _SQUID_FORMAT_TOKEN_H */