Skip to content

Latest commit

 

History

History
96 lines (71 loc) · 2.88 KB

statements.rst

File metadata and controls

96 lines (71 loc) · 2.88 KB

Statements

Shroud can be thought of as a fancy macro processor. The statement data structure is used to define code that should be used to create the wrapper. Combinations of language, type and attributes are used to select a statement entry.

name: f_mixin_one
f_pre_call:
- "! comment f_mixin_one"

name: f_mixin_two
mixin:
- f_mixin_one
f_pre_call:
- "! comment f_mixin_two"    # appends

name: f_function_one
mixin:
- f_mixin_one
f_pre_call:
- "! comment two"            # replaces

Passing function result as an argument

This section explains how statements are used to generate code for functions which return a struct.

Compiler ABI do not agree on how some function results should be returned. To ensure portablity, some function results must be passed as an additional argument. This is typically more complicated types such as struct or complex.

../shroud/statements.py