QDP++
QDPUtil Namespace Reference

Typedefs

typedef n_uint32_t uLong
typedef unsigned char Byte
typedef uLong uLongf
typedef unsigned short int n_uint16_t
 See qdp_crc32.cc for defs and discussion.
typedef unsigned int n_uint32_t

Functions

bool big_endian ()
 Is the native byte order big endian?
void byte_swap (void *ptr, size_t size, size_t nmemb)
 Byte-swap an array of data each of size nmemb.
size_t bfread (void *ptr, size_t size, size_t nmemb, FILE *stream)
 fread on a binary file written in big-endian order
size_t bfwrite (void *ptr, size_t size, size_t nmemb, FILE *stream)
 fwrite to a binary file in big-endian order
static uLongfget_crc_table ()
n_uint32_t crc32 (n_uint32_t crc, const unsigned char *buf, size_t len)
 crc32
n_uint32_t crc32 (n_uint32_t crc, const char *buf, size_t len)
 crc32

Variables

local uLongf crc_table [256]

Typedef Documentation

◆ Byte

typedef unsigned char QDPUtil::Byte

Definition at line 47 of file qdp_crc32.cc.

◆ n_uint16_t

typedef unsigned short int QDPUtil::n_uint16_t

See qdp_crc32.cc for defs and discussion.

Definition at line 19 of file qdp_byteorder.h.

◆ n_uint32_t

typedef unsigned int QDPUtil::n_uint32_t

Definition at line 20 of file qdp_byteorder.h.

◆ uLong

Definition at line 46 of file qdp_crc32.cc.

◆ uLongf

Definition at line 48 of file qdp_crc32.cc.

Function Documentation

◆ bfread()

size_t QDPUtil::bfread ( void * ptr,
size_t size,
size_t nmemb,
FILE * stream )

fread on a binary file written in big-endian order

Definition at line 174 of file qdp_byteorder.cc.

References big_endian(), and byte_swap().

◆ bfwrite()

size_t QDPUtil::bfwrite ( void * ptr,
size_t size,
size_t nmemb,
FILE * stream )

fwrite to a binary file in big-endian order

Definition at line 192 of file qdp_byteorder.cc.

References big_endian(), and byte_swap().

◆ big_endian()

◆ byte_swap()

void QDPUtil::byte_swap ( void * ptr,
size_t size,
size_t nmemb )

◆ crc32() [1/2]

n_uint32_t QDPUtil::crc32 ( n_uint32_t crc,
const char * buf,
size_t len )

crc32

Definition at line 208 of file qdp_crc32.cc.

References crc32().

◆ crc32() [2/2]

n_uint32_t QDPUtil::crc32 ( n_uint32_t crc,
const unsigned char * buf,
size_t len )

◆ get_crc_table()

uLongf * QDPUtil::get_crc_table ( )
static

Definition at line 169 of file qdp_crc32.cc.

References crc_table.

Variable Documentation

◆ crc_table

local uLongf QDPUtil::crc_table[256]

Definition at line 110 of file qdp_crc32.cc.

Referenced by get_crc_table().