Module sk_definition_writer

Functions

add_header (include)
add_macro (name, value)
reference_to (value[, index]) creates a pointer to another piece of data the data being referenced must be added to the output via add_definition
is_reference_type (value) returns true if value is a reference
raw (value) renders a string directly in the ouptut instead of wrapping the output in quotes
is_raw (value) returns true if value is a RawType
macro (name, ...) Generates as a macro eg `macro("MACRO_NAME", 1, 2)` will be displayed as MACRO_NAME(1, 2) in the c file output
is_macro (value) Returns true if value is of type MacroType
add_definition (nameHint, dataType, location, data) Outputs a c file defintion
consume_pending_definitions () Returns and clears all definitions that have been created using add_definiton meant for use in the c code
process_definitions (definitions) Processes definitions correctly connecting references meant for use in the c code

Tables

RefType
RawType
null_value alias for raw("NULL")
MacroType
PendingDefinition


Functions

add_header (include)

Parameters:

add_macro (name, value)

Parameters:

  • name string a hint on how to name the macro
  • value string the value of the macro

Returns:

    string the final name for the macro
reference_to (value[, index])
creates a pointer to another piece of data the data being referenced must be added to the output via add_definition

Parameters:

  • value any the value to reference
  • index integer if value is an array, you can specify the element to reference using this index (optional)

Returns:

    RefType result
is_reference_type (value)
returns true if value is a reference

Parameters:

  • value any any

Returns:

    boolean result
raw (value)
renders a string directly in the ouptut instead of wrapping the output in quotes

Parameters:

Returns:

    RawType result
is_raw (value)
returns true if value is a RawType

Parameters:

  • value any

Returns:

    boolean result
macro (name, ...)
Generates as a macro eg `macro("MACRO_NAME", 1, 2)` will be displayed as MACRO_NAME(1, 2) in the c file output

Parameters:

Returns:

    MacroType result
is_macro (value)
Returns true if value is of type MacroType

Parameters:

  • value any

Returns:

    boolean
add_definition (nameHint, dataType, location, data)
Outputs a c file defintion

Parameters:

  • nameHint string
  • dataType string the c type the definition is, if it is an array it should end in []
  • location string the file suffix where this definiton should be located in
  • data any The data of the file definition
consume_pending_definitions ()
Returns and clears all definitions that have been created using add_definiton meant for use in the c code

Returns:

    {PendingDefinition,...} result
process_definitions (definitions)
Processes definitions correctly connecting references meant for use in the c code

Parameters:

Tables

RefType
RawType
null_value
alias for raw("NULL")
MacroType
PendingDefinition

Fields:

generated by LDoc 1.4.6 Last updated 2022-12-30 12:30:52