C Macros

PreviousUpNext
Up: Structured Comments Next: Indicating Special Limitations Previous: C Routines

C macros are indicated by the structured comment /*M ... M*/. Unlike the case of C routines, macro definitions do not provide any information on the types of the arguments. Thus, the body of a structured comment for a C macro should include a synopsis section, containing a declaration of the macro as if it were a C routine. For example, if the Add example were implemented as a macro, the structured comment for it would look like

 
/*M 
   Add - Add two values 

Parameters: . a1,a2 - Values to add

Synopsis: int Add( a1, a2 ) int a1, a2; M*/

It is important that the word Synopsis be used; bfort and related programs (doctext and doc2lt) use this name to find the C-like declaration for the macro.


PreviousUpNext
Up: Structured Comments Next: Indicating Special Limitations Previous: C Routines