]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/esi/Parser.cc
2 * Copyright (C) 1996-2016 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 /* DEBUG: section 86 ESI processing */
12 #include "esi/Parser.h"
15 char *ESIParser::Type
= NULL
;
16 ESIParser::Register
*ESIParser::Parsers
= NULL
;
17 ESIParser::Register
*ESIParser::Parser
= NULL
;
20 ESIParser::NewParser(ESIParserClient
*aClient
)
25 while (Parser
!= NULL
&& strcasecmp(Parser
->name
, Type
) != 0)
26 Parser
= Parser
->next
;
29 fatal ("Unknown ESI Parser type");
32 return (Parser
->newParser
)(aClient
);
35 ESIParser::Register::Register(const char *_name
, ESIParser::Pointer (*_newParser
)(ESIParserClient
*aClient
)) : name(_name
), newParser(_newParser
)
37 this->next
= ESIParser::Parsers
;
38 ESIParser::Parsers
= this;
41 ESIParser::Register::~Register()
43 // TODO: support random-order deregistration
44 assert(ESIParser::Parsers
== this);
45 ESIParser::Parsers
= next
;