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

Constituent: fbs_rtos     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

FBS_path.c File Reference

Function definitions for file path utility library. More...

#include "stdlib.h"
#include "string.h"
#include "MDB/MDB_pubdefs.h"
#include "FBS/FBS_pubrtos.h"
#include "FBS/FBS_msgs.h"

Include dependency graph for FBS_path.c:


Defines

#define FILE_ID_TO_PATH_USR(_str, _dev, _dir, _file)   snprintf((_str), FILE_PATH_STR_SIZE_USR, "%s/d%03u/f%07u", (_dev), (_dir), (_file));
#define FILE_DEV_NUM_MAX   FILE_DEV_NUM_USR1

Functions

unsigned int FILE_pathInit (const char *usrName5, const char *usrName6)
 Initialize the file path mapping library.
unsigned int FILE_pathSizeof (void)
 Get the size of a file path string.
unsigned int FILE_pathIdToNum (unsigned int id, unsigned int *dev, unsigned int *dir, unsigned int *file)
 Translates a file ID word into component numbers.
unsigned int FILE_pathNumToId (unsigned int *id, unsigned int dev, unsigned int dir, unsigned int file)
 Translates file component numbers to an ID word.
unsigned int FILE_pathIdToPath (unsigned int id, char *str)
 Translates file ID word to an ASCII path name.
unsigned int FILE_pathPathToId (const char *nam)
 Convert a file name to a file ID (if possible).

Variables

static char FILE_devUser5 [FILE_PATH_STR_SIZE_USR]
static char FILE_devUser6 [FILE_PATH_STR_SIZE_USR]
static char * FILE_devNames [8]

Detailed Description

Function definitions for file path utility library.

Author:
D.L. Wood

Define Documentation

#define FILE_DEV_NUM_MAX   FILE_DEV_NUM_USR1
 

The largest valid device number allowed for mapping functions.

#define FILE_ID_TO_PATH_USR _str,
_dev,
_dir,
_file   )     snprintf((_str), FILE_PATH_STR_SIZE_USR, "%s/d%03u/f%07u", (_dev), (_dir), (_file));
 

Translates user-defined file component numbers to an ASCII path name.

Parameters:
_str Storage for the path string.
_dev The device name.
_dir The directory number.
_file The file number.


Function Documentation

unsigned int FILE_pathIdToNum unsigned int  id,
unsigned int *  dev,
unsigned int *  dir,
unsigned int *  file
 

Translates a file ID word into component numbers.

Parameters:
id The file ID word.
dev Storage for the device number.
dir Storage for the directory number.
file Storage for the file number.
Returns:
A FILE MSG value.
Breaks a file ID word into its numerical components, which are stored in the user supplied dev, dir, and file locations.

unsigned int FILE_pathIdToPath unsigned int  id,
char *  str
 

Translates file ID word to an ASCII path name.

Parameters:
id The file ID word.
str Storage for the file path string.
Returns:
A FILE MSG value.
Creates a file system path string from a set of file ID components. The result is stored in the user supplied str location. The resulting path string is appropriate for use with the file system API functions.

unsigned int FILE_pathInit const char *  usrName5,
const char *  usrName6
 

Initialize the file path mapping library.

Parameters:
usrName5 Root name for device 5; must start with '/' (use NULL to invalidate).
usrName6 Root name for device 6; must start with '/' (use NULL to invalidate).
Returns:
A FILE MSG value.
Sets the root partition names for device numbers '5' and '6' (FILE_DEV_NUM_USR0 and FILE_DEV_NUM_USR1). The names from usrName5 and usrName6 will be used when calling function FILE_pathIdToPath().

unsigned int FILE_pathNumToId unsigned int *  id,
unsigned int  dev,
unsigned int  dir,
unsigned int  file
 

Translates file component numbers to an ID word.

Parameters:
id Storage for the file ID word.
dev The device number.
dir The directory number.
file The file number.
Returns:
A FILE MSG value.
Composes a new file ID word from its numerical components. The result is stored in the user supplied id location.

unsigned int FILE_pathPathToId const char *  nam  ) 
 

Convert a file name to a file ID (if possible).

Parameters:
nam (in) File name
Return values:
0xffffffff Could not translate file name
x File ID

unsigned int FILE_pathSizeof void   ) 
 

Get the size of a file path string.

Returns:
The path string size in bytes.
Returns the number of bytes needed to hold an on-board file path string.


Variable Documentation

FILE_devNames [static]
 

Initial value:

A lookup table of file device names indexed by the file device number.

FILE_devUser5 [static]
 

Name storage for a user defined "device 5"

FILE_devUser6 [static]
 

Name storage for a user defined "device 6"


Generated on Wed Nov 16 20:55:12 2005 by  doxygen 1.4.4