Make foreach_free public and fix a few bugs.
This commit is contained in:
@@ -115,5 +115,14 @@ liblex_result eval_word(char* string, int index, eval_config* config, match* mat
|
||||
* @return LIBLEX_SUCCESS if all goes well, or LIBLEX_MALLOC if there was an allocation failure.
|
||||
*/
|
||||
liblex_result eval_all(char* string, int index, eval_config* config, ll* matches);
|
||||
/**
|
||||
* Function intended to be passed to "foreach" calls in libds.
|
||||
* Since eval_all creates a lot of matches and puts them all in a linked list,
|
||||
* this function takes care of freeing the matches.
|
||||
* @param data the match being freed
|
||||
* @param args unused
|
||||
* @return always 0.
|
||||
*/
|
||||
int eval_foreach_match_free(void *data, va_list args);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -16,7 +16,11 @@ enum liblex_result_e {
|
||||
/**
|
||||
* Represents an invalid pattern.
|
||||
*/
|
||||
LIBLEX_INVALID
|
||||
LIBLEX_INVALID,
|
||||
/**
|
||||
* Represents an unrecognized token.
|
||||
*/
|
||||
LIBLEX_UNRECOGNIZED
|
||||
};
|
||||
|
||||
typedef enum liblex_result_e liblex_result;
|
||||
|
||||
Reference in New Issue
Block a user