/home/dcp1990/prog/fakedbfs/include/fakedbfs/dbspecdata.h File Reference

#include <fakedbfs/types.h>

Go to the source code of this file.

Classes

struct  Heads
struct  EnumSubElem
struct  EnumElem
struct  EnumHead
struct  CatElem
struct  CatalogueHead

Defines

#define HAVE_DBSPECDATA_H   1
#define MAXLINE   2048
#define ALLSUBSTART   6500
#define SUBE_IS_SELF   0x1
#define SUBE_IS_SAMEAS   0x2
#define SUBE_IS_ALLSUB   0x4
#define ENUMH_FROM_DB   0x1
#define CATE_USES_FC   0x1
#define CATH_USES_FC   0x1
#define CATH_FROM_DB   0x2
#define CAT_TABLE_PREFIX   "c_"
#define CAT_FIELD_TABLE_PREFIX   "cft_"
#define ENUM_TABLE_PREFIX   "endef_"
#define OTHER_ELEM_PREFIX   "oth_"

Functions

EnumElemfdbfs_find_elem_by_name (struct EnumElem *h, const char *name)
 Find enum element by name.
CatElemfdbfs_find_catelem_enum (struct CatElem *h, struct EnumHead *en)
 Find catalogue element by enumhead.
char * fdbfs_get_enum_string_by_value (struct EnumElem *h, unsigned int val, short int fmted)
 Search enum list and return name of element with specified value.
EnumSubElemfdbfs_get_subhead_by_enval (struct EnumElem *h, unsigned int val)
 Get subelement head by value in enum.
char * fdbfs_get_enum_sub_string_by_value (struct EnumSubElem *h, unsigned int val)
 Get string in list of enum subelements by value.
CatalogueHeadfdbfs_find_cathead_by_name (struct CatalogueHead *h, const char *name)
 Search list of catalogue heads for a certain name.
CatElemfdbfs_find_catelem_by_name (struct CatElem *h, const char *name)
 Search for catalogue element by name.
EnumHeadfdbfs_find_enumhead_by_name (struct EnumHead *h, const char *name)
 Search for enum head by name.
EnumSubElemfdbfs_copy_sub_list (struct EnumSubElem *from, struct EnumSubElem *to, struct EnumElem *fajah, int *lastval)
 Copy subelement list.
EnumElemfdbfs_enumelems_from_dbtab (fdbfs_t *f, const char *table, struct EnumHead *e)
 Construct EnumElem list from database enum description table.
EnumHeadfdbfs_enums_from_db (fdbfs_t *f)
 Construct EnumHead list from database.
CatElemfdbfs_catelems_from_dbtab (fdbfs_t *f, const char *table, struct EnumHead *enumhead)
 Construct CatElem list from catalogue description table.
CatalogueHeadfdbfs_cats_from_db (fdbfs_t *f, struct EnumHead *enumhead)
 Construct CatalogueHead list from database.
EnumSubElemfdbfs_free_enum_sub_elem (struct EnumSubElem *e, short int allsub)
 Free an EnumSubElem object.
void fdbfs_free_enum_sub_elem_list (struct EnumSubElem *head, short int allsub)
 Free list of EnumSubElems.
EnumElemfdbfs_free_enum_elem (struct EnumElem *e)
 Free EnumElem object.
void fdbfs_free_enum_elem_list (struct EnumElem *head)
 Free list of EnumElems.
EnumHeadfdbfs_free_enum_head (struct EnumHead *e)
 Free EnumHead object.
void fdbfs_free_enum_head_list (struct EnumHead *head)
 Free list of EnumHeads.
CatElemfdbfs_free_cat_elem (struct CatElem *e)
 Free CatElem object.
void fdbfs_free_cat_elem_list (struct CatElem *head)
 Free list of CatElems.
CatalogueHeadfdbfs_free_cat_head (struct CatalogueHead *e)
 Free CatHead object.
void fdbfs_free_cat_head_list (struct CatalogueHead *head)
 Free list of CatHeads.
