Analyser/RB_Analyse_Document [ Functions ]
FUNCTION
Scan all the sourcefiles of all parts of a document for headers. Store these headers in each part (RB_Part).
SYNOPSIS
void RB_Analyse_Document( struct RB_Document *arg_document )
INPUTS
- document -- document to be analysed.
RESULT
Each part will contain the headers that were found in the sourcefile of the part.
SOURCE
{ struct RB_Part *a_part; struct RB_Filename *a_filename; FILE *filehandle; for ( a_part = arg_document->parts; a_part; a_part = a_part->next ) { struct RB_header *new_header = NULL; a_filename = a_part->filename; RB_Say( "analysing %s\n", SAY_DEBUG, Get_Fullname( a_filename ) ); RB_SetCurrentFile( Get_Fullname( a_filename ) ); RB_Header_Lock_Reset( ); filehandle = RB_Open_Source( a_part ); line_number = 0; for ( new_header = Grab_Header( filehandle, arg_document ); new_header; new_header = Grab_Header( filehandle, arg_document ) ) { if ( ToBeAdded( arg_document, new_header ) ) { /* The Add is required before the * Analyse because Add sets the owner of the header * which is needed for error messages. */ RB_Part_Add_Header( a_part, new_header ); Analyse_Items( new_header ); } else { RB_Free_Header( new_header ); } } fclose( filehandle ); } }