-
Notifications
You must be signed in to change notification settings - Fork 0
/
crockford.h
45 lines (33 loc) · 1.24 KB
/
crockford.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef CROCKFORD_H
#define CROCKFORD_H
#include "postgres.h"
#include "utils/builtins.h"
/* static int crockford_digits[32] = */
/* { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', */
/* 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', */
/* 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', */
/* 'Y', 'Z' */
/* }; */
/* static int crockford_check_symbols[37] = */
/* { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', */
/* 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', */
/* 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', */
/* 'Y', 'Z', '*', '~', '$', '=', 'U' */
/* }; */
#if PG_VERSION_NUM < 90600
#ifdef USE_FLOAT8_BYVAL
#define DatumGetUInt64(X) ((uint64) GET_8_BYTES(X))
#else
#define DatumGetUInt64(X) (* ((uint64 *) DatumGetPointer(X)))
#endif // USE_FLOAT8_BYVAL
#ifdef USE_FLOAT8_BYVAL
#define UInt64GetDatum(X) ((Datum) SET_8_BYTES(X))
#else
#define UInt64GetDatum(X) Int64GetDatum((int64) (X))
#endif // USE_FLOAT8_BYVAL
#endif // PG_VERSION_NUM < 90600
#define PG_RETURN_UINT32(x) return UInt32GetDatum(x)
#define PG_GETARG_UINT64(n) DatumGetUInt64(PG_GETARG_DATUM(n))
#define PG_RETURN_UINT64(x) return UInt64GetDatum(x)
#define SAMESIGN(a,b) (((a) < 0) == ((b) < 0))
#endif // CROCKFORD_H