` Printed Icetips Article

Icetips Article



Par2: Template to export prototypes
1998-09-16 -- Mike Hanson
 
Try the following template.  I just add it as a global template to all
of my DLLs.  When I reference the DLL module in another APP, I tell it
the name of the module include file created by this template.  The
nice thing about this is that the prototypes are always kept in sync
with the DLL APP.

NOTE: you must add this to an existing template chain or add the #TEMPLATE
line

#EXTENSION(mhPrototypeExporter,
	'Mike Hanson''s Prototype Exporter'),
	DESCRIPTION('[MikeH] Prototype Exporter'),APPLICATION
#BOXED('Mike Hanson''s Prototype Exporter')
  #PROMPT('Include Filename:',@S13), %IncludeFilename, REQ,
	DEFAULT(UPPER(SLICE(%Program, 1, 
	INSTRING('.', %Program, 1, 1)-1)) & '.INC')
#ENDBOXED
#!----------
#AT(%CustomGlobalDeclarations),WHERE(%ProgramExtension='DLL')
  #CREATE(%BuildInclude)
  #FOR(%Procedure),WHERE(%ProcedureExported)
    #INSERT(%MakeDeclr(ABC), 24, %OOPConstruct, %Procedure,
	%ProcedureType & %Prototype)
    #IF(%ProcedureDescription)
      #INSERT(%MakeDeclr(ABC), 55, %OOPConstruct,  %OOPConstruct, 
	'!'& %ProcedureDescription)
    #ENDIF
%OOPConstruct
  #ENDFOR
  #CLOSE(%BuildInclude)
  #REPLACE(%IncludeFilename, %BuildInclude)
  #REMOVE(%BuildInclude)
#ENDAT



Printed November 21, 2024, 6:35 am
This article has been viewed/printed 35182 times.