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:
- include string
- add_macro (name, value)
-
Parameters:
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:
- value string
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:
- name string
- ... {any,...}
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:
- 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:
- definitions {PendingDefinition,...}