/ languages / c.html

Table of content

Parameters

Templates


Details

Parameters

Naming convention for variables, parameters etc.

Default value: 'none'
Naming convention for structs and types

Default value: 'none'

Templates

c.comment(content, inline="false()")

C-style comment
  1. content
    Comment content
  2. inline
    Indicates if the comment should be displayed on one line
    Default value: false()

A shortcut for inline comments output
  1. content
    Comment content
c.block(indent="true()", content, addInitialEndl="true()", addFinalEndl="false()")

C code block
  1. indent
    Indicates if the block should be indented
    Default value: true()
  2. content
    Block content
  3. addInitialEndl
    Add a linebreak before the block
    Default value: true()
  4. addFinalEndl
    Add a linebreak after the block
    Default value: false()

A basic proprocessor #if with optional #else
  1. condition
    Condition
  2. then
    Content if condition evaluates to true (required)
  3. else
    Content if condition evaluates to false (optional)
  4. indent
    Indicate if the inner code have to be indented
    Default value: false()
  1. condition
    Condition
  2. then
    Content if condition evaluates to true (required)
  3. else
    Content if condition evaluates to false (optional)
  4. indent
    Default value: false()
  1. condition
    Condition
  2. then
    Content if condition evaluates to true (required)
  3. else
    Content if condition evaluates to false (optional)
  4. indent
    Default value: false()

Attempt to transform a name to fit C identifier name restriction (no spaces, etc)
  1. name
c.identifierDefinition(type, pointer="0", name, nameSuffix, value, nameStyle="$c.indentifierNamingStyle")

Output a variable or parameter definition
  1. type
    Variable type, including modifiers
  2. pointer
    Number of indirections (0 <=> standard variable, 1 <=> pointer, ...)
    Default value: 0
  3. name
    Variable name
  4. nameSuffix
    Name suffix. Untransformed text to append after the name. Should be used for array specification
  5. value
    Variable value
  6. nameStyle
    Naming style convention
    Default value: $c.indentifierNamingStyle
c.variableDeclaration(type, pointer="0", name, nameSuffix, value, nameStyle="$c.indentifierNamingStyle")

Output a variable declaration
  1. type
    Variable type, including modifiers
  2. pointer
    Number of indirections (0 <=> standard variable, 1 <=> pointer, ...)
    Default value: 0
  3. name
    Variable name
  4. nameSuffix
    Name suffix. Untransformed text to append after the name. Should be used for array specification
  5. value
    Variable value
  6. nameStyle
    Naming style convention
    Default value: $c.indentifierNamingStyle

Output a function parameter definition (alias of c.identifierDefinition)
  1. type
    Variable type, including modifiers
  2. pointer
    Number of indirections (0 <=> standard variable, 1 <=> pointer, ...)
    Default value: 0
  3. name
    Variable name
  4. nameSuffix
    Variable Name suffix. Untransformed text to append after the name. Should be used for array specification
  5. value
    Variable value
  6. nameStyle
    Naming style convention
    Default value: 'none'
c.enumDefinition(name, nameStyle="$c.structNamingStyle", content)
  1. name
  2. nameStyle
    Default value: $c.structNamingStyle
  3. content
c.structDefinition(name, nameStyle="$c.structNamingStyle", variableName, variableNameStyle="$c.indentifierNamingStyle", content, typedef="false()")
  1. name
    struct type name
  2. nameStyle
    struct type name style
    Default value: $c.structNamingStyle
  3. variableName
    Optional variable nmae
  4. variableNameStyle
    Variable name style
    Default value: $c.indentifierNamingStyle
  5. content
    Struct content
  6. typedef
    Use typedef
    Default value: false()
c.structVariableDeclaration(pointer="0", name, nameStyle="$c.structNamingStyle", variableName, variableNameSuffix, variableNameStyle="$c.indentifierNamingStyle", value)

Declare a variable of type struct
  1. pointer
    Number of indirections (0 <=> standard variable, 1 <=> pointer, ...)
    Default value: 0
  2. name
    struct type name
  3. nameStyle
    struct type name style
    Default value: $c.structNamingStyle
  4. variableName
    Optional variable nmae
  5. variableNameSuffix
    Variable name suffix. Untransformed text to append after the name. Should be used for array specification
  6. variableNameStyle
    Variable name style
    Default value: $c.indentifierNamingStyle
  7. value
    Variable initial value
  1. returnType
    Default value: 'void'
  2. name
  3. parameters
    Function parameters