Implement convenience functions for looking up the implemented entries.

This commit is contained in:
2018-02-11 23:00:07 -08:00
parent 8b13b9a735
commit ee19f55058
2 changed files with 32 additions and 0 deletions

View File

@@ -68,6 +68,22 @@ void libab_table_init(libab_table* table);
* @return the table entry, or NULL if an entry was not found.
*/
libab_table_entry* libab_table_search(libab_table* table, const char* string);
/**
* Searches for the given string in the table, returning a value only
* if it is an operator.
* @param table the table to search.
* @param string the string to search for.
* @return the found operator, or NULL if it was not found.
*/
libab_operator* libab_table_search_operator(libab_table* table, const char* string);
/**
* Searches for the given string in the table, returning a value only
* if it is a function.
* @param table the table to search.
* @param string the string to search for.
* @return the found function, or NULL if it was not found.
*/
libab_function* libab_table_search_function(libab_table* table, const char* string);
/**
* Stores the given entry in the table under the given key.
* @param table the table to store the entry into.