veil_datatypes.h File Reference


Detailed Description

Define all Veil public datatypes.

     Author:       Marc Munro
     Copyright (c) 2005, 2006 Marc Munro
     License:      BSD
 $Id: veil_datatypes.h,v 1.5 2007/07/31 22:18:27 bloodnok Exp $

Definition in file veil_datatypes.h.

#include "utils/hsearch.h"
#include "storage/lwlock.h"

Include dependency graph for veil_datatypes.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  MemChunk
struct  Object
struct  ShmemCtl
struct  Int4Var
struct  Range
struct  Bitmap
struct  BitmapRef
struct  BitmapArray
struct  BitmapHash
struct  Int4Array
struct  VarEntry
struct  veil_variable_t

Defines

#define VEIL_DATATYPES   1
#define VEIL_DEBUG   1
#define DBG_CANARY   0xca96ca96
#define DBG_CANARY_ENTRY   int32 canary;
#define DBG_ELEMS_ENTRY   int32 dbgelems;
#define DBG_SET_ELEMS(x, y)   (x).dbgelems = y
#define DBG_SET_CANARY(x)   (x).canary = DBG_CANARY
#define DBG_TEST_CANARY(x)
#define EMPTY   1
#define DBG_SET_TRAILER(x, y)   (x).y[(x).dbgelems] = DBG_CANARY;
#define DBG_TEST_TRAILER(x, y)
#define DBG_CHECK_INDEX(x, i)
#define HASH_KEYLEN   60

Enumerations

enum  ObjType {
  OBJ_UNDEFINED = 0, OBJ_SHMEMCTL, OBJ_INT4, OBJ_RANGE,
  OBJ_BITMAP, OBJ_BITMAP_ARRAY, OBJ_BITMAP_HASH, OBJ_BITMAP_REF,
  OBJ_INT4_ARRAY, OBJ_UNDEFINED = 0, OBJ_SHMEMCTL, OBJ_INT4,
  OBJ_RANGE, OBJ_BITMAP, OBJ_BITMAP_ARRAY, OBJ_BITMAP_HASH,
  OBJ_BITMAP_REF, OBJ_INT4_ARRAY
}


Define Documentation

#define DBG_CANARY   0xca96ca96

Value to be set in sacrificial "canary" fields. If this value is not as expected, the canaryu has been killed by something inappropriately stomping on memory.

Definition at line 32 of file veil_datatypes.h.

#define DBG_CANARY_ENTRY   int32 canary;

Defines a canary element in a data structure.

Definition at line 37 of file veil_datatypes.h.

#define DBG_CHECK_INDEX ( x,
 ) 

Value:

if (i >= (x).dbgelems) {\
        elog(ERROR, "Element index out of range %d", i); }
Check whether an array index is in bounds.

Definition at line 83 of file veil_datatypes.h.

Referenced by vl_BitmapSetbit().

#define DBG_ELEMS_ENTRY   int32 dbgelems;

Field to record the size of an array so that its canary element can be found.

Definition at line 43 of file veil_datatypes.h.

#define DBG_SET_CANARY (  )     (x).canary = DBG_CANARY

Code to initialise a canary.

Definition at line 54 of file veil_datatypes.h.

Referenced by vl_NewBitmap().

#define DBG_SET_ELEMS ( x,
 )     (x).dbgelems = y

Code to records the size of an array so that its canary element can be found.

Definition at line 49 of file veil_datatypes.h.

Referenced by vl_NewBitmap().

#define DBG_SET_TRAILER ( x,
 )     (x).y[(x).dbgelems] = DBG_CANARY;

Set a trailing canary in an array.

Definition at line 72 of file veil_datatypes.h.

Referenced by vl_NewBitmap().

#define DBG_TEST_CANARY (  ) 

Value:

if ((x).canary != DBG_CANARY) {\
        elog(ERROR, "canary fault"); }
Code to test for a canary having been overwritten.

Definition at line 59 of file veil_datatypes.h.

Referenced by vl_BitmapSetbit(), vl_ClearBitmapArray(), and vl_NewBitmap().

#define DBG_TEST_TRAILER ( x,
 ) 

Value:

if ((x).y[(x).dbgelems] != DBG_CANARY) {\
        elog(ERROR, "trailing canary fault"); }
Test the trailing canary in an array.

Definition at line 77 of file veil_datatypes.h.

Referenced by vl_BitmapSetbit(), and vl_NewBitmap().

#define EMPTY   1

Base size for an array containing a canary. This is zero if VEIL_DEBUG is not defined, iw when this is defined arrays will be one element longer to allow a canary to be placed at the end of the array.

Definition at line 67 of file veil_datatypes.h.

#define HASH_KEYLEN   60

The key length for veil hash types.

Definition at line 121 of file veil_datatypes.h.

Referenced by create_session_hash(), and create_shared_hash().

#define VEIL_DEBUG   1

Enables various debugging constructs, such as canaries, in code and data structures. If such debugging is required, define VEIL_DEBUG in the make invocation, eg: "make VEIL_DEBUG=1".

Definition at line 23 of file veil_datatypes.h.


Enumeration Type Documentation

enum ObjType

Describes the type of an Object record or one of its subtypes.

Definition at line 127 of file veil_datatypes.h.


Generated on Tue Mar 11 10:08:37 2008 for Veil by  doxygen 1.5.4