C code generation (ccode)

Description

The ccode module supports code generation for the C language.

To use the module in inline code generation import it by:

cogeno.import_module('ccode')

In case you want to use the ccode module in another Python project import it by:

import cogeno.modules.ccode

Cogeno invocation options

There are NO Cogeno invocation options.

Code generation functions

cogeno.modules.ccode.outl_config_guard(property_name)

Write #if guard for config property to output.

If there is a configuration property of the given name the property value is used as guard value, otherwise it is set to 0.

Parameters
  • property_name: Property name

cogeno.modules.ccode.outl_config_unguard(property_name)

Write #endif guard for config property to output.

This is the closing command for outl_guard_config().

Parameters
  • property_name: Property name

cogeno.modules.ccode.out_comment(s, blank_before=True)

Write ‘s’ as a comment.

Parameters
  • s: string, is allowed to have multiple lines.

  • blank_before: True adds a blank line before the comment.

cogeno.modules.ccode.out_edts_defines(prefix='EDT_')

Write EDTS database properties as C defines.

Parameters
  • prefix: Define label prefix. Default is ‘EDT_’.