GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> TRD / V0-0-3 > trd / rad750


Interface   Data Structures   File List   Data Fields   Globals  

TRD_row.c File Reference

Facilities to manipulate TRD (turbo-reset database) database entries. More...

#include <ctype.h>
#include <string.h>
#include <MDB/MDB_pubdefs.h>
#include <PBS/FFS.ih>
#include <TRD/TRD_msgs.h>
#include <TRD_prvdefs.h>

Functions

static unsigned int validRoutineName (const char *rtn, const char *fnc)
 Validate a routine name.
static int validRowHandle (TRD_Control *tcb, TRD_Row *row, const char *fnc)
 Validate a row handle.
unsigned int TRD_rowCreate (TRD_Row **hnd, const char *rtn, unsigned short fmt, unsigned short len, const void *dat)
 Create a row in the database.
unsigned int TRD_rowDelete (TRD_Row *row)
 Delete a row in the database.
unsigned int TRD_rowModifyData (TRD_Row *row, unsigned short fmt, unsigned short len, const void *dat)
 Modify a row in the database.


Detailed Description

Facilities to manipulate TRD (turbo-reset database) database entries.

CVS $Id: TRD_row.c,v 1.2 2011/03/28 21:41:08 apw Exp $
Author:
A.P.Waite
TRD_row.c provides facilities to manipulate TRD (turbo-reset database) database entries.

Function Documentation

unsigned int TRD_rowCreate ( TRD_Row **  hnd,
const char *  rtn,
unsigned short  fmt,
unsigned short  len,
const void *  dat 
)

Create a row in the database.

Parameters:
hnd (in/out) Row handle
rtn (in) Name of a callback routine
fmt (in) Format of data to follow
len (in) Length (bytes) of data to follow
dat (in) Data
TRD_rowCreate() creates a new row in the database.

References _TRD_Control::bit, _TRD_Row::buf, _TRD_RowHeader::chk, _TRD_Control::cnt, _TRD_Control::db, _TRD_RowHeader::fmt, _TRD_Row::hdr, _TRD_RowHeader::idx, _TRD_RowHeader::len, _TRD_Control::mtx, _TRD_RowHeader::off, _TRD_Control::state, TRD_CTL_INITIALIZED, TRD_tcb, and validRoutineName().

unsigned int TRD_rowDelete ( TRD_Row row  ) 

Delete a row in the database.

Parameters:
row (in) Row (handle) to delete
TRD_rowDelete() deletes an existing row in the database.

References _TRD_Control::bit, _TRD_RowHeader::chk, _TRD_Row::hdr, _TRD_Control::mtx, _TRD_Control::state, TRD_CTL_INITIALIZED, TRD_tcb, and validRowHandle().

unsigned int TRD_rowModifyData ( TRD_Row row,
unsigned short  fmt,
unsigned short  len,
const void *  dat 
)

Modify a row in the database.

Parameters:
row (in) Row handle
fmt (in) Format of data to follow
len (in) Length (bytes) of data to follow
dat (in) Data
TRD_rowModifyData() modifies (replaces) the data stored with a database row.

References _TRD_Row::buf, _TRD_Control::cnt, _TRD_RowHeader::fmt, _TRD_Row::hdr, _TRD_RowHeader::idx, _TRD_RowHeader::len, _TRD_Control::mtx, _TRD_RowHeader::off, _TRD_Control::state, TRD_CTL_INITIALIZED, TRD_tcb, and validRowHandle().

static unsigned int validRoutineName ( const char *  rtn,
const char *  fnc 
) [static]

Validate a routine name.

Parameters:
rtn (in) Routine name
fnc (in) Name of calling routine
Return values:
TRD_SUCCESS Success
x Otherwise
validRoutineName() validates a routine name

Referenced by TRD_rowCreate().

static int validRowHandle ( TRD_Control tcb,
TRD_Row row,
const char *  fnc 
) [static]

Validate a row handle.

Parameters:
tcb (in) TRD control block
row (in) TRD database row handle
fnc (in) Name of calling routine
Return values:
-1 Row handle is invalid
x Index of database entry
validRowHandle() validates a TRD database row handle

References _TRD_RowHeader::chk, _TRD_Control::db, and _TRD_Row::hdr.

Referenced by TRD_rowDelete(), and TRD_rowModifyData().


Generated on Wed Nov 21 19:56:14 2012 by  doxygen 1.5.8