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 _outA_Expr(), _readA_Expr(), _SPI_find_ENR_by_name(), aclparse(), add_bool_reloption(), add_descriptor(), add_enum_reloption(), add_int_reloption(), add_local_bool_reloption(), add_local_enum_reloption(), add_local_int_reloption(), add_local_real_reloption(), add_local_string_reloption(), add_parameter_name(), add_placeholder_variable(), add_real_reloption(), add_string_reloption(), AlignedAllocFree(), allocate_reloption(), AllocateFile(), AllocSetContextCreateInternal(), AlterEventTriggerOwner(), AlterForeignDataWrapperOwner(), AlterForeignServerOwner(), AlterObjectNamespace_internal(), AlterPublicationOwner(), AlterSchemaOwner(), AlterSubscriptionOwner(), AlterSystemSetConfigFile(), AlterTableGetRelOptionsLockLevel(), appendReloptionsArray(), assignVariables(), ATExecAttachPartitionIdx(), ATExecDetachPartition(), ATExecDetachPartitionFinalize(), avlMergeValue(), BaseBackupAddTarget(), BeginInternalSubTransaction(), binary_decode(), binary_encode(), BootstrapModeMain(), BufFileCreateFileSet(), BufFileDeleteFileSet(), BufFileOpenFileSet(), buildACLCommands(), buildDefItem(), BuildOnConflictExcludedTargetlist(), check_duplicates_in_publist(), check_encoding_conversion_args(), check_file_excluded(), check_GUC_name_for_parameter_acl(), check_restricted_library_name(), check_testspec(), checkInsertTargets(), CheckMyDatabase(), choose_dsm_implementation(), ChooseExtendedStatisticNameAddition(), ChooseForeignKeyConstraintNameAddition(), ChooseIndexNameAddition(), ChooseTablespace(), close_file(), CommitTransactionCommand(), compareVariableNames(), componentcheck(), convert_GUC_name_for_parameter_acl(), convertRegProcReference(), CopyGetAttnums(), create_logical_replication_slot(), create_physical_replication_slot(), createNewConnection(), CreatePortal(), CreateTriggerFiringOn(), cursor_to_xml(), cursor_to_xmlschema(), deallocate_one(), define_custom_variable(), DefineAggregate(), DefineAttr(), DefineCustomBoolVariable(), DefineCustomEnumVariable(), DefineCustomIntVariable(), DefineCustomRealVariable(), DefineCustomStringVariable(), DefineSavepoint(), deleteConnection(), DeleteVariable(), DescribeQuery(), descriptor_variable(), do_pset(), does_not_exist_skipping(), drop_descriptor(), dsm_impl_mmap(), dsm_impl_pin_segment(), dsm_impl_posix(), dsm_impl_sysv(), dsm_impl_unpin_segment(), dump_block(), dumpACL(), dumpComment(), dumpCommentExtended(), dumpSecLabel(), dupEvents(), eat(), eats(), ecpg_auto_prepare(), ecpg_find_desc(), ecpg_find_prepared_statement(), ecpg_prepared(), ecpg_register_prepared_stmt(), ecpg_result_by_descriptor(), ECPGallocate_desc(), ECPGconnect(), ECPGdeallocate(), ECPGdeallocate_desc(), ECPGdescribe(), ECPGdump_a_simple(), ECPGdump_a_struct(), ECPGdump_a_type(), ECPGmake_struct_member(), ECPGnumeric_lvalue(), ECPGprepare(), ECPGprepared_statement(), enum_in(), enum_recv(), ExecParallelHashJoinSetUpBatches(), expand_dynamic_library_name(), expandNSItemAttrs(), FigureColname(), FigureColnameInternal(), FigureIndexColname(), file_exists(), FilePath(), FileSetCreate(), FileSetDelete(), FileSetOpen(), FileSetSegmentName(), FillXLogStatsRow(), find_option(), find_provider(), find_simple(), find_struct(), find_struct_member(), find_variable(), findBuiltin(), findTargetlistEntrySQL92(), findWindowClause(), flatten_set_variable_args(), fmgr_lookupByName(), GenerationContextCreate(), GenerationRealloc(), get_db_info(), get_ENR(), get_object_address_unqualified(), get_prompt(), get_reloptions(), get_replslot_index(), get_typedef(), GetConfigOption(), GetConfigOptionByName(), GetConfigOptionFlags(), GetConfigOptionResetString(), getConnectionByName(), getopt_long(), GetPGVariable(), GetPGVariableResultDesc(), GetPortalByName(), gettype(), getVariable(), GetVariable(), guc_name_hash(), GUCArrayAdd(), GUCArrayDelete(), infile(), init_bool_reloption(), init_custom_variable(), init_enum_reloption(), init_int_reloption(), init_real_reloption(), init_string_reloption(), initialize_ntdll(), initialize_reloptions(), InitializeClientEncoding(), InitializeLWLocks(), is_checksummed_file(), is_true_boolean_expression(), IsReservedName(), IsReservedOriginName(), itsdir(), itssymlink(), listAvailableScripts(), llvm_split_symbol_name(), load_return_type(), looks_like_temp_rel_name(), lookup_descriptor(), lookup_prop_name(), lookupCreateVariable(), lookupVariable(), main(), makeA_Expr(), makeAlterConfigCommand(), makeDefElem(), makeDefElemExtended(), makeFuncCall(), makeJsonEncoding(), makeMultirangeConstructors(), MakeNewFileSetSegment(), makeObjectName(), makeRangeConstructors(), makeSimpleA_Expr(), map_xml_name_to_sql_identifier(), MemoryContextCreate(), MemoryContextStatsPrint(), merge_publications(), MergeAttributes(), MergeCheckConstraint(), mkdirs(), my_newCONSTSUB(), namecheck(), NameListToString(), namestrcmp(), namestrcpy(), new_variable(), output_deallocate_prepare_statement(), output_prepare_statement(), owningrel_does_not_exist_skipping(), parse_and_validate_value(), parse_compress_algorithm(), parse_filename_for_nontemp_relation(), parse_hba_auth_opt(), ParseLongOption(), parseQuery(), parseVariable(), ParseVariableBool(), ParseVariableNum(), PerformPortalClose(), pg_any_to_server(), pg_char_to_encoding(), pg_checksum_parse_type(), pg_config(), pg_create_logical_replication_slot(), pg_create_physical_replication_slot(), pg_digest(), pg_drop_replication_slot(), pg_fe_getusername(), pg_find_encoding(), pg_get_functiondef(), pg_get_object_address(), pg_hmac(), pg_import_system_collations(), pg_indexam_progress_phasename(), pg_load_tz(), pg_logging_init(), pg_logical_slot_get_changes_guts(), pg_open_tzfile(), pg_parameter_aclcheck(), pg_parameter_aclmask(), 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_size_pretty(), pg_size_pretty_numeric(), pg_stat_get_slru(), pg_unicode_to_server(), pg_valid_client_encoding(), pg_valid_server_encoding(), pgp_get_cipher_code(), pgp_get_digest_code(), pgp_load_digest(), pgp_set_cipher_algo(), pgp_set_s2k_cipher_algo(), pgp_set_s2k_digest_algo(), pgstat_create_transactional(), pgstat_get_kind_from_str(), pgstat_get_slru_index(), pgstat_read_statsfile(), pgstat_replslot_from_serialized_name_cb(), pgstat_replslot_to_serialized_name_cb(), pgstat_reset_replslot(), pgstat_reset_slru(), pgstat_write_statsfile(), pgtls_verify_peer_name_matches_certificate_guts(), pgwin32_setenv(), pgwin32_unsetenv(), plpgsql_ns_additem(), plpgsql_ns_lookup_label(), PLy_create_exception(), PLy_generate_spi_exceptions(), PLy_procedure_munge_source(), PLy_traceback(), PostmasterMain(), pp_require_safe(), pq_verify_peer_name_matches_certificate_name(), PQregisterEventProc(), pqSaveParameterStatus(), prepare_cert_name(), prepare_common(), printCrosstab(), process_postgres_switches(), process_startup_options(), ProcessGUCArray(), PsqlVarEnumError(), PutMemoryContextsStatsTupleStore(), putVariable(), putVariableInt(), putVariableValue(), px_find_cipher(), px_find_combo(), px_find_digest(), px_find_hmac(), px_resolve_alias(), quoteOneName(), reapply_stacked_values(), ReleaseSavepoint(), repairDependencyLoop(), replace_auto_config_value(), ReplicationSlotAcquire(), ReplicationSlotCreate(), ReplicationSlotDrop(), ReplicationSlotName(), ReplicationSlotValidateName(), replorigin_drop_by_name(), report_invalid_encoding(), report_name_conflict(), report_namespace_conflict(), report_untranslatable_char(), ResourceOwnerCreate(), RestoreSlotFromDisk(), ri_ReportViolation(), RollbackToSavepoint(), run_permutation(), run_reindex_command(), scan_available_timezones(), schema_does_not_exist_skipping(), schema_to_xml(), schema_to_xml_and_xmlschema(), schema_to_xmlschema(), SearchNamedReplicationSlot(), sendDir(), seq_search_ascii(), seq_search_localized(), set_config_by_name(), set_config_option(), set_config_option_ext(), set_config_sourcefile(), SetConfigOption(), SetPGVariable(), SetVariable(), SetVariableBool(), SetVariableHooks(), ShmemInitHash(), ShmemInitStruct(), show_item(), ShowGUCConfigOption(), SimpleLruInit(), skipfile(), SlabContextCreate(), SPI_cursor_find(), SPI_cursor_open(), SPI_cursor_open_internal(), SPI_cursor_open_with_args(), SPI_cursor_open_with_paramlist(), SPI_cursor_parse_open(), SPI_unregister_relation(), sqlda_variable(), strlist_to_textarray(), sts_filename(), sts_initialize(), sts_parallel_scan_next(), sts_puttuple(), substitute_libpath_macro(), tarOpen(), TSConfigIsVisible(), TSDictionaryIsVisible(), TSParserIsVisible(), TSTemplateIsVisible(), type_in_list_does_not_exist_skipping(), TypeCreate(), TypeShellMake(), tzload(), tzloadbody(), tzparse(), unregister_ENR(), uuid_generate_v3(), uuid_generate_v5(), valid_custom_variable_name(), valid_variable_name(), validate_option_array_item(), validOperatorName(), variable_is_guc_list_quote(), VariableHasHook(), worker_spi_main(), writezone(), X509_NAME_field_to_text(), X509_NAME_to_cstring(), XLogDumpStatsRow(), and XmlTableSetNamespace().