Header And Logo

| The world's most advanced open source database.

Defines | Functions | Variables

crc32.c File Reference

#include "postgres.h"
#include <sys/types.h>
#include <stdio.h>
#include "crc32.h"
Include dependency graph for crc32.c:

Go to the source code of this file.


#define TOLOWER(x)   (x)
#define _CRC32_(crc, ch)   ((crc) = ((crc) >> 8) ^ crc32tab[((crc) ^ (ch)) & 0xff])


unsigned int ltree_crc32_sz (char *buf, int size)


static const unsigned int crc32tab [256]

Define Documentation

#define _CRC32_ (   crc,
)    ((crc) = ((crc) >> 8) ^ crc32tab[((crc) ^ (ch)) & 0xff])

Definition at line 27 of file crc32.c.

Referenced by ltree_crc32_sz().

#define TOLOWER (   x  )     (x)

Definition at line 15 of file crc32.c.

Referenced by ltree_crc32_sz().

Function Documentation

unsigned int ltree_crc32_sz ( char *  buf,
int  size 

Definition at line 102 of file crc32.c.

References _CRC32_, and TOLOWER.

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

    unsigned int crc = ~((unsigned int) 0);
    char       *p;
    int         len,

    len = 0;
    nr = size;
    for (len += nr, p = buf; nr--; ++p)
        _CRC32_(crc, TOLOWER((unsigned int) *p));
    return ~crc;

Variable Documentation

const unsigned int crc32tab[256] [static]

Definition at line 34 of file crc32.c.