From 6d9ccee95dd99fecda3a6ba62c2768b4d39f69e5 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sat, 13 Jun 2009 16:54:04 +0000 Subject: base for the localization system --- src/base/system.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/base/system.c') diff --git a/src/base/system.c b/src/base/system.c index c94e4cf9..067c870f 100644 --- a/src/base/system.c +++ b/src/base/system.c @@ -1097,6 +1097,12 @@ int str_comp_nocase(const char *a, const char *b) #endif } +int str_comp(const char *a, const char *b) +{ + return strcmp(a, b); +} + + const char *str_find_nocase(const char *haystack, const char *needle) { while(*haystack) /* native implementation */ @@ -1116,6 +1122,26 @@ const char *str_find_nocase(const char *haystack, const char *needle) return 0; } + +const char *str_find(const char *haystack, const char *needle) +{ + while(*haystack) /* native implementation */ + { + const char *a = haystack; + const char *b = needle; + while(*a && *b && *a == *b) + { + a++; + b++; + } + if(!(*b)) + return haystack; + haystack++; + } + + return 0; +} + void str_hex(char *dst, int dst_size, const void *data, int data_size) { static const char hex[] = "0123456789ABCDEF"; -- cgit 1.4.1