97#define SIZEOF_NETWORK_SHORT 2
98#define SIZEOF_NETWORK_LONG 4
99#define SIZEOF_NETWORK_FLOAT 4
100#define SIZEOF_NETWORK_DOUBLE 8
109#define CV_CHANNEL_MASK 0x00ff
110#define CV_HOST_MASK 0x0100
111#define CV_SIGNED_MASK 0x0200
112#define CV_TYPE_MASK 0x1c00
113#define CV_CONVERT_MASK 0x6000
122#define CV_TYPE_SHIFT 10
123#define CV_CONVERT_SHIFT 13
131#define CV_CLIP 0x0000
132#define CV_NORMAL 0x2000
156#if !defined(HAVE_NTOHLL) && !defined(ntohll)
157# define ntohll(_val) ((bu_byteorder() == BU_LITTLE_ENDIAN) ? \
158 ((((uint64_t)ntohl((_val))) << 32) + ntohl((_val) >> 32)) : \
161#if !defined(HAVE_HTONLL) && !defined(htonll)
162# define htonll(_val) ntohll(_val)
177BU_EXPORT
extern size_t bu_cv(
void *out,
char *outfmt,
size_t size,
void *in,
char *infmt,
size_t count);
301BU_EXPORT
extern size_t bu_cv_w_cookie(
void *out,
int outcookie,
size_t size,
void *in,
int incookie,
size_t count);
370 const unsigned char *in,
373 const unsigned char *in,
383 const unsigned char *in,
386 const unsigned char *in,
457#define BU_GLONGLONG(_cp) \
458 ((((uint64_t)((_cp)[0])) << 56) | \
459 (((uint64_t)((_cp)[1])) << 48) | \
460 (((uint64_t)((_cp)[2])) << 40) | \
461 (((uint64_t)((_cp)[3])) << 32) | \
462 (((uint64_t)((_cp)[4])) << 24) | \
463 (((uint64_t)((_cp)[5])) << 16) | \
464 (((uint64_t)((_cp)[6])) << 8) | \
465 ((uint64_t)((_cp)[7])))
471#define BU_GLONG(_cp) \
472 ((((uint32_t)((_cp)[0])) << 24) | \
473 (((uint32_t)((_cp)[1])) << 16) | \
474 (((uint32_t)((_cp)[2])) << 8) | \
475 ((uint32_t)((_cp)[3])))
481#define BU_GSHORT(_cp) \
482 ((((uint16_t)((_cp)[0])) << 8) | \
Header file for the BRL-CAD common definitions.
DEPRECATED unsigned char * bu_pshort(unsigned char *msgp, uint16_t s)
DEPRECATED uint16_t bu_gshort(const unsigned char *msgp)
DEPRECATED uint32_t bu_glong(const unsigned char *msgp)
DEPRECATED unsigned char * bu_plonglong(unsigned char *msgp, uint64_t l)
DEPRECATED unsigned char * bu_plong(unsigned char *msgp, uint32_t l)
size_t bu_cv_itemlen(int cookie)
int bu_cv_optimize(int cookie)
size_t bu_cv_w_cookie(void *out, int outcookie, size_t size, void *in, int incookie, size_t count)
size_t bu_cv(void *out, char *outfmt, size_t size, void *in, char *infmt, size_t count)
int bu_cv_cookie(const char *in)
signed char * bu_b64_encode(const signed char *input)
signed char * bu_b64_encode_block(const signed char *input, size_t length_in)
int bu_b64_decode(signed char **output_buffer, const signed char *input)
int bu_b64_decode_block(signed char **output_buffer, const signed char *input, size_t length_in)
void bu_cv_htond(unsigned char *out, const unsigned char *in, size_t count)
void bu_cv_ntohd(unsigned char *out, const unsigned char *in, size_t count)
void bu_cv_htonf(unsigned char *out, const unsigned char *in, size_t count)
void bu_cv_ntohf(unsigned char *out, const unsigned char *in, size_t count)
size_t bu_cv_ntohss(signed short *in, size_t count, void *out, size_t size)
size_t bu_cv_htonss(void *, size_t, signed short *, size_t)
size_t bu_cv_ntohus(unsigned short *, size_t, void *, size_t)
size_t bu_cv_ntohsl(signed long int *, size_t, void *, size_t)
size_t bu_cv_htonul(void *, size_t, unsigned long *, size_t)
size_t bu_cv_ntohul(unsigned long int *, size_t, void *, size_t)
size_t bu_cv_htonsl(void *, size_t, long *, size_t)
size_t bu_cv_htonus(void *, size_t, unsigned short *, size_t)
void float float int int int int float * size