void fdbfs_free_head_members (Heads *hd)
 Free certain members of a Heads object.
int fdbfs_dbspec_parse (fdbfs_t *f, const char *filename)
 Parse dbspec.
void fdbfs_actcats_free (actcat_t *h)
 Free list of actcat_t.
actcat_tfdbfs_catalogues_from_db (fdbfs_t *f, struct CatalogueHead *cathead)
 Make actcat_t list from database.


Define Documentation

#define ALLSUBSTART   6500
 

#define CAT_FIELD_TABLE_PREFIX   "cft_"
 

#define CAT_TABLE_PREFIX   "c_"
 

#define CATE_USES_FC   0x1
 

#define CATH_FROM_DB   0x2
 

#define CATH_USES_FC   0x1
 

#define ENUM_TABLE_PREFIX   "endef_"
 

#define ENUMH_FROM_DB   0x1
 

#define HAVE_DBSPECDATA_H   1
 

#define MAXLINE   2048
 

#define OTHER_ELEM_PREFIX   "oth_"
 

#define SUBE_IS_ALLSUB   0x4
 

#define SUBE_IS_SAMEAS   0x2
 

#define SUBE_IS_SELF   0x1
 


Function Documentation

void fdbfs_actcats_free actcat_t h  ) 
 

Free list of actcat_t.

Parameters:
h Head of list to free.

actcat_t* fdbfs_catalogues_from_db fdbfs_t f,
struct CatalogueHead cathead
 

Make actcat_t list from database.

Parameters:
f Instance of fakedbfs.
cathead Catalogue head to search for definitions.
Returns:
Pointer to list of actcat_t elements, or NULL on error.

struct CatElem* fdbfs_catelems_from_dbtab fdbfs_t f,
const char *  table,
struct EnumHead enumhead
 

Construct CatElem list from catalogue description table.

Parameters:
f Instance of fakedbfs.
table Name of catalogue description table.
enumhead Head of enums to search when enum element is encountered.
Returns:
CatElem list, or NULL on error.

struct CatalogueHead* fdbfs_cats_from_db fdbfs_t f,
struct EnumHead enumhead
 

Construct CatalogueHead list from database.

Parameters:
f Instance of fakedbfs.
enumhead EnumHead list to search.
Returns:
CatalogueHead list, or NULL on error.

struct EnumSubElem* fdbfs_copy_sub_list struct EnumSubElem from,
struct EnumSubElem to,
struct EnumElem fajah,
int *  lastval
 

Copy subelement list.

For use with stuff like the sameas directive. Copies list of subelements.

Parameters:
[in] from From list.
[out] to To list. This must point to an allocated struct EnumSubElem; subsequent items will be allocated.
[in] fajah Father enum element of new list.
[in,out] lastval Pointer to integer specifying the value to use. Will be increased to last value when done.
Returns:
Tail element of copied list.

int fdbfs_dbspec_parse fdbfs_t f,
const char *  filename
 

Parse dbspec.

Parses the specified specfile and modifies the database accordingly. Must close and reopen before using other parts of the library to see changes.

Parameters:
f Instance of fakedbfs.
filename Specfile filename to read.
Returns:
0 on error.

struct EnumElem* fdbfs_enumelems_from_dbtab fdbfs_t f,
const char *  table,
struct EnumHead e
 

Construct EnumElem list from database enum description table.

DOes so according to TABLE_FORMAT.

Parameters:
f Instance of fakedbfs.
table Table to read.
e Parent of all elements.
Returns:
List of EnumElems, or NULL on error.

struct EnumHead* fdbfs_enums_from_db fdbfs_t f  ) 
 

Construct EnumHead list from database.

Parameters:
f Instance of fakedbfs.
Returns:
EnumHead list, or NULL on error.

struct CatElem* fdbfs_find_catelem_by_name struct CatElem h,
const char *  name
 

Search for catalogue element by name.

Parameters:
h Head of list to search.
name Name to search for.
Returns:
The element if found, NULL otherwise.

