context.h File Reference


Detailed Description

Context table management used by the db module.

#include <dballe/db/internals.h>

Go to the source code of this file.

Data Structures

struct  _dba_db_context
 Precompiled query to manipulate the context table. More...

Typedefs

typedef _dba_db_contextdba_db_context
 Precompiled query to manipulate the context table.

Functions

dba_err dba_db_context_create (dba_db db, dba_db_context *ins)
 Create a new dba_db_context.
void dba_db_context_delete (dba_db_context ins)
 Deletes a dba_db_context.
dba_err dba_db_context_get_id (dba_db_context ins, int *id)
 Get the context id for the context data previously set in ins.
dba_err dba_db_context_get_data (dba_db_context ins, int id)
 Get context information given a context ID.
dba_err dba_db_context_obtain_ana (dba_db_context ins, int *id)
 Get the context id for a pseudoana info context.
dba_err dba_db_context_insert (dba_db_context ins, int *id)
 Insert a new context in the database.
dba_err dba_db_context_remove (dba_db_context ins)
 Remove a context record.


Function Documentation

dba_err dba_db_context_create ( dba_db  db,
dba_db_context ins 
)

Create a new dba_db_context.

Parameters:
db The dba_db this dba_db_context will access
Return values:
ins The newly created dba_db_context (it will need to be deallocated wth dba_db_context_delete())
Returns:
The error indicator for the function (See error.h)

void dba_db_context_delete ( dba_db_context  ins  ) 

Deletes a dba_db_context.

Parameters:
ins The dba_db_context to delete

dba_err dba_db_context_get_data ( dba_db_context  ins,
int  id 
)

Get context information given a context ID.

Parameters:
ins dba_db_context to query
id ID of the context to query
Returns:
The error indicator for the function (See error.h)

dba_err dba_db_context_get_id ( dba_db_context  ins,
int *  id 
)

Get the context id for the context data previously set in ins.

Parameters:
ins The dba_db_context structure, with parameters filled in for the query
Return values:
id The database ID, or -1 if no existing context entry matches the given values
Returns:
The error indicator for the function (See error.h)

dba_err dba_db_context_insert ( dba_db_context  ins,
int *  id 
)

Insert a new context in the database.

Parameters:
ins The dba_db_context structure with all the input fields filled in.
Return values:
id The ID of the newly inserted context
Returns:
The error indicator for the function (See error.h)

dba_err dba_db_context_obtain_ana ( dba_db_context  ins,
int *  id 
)

Get the context id for a pseudoana info context.

Parameters:
ins The dba_db_context structure, with id_ana and id_report filled in for the query. If id_report is filled with -1, it gets replaced with the report code for pseudoana information.
Return values:
id The database ID
Returns:
The error indicator for the function (See error.h)

dba_err dba_db_context_remove ( dba_db_context  ins  ) 

Remove a context record.

Parameters:
ins The dba_db_context structure, with id filled with the id of the context to remove.
Returns:
The error indicator for the function (See error.h)


Generated on Fri Jun 22 15:18:10 2007 for libdballe-db by  doxygen 1.5.2