PostgreSQL Source Code git master
|
#include "postgres.h"
#include <ctype.h>
#include "mb/pg_wchar.h"
#include "utils/builtins.h"
#include "utils/memutils.h"
#include "varatt.h"
Go to the source code of this file.
Data Structures | |
struct | pg_encoding |
Macros | |
#define | VAL(CH) ((CH) - '0') |
#define | DIG(VAL) ((VAL) + '0') |
Functions | |
static const struct pg_encoding * | pg_find_encoding (const char *name) |
Datum | binary_encode (PG_FUNCTION_ARGS) |
Datum | binary_decode (PG_FUNCTION_ARGS) |
uint64 | hex_encode (const char *src, size_t len, char *dst) |
static bool | get_hex (const char *cp, char *out) |
uint64 | hex_decode (const char *src, size_t len, char *dst) |
uint64 | hex_decode_safe (const char *src, size_t len, char *dst, Node *escontext) |
static uint64 | hex_enc_len (const char *src, size_t srclen) |
static uint64 | hex_dec_len (const char *src, size_t srclen) |
static uint64 | pg_base64_encode (const char *src, size_t len, char *dst) |
static uint64 | pg_base64_decode (const char *src, size_t len, char *dst) |
static uint64 | pg_base64_enc_len (const char *src, size_t srclen) |
static uint64 | pg_base64_dec_len (const char *src, size_t srclen) |
static uint64 | esc_encode (const char *src, size_t srclen, char *dst) |
static uint64 | esc_decode (const char *src, size_t srclen, char *dst) |
static uint64 | esc_enc_len (const char *src, size_t srclen) |
static uint64 | esc_dec_len (const char *src, size_t srclen) |
Variables | |
static const char | hextbl [512] |
static const int8 | hexlookup [128] |
static const char | _base64 [] |
static const int8 | b64lookup [128] |
struct { | |
const char * name | |
struct pg_encoding enc | |
} | enclist [] |
Datum binary_decode | ( | PG_FUNCTION_ARGS | ) |
Definition at line 96 of file encode.c.
References data, pg_encoding::decode, pg_encoding::decode_len, elog, enc, ereport, errcode(), errmsg(), ERROR, FATAL, MaxAllocSize, name, palloc(), pg_find_encoding(), PG_GETARG_DATUM, PG_GETARG_TEXT_PP, PG_RETURN_BYTEA_P, SET_VARSIZE, TextDatumGetCString, VARDATA, VARDATA_ANY, VARHDRSZ, and VARSIZE_ANY_EXHDR.
Datum binary_encode | ( | PG_FUNCTION_ARGS | ) |
Definition at line 48 of file encode.c.
References data, elog, enc, pg_encoding::encode, pg_encoding::encode_len, ereport, errcode(), errmsg(), ERROR, FATAL, MaxAllocSize, name, palloc(), pg_find_encoding(), PG_GETARG_BYTEA_PP, PG_GETARG_DATUM, PG_RETURN_TEXT_P, SET_VARSIZE, TextDatumGetCString, VARDATA, VARDATA_ANY, VARHDRSZ, and VARSIZE_ANY_EXHDR.
|
static |
Definition at line 544 of file encode.c.
|
static |
Definition at line 475 of file encode.c.
References ereport, errcode(), errmsg(), ERROR, len, VAL, and val.
|
static |
|
static |
Definition at line 436 of file encode.c.
References DIG, IS_HIGHBIT_SET, and len.
|
inlinestatic |
Definition at line 197 of file encode.c.
References hexlookup.
Referenced by hex_decode_safe().
|
static |
uint64 hex_decode | ( | const char * | src, |
size_t | len, | ||
char * | dst | ||
) |
Definition at line 211 of file encode.c.
References hex_decode_safe(), and len.
Definition at line 217 of file encode.c.
References ereturn, errcode(), errmsg(), get_hex(), len, and pg_mblen().
Referenced by byteain(), and hex_decode().
|
static |
uint64 hex_encode | ( | const char * | src, |
size_t | len, | ||
char * | dst | ||
) |
Definition at line 181 of file encode.c.
Referenced by AddFileToBackupManifest(), byteaout(), and SendBackupManifest().
|
static |
|
static |
Definition at line 335 of file encode.c.
References b, b64lookup, buf, ereport, errcode(), errhint(), errmsg(), ERROR, len, and pg_mblen().
|
static |
|
static |
Definition at line 288 of file encode.c.
|
static |
Definition at line 624 of file encode.c.
References enclist, i, name, and pg_strcasecmp().
Referenced by binary_decode(), and binary_encode().
|
static |
Definition at line 273 of file encode.c.
Referenced by pg_base64_encode().
|
static |
Definition at line 276 of file encode.c.
Referenced by pg_base64_decode().
struct pg_encoding enc |
Definition at line 593 of file encode.c.
Referenced by binary_decode(), and binary_encode().
const struct { ... } enclist[] |
Referenced by pg_find_encoding().
|
static |
Definition at line 169 of file encode.c.
Referenced by get_hex().
|
static |
Definition at line 151 of file encode.c.
Referenced by hex_encode().
const char* name |
Definition at line 592 of file encode.c.
Referenced by binary_decode(), binary_encode(), and pg_find_encoding().