uint8 typalignby;
char **values;
char *ptr;
- bits8 *bitmap;
+ uint8 *bitmap;
int bitmask;
int i;
TupleDesc tupdesc;
Page page;
uint16 flagbits;
- bits16 printflags = 0;
+ uint16 printflags = 0;
OffsetNumber offset;
OffsetNumber maxoff = InvalidOffsetNumber;
char *index_columns;
/*
* bits_to_text
*
- * Converts a bits8-array of 'len' bits to a human-readable
+ * Converts a uint8-array of 'len' bits to a human-readable
* c-string representation.
*/
static char *
-bits_to_text(bits8 *bits, int len)
+bits_to_text(uint8 *bits, int len)
{
int i;
char *str;
/*
* text_to_bits
*
- * Converts a c-string representation of bits into a bits8-array. This is
+ * Converts a c-string representation of bits into a uint8-array. This is
* the reverse operation of previous routine.
*/
-static bits8 *
+static uint8 *
text_to_bits(char *str, int len)
{
- bits8 *bits;
+ uint8 *bits;
int off = 0;
char byte = 0;
static Datum
tuple_data_split_internal(Oid relid, char *tupdata,
uint16 tupdata_len, uint16 t_infomask,
- uint16 t_infomask2, bits8 *t_bits,
+ uint16 t_infomask2, uint8 *t_bits,
bool do_detoast)
{
ArrayBuildState *raw_attrs;
uint16 t_infomask2;
char *t_bits_str;
bool do_detoast = false;
- bits8 *t_bits = NULL;
+ uint8 *t_bits = NULL;
Datum res;
relid = PG_GETARG_OID(0);
PG_RETURN_NULL();
/*
- * Convert t_bits string back to the bits8 array as represented in the
+ * Convert t_bits string back to the uint8 array as represented in the
* tuple header.
*/
if (t_infomask & HEAP_HASNULL)
static char *
deparse_type_name(Oid type_oid, int32 typemod)
{
- bits16 flags = FORMAT_TYPE_TYPEMOD_GIVEN;
+ uint16 flags = FORMAT_TYPE_TYPEMOD_GIVEN;
if (!is_builtin(type_oid))
flags |= FORMAT_TYPE_FORCE_QUALIFY;
<para>
<programlisting>
ForeignDataWrapper *
-GetForeignDataWrapperExtended(Oid fdwid, bits16 flags);
+GetForeignDataWrapperExtended(Oid fdwid, uint16 flags);
</programlisting>
This function returns a <structname>ForeignDataWrapper</structname>
<para>
<programlisting>
ForeignServer *
-GetForeignServerExtended(Oid serverid, bits16 flags);
+GetForeignServerExtended(Oid serverid, uint16 flags);
</programlisting>
This function returns a <structname>ForeignServer</structname> object
static inline void brin_deconstruct_tuple(BrinDesc *brdesc,
- char *tp, bits8 *nullbits, bool nulls,
+ char *tp, uint8 *nullbits, bool nulls,
Datum *values, bool *allnulls, bool *hasnulls);
int keyno;
int idxattno;
uint16 phony_infomask = 0;
- bits8 *phony_nullbitmap;
+ uint8 *phony_nullbitmap;
Size len,
hoff,
data_len;
values = palloc_array(Datum, brdesc->bd_totalstored);
nulls = palloc0_array(bool, brdesc->bd_totalstored);
- phony_nullbitmap = palloc_array(bits8, BITMAPLEN(brdesc->bd_totalstored));
+ phony_nullbitmap = palloc_array(uint8, BITMAPLEN(brdesc->bd_totalstored));
#ifdef TOAST_INDEX_HACK
untoasted_values = palloc_array(Datum, brdesc->bd_totalstored);
*/
if (anynulls)
{
- bits8 *bitP;
+ uint8 *bitP;
int bitmask;
rettuple->bt_info |= BRIN_NULLS_MASK;
* store a 1 for a null attribute rather than a 0. So we must reverse
* the sense of the att_isnull test in brin_deconstruct_tuple as well.
*/
- bitP = ((bits8 *) ((char *) rettuple + SizeOfBrinTuple)) - 1;
+ bitP = ((uint8 *) ((char *) rettuple + SizeOfBrinTuple)) - 1;
bitmask = HIGHBIT;
for (keyno = 0; keyno < brdesc->bd_tupdesc->natts; keyno++)
{
Size hoff;
BrinTuple *rettuple;
int keyno;
- bits8 *bitP;
+ uint8 *bitP;
int bitmask;
/* compute total space needed: always add nulls */
rettuple->bt_info = hoff;
rettuple->bt_info |= BRIN_NULLS_MASK | BRIN_PLACEHOLDER_MASK | BRIN_EMPTY_RANGE_MASK;
- bitP = ((bits8 *) ((char *) rettuple + SizeOfBrinTuple)) - 1;
+ bitP = ((uint8 *) ((char *) rettuple + SizeOfBrinTuple)) - 1;
bitmask = HIGHBIT;
/* set allnulls true for all attributes */
for (keyno = 0; keyno < brdesc->bd_tupdesc->natts; keyno++)
bool *allnulls;
bool *hasnulls;
char *tp;
- bits8 *nullbits;
+ uint8 *nullbits;
int keyno;
int valueno;
MemoryContext oldcxt;
tp = (char *) tuple + BrinTupleDataOffset(tuple);
if (BrinTupleHasNulls(tuple))
- nullbits = (bits8 *) ((char *) tuple + SizeOfBrinTuple);
+ nullbits = (uint8 *) ((char *) tuple + SizeOfBrinTuple);
else
nullbits = NULL;
brin_deconstruct_tuple(brdesc,
*/
static inline void
brin_deconstruct_tuple(BrinDesc *brdesc,
- char *tp, bits8 *nullbits, bool nulls,
+ char *tp, uint8 *nullbits, bool nulls,
Datum *values, bool *allnulls, bool *hasnulls)
{
int attnum;
*/
static inline void
fill_val(CompactAttribute *att,
- bits8 **bit,
+ uint8 **bit,
int *bitmask,
char **dataP,
uint16 *infomask,
heap_fill_tuple(TupleDesc tupleDesc,
const Datum *values, const bool *isnull,
char *data, Size data_size,
- uint16 *infomask, bits8 *bit)
+ uint16 *infomask, uint8 *bit)
{
- bits8 *bitP;
+ uint8 *bitP;
int bitmask;
int i;
int numberOfAttributes = tupleDesc->natts;
CompactAttribute *cattr;
HeapTupleHeader td = tup->t_data;
char *tp; /* ptr to data part of tuple */
- bits8 *bp = td->t_bits; /* ptr to null bitmap in tuple */
+ uint8 *bp = td->t_bits; /* ptr to null bitmap in tuple */
int off; /* current offset within data */
int startAttr;
int firstNullAttr;
Size targetDataLen;
Size len;
int hoff;
- bits8 *nullBits = NULL;
+ uint8 *nullBits = NULL;
int bitMask = 0;
char *targetData;
uint16 *infoMask;
/* We also make sure that t_ctid is invalid unless explicitly set */
ItemPointerSetInvalid(&(targetTHeader->t_ctid));
if (targetNullLen > 0)
- nullBits = (bits8 *) ((char *) (*targetHeapTuple)->t_data
+ nullBits = (uint8 *) ((char *) (*targetHeapTuple)->t_data
+ offsetof(HeapTupleHeaderData, t_bits));
targetData = (char *) (*targetHeapTuple)->t_data + hoff;
infoMask = &(targetTHeader->t_infomask);
/* Same macro works for MinimalTuples */
HeapTupleHeaderSetNatts(*targetMinimalTuple, natts);
if (targetNullLen > 0)
- nullBits = (bits8 *) ((char *) *targetMinimalTuple
+ nullBits = (uint8 *) ((char *) *targetMinimalTuple
+ offsetof(MinimalTupleData, t_bits));
targetData = (char *) *targetMinimalTuple + hoff;
infoMask = &((*targetMinimalTuple)->t_infomask);
int attnum;
char *tp; /* ptr to tuple data */
uint32 off; /* offset in tuple data */
- bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */
+ uint8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */
int firstNonCacheOffsetAttr;
int firstNullAttr;
tp + hoff,
data_size,
&tupmask,
- (hasnull ? (bits8 *) tp + sizeof(IndexTupleData) : NULL));
+ (hasnull ? (uint8 *) tp + sizeof(IndexTupleData) : NULL));
#ifdef TOAST_INDEX_HACK
for (i = 0; i < numberOfAttributes; i++)
{
CompactAttribute *cattr;
char *tp; /* ptr to data part of tuple */
- bits8 *bp = NULL; /* ptr to null bitmap in tuple */
+ uint8 *bp = NULL; /* ptr to null bitmap in tuple */
int data_off; /* tuple data offset */
int off; /* current offset within data */
int startAttr;
*/
if (hasnulls)
{
- bp = (bits8 *) ((char *) tup + sizeof(IndexTupleData));
+ bp = (uint8 *) ((char *) tup + sizeof(IndexTupleData));
firstNullAttr = first_null_attr(bp, attnum);
}
else
Datum *values, bool *isnull)
{
char *tp; /* ptr to tuple data */
- bits8 *bp; /* ptr to null bitmap in tuple */
+ uint8 *bp; /* ptr to null bitmap in tuple */
/* XXX "knows" t_bits are just after fixed tuple header! */
- bp = (bits8 *) ((char *) tup + sizeof(IndexTupleData));
+ bp = (uint8 *) ((char *) tup + sizeof(IndexTupleData));
tp = (char *) tup + IndexInfoFindDataOffset(tup->t_info);
void
index_deform_tuple_internal(TupleDesc tupleDescriptor,
Datum *values, bool *isnull,
- char *tp, bits8 *bp, int hasnulls)
+ char *tp, uint8 *bp, int hasnulls)
{
CompactAttribute *cattr;
int natts = tupleDescriptor->natts; /* number of atts to extract */
};
static relopt_gen **relOpts = NULL;
-static bits32 last_assigned_kind = RELOPT_KIND_LAST_DEFAULT;
+static uint32 last_assigned_kind = RELOPT_KIND_LAST_DEFAULT;
static int num_custom_options = 0;
static relopt_gen **custom_options = NULL;
* (for types other than string)
*/
static relopt_gen *
-allocate_reloption(bits32 kinds, int type, const char *name, const char *desc,
+allocate_reloption(uint32 kinds, int type, const char *name, const char *desc,
LOCKMODE lockmode)
{
MemoryContext oldcxt;
* Allocate and initialize a new boolean reloption
*/
static relopt_bool *
-init_bool_reloption(bits32 kinds, const char *name, const char *desc,
+init_bool_reloption(uint32 kinds, const char *name, const char *desc,
bool default_val, LOCKMODE lockmode)
{
relopt_bool *newoption;
* Add a new boolean reloption
*/
void
-add_bool_reloption(bits32 kinds, const char *name, const char *desc,
+add_bool_reloption(uint32 kinds, const char *name, const char *desc,
bool default_val, LOCKMODE lockmode)
{
relopt_bool *newoption = init_bool_reloption(kinds, name, desc,
* Allocate and initialize a new ternary reloption
*/
static relopt_ternary *
-init_ternary_reloption(bits32 kinds, const char *name, const char *desc,
+init_ternary_reloption(uint32 kinds, const char *name, const char *desc,
LOCKMODE lockmode)
{
relopt_ternary *newoption;
* Add a new ternary reloption
*/
void
-add_ternary_reloption(bits32 kinds, const char *name, const char *desc,
+add_ternary_reloption(uint32 kinds, const char *name, const char *desc,
LOCKMODE lockmode)
{
relopt_ternary *newoption;
* Allocate and initialize a new integer reloption
*/
static relopt_int *
-init_int_reloption(bits32 kinds, const char *name, const char *desc,
+init_int_reloption(uint32 kinds, const char *name, const char *desc,
int default_val, int min_val, int max_val,
LOCKMODE lockmode)
{
* Add a new integer reloption
*/
void
-add_int_reloption(bits32 kinds, const char *name, const char *desc, int default_val,
+add_int_reloption(uint32 kinds, const char *name, const char *desc, int default_val,
int min_val, int max_val, LOCKMODE lockmode)
{
relopt_int *newoption = init_int_reloption(kinds, name, desc,
* Allocate and initialize a new real reloption
*/
static relopt_real *
-init_real_reloption(bits32 kinds, const char *name, const char *desc,
+init_real_reloption(uint32 kinds, const char *name, const char *desc,
double default_val, double min_val, double max_val,
LOCKMODE lockmode)
{
* Add a new float reloption
*/
void
-add_real_reloption(bits32 kinds, const char *name, const char *desc,
+add_real_reloption(uint32 kinds, const char *name, const char *desc,
double default_val, double min_val, double max_val,
LOCKMODE lockmode)
{
* Allocate and initialize a new enum reloption
*/
static relopt_enum *
-init_enum_reloption(bits32 kinds, const char *name, const char *desc,
+init_enum_reloption(uint32 kinds, const char *name, const char *desc,
relopt_enum_elt_def *members, int default_val,
const char *detailmsg, LOCKMODE lockmode)
{
* they are valid throughout the life of the process.
*/
void
-add_enum_reloption(bits32 kinds, const char *name, const char *desc,
+add_enum_reloption(uint32 kinds, const char *name, const char *desc,
relopt_enum_elt_def *members, int default_val,
const char *detailmsg, LOCKMODE lockmode)
{
* Allocate and initialize a new string reloption
*/
static relopt_string *
-init_string_reloption(bits32 kinds, const char *name, const char *desc,
+init_string_reloption(uint32 kinds, const char *name, const char *desc,
const char *default_val,
validate_string_relopt validator,
fill_string_relopt filler,
* the validation.
*/
void
-add_string_reloption(bits32 kinds, const char *name, const char *desc,
+add_string_reloption(uint32 kinds, const char *name, const char *desc,
const char *default_val, validate_string_relopt validator,
LOCKMODE lockmode)
{
if (needs_null_mask)
{
- bits8 *bp; /* ptr to null bitmap in tuple */
+ uint8 *bp; /* ptr to null bitmap in tuple */
/* Set nullmask presence bit in SpGistLeafTuple header */
SGLT_SET_HASNULLMASK(tup, true);
/* Fill the data area and null mask */
- bp = (bits8 *) ((char *) tup + sizeof(SpGistLeafTupleData));
+ bp = (uint8 *) ((char *) tup + sizeof(SpGistLeafTupleData));
heap_fill_tuple(tupleDescriptor, datums, isnulls, tp, data_size,
&tupmask, bp);
}
{
/* Fill data area only */
heap_fill_tuple(tupleDescriptor, datums, isnulls, tp, data_size,
- &tupmask, (bits8 *) NULL);
+ &tupmask, (uint8 *) NULL);
}
/* otherwise we have no data, nor a bitmap, to fill */
{
bool hasNullsMask = SGLT_GET_HASNULLMASK(tup);
char *tp; /* ptr to tuple data */
- bits8 *bp; /* ptr to null bitmap in tuple */
+ uint8 *bp; /* ptr to null bitmap in tuple */
if (keyColumnIsNull && tupleDescriptor->natts == 1)
{
}
tp = (char *) tup + SGLTHDRSZ(hasNullsMask);
- bp = (bits8 *) ((char *) tup + sizeof(SpGistLeafTupleData));
+ bp = (uint8 *) ((char *) tup + sizeof(SpGistLeafTupleData));
index_deform_tuple_internal(tupleDescriptor,
datums, isnulls,
const int16 *coloptions,
const NullableDatum *stattargets,
Datum reloptions,
- bits16 flags,
- bits16 constr_flags,
+ uint16 flags,
+ uint16 constr_flags,
bool allow_system_table_mods,
bool is_internal,
Oid *constraintId)
const IndexInfo *indexInfo,
const char *constraintName,
char constraintType,
- bits16 constr_flags,
+ uint16 constr_flags,
bool allow_system_table_mods,
bool is_internal)
{
if (HeapTupleHasNulls(tup))
{
TupleDesc tupdesc = RelationGetDescr(heapRel);
- bits8 *bp = tup->t_data->t_bits;
+ uint8 *bp = tup->t_data->t_bits;
for (int attnum = 0; attnum < tupdesc->natts; attnum++)
{
case ProcedureRelationId:
{
- bits16 flags = FORMAT_PROC_INVALID_AS_NULL;
+ uint16 flags = FORMAT_PROC_INVALID_AS_NULL;
char *proname = format_procedure_extended(object->objectId,
flags);
case TypeRelationId:
{
- bits16 flags = FORMAT_TYPE_INVALID_AS_NULL;
+ uint16 flags = FORMAT_TYPE_INVALID_AS_NULL;
char *typname = format_type_extended(object->objectId, -1,
flags);
case OperatorRelationId:
{
- bits16 flags = FORMAT_OPERATOR_INVALID_AS_NULL;
+ uint16 flags = FORMAT_OPERATOR_INVALID_AS_NULL;
char *oprname = format_operator_extended(object->objectId,
flags);
case ProcedureRelationId:
{
- bits16 flags = FORMAT_PROC_FORCE_QUALIFY | FORMAT_PROC_INVALID_AS_NULL;
+ uint16 flags = FORMAT_PROC_FORCE_QUALIFY | FORMAT_PROC_INVALID_AS_NULL;
char *proname = format_procedure_extended(object->objectId,
flags);
case TypeRelationId:
{
- bits16 flags = FORMAT_TYPE_INVALID_AS_NULL | FORMAT_TYPE_FORCE_QUALIFY;
+ uint16 flags = FORMAT_TYPE_INVALID_AS_NULL | FORMAT_TYPE_FORCE_QUALIFY;
char *typeout;
typeout = format_type_extended(object->objectId, -1, flags);
case OperatorRelationId:
{
- bits16 flags = FORMAT_OPERATOR_FORCE_QUALIFY | FORMAT_OPERATOR_INVALID_AS_NULL;
+ uint16 flags = FORMAT_OPERATOR_FORCE_QUALIFY | FORMAT_OPERATOR_INVALID_AS_NULL;
char *oprname = format_operator_extended(object->objectId,
flags);
Datum reloptions;
int16 *coloptions;
IndexInfo *indexInfo;
- bits16 flags;
- bits16 constr_flags;
+ uint16 flags;
+ uint16 constr_flags;
int numberOfAttributes;
int numberOfKeyAttributes;
TransactionId limitXmin;
*/
typedef struct SubOpts
{
- bits32 specified_opts;
+ uint32 specified_opts;
char *slot_name;
char *synchronous_commit;
bool connect;
*/
static void
parse_subscription_options(ParseState *pstate, List *stmt_options,
- bits32 supported_opts, SubOpts *opts)
+ uint32 supported_opts, SubOpts *opts)
{
ListCell *lc;
char *conninfo;
char originname[NAMEDATALEN];
List *publications;
- bits32 supported_opts;
+ uint32 supported_opts;
SubOpts opts = {0};
AclResult aclresult;
char *origin;
Subscription *sub;
Form_pg_subscription form;
- bits32 supported_opts;
+ uint32 supported_opts;
SubOpts opts = {0};
rel = table_open(SubscriptionRelationId, RowExclusiveLock);
char *constraintName;
char constraintType;
ObjectAddress address;
- bits16 flags;
+ uint16 flags;
Assert(IsA(stmt, IndexStmt));
Assert(OidIsValid(index_oid));
*/
bool
vacuum_is_permitted_for_relation(Oid relid, Form_pg_class reltuple,
- bits32 options)
+ uint32 options)
{
char *relname;
* or locked, a log is emitted if possible.
*/
Relation
-vacuum_open_relation(Oid relid, RangeVar *relation, bits32 options,
+vacuum_open_relation(Oid relid, RangeVar *relation, uint32 options,
bool verbose, LOCKMODE lmode)
{
Relation rel;
bool havenulls = false;
bool haveempty = false;
char **subdata;
- bits8 **subbitmaps;
+ uint8 **subbitmaps;
int *subbytes;
int *subnitems;
int32 dataoffset;
int iitem;
subdata = (char **) palloc(nelems * sizeof(char *));
- subbitmaps = (bits8 **) palloc(nelems * sizeof(bits8 *));
+ subbitmaps = (uint8 **) palloc(nelems * sizeof(uint8 *));
subbytes = (int *) palloc(nelems * sizeof(int));
subnitems = (int *) palloc(nelems * sizeof(int));
char typalign;
uint8 typalignby;
char *s;
- bits8 *bitmap;
+ uint8 *bitmap;
int bitmask;
/*
int nitems;
bool has_nulls = false;
char *s;
- bits8 *bitmap;
+ uint8 *bitmap;
int bitmask;
MemoryContext oldcontext;
ArrayType *arr;
List *
ExecInsertIndexTuples(ResultRelInfo *resultRelInfo,
EState *estate,
- bits32 flags,
+ uint32 flags,
TupleTableSlot *slot,
List *arbiterIndexes,
bool *specConflict)
if (resultRelInfo->ri_NumIndices > 0)
{
- bits32 flags;
+ uint32 flags;
if (conflictindexes != NIL)
flags = EIIT_NO_DUPE_ERROR;
if (resultRelInfo->ri_NumIndices > 0 && (update_indexes != TU_None))
{
- bits32 flags = EIIT_IS_UPDATE;
+ uint32 flags = EIIT_IS_UPDATE;
if (conflictindexes != NIL)
flags |= EIIT_NO_DUPE_ERROR;
natts = Min(natts, reqnatts);
if (natts > firstNonGuaranteedAttr)
{
- bits8 *bp = tup->t_bits;
+ uint8 *bp = tup->t_bits;
/* Find the first NULL attr */
firstNullAttr = first_null_attr(bp, natts);
/* insert index entries for tuple if necessary */
if (resultRelInfo->ri_NumIndices > 0 && (updateCxt->updateIndexes != TU_None))
{
- bits32 flags = EIIT_IS_UPDATE;
+ uint32 flags = EIIT_IS_UPDATE;
if (updateCxt->updateIndexes == TU_Summarizing)
flags |= EIIT_ONLY_SUMMARIZING;
* be found instead of raising an error.
*/
ForeignDataWrapper *
-GetForeignDataWrapperExtended(Oid fdwid, bits16 flags)
+GetForeignDataWrapperExtended(Oid fdwid, uint16 flags)
{
Form_pg_foreign_data_wrapper fdwform;
ForeignDataWrapper *fdw;
* instead of raising an error.
*/
ForeignServer *
-GetForeignServerExtended(Oid serverid, bits16 flags)
+GetForeignServerExtended(Oid serverid, uint16 flags)
{
Form_pg_foreign_server serverform;
ForeignServer *server;
# types that are copied by straight assignment
my @scalar_types = qw(
- bits32 bool char double int int8 int16 int32 int64 long uint8 uint16 uint32 uint64
+ bool char double int int8 int16 int32 int64 long uint8 uint16 uint32 uint64
AclMode AttrNumber Cardinality Cost Index Oid RelFileNumber Selectivity Size StrategyNumber SubTransactionId TimeLineID XLogRecPtr
);
print $rff "\tREAD_INT_FIELD($f);\n" unless $no_read;
}
elsif ($t eq 'uint32'
- || $t eq 'bits32'
|| $t eq 'BlockNumber'
|| $t eq 'Index'
|| $t eq 'SubTransactionId')
BackgroundWorkerInitializeConnection(const char *dbname, const char *username, uint32 flags)
{
BackgroundWorker *worker = MyBgworkerEntry;
- bits32 init_flags = 0; /* never honor session_preload_libraries */
+ uint32 init_flags = 0; /* never honor session_preload_libraries */
/* ignore datallowconn and ACL_CONNECT? */
if (flags & BGWORKER_BYPASS_ALLOWCONN)
BackgroundWorkerInitializeConnectionByOid(Oid dboid, Oid useroid, uint32 flags)
{
BackgroundWorker *worker = MyBgworkerEntry;
- bits32 init_flags = 0; /* never honor session_preload_libraries */
+ uint32 init_flags = 0; /* never honor session_preload_libraries */
/* ignore datallowconn and ACL_CONNECT? */
if (flags & BGWORKER_BYPASS_ALLOWCONN)
{
PipeProtoHeader p;
int chunklen;
- bits8 dest_flags;
+ uint8 dest_flags;
/* Do we have a valid header? */
memcpy(&p, cursor, offsetof(PipeProtoHeader, data));
* if some statistics could not be flushed due to lock contention.
*/
bool
-pgstat_flush_backend(bool nowait, bits32 flags)
+pgstat_flush_backend(bool nowait, uint32 flags)
{
PgStat_EntryRef *entry_ref;
bool has_pending_data = false;
int i;
char *dat1,
*dat2;
- bits8 *bitmap1,
+ uint8 *bitmap1,
*bitmap2;
Oid element_type;
Oid element_type1;
{
int size = (state2->aitems + 7) / 8;
- state1->nullbitmap = (bits8 *) palloc(size);
+ state1->nullbitmap = (uint8 *) palloc(size);
memcpy(state1->nullbitmap, state2->nullbitmap, size);
}
* previous inputs by marking all their items non-null.
*/
state1->aitems = pg_nextpower2_32(Max(256, newnitems + 1));
- state1->nullbitmap = (bits8 *) palloc((state1->aitems + 7) / 8);
+ state1->nullbitmap = (uint8 *) palloc((state1->aitems + 7) / 8);
array_bitmap_copy(state1->nullbitmap, 0,
NULL, 0,
state1->nitems);
int newaitems = state1->aitems + state2->aitems;
state1->aitems = pg_nextpower2_32(newaitems);
- state1->nullbitmap = (bits8 *)
+ state1->nullbitmap = (uint8 *)
repalloc(state1->nullbitmap, (state1->aitems + 7) / 8);
}
array_bitmap_copy(state1->nullbitmap, state1->nitems,
{
int size = (result->aitems + 7) / 8;
- result->nullbitmap = (bits8 *) palloc(size);
+ result->nullbitmap = (uint8 *) palloc(size);
temp = pq_getmsgbytes(&buf, size);
memcpy(result->nullbitmap, temp, size);
}
{
/* basic info about the array, set up during array_create_iterator() */
ArrayType *arr; /* array we're iterating through */
- bits8 *nullbitmap; /* its null bitmap, if any */
+ uint8 *nullbitmap; /* its null bitmap, if any */
int nitems; /* total number of elements in array */
int16 typlen; /* element type's length */
bool typbyval; /* element type's byval property */
Datum dataValue, bool isNull,
int arraytyplen,
int elmlen, bool elmbyval, char elmalign);
-static bool array_get_isnull(const bits8 *nullbitmap, int offset);
-static void array_set_isnull(bits8 *nullbitmap, int offset, bool isNull);
+static bool array_get_isnull(const uint8 *nullbitmap, int offset);
+static void array_set_isnull(uint8 *nullbitmap, int offset, bool isNull);
static Datum ArrayCast(char *value, bool byval, int len);
static int ArrayCastAndSet(Datum src,
int typlen, bool typbyval, uint8 typalignby,
char *dest);
-static char *array_seek(char *ptr, int offset, bits8 *nullbitmap, int nitems,
+static char *array_seek(char *ptr, int offset, uint8 *nullbitmap, int nitems,
int typlen, bool typbyval, char typalign);
-static int array_nelems_size(char *ptr, int offset, bits8 *nullbitmap,
+static int array_nelems_size(char *ptr, int offset, uint8 *nullbitmap,
int nitems, int typlen, bool typbyval, char typalign);
static int array_copy(char *destptr, int nitems,
- char *srcptr, int offset, bits8 *nullbitmap,
+ char *srcptr, int offset, uint8 *nullbitmap,
int typlen, bool typbyval, char typalign);
-static int array_slice_size(char *arraydataptr, bits8 *arraynullsptr,
+static int array_slice_size(char *arraydataptr, uint8 *arraynullsptr,
int ndim, int *dim, int *lb,
int *st, int *endp,
int typlen, bool typbyval, char typalign);
static void array_extract_slice(ArrayType *newarray,
int ndim, int *dim, int *lb,
- char *arraydataptr, bits8 *arraynullsptr,
+ char *arraydataptr, uint8 *arraynullsptr,
int *st, int *endp,
int typlen, bool typbyval, char typalign);
static void array_insert_slice(ArrayType *destArray, ArrayType *origArray,
bool freedata)
{
char *p = ARR_DATA_PTR(array);
- bits8 *bitmap = ARR_NULLBITMAP(array);
+ uint8 *bitmap = ARR_NULLBITMAP(array);
int bitval = 0;
int bitmask = 1;
uint8 typalignby = typalign_to_alignby(typalign);
fixedLb[1];
char *arraydataptr,
*retptr;
- bits8 *arraynullsptr;
+ uint8 *arraynullsptr;
if (arraytyplen > 0)
{
fixedLb[1];
Oid elemtype;
char *arraydataptr;
- bits8 *arraynullsptr;
+ uint8 *arraynullsptr;
int32 dataoffset;
int bytes,
span[MAXDIM];
offset;
char *elt_ptr;
bool newhasnulls;
- bits8 *oldnullbitmap;
+ uint8 *oldnullbitmap;
int oldnitems,
newnitems,
olddatasize,
*/
if (newhasnulls)
{
- bits8 *newnullbitmap = ARR_NULLBITMAP(newarray);
+ uint8 *newnullbitmap = ARR_NULLBITMAP(newarray);
/* palloc0 above already marked any inserted positions as nulls */
/* Fix the inserted value */
int slicelb = Max(oldlb, lowerIndx[0]);
int sliceub = Min(oldub, upperIndx[0]);
char *oldarraydata = ARR_DATA_PTR(array);
- bits8 *oldarraybitmap = ARR_NULLBITMAP(array);
+ uint8 *oldarraybitmap = ARR_NULLBITMAP(array);
/* count/size of old array entries that will go before the slice */
itemsbefore = Min(slicelb, oldub + 1) - oldlb;
/* fill in nulls bitmap if needed */
if (newhasnulls)
{
- bits8 *newnullbitmap = ARR_NULLBITMAP(newarray);
- bits8 *oldnullbitmap = ARR_NULLBITMAP(array);
+ uint8 *newnullbitmap = ARR_NULLBITMAP(newarray);
+ uint8 *oldnullbitmap = ARR_NULLBITMAP(array);
/* palloc0 above already marked any inserted positions as nulls */
array_bitmap_copy(newnullbitmap, addedbefore,
bool *nulls;
int nelems;
char *p;
- bits8 *bitmap;
+ uint8 *bitmap;
int bitmask;
int i;
uint8 elmalignby = typalign_to_alignby(elmalign);
array_contains_nulls(const ArrayType *array)
{
int nelems;
- bits8 *bitmap;
+ uint8 *bitmap;
int bitmask;
/* Easy answer if there's no null bitmap */
* offset: 0-based linear element number of array element
*/
static bool
-array_get_isnull(const bits8 *nullbitmap, int offset)
+array_get_isnull(const uint8 *nullbitmap, int offset)
{
if (nullbitmap == NULL)
return false; /* assume not null */
* isNull: null status to set
*/
static void
-array_set_isnull(bits8 *nullbitmap, int offset, bool isNull)
+array_set_isnull(uint8 *nullbitmap, int offset, bool isNull)
{
int bitmask;
* It is caller's responsibility to ensure that nitems is within range
*/
static char *
-array_seek(char *ptr, int offset, bits8 *nullbitmap, int nitems,
+array_seek(char *ptr, int offset, uint8 *nullbitmap, int nitems,
int typlen, bool typbyval, char typalign)
{
uint8 typalignby = typalign_to_alignby(typalign);
* Parameters same as for array_seek
*/
static int
-array_nelems_size(char *ptr, int offset, bits8 *nullbitmap, int nitems,
+array_nelems_size(char *ptr, int offset, uint8 *nullbitmap, int nitems,
int typlen, bool typbyval, char typalign)
{
return array_seek(ptr, offset, nullbitmap, nitems,
*/
static int
array_copy(char *destptr, int nitems,
- char *srcptr, int offset, bits8 *nullbitmap,
+ char *srcptr, int offset, uint8 *nullbitmap,
int typlen, bool typbyval, char typalign)
{
int numbytes;
* to make it worth worrying too much. For the moment, KISS.
*/
void
-array_bitmap_copy(bits8 *destbitmap, int destoffset,
- const bits8 *srcbitmap, int srcoffset,
+array_bitmap_copy(uint8 *destbitmap, int destoffset,
+ const uint8 *srcbitmap, int srcoffset,
int nitems)
{
int destbitmask,
* We assume the caller has verified that the slice coordinates are valid.
*/
static int
-array_slice_size(char *arraydataptr, bits8 *arraynullsptr,
+array_slice_size(char *arraydataptr, uint8 *arraynullsptr,
int ndim, int *dim, int *lb,
int *st, int *endp,
int typlen, bool typbyval, char typalign)
int *dim,
int *lb,
char *arraydataptr,
- bits8 *arraynullsptr,
+ uint8 *arraynullsptr,
int *st,
int *endp,
int typlen,
char typalign)
{
char *destdataptr = ARR_DATA_PTR(newarray);
- bits8 *destnullsptr = ARR_NULLBITMAP(newarray);
+ uint8 *destnullsptr = ARR_NULLBITMAP(newarray);
char *srcdataptr;
int src_offset,
dest_offset,
char *destPtr = ARR_DATA_PTR(destArray);
char *origPtr = ARR_DATA_PTR(origArray);
char *srcPtr = ARR_DATA_PTR(srcArray);
- bits8 *destBitmap = ARR_NULLBITMAP(destArray);
- bits8 *origBitmap = ARR_NULLBITMAP(origArray);
- bits8 *srcBitmap = ARR_NULLBITMAP(srcArray);
+ uint8 *destBitmap = ARR_NULLBITMAP(destArray);
+ uint8 *origBitmap = ARR_NULLBITMAP(origArray);
+ uint8 *srcBitmap = ARR_NULLBITMAP(srcArray);
int orignitems = ArrayGetNItems(ARR_NDIM(origArray),
ARR_DIMS(origArray));
int dest_offset,
* previous inputs by marking all their items non-null.
*/
astate->aitems = pg_nextpower2_32(Max(256, newnitems + 1));
- astate->nullbitmap = (bits8 *) palloc((astate->aitems + 7) / 8);
+ astate->nullbitmap = (uint8 *) palloc((astate->aitems + 7) / 8);
array_bitmap_copy(astate->nullbitmap, 0,
NULL, 0,
astate->nitems);
else if (newnitems > astate->aitems)
{
astate->aitems = Max(astate->aitems * 2, newnitems);
- astate->nullbitmap = (bits8 *)
+ astate->nullbitmap = (uint8 *)
repalloc(astate->nullbitmap, (astate->aitems + 7) / 8);
}
array_bitmap_copy(astate->nullbitmap, astate->nitems,
char typalign;
uint8 typalignby;
char *arraydataptr;
- bits8 *bitmap;
+ uint8 *bitmap;
int bitmask;
bool changed = false;
TypeCacheEntry *typentry;
Oid type_oid;
int32 typemod;
char *result;
- bits16 flags = FORMAT_TYPE_ALLOW_INVALID;
+ uint16 flags = FORMAT_TYPE_ALLOW_INVALID;
/* Since this function is not strict, we must test for null args */
if (PG_ARGISNULL(0))
* Returns a palloc'd string, or NULL.
*/
char *
-format_type_extended(Oid type_oid, int32 typemod, bits16 flags)
+format_type_extended(Oid type_oid, int32 typemod, uint16 flags)
{
HeapTuple tuple;
Form_pg_type typeform;
int ndims,
nitems,
*dims;
- bits8 *bitmap;
+ uint8 *bitmap;
Assert(PG_NARGS() == 1);
* always schema-qualify procedure names, regardless of search_path
*/
char *
-format_procedure_extended(Oid procedure_oid, bits16 flags)
+format_procedure_extended(Oid procedure_oid, uint16 flags)
{
char *result;
HeapTuple proctup;
* always schema-qualify operator names, regardless of search_path
*/
char *
-format_operator_extended(Oid operator_oid, bits16 flags)
+format_operator_extended(Oid operator_oid, uint16 flags)
{
char *result;
HeapTuple opertup;
/* Internal version, extensible with flags to control its behavior */
char *
-pg_get_indexdef_columns_extended(Oid indexrelid, bits16 flags)
+pg_get_indexdef_columns_extended(Oid indexrelid, uint16 flags)
{
bool pretty = ((flags & RULE_INDEXDEF_PRETTY) != 0);
bool keys_only = ((flags & RULE_INDEXDEF_KEYS_ONLY) != 0);
Node *escontext = fcinfo->context;
VarBit *result; /* The resulting bit string */
char *sp; /* pointer into the character string */
- bits8 *r; /* pointer into the result */
+ uint8 *r; /* pointer into the result */
int len, /* Length of the whole data structure */
bitlen, /* Number of bits in the bit string */
slen; /* Length of the input string */
bool bit_not_hex; /* false = hex string true = bit string */
int bc;
- bits8 x = 0;
+ uint8 x = 0;
/* Check that the first character is a b or an x */
if (input_string[0] == 'b' || input_string[0] == 'B')
for (bc = 0; *sp; sp++)
{
if (*sp >= '0' && *sp <= '9')
- x = (bits8) (*sp - '0');
+ x = (uint8) (*sp - '0');
else if (*sp >= 'A' && *sp <= 'F')
- x = (bits8) (*sp - 'A') + 10;
+ x = (uint8) (*sp - 'A') + 10;
else if (*sp >= 'a' && *sp <= 'f')
- x = (bits8) (*sp - 'a') + 10;
+ x = (uint8) (*sp - 'a') + 10;
else
ereturn(escontext, (Datum) 0,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
VarBit *s = PG_GETARG_VARBIT_P(0);
char *result,
*r;
- bits8 *sp;
+ uint8 *sp;
int i,
len,
bitlen;
Node *escontext = fcinfo->context;
VarBit *result; /* The resulting bit string */
char *sp; /* pointer into the character string */
- bits8 *r; /* pointer into the result */
+ uint8 *r; /* pointer into the result */
int len, /* Length of the whole data structure */
bitlen, /* Number of bits in the bit string */
slen; /* Length of the input string */
bool bit_not_hex; /* false = hex string true = bit string */
int bc;
- bits8 x = 0;
+ uint8 x = 0;
/* Check that the first character is a b or an x */
if (input_string[0] == 'b' || input_string[0] == 'B')
for (bc = 0; *sp; sp++)
{
if (*sp >= '0' && *sp <= '9')
- x = (bits8) (*sp - '0');
+ x = (uint8) (*sp - '0');
else if (*sp >= 'A' && *sp <= 'F')
- x = (bits8) (*sp - 'A') + 10;
+ x = (uint8) (*sp - 'A') + 10;
else if (*sp >= 'a' && *sp <= 'f')
- x = (bits8) (*sp - 'a') + 10;
+ x = (uint8) (*sp - 'a') + 10;
else
ereturn(escontext, (Datum) 0,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
VarBit *s = PG_GETARG_VARBIT_P(0);
char *result,
*r;
- bits8 *sp;
- bits8 x;
+ uint8 *sp;
+ uint8 x;
int i,
k,
len;
bytelen,
bit1pad,
bit2shift;
- bits8 *pr,
+ uint8 *pr,
*pa;
bitlen1 = VARBITLEN(arg1);
int32 e,
s1,
e1;
- bits8 *r,
+ uint8 *r,
*ps;
bitlen = VARBITLEN(arg);
bitlen1,
bitlen2,
i;
- bits8 *p1,
+ uint8 *p1,
*p2,
*r;
bitlen1,
bitlen2,
i;
- bits8 *p1,
+ uint8 *p1,
*p2,
*r;
bitlen1,
bitlen2,
i;
- bits8 *p1,
+ uint8 *p1,
*p2,
*r;
{
VarBit *arg = PG_GETARG_VARBIT_P(0);
VarBit *result;
- bits8 *p,
+ uint8 *p,
*r;
result = (VarBit *) palloc(VARSIZE(arg));
int byte_shift,
ishift,
len;
- bits8 *p,
+ uint8 *p,
*r;
/* Negative shift is a shift to the right */
int byte_shift,
ishift,
len;
- bits8 *p,
+ uint8 *p,
*r;
/* Negative shift is a shift to the left */
int32 a = PG_GETARG_INT32(0);
int32 typmod = PG_GETARG_INT32(1);
VarBit *result;
- bits8 *r;
+ uint8 *r;
int rlen;
int destbitsleft,
srcbitsleft;
/* sign-fill any excess bytes in output */
while (destbitsleft >= srcbitsleft + 8)
{
- *r++ = (bits8) ((a < 0) ? BITMASK : 0);
+ *r++ = (uint8) ((a < 0) ? BITMASK : 0);
destbitsleft -= 8;
}
/* store first fractional byte */
/* Force sign-fill in case the compiler implements >> as zero-fill */
if (a < 0)
val |= ((unsigned int) -1) << (srcbitsleft + 8 - destbitsleft);
- *r++ = (bits8) (val & BITMASK);
+ *r++ = (uint8) (val & BITMASK);
destbitsleft -= 8;
}
/* Now srcbitsleft and destbitsleft are the same, need not track both */
/* store whole bytes */
while (destbitsleft >= 8)
{
- *r++ = (bits8) ((a >> (destbitsleft - 8)) & BITMASK);
+ *r++ = (uint8) ((a >> (destbitsleft - 8)) & BITMASK);
destbitsleft -= 8;
}
/* store last fractional byte */
if (destbitsleft > 0)
- *r = (bits8) ((a << (8 - destbitsleft)) & BITMASK);
+ *r = (uint8) ((a << (8 - destbitsleft)) & BITMASK);
PG_RETURN_VARBIT_P(result);
}
{
VarBit *arg = PG_GETARG_VARBIT_P(0);
uint32 result;
- bits8 *r;
+ uint8 *r;
/* Check that the bit string is not too long */
if (VARBITLEN(arg) > sizeof(result) * BITS_PER_BYTE)
int64 a = PG_GETARG_INT64(0);
int32 typmod = PG_GETARG_INT32(1);
VarBit *result;
- bits8 *r;
+ uint8 *r;
int rlen;
int destbitsleft,
srcbitsleft;
/* sign-fill any excess bytes in output */
while (destbitsleft >= srcbitsleft + 8)
{
- *r++ = (bits8) ((a < 0) ? BITMASK : 0);
+ *r++ = (uint8) ((a < 0) ? BITMASK : 0);
destbitsleft -= 8;
}
/* store first fractional byte */
/* Force sign-fill in case the compiler implements >> as zero-fill */
if (a < 0)
val |= ((unsigned int) -1) << (srcbitsleft + 8 - destbitsleft);
- *r++ = (bits8) (val & BITMASK);
+ *r++ = (uint8) (val & BITMASK);
destbitsleft -= 8;
}
/* Now srcbitsleft and destbitsleft are the same, need not track both */
/* store whole bytes */
while (destbitsleft >= 8)
{
- *r++ = (bits8) ((a >> (destbitsleft - 8)) & BITMASK);
+ *r++ = (uint8) ((a >> (destbitsleft - 8)) & BITMASK);
destbitsleft -= 8;
}
/* store last fractional byte */
if (destbitsleft > 0)
- *r = (bits8) ((a << (8 - destbitsleft)) & BITMASK);
+ *r = (uint8) ((a << (8 - destbitsleft)) & BITMASK);
PG_RETURN_VARBIT_P(result);
}
{
VarBit *arg = PG_GETARG_VARBIT_P(0);
uint64 result;
- bits8 *r;
+ uint8 *r;
/* Check that the bit string is not too long */
if (VARBITLEN(arg) > sizeof(result) * BITS_PER_BYTE)
str_length,
i,
is;
- bits8 *s, /* pointer into substring */
+ uint8 *s, /* pointer into substring */
*p; /* pointer into str */
- bits8 cmp, /* shifted substring byte to compare */
+ uint8 cmp, /* shifted substring byte to compare */
mask1, /* mask for substring byte shifted right */
mask2, /* mask for substring byte shifted left */
end_mask, /* pad mask for last substring byte */
VarBit *result;
int len,
bitlen;
- bits8 *r,
+ uint8 *r,
*p;
int byteNo,
bitNo;
VarBit *arg1 = PG_GETARG_VARBIT_P(0);
int32 n = PG_GETARG_INT32(1);
int bitlen;
- bits8 *p;
+ uint8 *p;
int byteNo,
bitNo;
StringInfoData buf;
bool printed = false;
char *p;
- bits8 *bitmap;
+ uint8 *bitmap;
int bitmask;
int i;
ArrayMetaState *my_extra;
* RECORD datatype.
*/
void
-InitMaterializedSRF(FunctionCallInfo fcinfo, bits32 flags)
+InitMaterializedSRF(FunctionCallInfo fcinfo, uint32 flags)
{
bool random_access;
ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
void
InitPostgres(const char *in_dbname, Oid dboid,
const char *username, Oid useroid,
- bits32 flags,
+ uint32 flags,
char *out_dbname)
{
bool bootstrap = IsBootstrapProcessingMode();
{
struct LogicalRepInfo *dbinfo;
bool two_phase; /* enable-two-phase option */
- bits32 objecttypes_to_clean; /* flags indicating which object types
+ uint32 objecttypes_to_clean; /* flags indicating which object types
* to clean up on subscriber */
};
const VersionedQuery *vquery; /* versioned query, or NULL */
const SchemaQuery *squery; /* schema query, or NULL */
const char *const *keywords; /* keywords to be offered as well */
- const bits32 flags; /* visibility flags, see below */
+ const uint32 flags; /* visibility flags, see below */
} pgsql_thing_t;
#define THING_NO_CREATE (1 << 0) /* should not show up after CREATE */
* Entries that have 'excluded' flags are not returned.
*/
static char *
-create_or_drop_command_generator(const char *text, int state, bits32 excluded)
+create_or_drop_command_generator(const char *text, int state, uint32 excluded)
{
static int list_index,
string_length;
#include "vacuuming.h"
static void help(const char *progname);
-static void check_objfilter(bits32 objfilter);
+static void check_objfilter(uint32 objfilter);
int
* Verify that the filters used at command line are compatible.
*/
void
-check_objfilter(bits32 objfilter)
+check_objfilter(uint32 objfilter)
{
if ((objfilter & OBJFILTER_ALL_DBS) &&
(objfilter & OBJFILTER_DATABASE))
typedef struct vacuumingOptions
{
RunMode mode;
- bits32 objfilter;
+ uint32 objfilter;
bool verbose;
bool and_analyze;
bool full;
/* ^ - 23 bytes - ^ */
#define FIELDNO_HEAPTUPLEHEADERDATA_BITS 5
- bits8 t_bits[FLEXIBLE_ARRAY_MEMBER]; /* bitmap of NULLs */
+ uint8 t_bits[FLEXIBLE_ARRAY_MEMBER]; /* bitmap of NULLs */
/* MORE DATA FOLLOWS AT END OF STRUCT */
};
/* ^ - 23 bytes - ^ */
- bits8 t_bits[FLEXIBLE_ARRAY_MEMBER]; /* bitmap of NULLs */
+ uint8 t_bits[FLEXIBLE_ARRAY_MEMBER]; /* bitmap of NULLs */
/* MORE DATA FOLLOWS AT END OF STRUCT */
};
extern void heap_fill_tuple(TupleDesc tupleDesc,
const Datum *values, const bool *isnull,
char *data, Size data_size,
- uint16 *infomask, bits8 *bit);
+ uint16 *infomask, uint8 *bit);
extern bool heap_attisnull(HeapTuple tup, int attnum, TupleDesc tupleDesc);
extern Datum nocachegetattr(HeapTuple tup, int attnum,
TupleDesc tupleDesc);
typedef struct IndexAttributeBitMapData
{
- bits8 bits[(INDEX_MAX_KEYS + 8 - 1) / 8];
+ uint8 bits[(INDEX_MAX_KEYS + 8 - 1) / 8];
} IndexAttributeBitMapData;
typedef IndexAttributeBitMapData * IndexAttributeBitMap;
Datum *values, bool *isnull);
extern void index_deform_tuple_internal(TupleDesc tupleDescriptor,
Datum *values, bool *isnull,
- char *tp, bits8 *bp, int hasnulls);
+ char *tp, uint8 *bp, int hasnulls);
extern IndexTuple CopyIndexTuple(IndexTuple source);
extern IndexTuple index_truncate_tuple(TupleDesc sourceDescriptor,
IndexTuple source, int leavenatts);
}
else
{
- if (att_isnull(attnum - 1, (bits8 *) tup + sizeof(IndexTupleData)))
+ if (att_isnull(attnum - 1, (uint8 *) tup + sizeof(IndexTupleData)))
{
*isnull = true;
return (Datum) 0;
const char *name; /* must be first (used as list termination
* marker) */
const char *desc;
- bits32 kinds;
+ uint32 kinds;
LOCKMODE lockmode;
int namelen;
relopt_type type;
(char *)(optstruct) + (optstruct)->member)
extern relopt_kind add_reloption_kind(void);
-extern void add_bool_reloption(bits32 kinds, const char *name, const char *desc,
+extern void add_bool_reloption(uint32 kinds, const char *name, const char *desc,
bool default_val, LOCKMODE lockmode);
-extern void add_ternary_reloption(bits32 kinds, const char *name,
+extern void add_ternary_reloption(uint32 kinds, const char *name,
const char *desc, LOCKMODE lockmode);
-extern void add_int_reloption(bits32 kinds, const char *name, const char *desc,
+extern void add_int_reloption(uint32 kinds, const char *name, const char *desc,
int default_val, int min_val, int max_val,
LOCKMODE lockmode);
-extern void add_real_reloption(bits32 kinds, const char *name, const char *desc,
+extern void add_real_reloption(uint32 kinds, const char *name, const char *desc,
double default_val, double min_val, double max_val,
LOCKMODE lockmode);
-extern void add_enum_reloption(bits32 kinds, const char *name, const char *desc,
+extern void add_enum_reloption(uint32 kinds, const char *name, const char *desc,
relopt_enum_elt_def *members, int default_val,
const char *detailmsg, LOCKMODE lockmode);
-extern void add_string_reloption(bits32 kinds, const char *name, const char *desc,
+extern void add_string_reloption(uint32 kinds, const char *name, const char *desc,
const char *default_val, validate_string_relopt validator,
LOCKMODE lockmode);
* non-null.
*/
static inline bool
-att_isnull(int ATT, const bits8 *BITS)
+att_isnull(int ATT, const uint8 *BITS)
{
return !(BITS[ATT >> 3] & (1 << (ATT & 0x07)));
}
* effectively as if natts is rounded up to the next multiple of 8.
*/
static inline void
-populate_isnull_array(const bits8 *bits, int natts, bool *isnull)
+populate_isnull_array(const uint8 *bits, int natts, bool *isnull)
{
int nbytes = (natts + 7) >> 3;
for (int i = 0; i < nbytes; i++, isnull += 8)
{
uint64 isnull_8;
- bits8 nullbyte = ~bits[i];
+ uint8 nullbyte = ~bits[i];
/* Convert the lower 4 bits of NULL bitmap word into a 64 bit int */
isnull_8 = (nullbyte & 0xf) * SPREAD_BITS_MULTIPLIER_32;
* case.
*/
static inline int
-first_null_attr(const bits8 *bits, int natts)
+first_null_attr(const uint8 *bits, int natts)
{
int nattByte = natts >> 3;
int bytenum;
typedef uint32_t uint32;
typedef uint64_t uint64;
-/*
- * bitsN
- * Unit of bitwise operation, AT LEAST N BITS IN SIZE.
- */
-typedef uint8 bits8; /* >= 8 bits */
-typedef uint16 bits16; /* >= 16 bits */
-typedef uint32 bits32; /* >= 32 bits */
-
/*
* 64-bit integers
*/
/* options for REINDEX */
typedef struct ReindexParams
{
- bits32 options; /* bitmask of REINDEXOPT_* */
+ uint32 options; /* bitmask of REINDEXOPT_* */
Oid tablespaceOid; /* New tablespace to move indexes to.
* InvalidOid to do nothing. */
} ReindexParams;
const int16 *coloptions,
const NullableDatum *stattargets,
Datum reloptions,
- bits16 flags,
- bits16 constr_flags,
+ uint16 flags,
+ uint16 constr_flags,
bool allow_system_table_mods,
bool is_internal,
Oid *constraintId);
const IndexInfo *indexInfo,
const char *constraintName,
char constraintType,
- bits16 constr_flags,
+ uint16 constr_flags,
bool allow_system_table_mods,
bool is_internal);
/* options for CLUSTER */
typedef struct ClusterParams
{
- bits32 options; /* bitmask of CLUOPT_* */
+ uint32 options; /* bitmask of CLUOPT_* */
} ClusterParams;
*/
typedef struct VacuumParams
{
- bits32 options; /* bitmask of VACOPT_* */
+ uint32 options; /* bitmask of VACOPT_* */
int freeze_min_age; /* min freeze age, -1 to use default */
int freeze_table_age; /* age at which to scan whole table */
int multixact_freeze_min_age; /* min multixact freeze age, -1 to
extern void vac_update_datfrozenxid(void);
extern void vacuum_delay_point(bool is_analyze);
extern bool vacuum_is_permitted_for_relation(Oid relid, Form_pg_class reltuple,
- bits32 options);
+ uint32 options);
extern Relation vacuum_open_relation(Oid relid, RangeVar *relation,
- bits32 options, bool verbose,
+ uint32 options, bool verbose,
LOCKMODE lmode);
extern IndexBulkDeleteResult *vac_bulkdel_one_index(IndexVacuumInfo *ivinfo,
IndexBulkDeleteResult *istat,
bool incremental;
JsonTokenType token_type;
int lex_level;
- bits32 flags;
+ uint32 flags;
int line_number; /* line number, starting from 1 */
const char *line_start; /* where that line starts within input */
JsonParserStack *pstack;
#define EIIT_NO_DUPE_ERROR (1<<1)
#define EIIT_ONLY_SUMMARIZING (1<<2)
extern List *ExecInsertIndexTuples(ResultRelInfo *resultRelInfo, EState *estate,
- bits32 options, TupleTableSlot *slot,
+ uint32 options, TupleTableSlot *slot,
List *arbiterIndexes,
bool *specConflict);
extern bool ExecCheckIndexConstraints(ResultRelInfo *resultRelInfo,
int64 totalDiskSpaceUsed;
int64 maxMemorySpaceUsed;
int64 totalMemorySpaceUsed;
- bits32 sortMethods; /* bitmask of TuplesortMethod */
+ uint32 sortMethods; /* bitmask of TuplesortMethod */
} IncrementalSortGroupInfo;
typedef struct IncrementalSortInfo
extern ForeignServer *GetForeignServer(Oid serverid);
extern ForeignServer *GetForeignServerExtended(Oid serverid,
- bits16 flags);
+ uint16 flags);
extern ForeignServer *GetForeignServerByName(const char *srvname,
bool missing_ok);
extern char *ForeignServerConnectionString(Oid userid,
extern UserMapping *GetUserMapping(Oid userid, Oid serverid);
extern ForeignDataWrapper *GetForeignDataWrapper(Oid fdwid);
extern ForeignDataWrapper *GetForeignDataWrapperExtended(Oid fdwid,
- bits16 flags);
+ uint16 flags);
extern ForeignDataWrapper *GetForeignDataWrapperByName(const char *fdwname,
bool missing_ok);
extern ForeignTable *GetForeignTable(Oid relid);
#define MAT_SRF_USE_EXPECTED_DESC 0x01 /* use expectedDesc as tupdesc. */
#define MAT_SRF_BLESS 0x02 /* "Bless" a tuple descriptor with
* BlessTupleDesc(). */
-extern void InitMaterializedSRF(FunctionCallInfo fcinfo, bits32 flags);
+extern void InitMaterializedSRF(FunctionCallInfo fcinfo, uint32 flags);
extern FuncCallContext *init_MultiFuncCall(PG_FUNCTION_ARGS);
extern FuncCallContext *per_MultiFuncCall(PG_FUNCTION_ARGS);
extern void InitializeFastPathLocks(void);
extern void InitPostgres(const char *in_dbname, Oid dboid,
const char *username, Oid useroid,
- bits32 flags,
+ uint32 flags,
char *out_dbname);
extern void BaseInit(void);
extern void StoreConnectionWarning(char *msg, char *detail);
{
NodeTag type;
RangeVar *relation;
- bits32 options; /* OR of TableLikeOption flags */
+ uint32 options; /* OR of TableLikeOption flags */
Oid relationOid; /* If table has been looked up, its OID */
} TableLikeClause;
}
extern uint64 pg_popcount_portable(const char *buf, int bytes);
-extern uint64 pg_popcount_masked_portable(const char *buf, int bytes, bits8 mask);
+extern uint64 pg_popcount_masked_portable(const char *buf, int bytes, uint8 mask);
#if defined(HAVE_X86_64_POPCNTQ) || defined(USE_SVE_POPCNT_WITH_RUNTIME_CHECK)
/*
* first.
*/
extern PGDLLIMPORT uint64 (*pg_popcount_optimized) (const char *buf, int bytes);
-extern PGDLLIMPORT uint64 (*pg_popcount_masked_optimized) (const char *buf, int bytes, bits8 mask);
+extern PGDLLIMPORT uint64 (*pg_popcount_masked_optimized) (const char *buf, int bytes, uint8 mask);
#else
/* Use a portable implementation -- no need for a function pointer. */
extern uint64 pg_popcount_optimized(const char *buf, int bytes);
-extern uint64 pg_popcount_masked_optimized(const char *buf, int bytes, bits8 mask);
+extern uint64 pg_popcount_masked_optimized(const char *buf, int bytes, uint8 mask);
#endif
* it's likely to be faster.
*/
static inline uint64
-pg_popcount_masked(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked(const char *buf, int bytes, uint8 mask)
{
/*
* We set the threshold to the point at which we'll first use special
char nuls[2]; /* always \0\0 */
uint16 len; /* size of this chunk (counts data only) */
int32 pid; /* writer's pid */
- bits8 flags; /* bitmask of PIPE_PROTO_* */
+ uint8 flags; /* bitmask of PIPE_PROTO_* */
char data[FLEXIBLE_ARRAY_MEMBER]; /* data payload starts here */
} PipeProtoHeader;
typedef struct ReorderBufferTXN
{
/* See above */
- bits32 txn_flags;
+ uint32 txn_flags;
/* The transaction's transaction id, can be a toplevel or sub xid. */
TransactionId xid;
* can't reload the config file safely, so checkpointer updates this value
* as needed. Protected by SyncRepLock.
*/
- bits8 sync_standbys_status;
+ uint8 sync_standbys_status;
/* used as a registry of physical / logical walsenders to wake */
ConditionVariable wal_flush_cv;
{
MemoryContext mcontext; /* where all the temp stuff is kept */
char *data; /* accumulated data */
- bits8 *nullbitmap; /* bitmap of is-null flags, or NULL if none */
+ uint8 *nullbitmap; /* bitmap of is-null flags, or NULL if none */
int abytes; /* allocated length of "data" */
int nbytes; /* number of bytes used so far */
int aitems; /* allocated length of bitmap (in elements) */
#define ARR_NULLBITMAP(a) \
(ARR_HASNULL(a) ? \
- (bits8 *) (((char *) (a)) + sizeof(ArrayType) + \
+ (uint8 *) (((char *) (a)) + sizeof(ArrayType) + \
2 * sizeof(int) * ARR_NDIM(a)) \
- : (bits8 *) NULL)
+ : (uint8 *) NULL)
/*
* The total array header size (in bytes) for an array with the specified
ExprState *exprstate, ExprContext *econtext,
Oid retType, ArrayMapState *amstate);
-extern void array_bitmap_copy(bits8 *destbitmap, int destoffset,
- const bits8 *srcbitmap, int srcoffset,
+extern void array_bitmap_copy(uint8 *destbitmap, int destoffset,
+ const uint8 *srcbitmap, int srcoffset,
int nitems);
extern ArrayType *construct_array(Datum *elems, int nelems,
/* Fields used when we have a flat array */
char *dataptr; /* Current spot in the data area */
- bits8 *bitmapptr; /* Current byte of the nulls bitmap, or NULL */
+ uint8 *bitmapptr; /* Current byte of the nulls bitmap, or NULL */
int bitmask; /* mask for current bit in nulls bitmap */
/* Fields used in both cases: data about array's element type */
#define FORMAT_TYPE_ALLOW_INVALID 0x02 /* allow invalid types */
#define FORMAT_TYPE_FORCE_QUALIFY 0x04 /* force qualification of type */
#define FORMAT_TYPE_INVALID_AS_NULL 0x08 /* NULL if undefined */
-extern char *format_type_extended(Oid type_oid, int32 typemod, bits16 flags);
+extern char *format_type_extended(Oid type_oid, int32 typemod, uint16 flags);
extern char *format_type_be(Oid type_oid);
extern char *format_type_be_qualified(Oid type_oid);
#define PGSTAT_BACKEND_FLUSH_WAL (1 << 1) /* Flush WAL statistics */
#define PGSTAT_BACKEND_FLUSH_ALL (PGSTAT_BACKEND_FLUSH_IO | PGSTAT_BACKEND_FLUSH_WAL)
-extern bool pgstat_flush_backend(bool nowait, bits32 flags);
+extern bool pgstat_flush_backend(bool nowait, uint32 flags);
extern bool pgstat_backend_flush_cb(bool nowait);
extern void pgstat_backend_reset_timestamp_cb(PgStatShared_Common *header,
TimestampTz ts);
/* Control flags for format_procedure_extended */
#define FORMAT_PROC_INVALID_AS_NULL 0x01 /* NULL if undefined */
#define FORMAT_PROC_FORCE_QUALIFY 0x02 /* force qualification */
-extern char *format_procedure_extended(Oid procedure_oid, bits16 flags);
+extern char *format_procedure_extended(Oid procedure_oid, uint16 flags);
/* Control flags for format_operator_extended */
#define FORMAT_OPERATOR_INVALID_AS_NULL 0x01 /* NULL if undefined */
#define FORMAT_OPERATOR_FORCE_QUALIFY 0x02 /* force qualification */
-extern char *format_operator_extended(Oid operator_oid, bits16 flags);
+extern char *format_operator_extended(Oid operator_oid, uint16 flags);
extern List *stringToQualifiedNameList(const char *string, Node *escontext);
extern char *format_procedure(Oid procedure_oid);
extern char *pg_get_indexdef_string(Oid indexrelid);
extern char *pg_get_indexdef_columns(Oid indexrelid, bool pretty);
extern char *pg_get_indexdef_columns_extended(Oid indexrelid,
- bits16 flags);
+ uint16 flags);
extern char *pg_get_querydef(Query *query, bool pretty);
extern char *pg_get_partkeydef_columns(Oid relid, bool pretty);
#include "fmgr.h"
/*
- * Modeled on varlena from c.h, but data type is bits8.
+ * Modeled on varlena from c.h, but data type is uint8.
*
* Caution: if bit_len is not a multiple of BITS_PER_BYTE, the low-order
* bits of the last byte of bit_dat[] are unused and MUST be zeroes.
{
int32 vl_len_; /* varlena header (do not touch directly!) */
int32 bit_len; /* number of valid bits */
- bits8 bit_dat[FLEXIBLE_ARRAY_MEMBER]; /* bit string, most sig. byte
+ uint8 bit_dat[FLEXIBLE_ARRAY_MEMBER]; /* bit string, most sig. byte
* first */
} VarBit;
*/
#define VARBITMAXLEN (INT_MAX - BITS_PER_BYTE + 1)
/* pointer beyond the end of the bit string (like end() in STL containers) */
-#define VARBITEND(PTR) (((bits8 *) (PTR)) + VARSIZE(PTR))
+#define VARBITEND(PTR) (((uint8 *) (PTR)) + VARSIZE(PTR))
/* Mask that will cover exactly one byte, i.e. BITS_PER_BYTE bits */
#define BITMASK 0xFF
static PyObject *PLyObject_FromTransform(PLyDatumToOb *arg, Datum d);
static PyObject *PLyList_FromArray(PLyDatumToOb *arg, Datum d);
static PyObject *PLyList_FromArray_recurse(PLyDatumToOb *elm, int *dims, int ndim, int dim,
- char **dataptr_p, bits8 **bitmap_p, int *bitmask_p);
+ char **dataptr_p, uint8 **bitmap_p, int *bitmask_p);
static PyObject *PLyDict_FromComposite(PLyDatumToOb *arg, Datum d);
static PyObject *PLyDict_FromTuple(PLyDatumToOb *arg, HeapTuple tuple, TupleDesc desc, bool include_generated);
int ndim;
int *dims;
char *dataptr;
- bits8 *bitmap;
+ uint8 *bitmap;
int bitmask;
if (ARR_NDIM(array) == 0)
static PyObject *
PLyList_FromArray_recurse(PLyDatumToOb *elm, int *dims, int ndim, int dim,
- char **dataptr_p, bits8 **bitmap_p, int *bitmask_p)
+ char **dataptr_p, uint8 **bitmap_p, int *bitmask_p)
{
int i;
PyObject *list;
* for this slice.
*/
char *dataptr = *dataptr_p;
- bits8 *bitmap = *bitmap_p;
+ uint8 *bitmap = *bitmap_p;
int bitmask = *bitmask_p;
uint8 typalignby = typalign_to_alignby(elm->typalign);
* Returns the number of 1-bits in buf after applying the mask to each byte
*/
uint64
-pg_popcount_masked_portable(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked_portable(const char *buf, int bytes, uint8 mask)
{
uint64 popcnt = 0;
* Returns the number of 1-bits in buf after applying the mask to each byte
*/
uint64
-pg_popcount_masked_optimized(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked_optimized(const char *buf, int bytes, uint8 mask)
{
return pg_popcount_masked_portable(buf, bytes, mask);
}
* versions.
*/
static uint64 pg_popcount_neon(const char *buf, int bytes);
-static uint64 pg_popcount_masked_neon(const char *buf, int bytes, bits8 mask);
+static uint64 pg_popcount_masked_neon(const char *buf, int bytes, uint8 mask);
#ifdef USE_SVE_POPCNT_WITH_RUNTIME_CHECK
* These are the SVE implementations of the popcount functions.
*/
static uint64 pg_popcount_sve(const char *buf, int bytes);
-static uint64 pg_popcount_masked_sve(const char *buf, int bytes, bits8 mask);
+static uint64 pg_popcount_masked_sve(const char *buf, int bytes, uint8 mask);
/*
* The function pointers are initially set to "choose" functions. These
* caller's request.
*/
static uint64 pg_popcount_choose(const char *buf, int bytes);
-static uint64 pg_popcount_masked_choose(const char *buf, int bytes, bits8 mask);
+static uint64 pg_popcount_masked_choose(const char *buf, int bytes, uint8 mask);
uint64 (*pg_popcount_optimized) (const char *buf, int bytes) = pg_popcount_choose;
-uint64 (*pg_popcount_masked_optimized) (const char *buf, int bytes, bits8 mask) = pg_popcount_masked_choose;
+uint64 (*pg_popcount_masked_optimized) (const char *buf, int bytes, uint8 mask) = pg_popcount_masked_choose;
static inline bool
pg_popcount_sve_available(void)
}
static uint64
-pg_popcount_masked_choose(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked_choose(const char *buf, int bytes, uint8 mask)
{
choose_popcount_functions();
return pg_popcount_masked_optimized(buf, bytes, mask);
*/
pg_attribute_target("arch=armv8-a+sve")
static uint64
-pg_popcount_masked_sve(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked_sve(const char *buf, int bytes, uint8 mask)
{
svbool_t pred = svptrue_b64();
svuint64_t accum1 = svdup_u64(0),
}
uint64
-pg_popcount_masked_optimized(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked_optimized(const char *buf, int bytes, uint8 mask)
{
return pg_popcount_masked_neon(buf, bytes, mask);
}
* Returns number of 1 bits in buf after applying the mask to each byte
*/
static uint64
-pg_popcount_masked_neon(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked_neon(const char *buf, int bytes, uint8 mask)
{
uint8x16_t vec,
maskv = vdupq_n_u8(mask);
* follow than "popcnt" for these names.
*/
static uint64 pg_popcount_sse42(const char *buf, int bytes);
-static uint64 pg_popcount_masked_sse42(const char *buf, int bytes, bits8 mask);
+static uint64 pg_popcount_masked_sse42(const char *buf, int bytes, uint8 mask);
/*
* These are the AVX-512 implementations of the popcount functions.
*/
#ifdef USE_AVX512_POPCNT_WITH_RUNTIME_CHECK
static uint64 pg_popcount_avx512(const char *buf, int bytes);
-static uint64 pg_popcount_masked_avx512(const char *buf, int bytes, bits8 mask);
+static uint64 pg_popcount_masked_avx512(const char *buf, int bytes, uint8 mask);
#endif /* USE_AVX512_POPCNT_WITH_RUNTIME_CHECK */
/*
* caller's request.
*/
static uint64 pg_popcount_choose(const char *buf, int bytes);
-static uint64 pg_popcount_masked_choose(const char *buf, int bytes, bits8 mask);
+static uint64 pg_popcount_masked_choose(const char *buf, int bytes, uint8 mask);
uint64 (*pg_popcount_optimized) (const char *buf, int bytes) = pg_popcount_choose;
-uint64 (*pg_popcount_masked_optimized) (const char *buf, int bytes, bits8 mask) = pg_popcount_masked_choose;
+uint64 (*pg_popcount_masked_optimized) (const char *buf, int bytes, uint8 mask) = pg_popcount_masked_choose;
#ifdef USE_AVX512_POPCNT_WITH_RUNTIME_CHECK
}
static uint64
-pg_popcount_masked_choose(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked_choose(const char *buf, int bytes, uint8 mask)
{
choose_popcount_functions();
return pg_popcount_masked(buf, bytes, mask);
*/
pg_attribute_target("avx512vpopcntdq,avx512bw")
static uint64
-pg_popcount_masked_avx512(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked_avx512(const char *buf, int bytes, uint8 mask)
{
__m512i val,
vmasked,
*/
pg_attribute_no_sanitize_alignment()
static uint64
-pg_popcount_masked_sse42(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked_sse42(const char *buf, int bytes, uint8 mask)
{
uint64 popcnt = 0;
uint64 maskv = ~UINT64CONST(0) / 0xFF * mask;
Oid dboid;
Oid roleoid;
char *p;
- bits32 flags = 0;
+ uint32 flags = 0;
table = palloc_object(worktable);
sprintf(name, "schema%d", index);
p += sizeof(Oid);
memcpy(&roleoid, p, sizeof(Oid));
p += sizeof(Oid);
- memcpy(&flags, p, sizeof(bits32));
+ memcpy(&flags, p, sizeof(uint32));
/* Establish signal handlers before unblocking signals. */
pqsignal(SIGHUP, SignalHandlerForConfigReload);
BgwHandleStatus status;
pid_t pid;
char *p;
- bits32 flags = 0;
+ uint32 flags = 0;
ArrayType *arr = PG_GETARG_ARRAYTYPE_P(3);
Size ndim;
int nelems;
p += sizeof(Oid);
memcpy(p, &roleoid, sizeof(Oid));
p += sizeof(Oid);
- memcpy(p, &flags, sizeof(bits32));
+ memcpy(p, &flags, sizeof(uint32));
if (!RegisterDynamicBackgroundWorker(&worker, &handle))
PG_RETURN_NULL();
binaryheap
binaryheap_comparator
bitmapword
-bits16
-bits32
-bits8
blockreftable_hash
blockreftable_iterator
bloom_filter