# lib_include function library

Dependencies: lib_2da, lib_anon, lib_array, lib_fn, lib_ini, lib_sfo, lib_sugar, lib_tools, lib_ui

## Description

This library contains the 'include' and 'run' functions, used by SFO to apply syntactic sugar and to manage the overall install structure of a mod.

## Public functions

include(inline:b, literal:b, file:s, files:s, location:s, locbase:s, path:s)=() dimorphic

'file' (synonym: 'files') is a list of tpa files (leave off the suffix), located at the location specified by 'location', 'locbase', and 'path'. (If none are set, assume location is component_loc.) Each is INCLUDEd. Unless literal is set to 1, the SFO syntactic-sugar changes are applied.

run(marker:b=1, literal:b, file:s, files:s, location:s, locbase:s, path:s, version:s, tra:s)=() dimorphic

'file' (synonym: 'files') is a list of tpa files (leave off the suffix), located at the location specified by 'location', 'locbase', and 'path'. (If none are set, assume location is component_loc.) Each is loaded, and then each file's name is run as an action function, with the STR_VAR argument 'version' fed to it, and with the tra file 'tra' (english and local-language versions) loaded. (So each tpa should conform to the SFO convention of containing an action function of its own name.Unless literal=1, SFO syntactic sugar is applied.

When used outside an extant 'run' instruction (in the intended setup, this should be from your tp2 as the only instruction in the component, though I can't enforce that), it sets 'component_loc' to 'location', defaults to using 'location' as the name of the tra file, and sets a marker file with name '%marker_prefix%lib_include.tph'. 'marker_prefix' defaults to 'sfo_marker_prefix', which in normal usage should have been set in your 'always' file. If INT_VAR marker is set to 0, this marker is not placed.