PostgreSQL Source Code git master
Loading...
Searching...
No Matches
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 (const char *buf, int size)
 

Macro Definition Documentation

◆ crc32

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

Definition at line 10 of file crc32.h.

Function Documentation

◆ ltree_crc32_sz()

unsigned int ltree_crc32_sz ( const char buf,
int  size 
)
extern

Definition at line 22 of file crc32.c.

23{
25 const char *p = buf;
26 const char *end = buf + size;
27 static pg_locale_t locale = NULL;
28
29 if (!locale)
30 locale = pg_database_locale();
31
33 while (size > 0)
34 {
36 int srclen = pg_mblen_range(p, end);
37 size_t foldlen;
38
39 /* fold one codepoint at a time */
41 locale);
42
44
45 size -= srclen;
46 p += srclen;
47 }
49 return (unsigned int) crc;
50}
int pg_mblen_range(const char *mbstr, const char *end)
Definition mbutils.c:1084
return crc
uint32 pg_crc32
Definition pg_crc.h:37
#define FIN_TRADITIONAL_CRC32(crc)
Definition pg_crc.h:47
#define INIT_TRADITIONAL_CRC32(crc)
Definition pg_crc.h:46
#define COMP_TRADITIONAL_CRC32(crc, data, len)
Definition pg_crc.h:48
size_t pg_strfold(char *dst, size_t dstsize, const char *src, ssize_t srclen, pg_locale_t locale)
Definition pg_locale.c:1348
pg_locale_t pg_database_locale(void)
Definition pg_locale.c:1175
#define UNICODE_CASEMAP_BUFSZ
Definition pg_locale.h:32
static char buf[DEFAULT_XLOG_SEG_SIZE]
static int fb(int x)

References buf, COMP_TRADITIONAL_CRC32, crc, fb(), FIN_TRADITIONAL_CRC32, INIT_TRADITIONAL_CRC32, pg_database_locale(), pg_mblen_range(), pg_strfold(), and UNICODE_CASEMAP_BUFSZ.

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