PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <ctype.h>
#include "common/hex.h"
#include "mb/pg_wchar.h"
#include "utils/builtins.h"
#include "utils/memutils.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_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 srclen, char *dst, size_t dstlen) |
static uint64 | pg_base64_decode (const char *src, size_t srclen, char *dst, size_t dstlen) |
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, size_t dstlen) |
static uint64 | esc_decode (const char *src, size_t srclen, char *dst, size_t dstlen) |
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 | _base64 [] |
static const int8 | b64lookup [128] |
struct { | |
const char * name | |
struct pg_encoding enc | |
} | enclist [] |
Definition at line 340 of file encode.c.
Referenced by esc_encode().
#define VAL | ( | CH | ) | ((CH) - '0') |
Definition at line 339 of file encode.c.
Referenced by esc_decode().
Datum binary_decode | ( | PG_FUNCTION_ARGS | ) |
Definition at line 94 of file encode.c.
References pg_encoding::decode, pg_encoding::decode_len, enc, ereport, errcode(), errmsg(), ERROR, 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 50 of file encode.c.
References enc, pg_encoding::encode, pg_encoding::encode_len, ereport, errcode(), errmsg(), ERROR, 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 |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 547 of file encode.c.
References enclist, i, and pg_strcasecmp().
Referenced by binary_decode(), and binary_encode().
|
static |
Definition at line 162 of file encode.c.
Referenced by pg_base64_encode().
|
static |
Definition at line 165 of file encode.c.
Referenced by pg_base64_decode().
struct pg_encoding enc |
Definition at line 516 of file encode.c.
Referenced by binary_decode(), binary_encode(), get_encoding_id(), pg_import_system_collations(), pg_stat_statements_internal(), pg_valid_client_encoding(), pg_valid_server_encoding(), to_ascii_default(), to_ascii_enc(), and to_ascii_encname().
const { ... } enclist[] |
Referenced by pg_find_encoding().
const char* name |
Definition at line 515 of file encode.c.
Referenced by _copyAExpr(), _copyAlterDomainStmt(), _copyAlterTableCmd(), _copyCreateOpClassItem(), _copyDeallocateStmt(), _copyExecuteStmt(), _copyFunctionParameter(), _copyIndexElem(), _copyNamedArgExpr(), _copyPartitionCmd(), _copyPartitionElem(), _copyPLAssignStmt(), _copyPrepareStmt(), _copyReindexStmt(), _copyReplicaIdentityStmt(), _copyResTarget(), _copyTriggerTransition(), _copyVariableSetStmt(), _copyVariableShowStmt(), _copyWindowClause(), _copyWindowDef(), _copyXmlExpr(), _equalAExpr(), _equalAlterDomainStmt(), _equalAlterTableCmd(), _equalCreateOpClassItem(), _equalDeallocateStmt(), _equalExecuteStmt(), _equalFunctionParameter(), _equalIndexElem(), _equalNamedArgExpr(), _equalPartitionCmd(), _equalPartitionElem(), _equalPLAssignStmt(), _equalPrepareStmt(), _equalReindexStmt(), _equalReplicaIdentityStmt(), _equalResTarget(), _equalTriggerTransition(), _equalVariableSetStmt(), _equalVariableShowStmt(), _equalWindowClause(), _equalWindowDef(), _equalXmlExpr(), _outAExpr(), _outIndexElem(), _outNamedArgExpr(), _outPartitionElem(), _outPLAssignStmt(), _outResTarget(), _outTriggerTransition(), _outWindowClause(), _outWindowDef(), _outXmlExpr(), _readNamedArgExpr(), _readWindowClause(), _readXmlExpr(), aclparse(), aes_cbc_decrypt(), AllocSetContextCreateInternal(), AllocSetStats(), AlterObjectNamespace_internal(), AlterSystemSetConfigFile(), AlterTableGetRelOptionsLockLevel(), appendReloptionsArray(), assignVariables(), AuxiliaryPidGetProc(), binary_decode(), binary_encode(), BuildOnConflictExcludedTargetlist(), check_encoding_conversion_args(), checkInsertTargets(), choose_dsm_implementation(), ChooseExtendedStatisticNameAddition(), ChooseForeignKeyConstraintNameAddition(), ChooseIndexNameAddition(), compareVariableNames(), convert_sourcefiles_in(), convertRegProcReference(), CopyGetAttnums(), CreateTrigger(), cursor_to_xml(), cursor_to_xmlschema(), deallocate_one(), define_custom_variable(), DescribeQuery(), do_pset(), does_not_exist_skipping(), dsm_impl_mmap(), dsm_impl_op(), dsm_impl_pin_segment(), dsm_impl_sysv(), dsm_impl_unpin_segment(), dump_block(), dupEvents(), eats(), ecpg_register_prepared_stmt(), ECPGdescribe(), enum_in(), enum_recv(), ExecParallelHashJoinSetUpBatches(), expandNSItemAttrs(), FigureColname(), FigureIndexColname(), find_option(), findTargetlistEntrySQL92(), GenerationFree(), GenerationRealloc(), GenerationStats(), get_collation_version_for_oid(), get_object_address_unqualified(), get_prompt(), get_reloptions(), get_type(), GetMemoryChunkContext(), getopt_long(), initialize_reloptions(), initialize_worker_spi(), InitializeClientEncoding(), InitializeLWLocks(), leftmostvalue_name(), listAvailableScripts(), llvm_resolve_symbol(), lookupVariable(), main(), makeA_Expr(), makeDefElem(), makeDefElemExtended(), makeFuncCall(), makeObjectName(), MemoryContextCreate(), MemoryContextStatsPrint(), MergeAttributes(), mkdirs(), namecheck(), NameListToString(), parseQuery(), parseVariable(), pg_any_to_server(), pg_create_logical_replication_slot(), pg_create_physical_replication_slot(), pg_digest(), pg_drop_replication_slot(), pg_fe_getauthname(), pg_get_functiondef(), pg_get_object_address(), pg_hmac(), pg_import_system_collations(), pg_logging_init(), pg_logical_slot_get_changes_guts(), pg_open_tzfile(), pg_replication_origin_advance(), pg_replication_origin_create(), pg_replication_origin_drop(), pg_replication_origin_oid(), pg_replication_origin_progress(), pg_replication_origin_session_setup(), pg_stat_get_slru(), pg_unicode_to_server(), pgstat_reset_slru_counter(), pgtls_verify_peer_name_matches_certificate_guts(), PLy_traceback(), PostmasterMain(), pp_require_safe(), pq_verify_peer_name_matches_certificate_name(), process_postgres_switches(), process_startup_options(), ProcessGUCArray(), publicationListToArray(), PutMemoryContextsStatsTupleStore(), px_resolve_alias(), repairDependencyLoop(), report_invalid_encoding(), report_multiple_error_messages(), report_untranslatable_char(), ResourceOwnerCreate(), ri_ReportViolation(), run_permutation(), scan_available_timezones(), schema_to_xml(), schema_to_xml_and_xmlschema(), schema_to_xmlschema(), sendCommand(), seq_search_ascii(), set_config_by_name(), set_ps_display(), SetMessageEncoding(), show_item(), SlabStats(), strlist_to_textarray(), sts_parallel_scan_next(), sts_puttuple(), tarOpen(), TSConfigIsVisible(), TSDictionaryIsVisible(), TSParserIsVisible(), TSTemplateIsVisible(), TypeCreate(), TypeShellMake(), tzloadbody(), tzparse(), and xml_is_document().