PostgreSQL Source Code git master
|
#include "postgres.h"
#include <ctype.h>
#include "mb/pg_wchar.h"
#include "port/simd.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) |
static uint64 | hex_encode_scalar (const char *src, size_t len, char *dst) |
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) |
static uint64 | hex_decode_safe_scalar (const char *src, size_t len, char *dst, Node *escontext) |
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_internal (const char *src, size_t len, char *dst, bool url) |
static uint64 | pg_base64_encode (const char *src, size_t len, char *dst) |
static uint64 | pg_base64url_encode (const char *src, size_t len, char *dst) |
static uint64 | pg_base64_decode_internal (const char *src, size_t len, char *dst, bool url) |
static uint64 | pg_base64_decode (const char *src, size_t len, char *dst) |
static uint64 | pg_base64url_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 | pg_base64url_enc_len (const char *src, size_t srclen) |
static uint64 | pg_base64url_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 char | _base64url [] |
static const int8 | b64lookup [128] |
struct { | |
const char * name | |
struct pg_encoding enc | |
} | enclist [] |
Datum binary_decode | ( | PG_FUNCTION_ARGS | ) |
Definition at line 97 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 49 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 782 of file encode.c.
|
static |
Definition at line 713 of file encode.c.
References ereport, errcode(), errmsg(), ERROR, len, VAL, and val.
|
static |
|
static |
Definition at line 674 of file encode.c.
References DIG, IS_HIGHBIT_SET, and len.
|
inlinestatic |
Definition at line 247 of file encode.c.
References hexlookup.
Referenced by hex_decode_safe_scalar().
|
static |
uint64 hex_decode | ( | const char * | src, |
size_t | len, | ||
char * | dst | ||
) |
Definition at line 261 of file encode.c.
References hex_decode_safe(), and len.
Definition at line 347 of file encode.c.
References hex_decode_safe_scalar(), i, len, success, and vector8_load().
Referenced by byteain(), and hex_decode().
|
inlinestatic |
Definition at line 267 of file encode.c.
References ereturn, errcode(), errmsg(), get_hex(), len, and pg_mblen().
Referenced by hex_decode_safe().
|
static |
uint64 hex_encode | ( | const char * | src, |
size_t | len, | ||
char * | dst | ||
) |
Definition at line 198 of file encode.c.
References hex_encode_scalar(), i, len, vector8_broadcast(), and vector8_load().
Referenced by AddFileToBackupManifest(), byteaout(), and SendBackupManifest().
|
inlinestatic |
Definition at line 182 of file encode.c.
Referenced by hex_encode().
|
static |
|
static |
Definition at line 606 of file encode.c.
References len, and pg_base64_decode_internal().
|
static |
Definition at line 506 of file encode.c.
References b, b64lookup, buf, ereport, errcode(), errhint(), errmsg(), ERROR, len, and pg_mblen().
Referenced by pg_base64_decode(), and pg_base64url_decode().
|
static |
|
static |
Definition at line 488 of file encode.c.
References len, and pg_base64_encode_internal().
|
static |
Definition at line 427 of file encode.c.
References _base64, _base64url, buf, and len.
Referenced by pg_base64_encode(), and pg_base64url_encode().
|
static |
Definition at line 641 of file encode.c.
|
static |
Definition at line 612 of file encode.c.
References len, and pg_base64_decode_internal().
|
static |
|
static |
Definition at line 494 of file encode.c.
References len, and pg_base64_encode_internal().
|
static |
Definition at line 868 of file encode.c.
References enclist, i, name, and pg_strcasecmp().
Referenced by binary_decode(), and binary_encode().
|
static |
Definition at line 402 of file encode.c.
Referenced by pg_base64_encode_internal().
|
static |
Definition at line 405 of file encode.c.
Referenced by pg_base64_encode_internal().
|
static |
Definition at line 408 of file encode.c.
Referenced by pg_base64_decode_internal().
struct pg_encoding enc |
Definition at line 831 of file encode.c.
Referenced by binary_decode(), and binary_encode().
const struct { ... } enclist[] |
Referenced by pg_find_encoding().
|
static |
Definition at line 170 of file encode.c.
Referenced by get_hex().
|
static |
Definition at line 152 of file encode.c.
Referenced by hex_encode_scalar().
const char* name |
Definition at line 830 of file encode.c.
Referenced by binary_decode(), binary_encode(), and pg_find_encoding().