struct CatElem* fdbfs_find_catelem_enum struct CatElem h,
struct EnumHead en
 

Find catalogue element by enumhead.

Parameters:
h List head to search.
en Enumhead to search for.
Returns:
The element we found, or NULL on no match/error.

struct CatalogueHead* fdbfs_find_cathead_by_name struct CatalogueHead h,
const char *  name
 

Search list of catalogue heads for a certain name.

Parameters:
h Head of list to search.
name Name to search for.
Returns:
The element if found, NULL otherwise.

struct EnumElem* fdbfs_find_elem_by_name struct EnumElem h,
const char *  name
 

Find enum element by name.

Parameters:
h List head to search.
name Name to search for.
Returns:
The element we found, or NULL on no match/error.

struct EnumHead* fdbfs_find_enumhead_by_name struct EnumHead h,
const char *  name
 

Search for enum head by name.

Parameters:
h Head of list to search.
name Name to search for.
Returns:
The element if found, NULL otherwise.

struct CatElem* fdbfs_free_cat_elem struct CatElem e  ) 
 

Free CatElem object.

Parameters:
e Object to free.
Returns:
Next element, NULL on error.

void fdbfs_free_cat_elem_list struct CatElem head  ) 
 

Free list of CatElems.

Parameters:
head List to traverse and free.

struct CatalogueHead* fdbfs_free_cat_head struct CatalogueHead e  ) 
 

Free CatHead object.

Parameters:
e Object to free.
Returns:
Next element, NULL on error.

void fdbfs_free_cat_head_list struct CatalogueHead head  ) 
 

Free list of CatHeads.

Parameters:
head List to traverse and free.

struct EnumElem* fdbfs_free_enum_elem struct EnumElem e  ) 
 

Free EnumElem object.

Parameters:
e Object to free.
Returns:
Next element in list, NULL on error.

void fdbfs_free_enum_elem_list struct EnumElem head  ) 
 

Free list of EnumElems.

Parameters:
head List to traverse and free.

struct EnumHead* fdbfs_free_enum_head struct EnumHead e  ) 
 

Free EnumHead object.

Parameters:
e Object to free.
Returns:
Next element in list, NULL on error.

void fdbfs_free_enum_head_list struct EnumHead head  ) 
 

Free list of EnumHeads.

Parameters:
head List to traverse and free.

struct EnumSubElem* fdbfs_free_enum_sub_elem struct EnumSubElem e,
short int  allsub
 

Free an EnumSubElem object.

Parameters:
e Object to free.
allsub 1 if intentionally freeing allsubs, 0 to ignore allsubs.
Returns:
Next element in list, NULL on error.

void fdbfs_free_enum_sub_elem_list struct EnumSubElem head,
short int  allsub
 

Free list of EnumSubElems.

Parameters:
head Head of list.
allsub 1 if intentionally freeing allsubs, 0 to ignore allsubs.

void fdbfs_free_head_members Heads hd  ) 
 

Free certain members of a Heads object.

fdbfs_free_head_members() frees the lists specified by both hd->cathead and hd->enumhead.

Parameters:
hd Heads object to free from.

char* fdbfs_get_enum_string_by_value struct EnumElem h,
unsigned int  val,
short int  fmted
 

Search enum list and return name of element with specified value.

Parameters:
h Head of list.
val Value to search for.
fmted 1 if formatted name is desired. 0 otherwise.
Returns:
Name of enum element, or NULL if none found.

char* fdbfs_get_enum_sub_string_by_value struct EnumSubElem h,
unsigned int  val
 

Get string in list of enum subelements by value.

Parameters:
h Sub element list head to search.
val Value to search for.
Returns:
Name of subelement with specified value, or NULL otherwise.

struct EnumSubElem* fdbfs_get_subhead_by_enval struct EnumElem h,
unsigned int  val
 

Get subelement head by value in enum.

Parameters:
h List head to search.
val Value to search for.
Returns:
Sub element list, or NULL if no match.


Generated on Wed Apr 19 16:26:23 2006 for fakedbfs by  doxygen 1.4.6