Generator/RB_Generate_Section [ Functions ]
FUNCTION
Generate the documentation for a header and all its childern.
INPUTS
- document_file -- destination file
- parent -- the parent of the header for which the documentation is to be generated.
- document -- pointer to the RB_Document structure.
- depth -- level of sectioning ( 1 1.1 1.1.1 etc)
SYNOPSIS
void RB_Generate_Section( FILE *document_file, struct RB_header *parent, struct RB_Document *document, int depth )
NOTE
This is a recursive function.
SEE ALSO
SOURCE
{ unsigned long i; struct RB_header *header; char *headername; // We pass either modulename/name or just the name if ( course_of_action.do_sectionnameonly ) { headername = parent->function_name; } else { headername = parent->name; } switch ( output_mode ) { case XMLDOCBOOK: { RB_Generate_BeginSection( document_file, depth, headername, parent ); /* Docbook output does not like the labels to be * generated before the <section> part */ Generate_Label( document_file, parent->unique_name ); Generate_Label( document_file, parent->name ); } break; /* lowtexx 21.09.2005 11:37 */ case LATEX: { RB_Generate_BeginSection( document_file, depth, headername, parent ); /* We have to start section before labeling in latex */ Generate_Label( document_file, parent->unique_name ); Generate_Label( document_file, parent->name ); } break; /* --- */ default: { Generate_Label( document_file, parent->unique_name ); Generate_Label( document_file, parent->name ); RB_Generate_BeginSection( document_file, depth, headername, parent ); } break; } RB_Generate_Nav_Bar( document, document_file, parent ); RB_Generate_Index_Entry( document_file, document->doctype, parent ); Generate_Header( document_file, parent, document->singledoc_name ); for ( i = 0; i < document->no_headers; ++i ) { header = ( document->headers )[i]; if ( header->parent == parent ) { RB_Generate_Section( document_file, header, document, depth + 1 ); } else { /* Leeg */ } } RB_Generate_EndSection( document_file, depth, parent->name ); }