1
0
Fork 0
mirror of git://git.psyc.eu/libpsyc synced 2024-08-15 03:19:02 +00:00

find var in array

This commit is contained in:
tg(x) 2011-10-30 16:04:54 +01:00
parent 47984a765b
commit 0a95b0a518
3 changed files with 79 additions and 1 deletions

View file

@ -31,6 +31,8 @@ typedef enum
{
PSYC_FALSE = 0,
PSYC_TRUE = 1,
PSYC_NO = 0,
PSYC_YES = 1,
} psycBool;
/**
@ -149,6 +151,24 @@ psycType psyc_getVarType(psycString *name);
*/
psycType psyc_getVarType2(const char *name, size_t len);
/**
* Search for a variable name in an array.
*
* @param array The array to search, should be ordered alphabetically.
* @param size Size of array.
* @param name Name of variable to look for.
* @param namelen Length of name.
* @param startswith If true, look for any variable starting with name,
otherwise only exact matches are returned.
* @param matching A temporary array used for keeping track of results.
* Should be the same size as the array we're searching.
*
* @return The value of the matched variable in the array.
*/
int psyc_findVar(const psycMatchVar *array, size_t size,
const char *name, size_t namelen,
uint8_t startswith, int8_t *matching);
/**
* Is this a list variable name?
*/