ROOTANA
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
xxhash.c File Reference
#include "xxhash.h"
#include <stdlib.h>
#include <string.h>
Include dependency graph for xxhash.c:

Go to the source code of this file.

Data Structures

struct  XXH_istate32_t
 
struct  XXH_istate64_t
 

Macros

#define XXH_FORCE_NATIVE_FORMAT   0
 
#define FORCE_INLINE   static
 
#define GCC_VERSION   (__GNUC__ * 100 + __GNUC_MINOR__)
 
#define XXH_rotl32(x, r)   ((x << r) | (x >> (32 - r)))
 
#define XXH_rotl64(x, r)   ((x << r) | (x >> (64 - r)))
 
#define XXH_CPU_LITTLE_ENDIAN   (*(const char*)(&one))
 
#define XXH_STATIC_ASSERT(c)   { enum { XXH_static_assert = 1/(!!(c)) }; } /* use only *after* variable declarations */
 
#define PRIME32_1   2654435761U
 
#define PRIME32_2   2246822519U
 
#define PRIME32_3   3266489917U
 
#define PRIME32_4   668265263U
 
#define PRIME32_5   374761393U
 
#define PRIME64_1   11400714785074694791ULL
 
#define PRIME64_2   14029467366897019727ULL
 
#define PRIME64_3   1609587929392839161ULL
 
#define PRIME64_4   9650029242287828579ULL
 
#define PRIME64_5   2870177450012600261ULL
 
#define XXH_get32bits(p)   XXH_readLE32_align(p, endian, align)
 
#define XXH_get64bits(p)   XXH_readLE64_align(p, endian, align)
 

Typedefs

typedef unsigned char BYTE
 
typedef unsigned short U16
 
typedef unsigned int U32
 
typedef signed int S32
 
typedef unsigned long long U64
 

Enumerations

enum  XXH_endianess { XXH_bigEndian =0 , XXH_littleEndian =1 }
 
enum  XXH_alignment { XXH_aligned , XXH_unaligned }
 

Functions

static void * XXH_malloc (size_t s)
 
static void XXH_free (void *p)
 
static void * XXH_memcpy (void *dest, const void *src, size_t size)
 
static U32 XXH_read32 (const void *memPtr)
 
static U64 XXH_read64 (const void *memPtr)
 
static U32 XXH_swap32 (U32 x)
 
static U64 XXH_swap64 (U64 x)
 
FORCE_INLINE U32 XXH_readLE32_align (const void *ptr, XXH_endianess endian, XXH_alignment align)
 
FORCE_INLINE U32 XXH_readLE32 (const void *ptr, XXH_endianess endian)
 
FORCE_INLINE U64 XXH_readLE64_align (const void *ptr, XXH_endianess endian, XXH_alignment align)
 
FORCE_INLINE U64 XXH_readLE64 (const void *ptr, XXH_endianess endian)
 
FORCE_INLINE U32 XXH32_endian_align (const void *input, size_t len, U32 seed, XXH_endianess endian, XXH_alignment align)
 
unsigned XXH32 (const void *input, size_t len, unsigned seed)
 
FORCE_INLINE U64 XXH64_endian_align (const void *input, size_t len, U64 seed, XXH_endianess endian, XXH_alignment align)
 
unsigned long long XXH64 (const void *input, size_t len, unsigned long long seed)
 
XXH32_state_tXXH32_createState (void)
 
XXH_errorcode XXH32_freeState (XXH32_state_t *statePtr)
 
XXH64_state_tXXH64_createState (void)
 
XXH_errorcode XXH64_freeState (XXH64_state_t *statePtr)
 
XXH_errorcode XXH32_reset (XXH32_state_t *state_in, U32 seed)
 
XXH_errorcode XXH64_reset (XXH64_state_t *state_in, unsigned long long seed)
 
FORCE_INLINE XXH_errorcode XXH32_update_endian (XXH32_state_t *state_in, const void *input, size_t len, XXH_endianess endian)
 
XXH_errorcode XXH32_update (XXH32_state_t *state_in, const void *input, size_t len)
 
FORCE_INLINE U32 XXH32_digest_endian (const XXH32_state_t *state_in, XXH_endianess endian)
 
U32 XXH32_digest (const XXH32_state_t *state_in)
 
FORCE_INLINE XXH_errorcode XXH64_update_endian (XXH64_state_t *state_in, const void *input, size_t len, XXH_endianess endian)
 
XXH_errorcode XXH64_update (XXH64_state_t *state_in, const void *input, size_t len)
 
FORCE_INLINE U64 XXH64_digest_endian (const XXH64_state_t *state_in, XXH_endianess endian)
 
