#define OS_REGEX_MAXSIZE 3
#define OS_REGEX_OUTOFMEMORY 4
#define OS_REGEX_STR_NULL 5
#define OS_REGEX_MAXSIZE 3
#define OS_REGEX_OUTOFMEMORY 4
#define OS_REGEX_STR_NULL 5
- int (**match_fp)(char *str, char *str2, int str_len, int size);
+ int (**match_fp)(const char *str, const char *str2, size_t str_len, size_t size);
/** char *OSRegex_Execute(char *str, OSRegex *reg) v0.1
* Compare an already compiled regular expression with
/** char *OSRegex_Execute(char *str, OSRegex *reg) v0.1
* Compare an already compiled regular expression with
/** int OSRegex_FreeSubStrings(OSRegex *reg) v0.1
* Release all the memory created to store the sub strings.
* Returns void.
*/
/** int OSRegex_FreeSubStrings(OSRegex *reg) v0.1
* Release all the memory created to store the sub strings.
* Returns void.
*/
/** int OSMatch_Compile(char *pattern, OSMatch *reg, int flags) v0.1
* Compile a pattern to be used later.
* Allowed flags are:
/** int OSMatch_Compile(char *pattern, OSMatch *reg, int flags) v0.1
* Compile a pattern to be used later.
* Allowed flags are:
* Split a string into multiples pieces, divided by a char "match".
* Returns a NULL terminated array on success or NULL on error.
*/
* Split a string into multiples pieces, divided by a char "match".
* Returns a NULL terminated array on success or NULL on error.
*/
/** int OS_StrHowClosedMatch(char *str1, char *str2) v0.1
* Returns the number of characters that both strings
* have in similar (start at the beginning of them).
*/
/** int OS_StrHowClosedMatch(char *str1, char *str2) v0.1
* Returns the number of characters that both strings
* have in similar (start at the beginning of them).
*/
-#include <string.h>
-#define startswith(x,y) (strncmp(x,y,strlen(y)) == 0?1:0)
-#define OS_StrStartsWith startswith
+int OS_StrStartsWith(const char *str, const char *pattern) __attribute__((nonnull));