GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QSD / V0-2-0

Constituent: qsu     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

QFR_file.c File Reference

Facilty to resolve and manage dynamically mapped files. More...

#include "QSD/QFR_file.h"
#include "LSE/LFR_key.h"
#include "FMX/FMX_pubdefs.h"
#include "MSG/MSG_macdefs.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Include dependency graph for QFR_file.c:


Data Structures

struct  _QFR_fileRoots
 Holds onto the production, development and user file roots. More...
struct  _QFR_fileCtx
 The context for the file resolution facility. More...
struct  _QFR_scanConditions
 The specification of the conditions to be met to satisfy a file scan. More...
struct  _QFR_scanResults
 The specification of the results of the scan scan. More...
struct  _QFR_scanCtx
 The context to resolve a FMX_scanFilesByKey scan. More...

Typedefs

typedef _QFR_fileRoots QFR_fileRoots
 Typedef for struct _QFR_fileRoots.
typedef _QFR_fileCtx QFR_fileCtx
typedef _QFR_scanConditions QFR_scanConditions
 Typedef for struct _QFR_scanConditions.
typedef _QFR_scanResults QFR_scanResults
 Typedef for struct _QFR_scanResults.
typedef _QFR_scanCtx QFR_scanCtx
 Typedef for struct _QFR_scanCtx.

Functions

static const char * translate (const char *facility, const char *area)
 Translates the environment variable whose name looks like <facility>_<area>.
static unsigned int size (const char *root, const char *facility, const char *area)
 Gets the size, in bytes of the file root.
static const char * translatem (const char *const *facilities, const char *area)
 Translates the environment variable whose name looks like <facility>_<area>.
static unsigned int sizem (const char *root, const char *const *facilities, const char *area)
 Gets the size, in bytes of the file root.
int QFR_fileCtxSizeof (const QFR_fileCfg *cfg)
 Returns the size in bytes need to hold the file resolution context.
static int connect (FMX_Connection **fmx)
 Performs the one-time initialization and connection.
static int cmx_resolve (QFR_fileCtx *ctx, unsigned int key, const char *dirName, const char *fileName, char *name, unsigned int nameLen)
static unsigned int scan (QFR_scanCtx *ctx, unsigned int key, const char *dir, FMX_FileGroup group, unsigned int flight, unsigned int visible, const char *tag, unsigned int index, unsigned int size, const char *date, const char *fname, const char *pkg, const char *ver, const char *con, FMX_CaptureModule captured, unsigned int contents, unsigned int count, const unsigned int *dat)
static unsigned int resolve (QFR_fileCtx *ctx, unsigned int key, const char *dirName, const char *fileName, char *name, unsigned int nameLen, FMX_FileGroup group)
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_latcResolve (QFR_fileCtx *ctx, unsigned int key, const char *dirName, const char *fileName, char *name, unsigned int nameLen)
 Resolves a LATc 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.
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)

Variables

static const char Suffixes [4][8]
 The suffix of the environment variables.
static const char * Facilities [] = { "QSD", NULL }
static const QFR_fileCfg CfgDefault

Detailed Description

Facilty to resolve and manage dynamically mapped files.

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id: QFR_file.c,v 1.2 2008/06/09 18:45:18 russell Exp $

Function Documentation

static int connect FMX_Connection **  fmx  )  [static]
 

Performs the one-time initialization and connection.

Returns:
Status
Parameters:
fmx The FMX connection handle

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

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

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

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

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

static unsigned int size const char *  root,
const char *  facility,
const char *  area
[static]
 

Gets the size, in bytes of the file root.

Returns:
The size, in bytes, of the file root
Parameters:
root User specified root
facility If root is NULL, then an environment variable of the form <facility><area> is constructed and a translation on it is attempted.
area The area (_F_PROD, _F_DEV, _F_TEST)

static unsigned int sizem const char *  root,
const char *const *  facilities,
const char *  area
[static]
 

Gets the size, in bytes of the file root.

Returns:
The size, in bytes, of the file root
Parameters:
root User specified root
facilities If root is NULL, then an environment variable of the form <facility><area> is constructed and a translation on it is attempted. Facilities contains an array of N facility names that are search for a translation. This array must be NULL-terminated
area The area (_F_PROD, _F_DEV, _F_TEST)

static const char * translate const char *  facility,
const char *  area
[static]
 

Translates the environment variable whose name looks like <facility>_<area>.

Returns:
Pointer to the translated environment variable

static const char * translatem const char *const *  facilities,
const char *  area
[static]
 

Translates the environment variable whose name looks like <facility>_<area>.

Returns:
Pointer to the translated environment variable
Parameters:
facilities A NULL-terminated array ofstring pointers giving the search list
area The area (PROD, DEV, or TEST)


Variable Documentation

const QFR_fileCfg CfgDefault [static]
 

Initial value:

 
{ 
    Facilities,
    {NULL, NULL, NULL }
}

const char Suffixes[3] [static]
 

Initial value:

 
{ 
    "_C_FDB",
    "_F_PROD",
    "_F_DEV",
    "_F_TEST"
}
The suffix of the environment variables.

The full name of the environment variable is formed by appending the suffix to the facility name.


Generated on Thu Jun 12 02:13:58 2008 by  doxygen 1.4.4