GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSD / dev > qsu / linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

QFR_file.h File Reference

Interface the facilty to translate and manage dynamically mapped files. More...

#include <string.h>
#include <stdlib.h>

Classes

struct  _QFR_fileCfgStems
 Holds onto the production, development and user file stems. More...
struct  _QFR_fileCfg
 The configuration parameters for the file resolution facility. More...

Typedefs

typedef struct _QFR_fileCtx QFR_fileCtx
typedef enum _QFR_fileRoot QFR_fileRoot
 Typedef for enum _QFR_fileRoot.
typedef struct _QFR_fileCfgStems QFR_fileCfgStems
 Typedef for struct _QFR_fileCfgStems.
typedef struct _QFR_fileCfg QFR_fileCfg
 Typedef for struct _QFR_fileCfg.
typedef int(* QFR_resolver )(QFR_fileCtx *ctx, unsigned int key, const char *dirName, const char *fileName, char *name, unsigned int nameLen)
 Function signature to resolve a file key.

Enumerations

enum  _QFR_fileRoot {
  QFR_FILEROOT_K_NONE = -1,
  QFR_FILEROOT_K_FMX = 0,
  QFR_FILEROOT_K_PROD = 1,
  QFR_FILEROOT_K_DEV = 2,
  QFR_FILEROOT_K_TEST = 3
}
 Enumeration of the file root. More...

Functions

int QFR_fileCtxSizeof (const QFR_fileCfg *cfg)
 Returns the size in bytes need to hold the file resolution context.
void * QFR_fileCtxConstruct (QFR_fileCtx *ctx, const QFR_fileCfg *cfg)
 Constructs the file resolution translation context.
int QFR_fileResolve (QFR_fileCtx *ctx, unsigned int key, const char *dirName, const char *fileName, char *name, unsigned int nameLen)
int QFR_cdmResolve (QFR_fileCtx *ctx, unsigned int key, const char *dirName, const char *fileName, char *name, unsigned int nameLen)
 Resolves a CDM file key.
int QFR_fofResolve (QFR_fileCtx *ctx, unsigned int key, const char *dirName, const char *fileName, char *name, unsigned int nameLen)
 Resolves a FOF (file of file) file key.
int QFR_sbsResolve (QFR_fileCtx *ctx, unsigned int key, const char *dirName, const char *fileName, char *name, unsigned int nameLen)
 Resolves a SBS (secondary boot script) file key.
int QFR_latcResolve (QFR_fileCtx *ctx, unsigned int key, const char *dirName, const char *fileName, char *name, unsigned int nameLen)
 Resolves a LATc file key.
const char * QFR_rootGet (const QFR_fileCtx *ctx, QFR_fileRoot which)
 Returns the requested root.
int QFR_compose (const QFR_fileCtx *ctx, char *name, int namelen, QFR_fileRoot which, const char *nam, const char *prj, const char *pkg, const char *ver, const char *cons)


Detailed Description

Interface the facilty to translate and manage dynamically mapped files.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: QFR_file.h,v 1.1.1.1 2008/04/02 01:05:53 russell Exp $

Typedef Documentation

Typedef for struct _QFR_fileCfg.

Although the datagrams carry a key with them that can ultimately be resolved to a file name. For files resolved via FMX, that name is complete. However for testing and pre-production releases, that name, must, by definition be incomplete. It must be completed by providing the root of the file name. Typically at SLAC, for the production and development area, this will be whatever $GFSROOT translates to. For testing of files that come out of a user's test area, this must be provided by the user.
This configuration supports 2 different ways of supplying the file root for each of type of file, PRODUCTION, DEVELOPMENT and TEST.
  1. Translation of user environment variables
  2. A user provided string. There are advantages to either method. The suggestion is that an interactive utility provide command line support to directly give the roots of the three areas and that the facility provide three prefixes that are used to compose sets of environment variable names of the form
  • <PREFIX>_F_PROD
  • <PREFIX>_F_DEV
  • <PREFIX>_F_TEST

The prefixes are specified as an NULL-terminated array of string pointers. These function like a search list, with element 0 used to form the first search, 1 the next etc.. Thus, one should order the list from the most restrictive to the most general. For example for QSEP (physics event datagrams) there could be the following list of 3
  • QSEP, physics event specific
  • QSP, physics specific
  • QSD, any datagram

int(* QFR_resolver)(QFR_fileCtx *ctx, unsigned int key, const char *dirName, const char *fileName, char *name, unsigned int nameLen)