unsigned long long XXH64_digest (const XXH64_state_t *state_in)
 

Variables

static const int one = 1
 

Macro Definition Documentation

◆ FORCE_INLINE

#define FORCE_INLINE   static

Definition at line 79 of file xxhash.c.

◆ GCC_VERSION

#define GCC_VERSION   (__GNUC__ * 100 + __GNUC_MINOR__)

Definition at line 135 of file xxhash.c.

◆ PRIME32_1

#define PRIME32_1   2654435761U

Definition at line 225 of file xxhash.c.

◆ PRIME32_2

#define PRIME32_2   2246822519U

Definition at line 226 of file xxhash.c.

◆ PRIME32_3

#define PRIME32_3   3266489917U

Definition at line 227 of file xxhash.c.

◆ PRIME32_4

#define PRIME32_4   668265263U

Definition at line 228 of file xxhash.c.

◆ PRIME32_5

#define PRIME32_5   374761393U

Definition at line 229 of file xxhash.c.

◆ PRIME64_1

#define PRIME64_1   11400714785074694791ULL

Definition at line 231 of file xxhash.c.

◆ PRIME64_2

#define PRIME64_2   14029467366897019727ULL

Definition at line 232 of file xxhash.c.

◆ PRIME64_3

#define PRIME64_3   1609587929392839161ULL

Definition at line 233 of file xxhash.c.

◆ PRIME64_4

#define PRIME64_4   9650029242287828579ULL

Definition at line 234 of file xxhash.c.

◆ PRIME64_5

#define PRIME64_5   2870177450012600261ULL

Definition at line 235 of file xxhash.c.

◆ XXH_CPU_LITTLE_ENDIAN

#define XXH_CPU_LITTLE_ENDIAN   (*(const char*)(&one))

Definition at line 180 of file xxhash.c.

◆ XXH_FORCE_NATIVE_FORMAT

#define XXH_FORCE_NATIVE_FORMAT   0

Definition at line 62 of file xxhash.c.

◆ XXH_get32bits

#define XXH_get32bits (   p)    XXH_readLE32_align(p, endian, align)

◆ XXH_get64bits

#define XXH_get64bits (   p)    XXH_readLE64_align(p, endian, align)

◆ XXH_rotl32

#define XXH_rotl32 (   x,
 
)    ((x << r) | (x >> (32 - r)))

Definition at line 142 of file xxhash.c.

◆ XXH_rotl64

#define XXH_rotl64 (   x,
 
)    ((x << r) | (x >> (64 - r)))

Definition at line 143 of file xxhash.c.

◆ XXH_STATIC_ASSERT

#define XXH_STATIC_ASSERT (   c)    { enum { XXH_static_assert = 1/(!!(c)) }; } /* use only *after* variable declarations */

Definition at line 219 of file xxhash.c.

Typedef Documentation

◆ BYTE

typedef unsigned char BYTE

Definition at line 109 of file xxhash.c.

◆ S32

typedef signed int S32

Definition at line 112 of file xxhash.c.

◆ U16

typedef unsigned short U16

Definition at line 110 of file xxhash.c.

◆ U32

typedef unsigned int U32

Definition at line 111 of file xxhash.c.

◆ U64

typedef unsigned long long U64

Definition at line 113 of file xxhash.c.

Enumeration Type Documentation

◆ XXH_alignment

Enumerator
XXH_aligned 
XXH_unaligned 

Definition at line 187 of file xxhash.c.

◆ XXH_endianess

Enumerator
XXH_bigEndian 
XXH_littleEndian 

Definition at line 177 of file xxhash.c.

Function Documentation

◆ XXH32()

unsigned XXH32 ( const void *  input,
size_t  len,
unsigned  seed 
)

Definition at line 318 of file xxhash.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XXH32_createState()

XXH32_state_t* XXH32_createState ( void  )

Definition at line 516 of file xxhash.c.

Here is the call graph for this function:

◆ XXH32_digest()

U32 XXH32_digest ( const XXH32_state_t state_in)

Definition at line 711 of file xxhash.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XXH32_digest_endian()

FORCE_INLINE U32 XXH32_digest_endian ( const XXH32_state_t state_in,
XXH_endianess  endian 
)

Definition at line 669 of file xxhash.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XXH32_endian_align()

FORCE_INLINE U32 XXH32_endian_align ( const void *  input,
size_t  len,
U32  seed,
XXH_endianess  endian,
XXH_alignment  align 
)

Definition at line 241 of file xxhash.c.

Here is the caller graph for this function:

◆ XXH32_freeState()

