GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> RIM / V3-1-2 > lrd_parser / rhel4-32


Interface   Data Structures   File List   Data Fields   Globals  

fileUtils.c File Reference

Functions for writing generated files. More...

#include <fileUtils_p.h>
#include <lString_p.h>
#include <error_p.h>
#include <PBS/MBA.h>
#include <string.h>

Functions

FILE * openFile (const char *filename, const char *header, const char *brief)
 Create a new file and write some initial statements into it.
void closeFile (FILE *fp, int isHeader)
 Terminate the file and close it.
unsigned makeName (char *name, size_t size, const char *path, const char *file, const char *ext)
 Build a filename from the constituent parts (path/AG_file.ext).
void print_des (FILE *fp, const char *cptName, const char *regName, const char *fldName)
 Prints a descriptor declaration to the file pointed to by fp.
unsigned print_list (FILE *fp, L_head *list)
 Write out the list of strings to file separated by commas and new-lines, and terminated by closing braces, semicolons and newlines.


Detailed Description

Functions for writing generated files.

Author:
James Swain & Owen Saxton
$Id: fileUtils.c,v 1.3 2011/03/27 06:15:54 saxton Exp $

Function Documentation

void closeFile ( FILE *  fp,
int  isHeader 
)

Terminate the file and close it.

Parameters:
fp File pointer
isHeader Indicates that a closing #endif is needed for an include protection macro

Referenced by fini_fileAddr(), fini_fileDescription(), fini_fileFldEnum(), fini_fileMapTags(), fini_fileNumber(), fini_fileNumEnum(), fini_fileRegEnum(), fini_fileRimType(), fini_fileTree_c(), fini_fileTree_h(), fini_fileTypeEnum(), and fini_fileXMLTags().

unsigned makeName ( char *  name,
size_t  size,
const char *  path,
const char *  file,
const char *  ext 
)

Build a filename from the constituent parts (path/AG_file.ext).

Parameters:
name Pointer to storage for the constructed name
size Size of the available storage (including terminating NULL)
path Path portion of the filename
file File portion of the filename (without extension)
ext Extension portion of the filename

Referenced by init_fileAddr(), init_fileDescription(), init_fileFldEnum(), init_fileMapTags(), init_fileNumber(), init_fileNumEnum(), init_fileRegEnum(), init_fileRimType(), init_fileTree_c(), init_fileTree_h(), init_fileTypeEnum(), and init_fileXMLTags().

FILE* openFile ( const char *  filename,
const char *  header,
const char *  brief 
)

Create a new file and write some initial statements into it.

Parameters:
filename Name of the file to open
header String to use in the #ifdef, #define statements - NULL implies that this is not a header file so this step will be missed
brief Brief description for the doxygen block
Returns:
Pointer to the opened file or NULL on error.

Referenced by init_fileAddr(), init_fileDescription(), init_fileFldEnum(), init_fileMapTags(), init_fileNumber(), init_fileNumEnum(), init_fileRegEnum(), init_fileRimType(), init_fileTree_c(), init_fileTree_h(), init_fileTypeEnum(), and init_fileXMLTags().

void print_des ( FILE *  fp,
const char *  cptName,
const char *  regName,
const char *  fldName 
)

Prints a descriptor declaration to the file pointed to by fp.

Parameters:
fp Pointer to file to add to
cptName Component name
regName Register name
fldName Field name

Referenced by sfld_fileXMLTags(), and sreg_fileXMLTags().

unsigned print_list ( FILE *  fp,
L_head *  list 
)

Write out the list of strings to file separated by commas and new-lines, and terminated by closing braces, semicolons and newlines.

Parameters:
fp Pointer to the target file
list Head of the linked list of lStrings to print
Returns:
Number of elements written

References lString::string.

Referenced by ecpt_fileDescription(), ecpt_fileMapTags(), ecpt_fileXMLTags(), and ereg_fileXMLTags().


Generated on Fri Sep 30 18:26:45 2011 by  doxygen 1.5.8