]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/format/Token.h
2 * Copyright (C) 1996-2014 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/TokenTableEntry.h"
13 #include "format/ByteCode.h"
16 * Squid configuration allows users to define custom formats in
19 * - external ACL input
22 * These enumerations and classes define the API for parsing of
23 * format directives to define these patterns. Along with output
24 * functionality to produce formatted buffers.
30 class TokenTableEntry
;
32 #define LOG_BUF_SZ (MAX_URL<<2)
34 // XXX: inherit from linked list
41 /// Initialize the format token registrations
44 /** parses a single token. Returns the token length in characters,
45 * and fills in this item with the token information.
46 * def is for sure null-terminated.
48 int parse(const char *def
, enum Quoting
*quote
);
61 int widthMin
; ///< minimum field width
62 int widthMax
; ///< maximum field width
67 int divisor
; // class invariant: MUST NOT be zero.
68 Token
*next
; /* todo: move from linked list to array */
71 const char *scanForToken(TokenTableEntry
const table
[], const char *cur
);
76 #endif /* _SQUID_FORMAT_TOKEN_H */