GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSD / dev > qsu / sun-gcc
#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>
Classes | |
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 struct _QFR_fileRoots | QFR_fileRoots |
Typedef for struct _QFR_fileRoots. | |
typedef struct _QFR_fileCtx | QFR_fileCtx |
typedef struct _QFR_scanConditions | QFR_scanConditions |
Typedef for struct _QFR_scanConditions. | |
typedef struct _QFR_scanResults | QFR_scanResults |
Typedef for struct _QFR_scanResults. | |
typedef struct _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 *def, 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 *def, const char *const *facilities, const char *area) |
Gets the size, in bytes of the file root. | |
void | QFR_fileTagSet (const char *tag) |
This is a backdoor to change the host architecture tag. This is really not meant for anything other than helping to bootstrap a new host architecture. | |
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 * | Host = CMX_TAG |
static const char | Suffixes [4][8] |
The suffix of the environment variables. | |
static const char | DefaultRoot [] = "GFSROOT" |
static const char | TestRoot [] = "GFSUROOT" |
static const char * | Facilities [] = { "QSD", NULL } |
static const QFR_fileCfg | CfgDefault |
CVS $Id: QFR_file.c,v 1.7 2012/09/21 18:41:25 russell Exp $
static int connect | ( | FMX_Connection ** | fmx | ) | [static] |
Performs the one-time initialization and connection.
fmx | The FMX connection handle |
Referenced by QFR_cdmResolve().
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.
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.
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.
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.
QFR_fileTagSet | ( | const char * | tag | ) |
This is a backdoor to change the host architecture tag. This is really not meant for anything other than helping to bootstrap a new host architecture.
[in] | tag | The host architecture tag |
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.
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.
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.
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.
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.
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) |
References translate().
Referenced by QFR_fileCtxSizeof(), and sizem().
static unsigned int sizem | ( | const char * | root, | |
const char * | def, | |||
const char *const * | facilities, | |||
const char * | area | |||
) | [static] |
Gets the size, in bytes of the file root.
root | User specified root | |
def | The name of environment variable giving the root To be used if the other translation fails. | |
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) |
References size().
Referenced by QFR_fileCtxSizeof().
static const char * translate | ( | const char * | facility, | |
const char * | area | |||
) | [static] |
Translates the environment variable whose name looks like <facility>_<area>.
Referenced by size(), and translatem().
static const char * translatem | ( | const char * | def, | |
const char *const * | facilities, | |||
const char * | area | |||
) | [static] |
Translates the environment variable whose name looks like <facility>_<area>.
def | The name of an environment variable giving the default root. | |
facilities | A NULL-terminated array ofstring pointers giving the search list | |
area | The area (PROD, DEV, or TEST) |
References translate().
Referenced by QFR_fileCtxConstruct().
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 full name of the environment variable is formed by appending the suffix to the facility name.
Referenced by QFR_fileCtxConstruct(), and QFR_fileCtxSizeof().