PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
crc32.c File Reference
#include "postgres.h"
#include "utils/pg_crc.h"
#include "crc32.h"
Include dependency graph for crc32.c:

Go to the source code of this file.

Macros

#define TOLOWER(x)   (x)
 

Functions

unsigned int ltree_crc32_sz (char *buf, int size)
 

Macro Definition Documentation

#define TOLOWER (   x)    (x)

Definition at line 16 of file crc32.c.

Referenced by ltree_crc32_sz().

Function Documentation

unsigned int ltree_crc32_sz ( char *  buf,
int  size 
)

Definition at line 23 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().

24 {
25  pg_crc32 crc;
26  char *p = buf;
27 
29  while (size > 0)
30  {
31  char c = (char) TOLOWER(*p);
32 
33  COMP_TRADITIONAL_CRC32(crc, &c, 1);
34  size--;
35  p++;
36  }
38  return (unsigned int) crc;
39 }
#define COMP_TRADITIONAL_CRC32(crc, data, len)
Definition: pg_crc.h:48
#define TOLOWER(x)
Definition: crc32.c:16
#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