]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/format/Token.h
2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 #ifndef _SQUID_FORMAT_TOKEN_H
10 #define _SQUID_FORMAT_TOKEN_H
12 #include "format/ByteCode.h"
15 * Squid configuration allows users to define custom formats in
18 * - external ACL input
21 * These enumerations and classes define the API for parsing of
22 * format directives to define these patterns. Along with output
23 * functionality to produce formatted buffers.
29 class TokenTableEntry
;
31 #define LOG_BUF_SZ (MAX_URL<<2)
33 // XXX: inherit from linked list
40 /// Initialize the format token registrations
43 /** parses a single token. Returns the token length in characters,
44 * and fills in this item with the token information.
45 * def is for sure null-terminated.
47 int parse(const char *def
, enum Quoting
*quote
);
60 int widthMin
; ///< minimum field width
61 int widthMax
; ///< maximum field width
66 int divisor
; // class invariant: MUST NOT be zero.
67 Token
*next
; /* todo: move from linked list to array */
70 const char *scanForToken(TokenTableEntry
const table
[], const char *cur
);
75 #endif /* _SQUID_FORMAT_TOKEN_H */