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 struct _dba_db_contextdba_db_context

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.


Typedef Documentation

Precompiled query to manipulate the context table.


Function Documentation

dba_err dba_db_context_create ( dba_db  db,
dba_db_context ins 
)

void dba_db_context_delete ( dba_db_context  ins  ) 

Deletes a dba_db_context.

Parameters:
ins The dba_db_context to delete

References _dba_db_context::dstm, _dba_db_context::istm, _dba_db_context::sdstm, and _dba_db_context::sstm.

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)

References dba_error_notfound, _dba_db_context::id, and _dba_db_context::sdstm.

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)

References _dba_db_context::id, and _dba_db_context::sstm.

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)

References _dba_db_context::db, DBA_RUN_OR_RETURN, _dba_db_context::istm, _dba_db::seq_context, and _dba_db::server_type.

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)

References _dba_db_context::date, DBA_RUN_OR_RETURN, _dba_db_context::l1, _dba_db_context::l2, _dba_db_context::ltype1, _dba_db_context::ltype2, _dba_db_context::p1, _dba_db_context::p2, and _dba_db_context::pind.

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)

References _dba_db_context::dstm.


Generated on Fri Aug 1 15:20:53 2008 for libdballe by  doxygen 1.5.6