PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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

#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)
unsigned int uint32
Definition: c.h:258

Definition at line 53 of file pg_crc.h.

#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)
unsigned int uint32
Definition: c.h:258

Definition at line 89 of file pg_crc.h.

#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.

Referenced by compact_trigram(), gtsvector_compress(), pushValue(), and tsqueryrecv().

#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.

Referenced by crc32_sz(), and ltree_crc32_sz().

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

Definition at line 83 of file pg_crc.h.

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

Definition at line 50 of file pg_crc.h.

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

Definition at line 80 of file pg_crc.h.

Referenced by compact_trigram(), gtsvector_compress(), pushValue(), and tsqueryrecv().

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

Definition at line 47 of file pg_crc.h.

Referenced by crc32_sz(), and ltree_crc32_sz().

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

Definition at line 79 of file pg_crc.h.

Referenced by compact_trigram(), gtsvector_compress(), pushValue(), and tsqueryrecv().

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

Definition at line 46 of file pg_crc.h.

Referenced by crc32_sz(), and ltree_crc32_sz().

Typedef Documentation

Definition at line 37 of file pg_crc.h.

Variable Documentation

PGDLLIMPORT const uint32 pg_crc32_table[256]

Definition at line 32 of file pg_crc.c.