PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
crc32.c File Reference
#include "postgres.h"
#include <sys/types.h>
#include <stdio.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 20 of file crc32.c.

Referenced by ltree_crc32_sz().

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