GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > MSG / V3-0-2

Constituent: msg2src     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

msg2src.c File Reference

Implements the msg2src command. More...

#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "PBS/MBA.h"
#include "PBS/TASK.h"
#include "MDB/MDB_pubdefs.h"
#include "MSG/MSG_printProc.h"
#include "MSG/MSG_msgs.h"
#include "M2S_msgs.h"
#include "MSG_m2sdefs.h"

Include dependency graph for msg2src.c:

Include dependency graph

Data Structures

struct  _MSG_Qualifier
 Standard structure for describing a command qualifier. More...


Defines

#define MSG_FILE_HED   ( 0 )
 Index for a .h file.

#define MSG_FILE_SRC   ( 1 )
 Index for a .c file.

#define MSG_FILE_MSG   ( 2 )
 Index for a .msg file.

#define MSG_FILE_MAX   ( 3 )
 Number of file indices supported.


Typedefs

typedef _MSG_Qualifier MSG_Qualifier
 Typedef for struct _MSG_Qualifier.


Functions

unsigned int abbrev (const char *left, unsigned int llen, const char *rite, unsigned int rlen, unsigned int min)
 Test a string for being a minimally long abbreviation of another.

unsigned int parseArg (int *pcnt, char *parm[], unsigned int qcnt, MSG_Qualifier *qlst)
 Identify parameters and qualifiers in arguments.

unsigned int writeHeader (MSG_FacDefinition *fac, char *file)
 Write out a .h file.

unsigned int writeSource (MSG_FacDefinition *fac, char *file)
 Write out a .c file.

int main (int pcnt, char *parm[])
 Program to 'compile' a .msg file.


Variables

const char * s_few = "few"
 The string "few".

const char * s_many = "many"
 The string "many".

const char * cext [MSG_FILE_MAX] = { ".h", ".c", ".msg" }
 File suffixes corresponding to file indices.


Detailed Description

Implements the msg2src command.

CVS $Id: msg2src.c,v 1.7 2005/09/22 01:45:07 apw Exp $
Author:
A.P.Waite

Function Documentation

unsigned int abbrev const char *  left,
unsigned int  llen,
const char *  rite,
unsigned int  rlen,
unsigned int  min
[static]
 

Test a string for being a minimally long abbreviation of another.

Parameters:
left (in) String to test
llen (in) Length of string to test
rite (in) String to test against
rlen (in) Length of string to test against
min (in) Minimum length of overlap
Return values:
0 Success
1 Failure

int main int  pcnt,
char *  parm[]
 

Program to 'compile' a .msg file.

Parameters:
pcnt (in) Number of argument tokens
parm (in) Pointers to argument tokens
Return values:
0 Success
1 Failure
The msg2src command "compiles" a .msg file. It produces a .h file (for inclusion in user programs) and .c file (for compilation and linking in user programs).

Here is the call graph for this function:

unsigned int parseArg int *  pcnt,
char *  parm[],
unsigned int  qcnt,
MSG_Qualifier qlst
[static]
 

Identify parameters and qualifiers in arguments.

Parameters:
pcnt (I/O) Token count on input, parameter count on output
parm (I/O) Token pointers on input, parameter pointers on output
qcnt (in ) Count of predefined qualifiers
qlst (I/O) Predefined qualifier list updated for qualifiers present
Return values:
M2S_SUCCESS Success
M2S_BADQUAL Cannot parse qualifier
M2S_BADTOKEN Cannot parse token
M2S_QULNEGAT Qualifier is not negatable
M2S_QULVALUD Qualifier never takes a value
M2S_QULNOVAL Qualifier always takes a value
M2S_QULUNDEF Qualifier is not defined

Here is the call graph for this function:

unsigned int writeHeader MSG_FacDefinition fac,
char *  fhed
[static]
 

Write out a .h file.

Parameters:
fac (in) Facility structure
fhed (in) Filename of .h file
Return values:
M2S_SUCCESS Success
M2S_FILOPEN Error opening file
M2S_FILWRITE Error writing file
M2S_FILCLOSE Error closing file

unsigned int writeSource MSG_FacDefinition fac,
char *  fsrc
[static]
 

Write out a .c file.

Parameters:
fac (in) Facility structure
fsrc (in) Filename of .c file
Return values:
M2S_SUCCESS Success
M2S_FILOPEN Error opening file
M2S_FILWRITE Error writing file
M2S_FILCLOSE Error closing file


Generated on Thu Sep 22 08:08:38 2005 by doxygen 1.3.3