#include <isc/util.h>
#include <string.h>
Go to the source code of this file.
Defines | |
#define | ISCCC_UTIL_H 1 |
#define | GET8(v, w) |
#define | GET16(v, w) |
#define | GET24(v, w) |
#define | GET32(v, w) |
#define | GET64(v, w) |
#define | GETC16(v, w, d) |
#define | GETC32(v, w) |
#define | GET_OFFSET(v, w) GET32(v, w) |
#define | GET_MEM(v, c, w) |
#define | GET_TYPE(v, w) |
#define | PUT8(v, w) |
#define | PUT16(v, w) |
#define | PUT24(v, w) |
#define | PUT32(v, w) |
#define | PUT64(v, w) |
#define | PUTC16(v, w) |
#define | PUTC32(v, w) |
#define | PUT_OFFSET(v, w) PUT32(v, w) |
#define | PUT_MEM(s, c, w) |
#define | REGION_SIZE(r) ((unsigned int)((r).rend - (r).rstart)) |
#define | REGION_EMPTY(r) ((r).rstart == (r).rend) |
#define | REGION_FROMSTRING(r, s) |
#define | DE_CONST(konst, var) |
Use this to remove the const qualifier of a variable to assign it to a non-const variable or pass it as a non-const function argument ... but only when you are sure it won't then be changed! This is necessary to sometimes shut up some compilers (as with gcc -Wcast-qual) when there is just no other good way to avoid the situation. |
Definition in file util.h.
#define GET8 | ( | v, | |||
w | ) |
Value:
do { \ v = *w; \ w++; \ } while (0)
Definition at line 46 of file util.h.
Referenced by table_fromwire(), value_fromwire(), and verify().
#define GET16 | ( | v, | |||
w | ) |
#define GET24 | ( | v, | |||
w | ) |
#define GET32 | ( | v, | |||
w | ) |
Value:
do { \ v = (unsigned int)w[0] << 24; \ v |= (unsigned int)w[1] << 16; \ v |= (unsigned int)w[2] << 8; \ v |= (unsigned int)w[3]; \ w += 4; \ } while (0)
Definition at line 67 of file util.h.
Referenced by isccc_cc_fromwire(), and value_fromwire().
#define GET64 | ( | v, | |||
w | ) |
Value:
do { \ v = (isc_uint64_t)w[0] << 56; \ v |= (isc_uint64_t)w[1] << 48; \ v |= (isc_uint64_t)w[2] << 40; \ v |= (isc_uint64_t)w[3] << 32; \ v |= (isc_uint64_t)w[4] << 24; \ v |= (isc_uint64_t)w[5] << 16; \ v |= (isc_uint64_t)w[6] << 8; \ v |= (isc_uint64_t)w[7]; \ w += 8; \ } while (0)
#define GETC16 | ( | v, | |||
w, | |||||
d | ) |
#define GETC32 | ( | v, | |||
w | ) |
#define GET_MEM | ( | v, | |||
c, | |||||
w | ) |
Value:
do { \ memmove(v, w, c); \ w += c; \ } while (0)
Definition at line 110 of file util.h.
Referenced by table_fromwire().
#define GET_TYPE | ( | v, | |||
w | ) |
#define PUT8 | ( | v, | |||
w | ) |
#define PUT16 | ( | v, | |||
w | ) |
#define PUT24 | ( | v, | |||
w | ) |
#define PUT32 | ( | v, | |||
w | ) |
#define PUT64 | ( | v, | |||
w | ) |
Value:
do { \ w[0] = (v & 0xff00000000000000ULL) >> 56; \ w[1] = (v & 0x00ff000000000000ULL) >> 48; \ w[2] = (v & 0x0000ff0000000000ULL) >> 40; \ w[3] = (v & 0x000000ff00000000ULL) >> 32; \ w[4] = (v & 0x00000000ff000000ULL) >> 24; \ w[5] = (v & 0x0000000000ff0000ULL) >> 16; \ w[6] = (v & 0x000000000000ff00ULL) >> 8; \ w[7] = (v & 0x00000000000000ffULL); \ w += 8; \ } while (0)
#define PUTC16 | ( | v, | |||
w | ) |
#define PUTC32 | ( | v, | |||
w | ) |
#define PUT_MEM | ( | s, | |||
c, | |||||
w | ) |
Definition at line 203 of file util.h.
Referenced by control_recvmessage(), isccc_cc_fromwire(), isccc_sexpr_frombinary(), isccc_sexpr_print(), sign(), table_fromwire(), value_fromwire(), value_towire(), and verify().
#define DE_CONST | ( | konst, | |||
var | ) |
Value:
do { \ union { const void *k; void *v; } _u; \ _u.k = konst; \ var = _u.v; \ } while (0)