PostgreSQL Source Code  git master
pg_crc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define INIT_TRADITIONAL_CRC32(crc)   ((crc) = 0xFFFFFFFF)
 
#define FIN_TRADITIONAL_CRC32(crc)   ((crc) ^= 0xFFFFFFFF)
 
#define COMP_TRADITIONAL_CRC32(crc, data, len)    COMP_CRC32_NORMAL_TABLE(crc, data, len, pg_crc32_table)
 
#define EQ_TRADITIONAL_CRC32(c1, c2)   ((c1) == (c2))
 
#define COMP_CRC32_NORMAL_TABLE(crc, data, len, table)
 
#define INIT_LEGACY_CRC32(crc)   ((crc) = 0xFFFFFFFF)
 
#define FIN_LEGACY_CRC32(crc)   ((crc) ^= 0xFFFFFFFF)
 
#define COMP_LEGACY_CRC32(crc, data, len)    COMP_CRC32_REFLECTED_TABLE(crc, data, len, pg_crc32_table)
 
#define EQ_LEGACY_CRC32(c1, c2)   ((c1) == (c2))
 
#define COMP_CRC32_REFLECTED_TABLE(crc, data, len, table)
 

Typedefs

typedef uint32 pg_crc32
 

Variables

PGDLLIMPORT const uint32 pg_crc32_table [256]
 

Macro Definition Documentation

◆ COMP_CRC32_NORMAL_TABLE

#define COMP_CRC32_NORMAL_TABLE (   crc,
  data,
  len,
  table 
)
Value:
do { \
const unsigned char *__data = (const unsigned char *) (data); \
uint32 __len = (len); \
while (__len-- > 0) \
{ \
int __tab_index = ((int) (crc) ^ *__data++) & 0xFF; \
(crc) = table[__tab_index] ^ ((crc) >> 8); \
} \
} while (0)
const void size_t len
const void * data
return crc
while(p+4<=pend)

Definition at line 53 of file pg_crc.h.

◆ COMP_CRC32_REFLECTED_TABLE

#define COMP_CRC32_REFLECTED_TABLE (   crc,
  data,
  len,
  table 
)
Value:
do { \
const unsigned char *__data = (const unsigned char *) (data); \
uint32 __len = (len); \
while (__len-- > 0) \
{ \
int __tab_index = ((int) ((crc) >> 24) ^ *__data++) & 0xFF; \
(crc) = table[__tab_index] ^ ((crc) << 8); \
} \
} while (0)

Definition at line 89 of file pg_crc.h.

◆ COMP_LEGACY_CRC32

#define COMP_LEGACY_CRC32 (   crc,
  data,
  len 
)     COMP_CRC32_REFLECTED_TABLE(crc, data, len, pg_crc32_table)

Definition at line 81 of file pg_crc.h.

◆ COMP_TRADITIONAL_CRC32

#define COMP_TRADITIONAL_CRC32 (   crc,
  data,
  len 
)     COMP_CRC32_NORMAL_TABLE(crc, data, len, pg_crc32_table)

Definition at line 48 of file pg_crc.h.

◆ EQ_LEGACY_CRC32

#define EQ_LEGACY_CRC32 (   c1,
  c2 
)    ((c1) == (c2))

Definition at line 83 of file pg_crc.h.

◆ EQ_TRADITIONAL_CRC32

#define EQ_TRADITIONAL_CRC32 (   c1,
  c2 
)    ((c1) == (c2))

Definition at line 50 of file pg_crc.h.

◆ FIN_LEGACY_CRC32

#define FIN_LEGACY_CRC32 (   crc)    ((crc) ^= 0xFFFFFFFF)

Definition at line 80 of file pg_crc.h.

◆ FIN_TRADITIONAL_CRC32

#define FIN_TRADITIONAL_CRC32 (   crc)    ((crc) ^= 0xFFFFFFFF)

Definition at line 47 of file pg_crc.h.

◆ INIT_LEGACY_CRC32

#define INIT_LEGACY_CRC32 (   crc)    ((crc) = 0xFFFFFFFF)

Definition at line 79 of file pg_crc.h.

◆ INIT_TRADITIONAL_CRC32

#define INIT_TRADITIONAL_CRC32 (   crc)    ((crc) = 0xFFFFFFFF)

Definition at line 46 of file pg_crc.h.

Typedef Documentation

◆ pg_crc32

typedef uint32 pg_crc32

Definition at line 37 of file pg_crc.h.

Variable Documentation

◆ pg_crc32_table

PGDLLIMPORT const uint32 pg_crc32_table[256]
extern

Definition at line 32 of file pg_crc.c.