XXH_errorcode XXH32_freeState ( XXH32_state_t statePtr)

Definition at line 521 of file xxhash.c.

Here is the call graph for this function:

◆ XXH32_reset()

XXH_errorcode XXH32_reset ( XXH32_state_t state_in,
U32  seed 
)

Definition at line 541 of file xxhash.c.

Here is the caller graph for this function:

◆ XXH32_update()

XXH_errorcode XXH32_update ( XXH32_state_t state_in,
const void *  input,
size_t  len 
)

Definition at line 657 of file xxhash.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XXH32_update_endian()

FORCE_INLINE XXH_errorcode XXH32_update_endian ( XXH32_state_t state_in,
const void *  input,
size_t  len,
XXH_endianess  endian 
)

Definition at line 568 of file xxhash.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XXH64()

unsigned long long XXH64 ( const void *  input,
size_t  len,
unsigned long long  seed 
)

Definition at line 458 of file xxhash.c.

Here is the call graph for this function:

◆ XXH64_createState()

XXH64_state_t* XXH64_createState ( void  )

Definition at line 527 of file xxhash.c.

Here is the call graph for this function:

◆ XXH64_digest()

unsigned long long XXH64_digest ( const XXH64_state_t state_in)

Definition at line 905 of file xxhash.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XXH64_digest_endian()

FORCE_INLINE U64 XXH64_digest_endian ( const XXH64_state_t state_in,
XXH_endianess  endian 
)

Definition at line 823 of file xxhash.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XXH64_endian_align()

FORCE_INLINE U64 XXH64_endian_align ( const void *  input,
size_t  len,
U64  seed,
XXH_endianess  endian,
XXH_alignment  align 
)

Definition at line 346 of file xxhash.c.

Here is the caller graph for this function:

◆ XXH64_freeState()

XXH_errorcode XXH64_freeState ( XXH64_state_t statePtr)

Definition at line 532 of file xxhash.c.

Here is the call graph for this function:

◆ XXH64_reset()

XXH_errorcode XXH64_reset ( XXH64_state_t state_in,
unsigned long long  seed 
)

Definition at line 554 of file xxhash.c.

Here is the caller graph for this function:

◆ XXH64_update()

XXH_errorcode XXH64_update ( XXH64_state_t state_in,
const void *  input,
size_t  len 
)

Definition at line 811 of file xxhash.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XXH64_update_endian()

FORCE_INLINE XXH_errorcode XXH64_update_endian ( XXH64_state_t state_in,
const void *  input,
size_t  len,
XXH_endianess  endian 
)

Definition at line 722 of file xxhash.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XXH_free()

static void XXH_free ( void *  p)
static

Definition at line 92 of file xxhash.c.

Here is the caller graph for this function:

◆ XXH_malloc()

static void* XXH_malloc ( size_t  s)
static

Definition at line 91 of file xxhash.c.

Here is the caller graph for this function:

◆ XXH_memcpy()

static void* XXH_memcpy ( void *  dest,
const void *  src,
size_t  size 
)
static

Definition at line 95 of file xxhash.c.

Here is the caller graph for this function:

◆ XXH_read32()

static U32 XXH_read32 ( const void *  memPtr)
static

Definition at line 116 of file xxhash.c.

Here is the caller graph for this function:

◆ XXH_read64()

static U64 XXH_read64 ( const void *  memPtr)
static

Definition at line 123 of file xxhash.c.

Here is the caller graph for this function:

◆ XXH_readLE32()

FORCE_INLINE U32 XXH_readLE32 ( const void *  ptr,
XXH_endianess  endian 
)

Definition at line 197 of file xxhash.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XXH_readLE32_align()

FORCE_INLINE U32 XXH_readLE32_align ( const void *  ptr,
XXH_endianess  endian,
XXH_alignment  align 
)

Definition at line 189 of file xxhash.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XXH_readLE64()

FORCE_INLINE U64 XXH_readLE64 ( const void *  ptr,
XXH_endianess  endian 
)

Definition at line 210 of file xxhash.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XXH_readLE64_align()

FORCE_INLINE U64 XXH_readLE64_align ( const void *  ptr,
XXH_endianess  endian,
XXH_alignment  align 
)

Definition at line 202 of file xxhash.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XXH_swap32()

static U32 XXH_swap32 ( U32  x)
static

Definition at line 153 of file xxhash.c.

Here is the caller graph for this function:

◆ XXH_swap64()

static U64 XXH_swap64 ( U64  x)
static

Definition at line 160 of file xxhash.c.

Here is the caller graph for this function:

Variable Documentation

◆ one

const int one = 1
static

Definition at line 179 of file xxhash.c.