]> git.ipfire.org Git - thirdparty/squid.git/blob - src/Packer.h
Boilerplate: update copyright blurbs on src/
[thirdparty/squid.git] / src / Packer.h
1 /*
2 * Copyright (C) 1996-2014 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_PACKER_H
10 #define SQUID_PACKER_H
11
12 /* see Packer.cc for description */
13 class Packer;
14
15 /* a common objPackInto interface; used by debugObj */
16 typedef void (*ObjPackMethod) (void *obj, Packer * p);
17
18 /* append/vprintf's for Packer */
19 typedef void (*append_f) (void *, const char *buf, int size);
20 typedef void (*vprintf_f) (void *, const char *fmt, va_list args);
21
22 class Packer
23 {
24
25 public:
26 /* protected, use interface functions instead */
27 append_f append;
28 vprintf_f packer_vprintf;
29 void *real_handler; /* first parameter to real append and vprintf */
30 };
31
32 void packerClean(Packer * p);
33 void packerAppend(Packer * p, const char *buf, int size);
34 void packerPrintf(Packer * p, const char *fmt,...) PRINTF_FORMAT_ARG2;
35
36 #endif /* SQUID_PACKER_H */