]>
git.ipfire.org Git - thirdparty/squid.git/blob - include/util.h
2 * Copyright (C) 1996-2022 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.
13 #include <arpa/inet.h>
16 SQUIDCEXTERN
void Tolower(char *);
18 SQUIDCEXTERN
double xpercent(double part
, double whole
);
19 SQUIDCEXTERN
int xpercentInt(double part
, double whole
);
20 SQUIDCEXTERN
double xdiv(double nom
, double denom
);
22 SQUIDCEXTERN
const char *xitoa(int num
);
23 SQUIDCEXTERN
const char *xint64toa(int64_t num
);
31 /* gb_type operations */
32 #define gb_flush_limit (0x3FFFFFFF)
33 #define gb_inc(gb, delta) { if ((gb)->bytes > gb_flush_limit || delta > gb_flush_limit) gb_flush(gb); (gb)->bytes += delta; (gb)->count++; }
34 #define gb_incb(gb, delta) { if ((gb)->bytes > gb_flush_limit || delta > gb_flush_limit) gb_flush(gb); (gb)->bytes += delta; }
35 #define gb_incc(gb, delta) { if ((gb)->bytes > gb_flush_limit || delta > gb_flush_limit) gb_flush(gb); (gb)->count+= delta; }
36 extern double gb_to_double(const gb_t
*);
37 SQUIDCEXTERN
const char *double_to_str(char *buf
, int buf_size
, double value
);
38 extern const char *gb_to_str(const gb_t
*);
39 extern void gb_flush(gb_t
*); /* internal, do not use this */
41 SQUIDCEXTERN
unsigned int RoundTo(const unsigned int num
, const unsigned int what
);
43 #endif /* SQUID_UTIL_H */