veil_funcs.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "veil_datatypes.h"
00014 #include "fmgr.h"
00015
00016
00017 extern void *vl_malloc(size_t size);
00018 char *vl_ObjTypeName(ObjType obj);
00019
00020
00021
00022 extern VarEntry *vl_lookup_shared_variable(char *name);
00023 extern VarEntry *vl_lookup_variable(char *name);
00024 extern veil_variable_t *vl_next_variable(veil_variable_t *prev);
00025 extern void vl_ClearInt4Array(Int4Array *array);
00026 extern Int4Array *vl_NewInt4Array(Int4Array *current, bool shared,
00027 int32 min, int32 max);
00028 extern void vl_Int4ArraySet(Int4Array *array, int32 idx, int32 value);
00029 extern int32 vl_Int4ArrayGet(Int4Array *array, int32 idx);
00030
00031
00032
00033 extern Range *vl_NewRange(bool shared);
00034 extern Int4Var *vl_NewInt4(bool shared);
00035
00036
00037 extern void vl_ClearBitmap(Bitmap *bitmap);
00038 extern void vl_NewBitmap(Bitmap **p_bitmap, bool shared, int32 min, int32 max);
00039 extern void vl_BitmapSetbit(Bitmap *bitmap, int32 bit);
00040 extern void vl_BitmapClearbit(Bitmap *bitmap, int32 bit);
00041 extern bool vl_BitmapTestbit(Bitmap *bitmap, int32 bit);
00042 extern void vl_BitmapUnion(Bitmap *target, Bitmap *source);
00043 extern void vl_BitmapIntersect(Bitmap *target, Bitmap *source);
00044 extern int32 vl_BitmapNextBit(Bitmap *bitmap, int32 bit, bool *found);
00045 extern Bitmap *vl_BitmapFromArray(BitmapArray *bmarray, int32 elem);
00046 extern void vl_ClearBitmapArray(BitmapArray *bmarray);
00047 extern void vl_NewBitmapArray(BitmapArray **p_bmarray, bool shared,
00048 int32 arrayzero, int32 arraymax,
00049 int32 bitzero, int32 bitmax);
00050 extern VarEntry *vl_NextHashEntry(HTAB *hash, VarEntry *prev);
00051 extern void vl_NewBitmapHash(BitmapHash **p_bmhash, char *name,
00052 int32 bitzero, int32 bitmax);
00053 extern Bitmap *vl_BitmapFromHash(BitmapHash *bmhash, char *hashelem);
00054 extern Bitmap *vl_AddBitmapToHash(BitmapHash *bmhash, char *hashelem);
00055 extern bool vl_BitmapHashHasKey(BitmapHash *bmhash, char *hashelem);
00056
00057
00058 extern HTAB *vl_get_shared_hash(void);
00059 extern bool vl_prepare_context_switch(void);
00060 extern bool vl_complete_context_switch(void);
00061 extern void vl_force_context_switch(void);
00062 extern void *vl_shmalloc(size_t size);
00063 extern void vl_free(void *mem);
00064 extern void _PG_init(void);
00065
00066
00067 extern int vl_spi_connect(bool *p_pushed);
00068 extern int vl_spi_finish(bool pushed);
00069 extern bool vl_bool_from_query(const char *qry, bool *result);
00070 extern bool vl_db_exists(Oid db_id);
00071 extern int vl_call_init_fns(bool param);
00072
00073
00074 extern void veil_config_init(void);
00075 extern void veil_load_config(void);
00076 extern int veil_shared_hash_elems(void);
00077 extern int veil_dbs_in_cluster(void);
00078 extern int veil_shmem_context_size(void);
00079
00080
00081
00082 extern void vl_type_mismatch(char *name, ObjType expected, ObjType got);
00083 extern Datum veil_variables(PG_FUNCTION_ARGS);
00084 extern Datum veil_share(PG_FUNCTION_ARGS);
00085 extern Datum veil_init_range(PG_FUNCTION_ARGS);
00086 extern Datum veil_range(PG_FUNCTION_ARGS);
00087 extern Datum veil_init_bitmap(PG_FUNCTION_ARGS);
00088 extern Datum veil_clear_bitmap(PG_FUNCTION_ARGS);
00089 extern Datum veil_bitmap_setbit(PG_FUNCTION_ARGS);
00090 extern Datum veil_bitmap_clearbit(PG_FUNCTION_ARGS);
00091 extern Datum veil_bitmap_testbit(PG_FUNCTION_ARGS);
00092 extern Datum veil_bitmap_union(PG_FUNCTION_ARGS);
00093 extern Datum veil_bitmap_intersect(PG_FUNCTION_ARGS);
00094 extern Datum veil_bitmap_bits(PG_FUNCTION_ARGS);
00095 extern Datum veil_bitmap_range(PG_FUNCTION_ARGS);
00096 extern Datum veil_init_bitmap_array(PG_FUNCTION_ARGS);
00097 extern Datum veil_clear_bitmap_array(PG_FUNCTION_ARGS);
00098 extern Datum veil_bitmap_from_array(PG_FUNCTION_ARGS);
00099 extern Datum veil_bitmap_array_testbit(PG_FUNCTION_ARGS);
00100 extern Datum veil_bitmap_array_setbit(PG_FUNCTION_ARGS);
00101 extern Datum veil_bitmap_array_clearbit(PG_FUNCTION_ARGS);
00102 extern Datum veil_union_from_bitmap_array(PG_FUNCTION_ARGS);
00103 extern Datum veil_intersect_from_bitmap_array(PG_FUNCTION_ARGS);
00104 extern Datum veil_bitmap_array_bits(PG_FUNCTION_ARGS);
00105 extern Datum veil_bitmap_array_arange(PG_FUNCTION_ARGS);
00106 extern Datum veil_bitmap_array_brange(PG_FUNCTION_ARGS);
00107 extern Datum veil_init_bitmap_hash(PG_FUNCTION_ARGS);
00108 extern Datum veil_clear_bitmap_hash(PG_FUNCTION_ARGS);
00109 extern Datum veil_bitmap_hash_key_exists(PG_FUNCTION_ARGS);
00110 extern Datum veil_bitmap_from_hash(PG_FUNCTION_ARGS);
00111 extern Datum veil_bitmap_hash_testbit(PG_FUNCTION_ARGS);
00112 extern Datum veil_bitmap_hash_setbit(PG_FUNCTION_ARGS);
00113 extern Datum veil_bitmap_hash_clearbit(PG_FUNCTION_ARGS);
00114 extern Datum veil_union_into_bitmap_hash(PG_FUNCTION_ARGS);
00115 extern Datum veil_union_from_bitmap_hash(PG_FUNCTION_ARGS);
00116 extern Datum veil_intersect_from_bitmap_hash(PG_FUNCTION_ARGS);
00117 extern Datum veil_bitmap_hash_bits(PG_FUNCTION_ARGS);
00118 extern Datum veil_bitmap_hash_entries(PG_FUNCTION_ARGS);
00119 extern Datum veil_bitmap_from_hash(PG_FUNCTION_ARGS);
00120 extern Datum veil_bitmap_hash_range(PG_FUNCTION_ARGS);
00121 extern Datum veil_int4_set(PG_FUNCTION_ARGS);
00122 extern Datum veil_int4_get(PG_FUNCTION_ARGS);
00123 extern Datum veil_init_int4array(PG_FUNCTION_ARGS);
00124 extern Datum veil_clear_int4array(PG_FUNCTION_ARGS);
00125 extern Datum veil_int4array_set(PG_FUNCTION_ARGS);
00126 extern Datum veil_int4array_get(PG_FUNCTION_ARGS);
00127 extern Datum veil_init(PG_FUNCTION_ARGS);
00128 extern Datum veil_perform_reset(PG_FUNCTION_ARGS);
00129 extern Datum veil_force_reset(PG_FUNCTION_ARGS);
00130 extern Datum veil_version(PG_FUNCTION_ARGS);
00131 extern Datum veil_serialise(PG_FUNCTION_ARGS);
00132 extern Datum veil_deserialise(PG_FUNCTION_ARGS);
00133
00134
00135
00136 extern char *vl_serialise_var(char *name);
00137 extern int4 vl_deserialise(char **p_stream);
00138 extern VarEntry *vl_deserialise_next(char **p_stream);