瀏覽代碼

Add mg_strcasecmp to the public interface

bel 9 年之前
父節點
當前提交
4385636c96
共有 3 個文件被更改,包括 3 次插入15 次删除
  1. 2 1
      include/civetweb.h
  2. 1 1
      src/civetweb.c
  3. 0 13
      test/public_server.c

+ 2 - 1
include/civetweb.h

@@ -907,7 +907,8 @@ CIVETWEB_API void mg_cry(const struct mg_connection *conn,
                          ...) PRINTF_ARGS(2, 3);
                          ...) PRINTF_ARGS(2, 3);
 
 
 
 
-/* utility method to compare two buffers, case incensitive. */
+/* utility methods to compare two buffers, case incensitive. */
+CIVETWEB_API int mg_strcasecmp(const char *s1, const char *s2);
 CIVETWEB_API int mg_strncasecmp(const char *s1, const char *s2, size_t len);
 CIVETWEB_API int mg_strncasecmp(const char *s1, const char *s2, size_t len);
 
 
 
 

+ 1 - 1
src/civetweb.c

@@ -1598,7 +1598,7 @@ mg_strncasecmp(const char *s1, const char *s2, size_t len)
 }
 }
 
 
 
 
-static int
+int
 mg_strcasecmp(const char *s1, const char *s2)
 mg_strcasecmp(const char *s1, const char *s2)
 {
 {
 	int diff;
 	int diff;

+ 0 - 13
test/public_server.c

@@ -48,19 +48,6 @@
  * http://check.sourceforge.net/doc/check_html/index.html
  * http://check.sourceforge.net/doc/check_html/index.html
  */
  */
 
 
-/* Replicate this function here, since it is static in civetweb.c */
-static int
-mg_strcasecmp(const char *s1, const char *s2)
-{
-	int diff;
-
-	do {
-		diff = lowercase(s1++) - lowercase(s2++);
-	} while (diff == 0 && s1[-1] != '\0');
-
-	return diff;
-}
-
 
 
 static const char *
 static const char *
 locate_path(const char *a_path)
 locate_path(const char *a_path)