GetIncludes - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Printer

  

GetIncludes

  

get library inclusion statements

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Printer:-GetIncludes()

Parameters

Printer

-

Printer module

Description

• 

When called after the printing of intermediate code, the GetIncludes command returns a string containing the commands necessary for including all libraries or packages which have been declared necessary during the printing phase with AddLibrary calls.

• 

The LibraryInclusion language attribute controls the formatting of the results returned by GetIncludes.

• 

The GetIncludes command is frequently called by PrintTarget in order to preface the generated code with any necessary include directives.

Examples

withCodeGeneration:

LanguageDefinition[Define]("GetIncludesExample",
   extend = "C",
   AddFunction(
       "show_libraries",
       [anything]::anything,
       proc()
           Printer:-Print(
               "printf(\"Library inclusion statements are: ",
               Printer:-GetIncludes(), "\")"
           )
       end proc
   )
):

Translatea=sinx,b=show_libraries,language=GetIncludesExample

a = sin(x);
b = (double) printf("Library inclusion statements are: #include <math.h>

");

See Also

AddLibrary

Language Attributes

Printer