GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> RIM / V3-1-2 > rim / linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

RIM_import.c File Reference

Functions that import data into RIM structures. More...

#include <RIM_p.h>
#include <RIM_descriptions.ic>
#include <RIM_number.ic>
#include <RIM_AG_init_p.h>
#include <RIM/RIM_msgs.h>
#include <MSG/MSG_pubdefs.h>
#include <PBS/BSWP.h>

Functions

static unsigned importData (RIM_impDataCB dataRtn, void *parm, int iShrt, void *data, int leng, int swap, int *rLeng)
 Import a block of data.
unsigned RIM_import (RIM *rim, int optns, unsigned short *versn, RIM_impRecdCB recdRtn, RIM_impDataCB dataRtn, void *parm)
 Import RIM data as a series of records.
unsigned RIM_importMap (RIM_map *map, int optns, unsigned short *versn, RIM_impRecdCB recdRtn, RIM_impDataCB dataRtn, void *parm)
 Import RIM map data as a series of records.


Detailed Description

Functions that import data into RIM structures.

Author:
Owen Saxton
$Id: RIM_import.c,v 1.3 2011/03/27 06:47:13 saxton Exp $

Function Documentation

unsigned importData ( RIM_impDataCB  dataRtn,
void *  parm,
int  iShrt,
void *  data,
int  leng,
int  swap,
int *  rLeng 
) [static]

Import a block of data.

This routine imports a block of data then swaps its bytes, if requested to, from big-endian to machine order.

Parameters:
dataRtn Routine to do the actual importing.
parm Parameter for the importing routine.
iShrt If TRUE, don't report or return data too short error.
data Address of the data area.
leng Number of bytes to import.
swap If TRUE, the data is to have its bytes swapped.
rLeng Address of integer to receive the number of bytes actually imported.
Returns:
The return value from the importing routine

Referenced by RIM_import(), and RIM_importMap().

unsigned RIM_import ( RIM rim,
int  optns,
unsigned short *  versn,
RIM_impRecdCB  recdRtn,
RIM_impDataCB  dataRtn,
void *  parm 
)

Import RIM data as a series of records.

This routine provides a general way to import data into a RIM structure. The data are received as a series of records from the supplied callback routines. One routine is called to position at the start of the next record to be imported and supplies the record type and data length. The second routine is called to retrieve data for the record, and is called as many times as necessary to retrieve all the data.

Parameters:
rim RIM structure to use as a repository.
optns An options word, consisting of the logical OR of the following possible values:
  • RIM_OPT_SWAP Swap the bytes of the imported data from big-endian to machine order.
  • RIM_OPT_CURR Allow only the current version of the data.
versn The address of a two-element array containing the major and minor version numbers of the data being imported.
recdRtn Routine to be called at the start of each record to be imported.
dataRtn Routine to be called for each block of data to be imported.
parm Parameter to pass to the callback routines.
Return values:
RIM_SUCCESS Success
RIM_BADVERSN The supplied version number is invalid
RIM_RTYPUNKN Received a record with invalid record type
RIM_TYPEUNKN Received a record with invalid RIM type

References checkBit(), importData(), RIM_cptDesc(), RIM_number(), RIM_OPT_CURR, RIM_OPT_SWAP, RIM_RT_DFT, RIM_RT_EXCP, RIM_RT_MAP, RIM_RT_MASK, sizeofCpt(), and sizeofMap().

unsigned RIM_importMap ( RIM_map map,
int  optns,
unsigned short *  versn,
RIM_impRecdCB  recdRtn,
RIM_impDataCB  dataRtn,
void *  parm 
)

Import RIM map data as a series of records.

This routine provides a general way to export the data from a RIM map structure. The data are presented as a series of records to the supplied callback routines. One routine is called at the start of each record to receive the record type and length of the data in the record. The second routine is called to receive data for the record, and is called as many times as necessary to receive all the data.

Parameters:
map RIM map structure to use as a source
optns An options word, consisting of the logical OR of the following possible values:
  • RIM_OPT_SWAP Swap the bytes of the imported data from big-endian to machine order.
  • RIM_OPT_CURR Allow only the current version of the data.
versn The address of a two-element array containing the major and minor version numbers of the data being imported.
recdRtn Routine to be called at the start of each record to be exported.
dataRtn Routine to be called for each block of data to be exported.
parm Parameter to pass to the callback routines.
Return values:
RIM_SUCCESS Success
RIM_BADVERSN The supplied version number is invalid
RIM_RTYPUNKN Received a record with invalid record type
RIM_TYPEUNKN Received a record with invalid RIM type

References importData(), RIM_OPT_CURR, RIM_OPT_SWAP, RIM_RT_MAP, RIM_RT_MASK, and sizeofMap().


Generated on Fri Sep 30 18:27:31 2011 by  doxygen 1.5.8