lwes_event_type_db.h File Reference


Detailed Description

Functions for an event specification file database.

This is used in cases where you want to restrict the events allowed to be emitted or listened to to a particular esf file

Go to the source code of this file.

Data Structures

struct  lwes_event_type_db_attribute
 The attributes stored in the database. More...
struct  lwes_event_type_db
 The data base itself. More...

Functions

lwes_event_type_dblwes_event_type_db_create (const char *filename)
 Creates the memory for the event_type_db.
int lwes_event_type_db_destroy (struct lwes_event_type_db *db)
 Cleanup the memory for the event_type_db.
int lwes_event_type_db_add_event (struct lwes_event_type_db *db, LWES_SHORT_STRING event_name)
 Add an an event name to the database.
int lwes_event_type_db_add_attribute (struct lwes_event_type_db *db, LWES_SHORT_STRING event_name, LWES_SHORT_STRING attr_name, LWES_SHORT_STRING type)
 Add an attribute name to an event name of the database.
int lwes_event_type_db_check_for_event (struct lwes_event_type_db *db, LWES_SHORT_STRING event_name)
 Check for an event in the database.
int lwes_event_type_db_check_for_attribute (struct lwes_event_type_db *db, LWES_CONST_SHORT_STRING attr_name, LWES_CONST_SHORT_STRING event_name)
 Check for an attribute in an event in the database.
int lwes_event_type_db_check_for_type (struct lwes_event_type_db *db, LWES_BYTE type_value, LWES_CONST_SHORT_STRING attr_name, LWES_CONST_SHORT_STRING event_name)
 Check the type of an attribute in an event in the db.


Function Documentation

struct lwes_event_type_db* lwes_event_type_db_create const char *  filename  ) 
 

Creates the memory for the event_type_db.

This creates memory which should be freed with lwes_event_type_db_destroy

Parameters:
[in] filename the path to the file containing the esf description
See also:
lwes_event_type_db_destroy
Returns:
the newly created db on success, NULL on failure

int lwes_event_type_db_destroy struct lwes_event_type_db db  ) 
 

Cleanup the memory for the event_type_db.

This frees the memory created by lwes_event_type_db_create.

Parameters:
[in] db the db to free
Returns:
0 on success, a negative number on failure

int lwes_event_type_db_add_event struct lwes_event_type_db db,
LWES_SHORT_STRING  event_name
 

Add an an event name to the database.

Parameters:
[in] db the db to add the event name to
[in] event_name the name of an event
Returns:
0 if the add is successful, a negative number on failure

int lwes_event_type_db_add_attribute struct lwes_event_type_db db,
LWES_SHORT_STRING  event_name,
LWES_SHORT_STRING  attr_name,
LWES_SHORT_STRING  type
 

Add an attribute name to an event name of the database.

Parameters:
[in] db the db to add the attr_name into
[in] event_name the name of an event
[in] attr_name the name of an attribute
[in] type the type of the attribute
Returns:
0 if the add is successful, a negative number on failure

int lwes_event_type_db_check_for_event struct lwes_event_type_db db,
LWES_SHORT_STRING  event_name
 

Check for an event in the database.

Parameters:
[in] db the db to check for the event in
[in] event_name the name of an event
Returns:
1 if the event is in the db, 0 if it is not

int lwes_event_type_db_check_for_attribute struct lwes_event_type_db db,
LWES_CONST_SHORT_STRING  attr_name,
LWES_CONST_SHORT_STRING  event_name
 

Check for an attribute in an event in the database.

Parameters:
[in] db the db to check
[in] attr_name the attribute name to check for
[in] event_name the event name to check in
Returns:
1 if the attribute is in the event in the db, 0 if it is not

int lwes_event_type_db_check_for_type struct lwes_event_type_db db,
LWES_BYTE  type_value,
LWES_CONST_SHORT_STRING  attr_name,
LWES_CONST_SHORT_STRING  event_name
 

Check the type of an attribute in an event in the db.

Parameters:
[in] db the db to check
[in] type_value the type to check against
[in] attr_name the attribute name to check for
[in] event_name the event name to check in
Returns:
1 if the attribute in the event in the db is of the asked for type, 0 if it is not of the specified type


Generated on Thu Aug 21 07:18:55 2008 for lwes by  doxygen 1.4.6