Move variable setting code into utilities.

This commit is contained in:
2018-09-13 23:57:33 -07:00
parent ca6075e8d5
commit 06f17f491c
3 changed files with 26 additions and 13 deletions

View File

@@ -114,6 +114,17 @@ libab_result libab_overload_function(libab* ab,
libab_table* table,
const char* name,
libab_ref* function);
/**
* Sets a value under the given name, overriding
* an existing value if it exists.
* @param table the table to store the value into.
* @param name the name of the variable.
* @param the value of the new variable.
* @return the result of setting the variable.
*/
libab_result libab_set_variable(libab_table* table,
const char* name,
libab_ref* value);
/**
* Allocates a function that uses internal code to run.
* @param into the reference into which to store the new function.