Function signature to resolve a file key.

Returns:
Status
Parameters:
ctx The QFR context handle
key The LFR file key
dirName The directory root, used if and only if the key is a CMX-style key.
fileName The file name, used if and only if the key is a CMX-style key.
name Buffer to receive the fully resolved file name
nameLen The size of the name buffer


Enumeration Type Documentation

Enumeration of the file root.

Enumerator:
QFR_FILEROOT_K_NONE  No file stem
QFR_FILEROOT_K_FMX  The FMX file root
QFR_FILEROOT_K_PROD  The CMX production file root
QFR_FILEROOT_K_DEV  The CMX development file root
QFR_FILEROOT_K_TEST  The CMX test file root


Function Documentation

int QFR_cdmResolve ( QFR_fileCtx ctx,
unsigned int  key,
const char *  dirName,
const char *  fileName,
char *  name,
unsigned int  nameLen 
)

Resolves a CDM file key.

Returns:
Status
Parameters:
ctx The QFR context handle
key The LFR file key
dirName The directory root, used if and only if the key is a CMX-style key.
fileName The file name, used if and only if the key is a CMX-style key.
name Buffer to receive the fully resolved file name
nameLen The size of the name buffer

References connect(), and _QFR_fileCtx::fmx.

void* QFR_fileCtxConstruct ( QFR_fileCtx ctx,
const QFR_fileCfg cfg 
)

Constructs the file resolution translation context.

Returns:
Pointer to the next location
Parameters:
ctx The context to construct
cfg The configuration

References _QFR_fileCfg::facilities, _QFR_fileCtx::fmx, _QFR_fileRoots::len, _QFR_fileRoots::nam, _QFR_fileCfgStems::prd, QFR_FILEROOT_K_FMX, QFR_FILEROOT_K_PROD, QFR_FILEROOT_K_TEST, _QFR_fileCtx::roots, _QFR_fileCfg::stems, Suffixes, and translatem().

int QFR_fileCtxSizeof ( const QFR_fileCfg cfg  ) 

Returns the size in bytes need to hold the file resolution context.

Parameters:
cfg The file resolution configuration

References _QFR_fileCfgStems::dev, _QFR_fileCfg::facilities, _QFR_fileCfgStems::prd, size(), sizem(), _QFR_fileCfg::stems, Suffixes, and _QFR_fileCfgStems::tst.

int QFR_fofResolve ( QFR_fileCtx ctx,
unsigned int  key,
const char *  dirName,
const char *  fileName,
char *  name,
unsigned int  nameLen 
)

Resolves a FOF (file of file) file key.

Returns:
Status
Parameters:
ctx The QFR context handle
key The LFR file key
dirName The directory root, used if and only if the key is a CMX-style key.
fileName The file name, used if and only if the key is a CMX-style key.
name Buffer to receive the fully resolved file name
nameLen The size of the name buffer

int QFR_latcResolve ( QFR_fileCtx ctx,
unsigned int  key,
const char *  dirName,
const char *  fileName,
char *  name,
unsigned int  nameLen 
)

Resolves a LATc file key.

Returns:
Status
Parameters:
ctx The QFR context handle
key The LFR file key
dirName The directory root, used if and only if the key is a CMX-style key.
fileName The file name, used if and only if the key is a CMX-style key.
name Buffer to receive the fully resolved file name
nameLen The size of the name buffer

const char* QFR_rootGet ( const QFR_fileCtx ctx,
QFR_fileRoot  which 
)

Returns the requested root.

Returns:
Pointer to the requested root or NULL if either an invalid root is requested or the root is non-existent
Parameters:
ctx The file resolution context
which Which root

References _QFR_fileRoots::nam, QFR_FILEROOT_K_TEST, and _QFR_fileCtx::roots.

int QFR_sbsResolve ( QFR_fileCtx ctx,
unsigned int  key,
const char *  dirName,
const char *  fileName,
char *  name,
unsigned int  nameLen 
)

Resolves a SBS (secondary boot script) file key.

Returns:
Status
Parameters:
ctx The QFR context handle
key The LFR file key
dirName The directory root, used if and only if the key is a CMX-style key.
fileName The file name, used if and only if the key is a CMX-style key.
name Buffer to receive the fully resolved file name
nameLen The size of the name buffer


Generated on Sat Mar 26 14:08:24 2011 by  doxygen 1.5.8