|
PostgreSQL Source Code git master
|
#include "pg_config.h"#include "pg_config_manual.h"#include "pg_config_os.h"#include <inttypes.h>#include <stdalign.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 "postgres_ext.h"#include <stdbool.h>#include "port.h"

Go to the source code of this file.
Data Structures | |
| struct | varlena |
| struct | int2vector |
| struct | oidvector |
| struct | nameData |
| struct | PGAlignedBlock |
| struct | PGIOAlignedBlock |
| struct | PGAlignedXLogBlock |
Macros | |
| #define | pg_restrict restrict |
| #define | __has_attribute(attribute) 0 |
| #define | pg_attribute_unused() |
| #define | pg_nodiscard |
| #define | pg_noreturn |
| #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_always_inline inline |
| #define | pg_noinline |
| #define | pg_attribute_cold |
| #define | pg_attribute_hot |
| #define | pg_unreachable() abort() |
| #define | pg_assume(expr) ((void) 0) |
| #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 | INT64CONST(x) INT64_C(x) |
| #define | UINT64CONST(x) UINT64_C(x) |
| #define | INT64_FORMAT "%" PRId64 |
| #define | UINT64_FORMAT "%" PRIu64 |
| #define | PG_INT8_MIN INT8_MIN |
| #define | PG_INT8_MAX INT8_MAX |
| #define | PG_UINT8_MAX UINT8_MAX |
| #define | PG_INT16_MIN INT16_MIN |
| #define | PG_INT16_MAX INT16_MAX |
| #define | PG_UINT16_MAX UINT16_MAX |
| #define | PG_INT32_MIN INT32_MIN |
| #define | PG_INT32_MAX INT32_MAX |
| #define | PG_UINT32_MAX UINT32_MAX |
| #define | PG_INT64_MIN INT64_MIN |
| #define | PG_INT64_MAX INT64_MAX |
| #define | PG_UINT64_MAX UINT64_MAX |
| #define | HAVE_INT64_TIMESTAMP |
| #define | FLOAT8PASSBYVAL true |
| #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 | 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 | SIZE_T_ALIGN_MASK (sizeof(size_t) - 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 | PGDLLIMPORT |
| #define | PGDLLEXPORT |
| #define | SIGNAL_ARGS int postgres_signal_arg |
Typedefs | |
| typedef void(* | pg_funcptr_t) (void) |
| typedef char * | Pointer |
| typedef int8_t | int8 |
| typedef int16_t | int16 |
| typedef int32_t | int32 |
| typedef int64_t | int64 |
| typedef uint8_t | uint8 |
| typedef uint16_t | uint16 |
| typedef uint32_t | uint32 |
| typedef uint64_t | uint64 |
| 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 struct PGAlignedBlock | PGAlignedBlock |
| typedef struct PGIOAlignedBlock | PGIOAlignedBlock |
| typedef struct PGAlignedXLogBlock | PGAlignedXLogBlock |
| typedef uint16_t | char16_t |
| typedef uint32_t | char32_t |
Functions | |
| pg_noreturn void | ExceptionalCondition (const char *conditionName, const char *fileName, int lineNumber) |
| 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 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 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 struct PGAlignedBlock PGAlignedBlock |
| typedef struct PGAlignedXLogBlock PGAlignedXLogBlock |
| typedef struct PGIOAlignedBlock PGIOAlignedBlock |
| typedef regproc RegProcedure |
| typedef uint32 SubTransactionId |
| typedef uint32 TransactionId |
| pg_noreturn void ExceptionalCondition | ( | const char * | conditionName, |
| const char * | fileName, | ||
| int | lineNumber | ||
| ) |
Definition at line 30 of file assert.c.
References buf, lengthof, 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().