GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> FBS / V0-3-1 > fbs_rtos / rad750


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>

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_USR

Functions

unsigned int FILE_pathInit (const char *usrName, const char *deprecated)
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_devUser [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_USR

The largest valid device number allowed for mapping functions.

Referenced by FILE_pathIdToNum(), FILE_pathIdToPath(), FILE_pathNumToId(), and FILE_pathPathToId().

#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.

Referenced by FILE_pathIdToPath().


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.

References FILE_DEV_NUM_MAX, and FILE_ID_TO_NUM.

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.

References dir, FILE_DEV_NUM_MAX, FILE_ID_TO_NUM, FILE_ID_TO_PATH, and FILE_ID_TO_PATH_USR.

Referenced by FILE_loadModuleByID(), and FILE_loadModuleSecondary().

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.

References FILE_DEV_NUM_MAX, and FILE_NUM_TO_ID.

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

References dir, and FILE_DEV_NUM_MAX.

Referenced by FILE_loadModuleByName().

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.

References FILE_PATH_STR_SIZE_USR.


Variable Documentation

FILE_devNames [static]

Initial value:

 
{
        FILE_DEV_NAME_BOOT,
        FILE_DEV_NAME_RAM,
        FILE_DEV_NAME_EE0,
        FILE_DEV_NAME_EE1,
        FILE_DEV_NAME_MEM,
        FILE_DEV_NAME_MM0,
        FILE_DEV_NAME_MM1,
        NULL
}
A lookup table of file device names indexed by the file device number.

FILE_devUser [static]

Name storage for a user device name


Generated on Wed Nov 21 17:55:21 2012 by  doxygen 1.5.8