27 int32 min, int32 max);
48 int32 arrayzero, int32 arraymax,
49 int32 bitzero, int32 bitmax);
52 int32 bitzero, int32 bitmax);
127 extern Datum
veil_init(PG_FUNCTION_ARGS);
Datum veil_init_bitmap_array(PG_FUNCTION_ARGS)
veil_init_bitmap_array(text, text, text) returns bool Create or reset a BitmapArray.
veil_variable_t * vl_next_variable(veil_variable_t *prev)
Return the next variable from a scan of the hash of variables.
Datum veil_bitmap_array_arange(PG_FUNCTION_ARGS)
veil_bitmap_array_arange(bmarray text) returns veil_range_t Return composite type giving the range of...
Datum veil_bitmap_array_setbit(PG_FUNCTION_ARGS)
veil_bitmap_array_setbit(bmarray text, arr_idx int4, bitno int4) returns bool Set a specified bit wit...
Bitmap * vl_BitmapFromHash(BitmapHash *bmhash, char *hashelem)
Return a specified Bitmap from a BitmapHash.
Subtype of Object for storing arrays of integers.
Int4Var * vl_NewInt4(bool shared)
Create a new session or shared Int4Var object.
Subtype of Object for storing bitmaps.
Bitmap * vl_BitmapFromArray(BitmapArray *bmarray, int32 elem)
Return a specified Bitmap from a BitmapArray.
Datum veil_init_int4array(PG_FUNCTION_ARGS)
veil_init_int4array(arrayname text, range text) returns bool Initialise an Int4Array variable...
Subtype of Object for storing simple int4 values.
VarEntry * vl_NextHashEntry(HTAB *hash, VarEntry *prev)
Utility function for scanning the hash table of a BitmapHash.
HTAB * vl_get_shared_hash(void)
Return the shared hash for the current context.
Describes a veil shared or session variable.
bool vl_bool_from_query(const char *qry, bool *result)
Executes a query that returns a single bool value.
VarEntry * vl_lookup_shared_variable(char *name)
Define a new, or attach to an existing, shared variable.
Datum veil_bitmap_intersect(PG_FUNCTION_ARGS)
veil_bitmap_intersect(result_name text, name2 text) returns bool Intersect the bitmap specified in pa...
Datum veil_clear_bitmap(PG_FUNCTION_ARGS)
veil_clear_bitmap(name text) returns bool Clear all bits in the specified Bitmap. ...
void vl_ClearBitmap(Bitmap *bitmap)
Clear all bits in a Bitmap.
Datum veil_bitmap_clearbit(PG_FUNCTION_ARGS)
veil_bitmap_clearbit(name int4, bit_number text) returns bool Clear the specified bit in the specifie...
void vl_BitmapClearbit(Bitmap *bitmap, int32 bit)
Clear a bit within a Bitmap.
int32 vl_Int4ArrayGet(Int4Array *array, int32 idx)
Get an entry from an Int4Array.
void vl_BitmapSetbit(Bitmap *bitmap, int32 bit)
Set a bit within a Bitmap.
Datum veil_union_from_bitmap_hash(PG_FUNCTION_ARGS)
veil_union_from_bitmap_hash(bmhash text, key text, bitmap text) returns bool Union a Bitmap with the ...
Datum veil_version(PG_FUNCTION_ARGS)
veil_version() returns text Return a string describing this version of veil.
VarEntry * vl_lookup_variable(char *name)
Lookup a variable by name, creating it as as a session variable if it does not already exist...
Datum veil_bitmap_bits(PG_FUNCTION_ARGS)
veil_bitmap_bits(name text) returns setof int4 Return the set of all bits set in the specified Bitmap...
Datum veil_clear_int4array(PG_FUNCTION_ARGS)
veil_clear_int4array(name text) returns bool Clear an Int4Array variable.
char * vl_serialise_var(char *name)
Serialise a veil variable.
void vl_NewBitmapArray(BitmapArray **p_bmarray, bool shared, int32 arrayzero, int32 arraymax, int32 bitzero, int32 bitmax)
Return a newly initialised (empty) BitmapArray.
bool vl_BitmapHashHasKey(BitmapHash *bmhash, char *hashelem)
Determine whether the supplied key exists in the BitmapHash.
Range * vl_NewRange(bool shared)
Create a new session or shared Range object.
Datum veil_bitmap_from_array(PG_FUNCTION_ARGS)
veil_bitmap_from_array(bmref text, bmarray text, index int4) returns text Place a reference to the sp...
Datum veil_bitmap_setbit(PG_FUNCTION_ARGS)
veil_bitmap_setbit(name text, bit_number int4) returns bool Set the specified bit in the specified Bi...
Datum veil_serialise(PG_FUNCTION_ARGS)
veil_serialise(varname text) returns text Return a string representing the contents of our variable...
void _PG_init(void)
Veil's startup function.
Datum veil_bitmap_testbit(PG_FUNCTION_ARGS)
veil_bitmap_testbit(name text, bit_number int4) returns bool Test the specified bit in the specified ...
Datum veil_bitmap_array_testbit(PG_FUNCTION_ARGS)
veil_bitmap_array_testbit(bmarray text, arr_idx int4, bitno int4) returns bool Test a specified bit w...
Datum veil_variables(PG_FUNCTION_ARGS)
veil_variables() returns setof veil_variable_t Return a veil_variable_t record for each defined varia...
void vl_NewBitmapHash(BitmapHash **p_bmhash, char *name, int32 bitzero, int32 bitmax)
Return a newly initialised (empty) BitmapHash.
void vl_free(void *mem)
Free a piece of shared memory within the current context.
bool vl_prepare_context_switch(void)
Prepare for a switch to the alternate context.
Datum veil_bitmap_range(PG_FUNCTION_ARGS)
veil_bitmap_range(name text) returns veil_range_t Return composite type giving the range of the speci...
int32 vl_BitmapNextBit(Bitmap *bitmap, int32 bit, bool *found)
Return the next set bit in the Bitmap.
Datum veil_force_reset(PG_FUNCTION_ARGS)
veil_force_reset() returns bool Reset veil shared memory for this database, ignoring existing transac...
Datum veil_bitmap_array_bits(PG_FUNCTION_ARGS)
veil_bitmap_array_bits(bmarray text, arr_idx int4) returns setof int4 Return the set of all bits set ...
int vl_spi_finish(bool pushed)
Reciprocal function for vl_spi_connect()
Datum veil_bitmap_hash_testbit(PG_FUNCTION_ARGS)
veil_bitmap_hash_testbit(bmhash text, key text, bitno int4) returns bool Test a specified bit within ...
Datum veil_bitmap_union(PG_FUNCTION_ARGS)
veil_bitmap_union(result_name text, name2 text) returns bool Union the bitmap specified in parameter ...
Subtype of Object for storing bitmap hashes.
Datum veil_init_range(PG_FUNCTION_ARGS)
veil_init_range(name text, min int4, max int4) returns int4 Initialise a Range variable called NAME c...
Datum veil_clear_bitmap_hash(PG_FUNCTION_ARGS)
veil_clear_bitmap_hash(bmhash text) returns bool Clear the bits in an existing BitmapHash.
Datum veil_bitmap_hash_bits(PG_FUNCTION_ARGS)
veil_bitmap_hash_bits(bmhash text, key text) returns setof int4 Return the set of all bits set in the...
ObjType
Describes the type of an Object record or one of its subtypes.
void vl_ClearInt4Array(Int4Array *array)
Reset all Int4 entries in an Int4Array (to zero).
void vl_type_mismatch(char *name, ObjType expected, ObjType got)
Report, by raising an error, a type mismatch between the expected and actual type of a VarEntry varia...
Int4Array * vl_NewInt4Array(Int4Array *current, bool shared, int32 min, int32 max)
Return a newly initialised (zeroed) Int4Array.
Datum veil_init(PG_FUNCTION_ARGS)
veil_init(doing_reset bool) returns bool Initialise or reset a veil session.
Datum veil_int4_get(PG_FUNCTION_ARGS)
veil_int4_get(name text) returns int4 Return the value of an Int4Var variable.
Datum veil_bitmap_hash_key_exists(PG_FUNCTION_ARGS)
veil_bitmap_hashkey_exists(bmhash text, key text) returns bool Return true if the key exists in the b...
Subtype of Object for storing range values.
bool vl_BitmapTestbit(Bitmap *bitmap, int32 bit)
Test a bit within a Bitmap.
void * vl_shmalloc(size_t size)
Dynamically allocate a piece of shared memory from the current context.
void vl_Int4ArraySet(Int4Array *array, int32 idx, int32 value)
Set an entry within an Int4Array.
void vl_force_context_switch(void)
In desparation, if we are unable to complete a context switch, we should use this function...
Datum veil_bitmap_array_brange(PG_FUNCTION_ARGS)
veil_bitmap_array_brange(bmarray text) returns veil_range_t Return composite type giving the range of...
Datum veil_range(PG_FUNCTION_ARGS)
veil_range(name text) returns veil_range_t Return the range (as a SQL veil_range_t composite type) fr...
Datum veil_int4array_set(PG_FUNCTION_ARGS)
veil_int4array_set(array text, idx int4, value int4) returns int4 Set an Int4Array entry...
void * vl_malloc(size_t size)
Dynamically allocate memory using palloc in TopMemoryContext.
int veil_dbs_in_cluster(void)
Return the number of databases, within the database cluster, that will use Veil.
Datum veil_clear_bitmap_array(PG_FUNCTION_ARGS)
veil_clear_bitmap_array(bmarray text) returns bool Clear the bits in an existing BitmapArray.
Datum veil_intersect_from_bitmap_hash(PG_FUNCTION_ARGS)
veil_intersect_from_bitmap_hash(bitmap text, bmhash text, key text) returns bool Intersect a Bitmap w...
bool vl_db_exists(Oid db_id)
Determine whether the given oid represents an existing database or not.
Datum veil_perform_reset(PG_FUNCTION_ARGS)
veil_perform_reset() returns bool Reset veil shared memory for this database.
int veil_shared_hash_elems(void)
Return the number of entries that should be allocated for shared variables in our shared hashes...
Subtype of Object for storing bitmap arrays.
void vl_BitmapIntersect(Bitmap *target, Bitmap *source)
Create the intersection of two bitmaps, updating the first with the result.
int vl_call_init_fns(bool param)
Identify any registered init_functions and execute them.
Datum veil_bitmap_hash_setbit(PG_FUNCTION_ARGS)
veil_bitmap_hash_setbit(bmhash text, key text, bitno int4) returns bool Set a specified bit within a ...
Datum veil_deserialise(PG_FUNCTION_ARGS)
veil_deserialise(stream text) returns text Create or reset variables based on the output of previous ...
int vl_spi_connect(bool *p_pushed)
If already connected in this session, push the current connection, and get a new one.
Datum veil_int4array_get(PG_FUNCTION_ARGS)
veil_int4array_get(array text, idx int4) returns int4 Get an Int4Array entry.
int32 vl_deserialise(char **p_stream)
De-serialise a base64 string containing, possibly many, derialised veil variables.
Datum veil_bitmap_array_clearbit(PG_FUNCTION_ARGS)
veil_bitmap_array_clearbit(bmarray text, arr_idx int4, bitno int4) returns bool Clear a specified bit...
Datum veil_intersect_from_bitmap_array(PG_FUNCTION_ARGS)
veil_intersect_from_bitmap_array(bitmap text, bmarray text, arr_idx int4) returns bool Intersect a Bi...
void veil_load_config(void)
Retrieve Veil's GUC variables for this session.
Datum veil_init_bitmap(PG_FUNCTION_ARGS)
veil_init_bitmap(bitmap_name text, range_nametext) returns bool Create or re-initialise a Bitmap...
void veil_config_init(void)
Initialise Veil's use of GUC variables.
Datum veil_int4_set(PG_FUNCTION_ARGS)
veil_int4_set(name text,value int4) returns int4 Set an Int4Var variable type to a specified value...
VarEntry * vl_deserialise_next(char **p_stream)
De-serialise the next veil variable from *p_stream.
Datum veil_bitmap_hash_entries(PG_FUNCTION_ARGS)
veil_bitmap_hash_entries(bmhash text) returns setof text Return the key of every Bitmap within the Bi...
Datum veil_bitmap_from_hash(PG_FUNCTION_ARGS)
veil_bitmap_from_hash(bmref text, bmhash text, key text) returns text Place a reference to the specif...
void vl_BitmapUnion(Bitmap *target, Bitmap *source)
Create the union of two bitmaps, updating the first with the result.
Bitmap * vl_AddBitmapToHash(BitmapHash *bmhash, char *hashelem)
Create a newly allocated empty Bitmap to a BitmapHash.
Datum veil_union_from_bitmap_array(PG_FUNCTION_ARGS)
veil_union_from_bitmap_array(bitmap text, bmarray text, arr_idx int4) returns bool Union a Bitmap wit...
Datum veil_bitmap_hash_range(PG_FUNCTION_ARGS)
veil_bitmap_hash_range(bmhash text) returns veil_range_t Return composite type giving the range of ev...
Datum veil_share(PG_FUNCTION_ARGS)
veil_share(name text) returns bool Define a shared variable called NAME, returning true...
bool vl_complete_context_switch(void)
Complete the context switch started by vl_prepare_context_switch().
Datum veil_union_into_bitmap_hash(PG_FUNCTION_ARGS)
veil_union_into_bitmap_hash(bmhash text, key text, bitmap text) returns bool Union a Bitmap with the ...
char * vl_ObjTypeName(ObjType obj)
Return a static string describing an ObjType object.
void vl_ClearBitmapArray(BitmapArray *bmarray)
Clear all bitmaps in the given BitmapArray.
void vl_NewBitmap(Bitmap **p_bitmap, bool shared, int32 min, int32 max)
Return a newly initialised (empty) Bitmap.
Datum veil_init_bitmap_hash(PG_FUNCTION_ARGS)
veil_init_bitmap_hash(bmhash text, range text) returns bool Create or reset a BitmapHash.
Datum veil_bitmap_hash_clearbit(PG_FUNCTION_ARGS)
veil_bitmap_hash_clearbit(bmhash text, key text, bitno int4) returns bool Clear a specified bit withi...
int veil_shmem_context_size(void)
Return the amount of shared memory to be requested for each of the two shared memory contexts...
Define all Veil public datatypes.