]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/esi/Libxml2Parser.h
2 * Copyright (C) 1996-2015 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.
10 * The ESI Libxml2 parser is Copyright (c) 2004 by Joachim Bauch
11 * http://www.joachim-bauch.de
12 * mail@joachim-bauch.de
15 #ifndef SQUID_ESILIBXML2PARSER_H
16 #define SQUID_ESILIBXML2PARSER_H
18 #if USE_SQUID_ESI && HAVE_LIBXML2
20 #include "esi/Parser.h"
21 // workaround for definition of "free" that prevents include of
22 // parser.h from libxml2 without errors
29 // workaround for clang complaining of unknown attributes in libxml2 on fedora22
30 #ifdef LIBXML_ATTR_ALLOC_SIZE
31 #undef LIBXML_ATTR_ALLOC_SIZE
33 #define LIBXML_ATTR_ALLOC_SIZE(x)
34 #endif /* __clang__ */
36 #if HAVE_LIBXML_PARSER_H
37 #include <libxml/parser.h>
39 #if HAVE_LIBXML_HTMLPARSER_H
40 #include <libxml/HTMLparser.h>
42 #if HAVE_LIBXML_HTMLTREE_H
43 #include <libxml/HTMLtree.h>
50 class ESILibxml2Parser
: public ESIParser
54 ESILibxml2Parser(ESIParserClient
*);
57 bool parse(char const *dataToParse
, size_t const lengthOfData
, bool const endOfStream
);
58 long int lineNumber() const;
59 char const * errorString() const;
61 ESIParserClient
*getClient() { return theClient
; }
66 mutable xmlParserCtxtPtr parser
; /* our parser */
68 ESIParserClient
*theClient
;
71 #endif /* USE_SQUID_ESI */
73 #endif /* SQUID_ESILIBXML2PARSER_H */