PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
crc32.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define crc32(buf)   ltree_crc32_sz((buf),strlen(buf))
 

Functions

unsigned int ltree_crc32_sz (char *buf, int size)
 

Macro Definition Documentation

#define crc32 (   buf)    ltree_crc32_sz((buf),strlen(buf))

Definition at line 10 of file crc32.h.

Function Documentation

unsigned int ltree_crc32_sz ( char *  buf,
int  size 
)

Definition at line 27 of file crc32.c.

References buf, COMP_TRADITIONAL_CRC32, FIN_TRADITIONAL_CRC32, INIT_TRADITIONAL_CRC32, and TOLOWER.

Referenced by gist_te(), hashing(), lquery_in(), and pushval_asis().

28 {
29  pg_crc32 crc;
30  char *p = buf;
31 
33  while (size > 0)
34  {
35  char c = (char) TOLOWER(*p);
36 
37  COMP_TRADITIONAL_CRC32(crc, &c, 1);
38  size--;
39  p++;
40  }
42  return (unsigned int) crc;
43 }
#define COMP_TRADITIONAL_CRC32(crc, data, len)
Definition: pg_crc.h:48
#define TOLOWER(x)
Definition: crc32.c:20
#define INIT_TRADITIONAL_CRC32(crc)
Definition: pg_crc.h:46
char * c
static char * buf
Definition: pg_test_fsync.c:65
#define FIN_TRADITIONAL_CRC32(crc)
Definition: pg_crc.h:47
uint32 pg_crc32
Definition: pg_crc.h:37