veil_datatypes.c

Go to the documentation of this file.
00001 /**
00002  * @file   veil_datatypes.c
00003  * \code
00004  *     Author:       Marc Munro
00005  *     Copyright (c) 2005, 2006 Marc Munro
00006  *     License:      BSD
00007  * $Id: veil_datatypes.c,v 1.3 2006/10/04 15:50:09 bloodnok Exp $
00008  * \endcode
00009  * @brief  
00010  * Code for non-bitmap datatypes.
00011  * 
00012  */
00013 
00014 #include "postgres.h"
00015 #include "veil_datatypes.h"
00016 #include "veil_funcs.h"
00017 
00018 
00019 /** 
00020  * Create a new session or shared ::Range object.
00021  * 
00022  * @param shared Whether the object is to be created in shared (true) or
00023  * session (false) memory.
00024  * 
00025  * @return Pointer to newly created object.
00026  */
00027 Range *
00028 vl_NewRange(bool shared)
00029 {
00030     Range *range;
00031 
00032     if (shared) {
00033         range = vl_shmalloc(sizeof(Range));
00034     }
00035     else {
00036         range = vl_malloc(sizeof(Range));
00037     }
00038 
00039     range->type = OBJ_RANGE;
00040     return range;
00041 }
00042 
00043 /** 
00044  * Create a new session or shared ::Int4Var object.
00045  * 
00046  * @param shared Whether the object is to be created in shared (true) or
00047  * session (false) memory.
00048  * 
00049  * @return Pointer to newly created object.
00050  */
00051 Int4Var *
00052 vl_NewInt4(bool shared)
00053 {
00054     Int4Var *i4v;
00055 
00056     if (shared) {
00057         i4v = vl_shmalloc(sizeof(Int4Var));
00058     }
00059     else {
00060         i4v = vl_malloc(sizeof(Int4Var));
00061     }
00062     i4v->type = OBJ_INT4;
00063     i4v->isnull = true;
00064     return i4v;
00065 }
00066 

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