]> git.ipfire.org Git - thirdparty/squid.git/blob - src/typedefs.h
SourceLayout: shuffle kb_t to ByteCounter in libbase
[thirdparty/squid.git] / src / typedefs.h
1 /*
2 * Copyright (C) 1996-2015 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 #include "enums.h"
10
11 #ifndef SQUID_TYPEDEFS_H
12 #define SQUID_TYPEDEFS_H
13
14 typedef int32_t sfileno;
15 typedef signed int sdirno;
16
17 typedef uint32_t nfmark_t;
18 typedef unsigned char tos_t;
19
20 typedef struct _CommWriteStateData CommWriteStateData;
21
22 #if SQUID_SNMP
23 #include "cache_snmp.h"
24 typedef variable_list *(oid_ParseFn) (variable_list *, snint *);
25 #endif
26
27 typedef void FREE(void *);
28 typedef void FOCB(void *, int fd, int errcode);
29 typedef void PF(int, void *);
30
31 /* disk.c / diskd.c callback typedefs */
32 typedef void DRCB(int, const char *buf, int size, int errflag, void *data);
33 /* Disk read CB */
34 typedef void DWCB(int, int, size_t, void *); /* disk write CB */
35 typedef void DOCB(int, int errflag, void *data); /* disk open CB */
36 typedef void DCCB(int, int errflag, void *data); /* disk close CB */
37 typedef void DUCB(int errflag, void *data); /* disk unlink CB */
38 typedef void DTCB(int errflag, void *data); /* disk trunc CB */
39
40 namespace Dns
41 {
42 class LookupDetails;
43 }
44 typedef void FQDNH(const char *, const Dns::LookupDetails &details, void *);
45
46 #include "anyp/ProtocolType.h"
47 class CachePeer;
48 typedef void IRCB(CachePeer *, peer_t, AnyP::ProtocolType, void *, void *data);
49
50 /* in wordlist.h */
51
52 class wordlist;
53 typedef void UH(void *data, wordlist *);
54
55 /**
56 * READ_HANDLER functions return < 0 if, and only if, they fail with an error.
57 * On error, they must pass back an error code in 'errno'.
58 */
59 typedef int READ_HANDLER(int, char *, int);
60
61 /**
62 * WRITE_HANDLER functions return < 0 if, and only if, they fail with an error.
63 * On error, they must pass back an error code in 'errno'.
64 */
65 typedef int WRITE_HANDLER(int, const char *, int);
66
67 typedef int QS(const void *, const void *); /* qsort */
68 typedef void STABH(void *);
69 typedef void ERCB(int fd, void *, size_t);
70 class StoreEntry;
71 typedef void SIGHDLR(int sig);
72 typedef void STVLDCB(void *, int, int);
73 typedef int HLPSAVAIL(void *);
74 typedef void HLPSONEQ(void *);
75 typedef void HLPCMDOPTS(int *argc, char **argv);
76
77 /* MD5 cache keys */
78 typedef unsigned char cache_key;
79
80 /* in case we want to change it later */
81 typedef ssize_t mb_size_t;
82
83 typedef int STDIRSELECT(const StoreEntry *);
84
85 /*Use uint64_t to store miliseconds*/
86 typedef uint64_t time_msec_t;
87 #endif /* SQUID_TYPEDEFS_H */
88