Squid Web Cache
master
Loading...
Searching...
No Matches
Token.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1996-2025 The Squid Software Foundation and contributors
3
*
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.
7
*/
8
9
#ifndef SQUID_SRC_FORMAT_TOKEN_H
10
#define SQUID_SRC_FORMAT_TOKEN_H
11
12
#include "
format/ByteCode.h
"
13
#include "
proxyp/Elements.h
"
14
15
/*
16
* Squid configuration allows users to define custom formats in
17
* several components.
18
* - logging
19
* - external ACL input
20
* - deny page URL
21
*
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.
25
*/
26
27
namespace
Format
28
{
29
30
class
TokenTableEntry;
31
32
#define LOG_BUF_SZ (MAX_URL<<2)
33
34
// XXX: inherit from linked list
35
class
Token
36
{
37
public
:
38
Token
();
39
~Token
();
40
42
static
void
Init
();
43
48
int
parse
(
const
char
*def,
enum
Quoting
*
quote
);
49
50
ByteCode_t
type
;
51
const
char
*
label
;
52
struct
{
53
char
*
string
;
54
// TODO: Add ID caching for protocols other than PROXY protocol.
56
ProxyProtocol::Two::FieldType
headerId
;
57
58
struct
{
59
char
*
header
;
60
char
*
element
;
61
char
separator
;
62
}
header
;
63
64
uint8_t
byteValue
;
// %byte{} parameter or zero
65
}
data
;
66
int
widthMin
;
67
int
widthMax
;
68
enum
Quoting
quote
;
69
bool
left
;
70
bool
space
;
71
bool
zero
;
72
int
divisor
;
// class invariant: MUST NOT be zero.
73
Token
*
next
;
// TODO: move from linked list to array
74
75
private
:
76
const
char
*
scanForToken
(
TokenTableEntry
const
table[],
const
char
*
cur
);
77
};
78
79
}
// namespace Format
80
81
#endif
/* SQUID_SRC_FORMAT_TOKEN_H */
82
ByteCode.h
cur
int cur
Definition
ModDevPoll.cc:69
Format::TokenTableEntry
One entry in a table of format tokens.
Definition
TokenTableEntry.h:31
Format::Token
Definition
Token.h:36
Format::Token::widthMin
int widthMin
minimum field width
Definition
Token.h:66
Format::Token::~Token
~Token()
Definition
Token.cc:759
Format::Token::scanForToken
const char * scanForToken(TokenTableEntry const table[], const char *cur)
Definition
Token.cc:276
Format::Token::data
struct Format::Token::@49 data
Format::Token::quote
enum Quoting quote
Definition
Token.h:68
Format::Token::separator
char separator
Definition
Token.h:61
Format::Token::byteValue
uint8_t byteValue
Definition
Token.h:64
Format::Token::element
char * element
Definition
Token.h:60
Format::Token::divisor
int divisor
Definition
Token.h:72
Format::Token::string
char * string
Definition
Token.h:53
Format::Token::headerId
ProxyProtocol::Two::FieldType headerId
the cached ID of the parsed header or zero
Definition
Token.h:56
Format::Token::label
const char * label
Definition
Token.h:51
Format::Token::next
Token * next
Definition
Token.h:73
Format::Token::zero
bool zero
Definition
Token.h:71
Format::Token::parse
int parse(const char *def, enum Quoting *quote)
Definition
Token.cc:355
Format::Token::type
ByteCode_t type
Definition
Token.h:50
Format::Token::left
bool left
Definition
Token.h:69
Format::Token::space
bool space
Definition
Token.h:70
Format::Token::Init
static void Init()
Initialize the format token registrations.
Definition
Token.cc:255
Format::Token::Token
Token()
Definition
Token.cc:740
Format::Token::header
char * header
Definition
Token.h:59
Format::Token::widthMax
int widthMax
maximum field width
Definition
Token.h:67
Format
Definition
SchemeConfig.h:28
Format::ByteCode_t
ByteCode_t
Definition
ByteCode.h:30
Format::Quoting
Quoting
Quoting style for a format output.
Definition
ByteCode.h:262
ProxyProtocol::Two::FieldType
FieldType
numeric IDs of registered PROXY protocol TLV types and pseudo headers
Definition
Elements.h:19
Elements.h
squid
src
format
Token.h
Generated by
1.9.8