1 /* $OSSEC, os_regex_str.c, v0.1, 2005/12/29, Daniel B. Cid$ */
3 /* Copyright (C) 2009 Trend Micro Inc.
6 * This program is a free software; you can redistribute it
7 * and/or modify it under the terms of the GNU General Public
8 * License (version 2) as published by the FSF - Free Software
18 #include "os_regex_internal.h"
21 /** int OS_StrIsNum(char *str) v0.1
22 * Checks if a specific string is numeric (like "129544")
24 int OS_StrIsNum(const char *str)
32 return(FALSE); /* 0 */
40 /** int OS_StrHowClosedMatch(char *str1, char *str2) v0.1
41 * Returns the number of characters that both strings
44 size_t OS_StrHowClosedMatch(const char *str1, const char *str2)
48 /* They don't match if any of them is null */
56 if(str1[count] != str2[count])
62 }while((str1[count] != '\0') && (str2[count] != '\0'));