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 [] = "0123456789abcdef" |
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, res, 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, res, SET_VARSIZE, TextDatumGetCString, VARDATA, VARDATA_ANY, VARHDRSZ, and VARSIZE_ANY_EXHDR.
|
static |
|
static |
|
static |
|
static |
|
inlinestatic |
Definition at line 176 of file encode.c.
References hexlookup, and res.
Referenced by hex_decode_safe().
|
static |
uint64 hex_decode | ( | const char * | src, |
size_t | len, | ||
char * | dst | ||
) |
Definition at line 190 of file encode.c.
References hex_decode_safe(), and len.
uint64 hex_decode_safe | ( | const char * | src, |
size_t | len, | ||
char * | dst, | ||
Node * | escontext | ||
) |
Definition at line 196 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 162 of file encode.c.
Referenced by AddFileToBackupManifest(), byteaout(), and SendBackupManifest().
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 603 of file encode.c.
References enclist, i, name, and pg_strcasecmp().
Referenced by binary_decode(), and binary_encode().
|
static |
Definition at line 252 of file encode.c.
Referenced by pg_base64_encode().
|
static |
Definition at line 255 of file encode.c.
Referenced by pg_base64_decode().
struct pg_encoding enc |
Definition at line 571 of file encode.c.
Referenced by binary_decode(), and binary_encode().
const { ... } enclist[] |
Referenced by pg_find_encoding().
|
static |
Definition at line 150 of file encode.c.
Referenced by get_hex().
|
static |
Definition at line 148 of file encode.c.
Referenced by hex_encode().
const char* name |
Definition at line 571 of file encode.c.
Referenced by binary_decode(), binary_encode(), and pg_find_encoding().