PostgreSQL Source Code
git master
|
#include "postgres_ext.h"
#include "pg_config.h"
#include "pg_config_manual.h"
#include "pg_config_os.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include <stdarg.h>
#include <stdint.h>
#include <sys/types.h>
#include <errno.h>
#include <locale.h>
#include "port.h"
Go to the source code of this file.
Data Structures | |
struct | varlena |
struct | int2vector |
struct | oidvector |
struct | nameData |
union | PGAlignedBlock |
union | PGIOAlignedBlock |
union | PGAlignedXLogBlock |
Macros | |
#define | __has_attribute(attribute) 0 |
#define | pg_attribute_unused() |
#define | pg_nodiscard |
#define | pg_attribute_no_sanitize_address() |
#define | pg_attribute_no_sanitize_alignment() |
#define | pg_attribute_nonnull(...) |
#define | pg_attribute_target(...) |
#define | PG_USED_FOR_ASSERTS_ONLY pg_attribute_unused() |
#define | pg_attribute_format_arg(a) |
#define | pg_attribute_printf(f, a) |
#define | pg_attribute_noreturn() |
#define | pg_attribute_always_inline inline |
#define | pg_noinline |
#define | pg_attribute_cold |
#define | pg_attribute_hot |
#define | pg_unreachable() abort() |
#define | likely(x) ((x) != 0) |
#define | unlikely(x) ((x) != 0) |
#define | CppAsString(identifier) #identifier |
#define | CppAsString2(x) CppAsString(x) |
#define | CppConcat(x, y) x##y |
#define | VA_ARGS_NARGS(...) |
#define | VA_ARGS_NARGS_(_01, _02, _03, _04, _05, _06, _07, _08, _09, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, N, ...) (N) |
#define | FLEXIBLE_ARRAY_MEMBER /* empty */ |
#define | true ((bool) 1) |
#define | false ((bool) 0) |
#define | INT64_FORMAT "%" INT64_MODIFIER "d" |
#define | UINT64_FORMAT "%" INT64_MODIFIER "u" |
#define | PG_INT8_MIN (-0x7F-1) |
#define | PG_INT8_MAX (0x7F) |
#define | PG_UINT8_MAX (0xFF) |
#define | PG_INT16_MIN (-0x7FFF-1) |
#define | PG_INT16_MAX (0x7FFF) |
#define | PG_UINT16_MAX (0xFFFF) |
#define | PG_INT32_MIN (-0x7FFFFFFF-1) |
#define | PG_INT32_MAX (0x7FFFFFFF) |
#define | PG_UINT32_MAX (0xFFFFFFFFU) |
#define | PG_INT64_MIN (-INT64CONST(0x7FFFFFFFFFFFFFFF) - 1) |
#define | PG_INT64_MAX INT64CONST(0x7FFFFFFFFFFFFFFF) |
#define | PG_UINT64_MAX UINT64CONST(0xFFFFFFFFFFFFFFFF) |
#define | HAVE_INT64_TIMESTAMP |
#define | FLOAT8PASSBYVAL false |
#define | InvalidSubTransactionId ((SubTransactionId) 0) |
#define | TopSubTransactionId ((SubTransactionId) 1) |
#define | FirstCommandId ((CommandId) 0) |
#define | InvalidCommandId (~(CommandId)0) |
#define | VARHDRSZ ((int32) sizeof(int32)) |
#define | NameStr(name) ((name).data) |
#define | BoolIsValid(boolean) ((boolean) == false || (boolean) == true) |
#define | PointerIsValid(pointer) ((const void*)(pointer) != NULL) |
#define | PointerIsAligned(pointer, type) (((uintptr_t)(pointer) % (sizeof (type))) == 0) |
#define | OffsetToPointer(base, offset) ((void *)((char *) base + offset)) |
#define | OidIsValid(objectId) ((bool) ((objectId) != InvalidOid)) |
#define | RegProcedureIsValid(p) OidIsValid(p) |
#define | lengthof(array) (sizeof (array) / sizeof ((array)[0])) |
#define | TYPEALIGN(ALIGNVAL, LEN) (((uintptr_t) (LEN) + ((ALIGNVAL) - 1)) & ~((uintptr_t) ((ALIGNVAL) - 1))) |
#define | SHORTALIGN(LEN) TYPEALIGN(ALIGNOF_SHORT, (LEN)) |
#define | INTALIGN(LEN) TYPEALIGN(ALIGNOF_INT, (LEN)) |
#define | LONGALIGN(LEN) TYPEALIGN(ALIGNOF_LONG, (LEN)) |
#define | DOUBLEALIGN(LEN) TYPEALIGN(ALIGNOF_DOUBLE, (LEN)) |
#define | MAXALIGN(LEN) TYPEALIGN(MAXIMUM_ALIGNOF, (LEN)) |
#define | BUFFERALIGN(LEN) TYPEALIGN(ALIGNOF_BUFFER, (LEN)) |
#define | CACHELINEALIGN(LEN) TYPEALIGN(PG_CACHE_LINE_SIZE, (LEN)) |
#define | TYPEALIGN_DOWN(ALIGNVAL, LEN) (((uintptr_t) (LEN)) & ~((uintptr_t) ((ALIGNVAL) - 1))) |
#define | SHORTALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_SHORT, (LEN)) |
#define | INTALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_INT, (LEN)) |
#define | LONGALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_LONG, (LEN)) |
#define | DOUBLEALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_DOUBLE, (LEN)) |
#define | MAXALIGN_DOWN(LEN) TYPEALIGN_DOWN(MAXIMUM_ALIGNOF, (LEN)) |
#define | BUFFERALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_BUFFER, (LEN)) |
#define | TYPEALIGN64(ALIGNVAL, LEN) (((uint64) (LEN) + ((ALIGNVAL) - 1)) & ~((uint64) ((ALIGNVAL) - 1))) |
#define | MAXALIGN64(LEN) TYPEALIGN64(MAXIMUM_ALIGNOF, (LEN)) |
#define | Assert(condition) ((void)true) |
#define | AssertMacro(condition) ((void)true) |
#define | AssertPointerAlignment(ptr, bndr) Assert(TYPEALIGN(bndr, (uintptr_t)(ptr)) == (uintptr_t)(ptr)) |
#define | StaticAssertDecl(condition, errmessage) extern void static_assert_func(int static_assert_failure[(condition) ? 1 : -1]) |
#define | StaticAssertStmt(condition, errmessage) ((void) sizeof(struct { int static_assert_failure : (condition) ? 1 : -1; })) |
#define | StaticAssertExpr(condition, errmessage) StaticAssertStmt(condition, errmessage) |
#define | AssertVariableIsOfType(varname, typename) |
#define | AssertVariableIsOfTypeMacro(varname, typename) |
#define | Max(x, y) ((x) > (y) ? (x) : (y)) |
#define | Min(x, y) ((x) < (y) ? (x) : (y)) |
#define | LONG_ALIGN_MASK (sizeof(long) - 1) |
#define | MemSet(start, val, len) |
#define | MemSetAligned(start, val, len) |
#define | FLOAT4_FITS_IN_INT16(num) ((num) >= (float4) PG_INT16_MIN && (num) < -((float4) PG_INT16_MIN)) |
#define | FLOAT4_FITS_IN_INT32(num) ((num) >= (float4) PG_INT32_MIN && (num) < -((float4) PG_INT32_MIN)) |
#define | FLOAT4_FITS_IN_INT64(num) ((num) >= (float4) PG_INT64_MIN && (num) < -((float4) PG_INT64_MIN)) |
#define | FLOAT8_FITS_IN_INT16(num) ((num) >= (float8) PG_INT16_MIN && (num) < -((float8) PG_INT16_MIN)) |
#define | FLOAT8_FITS_IN_INT32(num) ((num) >= (float8) PG_INT32_MIN && (num) < -((float8) PG_INT32_MIN)) |
#define | FLOAT8_FITS_IN_INT64(num) ((num) >= (float8) PG_INT64_MIN && (num) < -((float8) PG_INT64_MIN)) |
#define | INVERT_COMPARE_RESULT(var) ((var) = ((var) < 0) ? 1 : -(var)) |
#define | HIGHBIT (0x80) |
#define | IS_HIGHBIT_SET(ch) ((unsigned char)(ch) & HIGHBIT) |
#define | SQL_STR_DOUBLE(ch, escape_backslash) ((ch) == '\'' || ((ch) == '\\' && (escape_backslash))) |
#define | ESCAPE_STRING_SYNTAX 'E' |
#define | STATUS_OK (0) |
#define | STATUS_ERROR (-1) |
#define | STATUS_EOF (-2) |
#define | gettext(x) (x) |
#define | dgettext(d, x) (x) |
#define | ngettext(s, p, n) ((n) == 1 ? (s) : (p)) |
#define | dngettext(d, s, p, n) ((n) == 1 ? (s) : (p)) |
#define | _(x) gettext(x) |
#define | gettext_noop(x) (x) |
#define | PG_TEXTDOMAIN(domain) (domain "-" PG_MAJORVERSION) |
#define | unconstify(underlying_type, expr) ((underlying_type) (expr)) |
#define | unvolatize(underlying_type, expr) ((underlying_type) (expr)) |
#define | PG_BINARY 0 |
#define | PG_BINARY_A "a" |
#define | PG_BINARY_R "r" |
#define | PG_BINARY_W "w" |
#define | strtoi64(str, endptr, base) ((int64) strtoll(str, endptr, base)) |
#define | strtou64(str, endptr, base) ((uint64) strtoull(str, endptr, base)) |
#define | i64abs(i) llabs(i) |
#define | PGDLLIMPORT |
#define | PGDLLEXPORT |
#define | SIGNAL_ARGS int postgres_signal_arg |
Typedefs | |
typedef void(* | pg_funcptr_t) (void) |
typedef unsigned char | bool |
typedef char * | Pointer |
typedef signed char | int8 |
typedef signed short | int16 |
typedef signed int | int32 |
typedef unsigned char | uint8 |
typedef unsigned short | uint16 |
typedef unsigned int | uint32 |
typedef uint8 | bits8 |
typedef uint16 | bits16 |
typedef uint32 | bits32 |
typedef size_t | Size |
typedef unsigned int | Index |
typedef signed int | Offset |
typedef float | float4 |
typedef double | float8 |
typedef Oid | regproc |
typedef regproc | RegProcedure |
typedef uint32 | TransactionId |
typedef uint32 | LocalTransactionId |
typedef uint32 | SubTransactionId |
typedef TransactionId | MultiXactId |
typedef uint32 | MultiXactOffset |
typedef uint32 | CommandId |
typedef struct varlena | bytea |
typedef struct varlena | text |
typedef struct varlena | BpChar |
typedef struct varlena | VarChar |
typedef struct nameData | NameData |
typedef NameData * | Name |
typedef union PGAlignedBlock | PGAlignedBlock |
typedef union PGIOAlignedBlock | PGIOAlignedBlock |
typedef union PGAlignedXLogBlock | PGAlignedXLogBlock |
Functions | |
void | ExceptionalCondition (const char *conditionName, const char *fileName, int lineNumber) pg_attribute_noreturn() |
int | fdatasync (int fildes) |
#define AssertVariableIsOfType | ( | varname, | |
typename | |||
) |
#define AssertVariableIsOfTypeMacro | ( | varname, | |
typename | |||
) |
#define BUFFERALIGN | ( | LEN | ) | TYPEALIGN(ALIGNOF_BUFFER, (LEN)) |
#define BUFFERALIGN_DOWN | ( | LEN | ) | TYPEALIGN_DOWN(ALIGNOF_BUFFER, (LEN)) |
#define CACHELINEALIGN | ( | LEN | ) | TYPEALIGN(PG_CACHE_LINE_SIZE, (LEN)) |
#define CppAsString2 | ( | x | ) | CppAsString(x) |
#define DOUBLEALIGN_DOWN | ( | LEN | ) | TYPEALIGN_DOWN(ALIGNOF_DOUBLE, (LEN)) |
#define FLOAT4_FITS_IN_INT16 | ( | num | ) | ((num) >= (float4) PG_INT16_MIN && (num) < -((float4) PG_INT16_MIN)) |
#define FLOAT4_FITS_IN_INT32 | ( | num | ) | ((num) >= (float4) PG_INT32_MIN && (num) < -((float4) PG_INT32_MIN)) |
#define FLOAT4_FITS_IN_INT64 | ( | num | ) | ((num) >= (float4) PG_INT64_MIN && (num) < -((float4) PG_INT64_MIN)) |
#define FLOAT8_FITS_IN_INT16 | ( | num | ) | ((num) >= (float8) PG_INT16_MIN && (num) < -((float8) PG_INT16_MIN)) |
#define FLOAT8_FITS_IN_INT32 | ( | num | ) | ((num) >= (float8) PG_INT32_MIN && (num) < -((float8) PG_INT32_MIN)) |
#define FLOAT8_FITS_IN_INT64 | ( | num | ) | ((num) >= (float8) PG_INT64_MIN && (num) < -((float8) PG_INT64_MIN)) |
#define INTALIGN_DOWN | ( | LEN | ) | TYPEALIGN_DOWN(ALIGNOF_INT, (LEN)) |
#define InvalidSubTransactionId ((SubTransactionId) 0) |
#define INVERT_COMPARE_RESULT | ( | var | ) | ((var) = ((var) < 0) ? 1 : -(var)) |
#define lengthof | ( | array | ) | (sizeof (array) / sizeof ((array)[0])) |
#define LONGALIGN_DOWN | ( | LEN | ) | TYPEALIGN_DOWN(ALIGNOF_LONG, (LEN)) |
#define MAXALIGN64 | ( | LEN | ) | TYPEALIGN64(MAXIMUM_ALIGNOF, (LEN)) |
#define MAXALIGN_DOWN | ( | LEN | ) | TYPEALIGN_DOWN(MAXIMUM_ALIGNOF, (LEN)) |
#define OffsetToPointer | ( | base, | |
offset | |||
) | ((void *)((char *) base + offset)) |
#define OidIsValid | ( | objectId | ) | ((bool) ((objectId) != InvalidOid)) |
#define PG_USED_FOR_ASSERTS_ONLY pg_attribute_unused() |
#define PointerIsValid | ( | pointer | ) | ((const void*)(pointer) != NULL) |
#define RegProcedureIsValid | ( | p | ) | OidIsValid(p) |
#define SHORTALIGN_DOWN | ( | LEN | ) | TYPEALIGN_DOWN(ALIGNOF_SHORT, (LEN)) |
#define SQL_STR_DOUBLE | ( | ch, | |
escape_backslash | |||
) | ((ch) == '\'' || ((ch) == '\\' && (escape_backslash))) |
#define StaticAssertDecl | ( | condition, | |
errmessage | |||
) | extern void static_assert_func(int static_assert_failure[(condition) ? 1 : -1]) |
#define StaticAssertExpr | ( | condition, | |
errmessage | |||
) | StaticAssertStmt(condition, errmessage) |
#define StaticAssertStmt | ( | condition, | |
errmessage | |||
) | ((void) sizeof(struct { int static_assert_failure : (condition) ? 1 : -1; })) |
#define TopSubTransactionId ((SubTransactionId) 1) |
#define TYPEALIGN | ( | ALIGNVAL, | |
LEN | |||
) | (((uintptr_t) (LEN) + ((ALIGNVAL) - 1)) & ~((uintptr_t) ((ALIGNVAL) - 1))) |
#define TYPEALIGN64 | ( | ALIGNVAL, | |
LEN | |||
) | (((uint64) (LEN) + ((ALIGNVAL) - 1)) & ~((uint64) ((ALIGNVAL) - 1))) |
#define TYPEALIGN_DOWN | ( | ALIGNVAL, | |
LEN | |||
) | (((uintptr_t) (LEN)) & ~((uintptr_t) ((ALIGNVAL) - 1))) |
#define unconstify | ( | underlying_type, | |
expr | |||
) | ((underlying_type) (expr)) |
#define unvolatize | ( | underlying_type, | |
expr | |||
) | ((underlying_type) (expr)) |
#define VA_ARGS_NARGS | ( | ... | ) |
#define VA_ARGS_NARGS_ | ( | _01, | |
_02, | |||
_03, | |||
_04, | |||
_05, | |||
_06, | |||
_07, | |||
_08, | |||
_09, | |||
_10, | |||
_11, | |||
_12, | |||
_13, | |||
_14, | |||
_15, | |||
_16, | |||
_17, | |||
_18, | |||
_19, | |||
_20, | |||
_21, | |||
_22, | |||
_23, | |||
_24, | |||
_25, | |||
_26, | |||
_27, | |||
_28, | |||
_29, | |||
_30, | |||
_31, | |||
_32, | |||
_33, | |||
_34, | |||
_35, | |||
_36, | |||
_37, | |||
_38, | |||
_39, | |||
_40, | |||
_41, | |||
_42, | |||
_43, | |||
_44, | |||
_45, | |||
_46, | |||
_47, | |||
_48, | |||
_49, | |||
_50, | |||
_51, | |||
_52, | |||
_53, | |||
_54, | |||
_55, | |||
_56, | |||
_57, | |||
_58, | |||
_59, | |||
_60, | |||
_61, | |||
_62, | |||
_63, | |||
N, | |||
... | |||
) | (N) |
typedef uint32 LocalTransactionId |
typedef TransactionId MultiXactId |
typedef uint32 MultiXactOffset |
typedef union PGAlignedBlock PGAlignedBlock |
typedef union PGAlignedXLogBlock PGAlignedXLogBlock |
typedef union PGIOAlignedBlock PGIOAlignedBlock |
typedef regproc RegProcedure |
typedef uint32 SubTransactionId |
typedef uint32 TransactionId |
void ExceptionalCondition | ( | const char * | conditionName, |
const char * | fileName, | ||
int | lineNumber | ||
) |
Definition at line 30 of file assert.c.
References buf, fflush(), lengthof, PointerIsValid, and write_stderr.
Referenced by pg_re_throw().
int fdatasync | ( | int | fildes | ) |
Definition at line 23 of file win32fdatasync.c.
References _dosmaperr(), fd(), FLUSH_FLAGS_FILE_DATA_SYNC_ONLY, initialize_ntdll(), pg_NtFlushBuffersFileEx, and pg_RtlNtStatusToDosError.
Referenced by pg_fdatasync(), and test_sync().