Part
[ Top ] [ ROBODoc ] [ Modules ]
FUNCTION
Structures and functions that deal with documentation parts. A part links a sourcefile to the documentation file and contains all the headers found in a sourcefile. Parts (in the form of struct RB_Part) are stored in a RB_Document structure.
RB_Free_RB_Part
[ Top ] [ Part ] [ Functions ]
FUNCTION
Free the memory used by an RB_Part. Most of this is handled in other functions.
SYNOPSIS
void RB_Free_RB_Part( struct RB_Part *part )
INPUTS
- part -- the part to be freed.
SOURCE
{ /* part->filename is freed by RB_Directory */ /* part->headers. Headers are freed by the document */ free( part ); }
RB_Get_RB_Part
[ Top ] [ Part ] [ Functions ]
FUNCTION
Create a new RB_Part and initialize it.
SYNOPSIS
struct RB_Part* RB_Get_RB_Part( void )
RESULT
A freshly allocated and initializedand RB_Part.
SOURCE
{ struct RB_Part *part = NULL; part = ( struct RB_Part * ) malloc( sizeof( struct RB_Part ) ); if ( part ) { part->next = NULL; part->filename = NULL; part->headers = NULL; part->last_header = NULL; } else { RB_Panic( "Out of memory! RB_Get_RB_Part()" ); } return part; }
RB_Open_Source
[ Top ] [ Part ] [ Functions ]
FUNCTION
Open the sourcefile of this part.
SYNOPSIS
FILE* RB_Open_Source( struct RB_Part *part )
INPUTS
- part -- the part for which the file is opened.
SOURCE
{ char *sourcefilename = NULL; FILE *result; assert( part ); assert( part->filename ); sourcefilename = Get_Fullname( part->filename ); result = fopen( sourcefilename, "r" ); if ( result ) { /* OK */ } else { RB_Panic( "can't open %s!", sourcefilename ); } return result; }