GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> CMX / V2-13-5 > cmx_interface / rhel4-32


Interface   Data Structures   File List   Data Fields   Globals  

CMX_interfaceRead.c File Reference

Read and parse a linker interface description file. More...

#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <CMX_interface_prv.h>

Defines

#define CMX_L_TOKEN   4096

Functions

static unsigned int hierarchy (struct _CMX_Interface *ifac, struct _CMX_Instance *inst, struct _CMX_Hierarchy **hier)
 Fill in a node in the hierarchy.
static unsigned int parse_global (char *name, struct _CMX_Interface *ifac, struct _CMX_Instance *inst, signed int line)
 Parse a global symbol name.
static struct
_CMX_Instance
parse_interface (char *name, struct _CMX_Interface *ifac, struct _CMX_Instance *inst, signed int type, signed int line)
 Parse an interface name.
static unsigned int parse_local (char *name, struct _CMX_Instance *inst, signed int line)
 Parse a local symbol name.
static unsigned int validate (struct _CMX_Interface *head)
 Ensure that a linker script meets CMX restrictions.
unsigned int CMX_interfaceRead (struct _CMX_Interface **ifac, const char *file)
 Parse a (CMX version) linker interface description file.


Detailed Description

Read and parse a linker interface description file.

CMX_interfaceRead reads and parses a linker interface description file. CMX linker interface description files have slightly more stringent syntax rules than the standard. Non-adherence to these rules is regarded as a fatal error.

CVS $Id: CMX_interfaceRead.c,v 1.5 2010/04/22 23:41:29 apw Exp $

Function Documentation

unsigned int CMX_interfaceRead ( struct _CMX_Interface **  ifac,
const char *  file 
)

Parse a (CMX version) linker interface description file.

Parameters:
ifac Pointer to an interface description header block
file Filename of script file to be parsed
Return values:
0 Success
1 Failure

unsigned int hierarchy ( struct _CMX_Interface ifac,
struct _CMX_Instance inst,
struct _CMX_Hierarchy **  hier 
) [static]

Fill in a node in the hierarchy.

Parameters:
ifac Interface description header block
inst Instance being filled out
hier Pointer to head of instance list
This is altogether a rather vicious routine. Simply put, it scans the instancies listed in the interface to find those that point back to the address defined by inst and form them into an ordered list (first by interface stem name, then by interface version number). It only gets complicated in that along the way, it calls itself back with each created node (a depth first hierarchy construction). It is seeded by asking for those nodes which point back to NULL.

Return values:
0 Success
1 Failure

static unsigned int parse_global ( char *  name,
struct _CMX_Interface ifac,
struct _CMX_Instance inst,
signed int  line 
) [static]

Parse a global symbol name.

Parameters:
name String to parse
ifac Interface description header block
inst Instance being parsed
line Line number being parsed.
Return values:
0 Success
1 Failure

static struct _CMX_Instance * parse_interface ( char *  name,
struct _CMX_Interface ifac,
struct _CMX_Instance inst,
signed int  type,
signed int  line 
) [static, read]

Parse an interface name.

Parameters:
name String to parse
ifac Interface description header block
inst Instance being parsed
type Type of name (interface name or parent name)
line Line number being parsed
Return values:
NULL Failure
x Pointer to created/referenced interface instance

static unsigned int parse_local ( char *  name,
struct _CMX_Instance inst,
signed int  line 
) [static]

Parse a local symbol name.

Parameters:
name String to parse
inst Instance being parsed
line Line number being parsed.
Return values:
0 Success
1 Failure

static unsigned int validate ( struct _CMX_Interface head  )  [static]

Ensure that a linker script meets CMX restrictions.

Parameters:
head Overall control structure.
Return values:
0 Success
1 Failure


Generated on Thu Apr 22 16:57:01 2010 by  doxygen 1.5.3