changeset 5:8a64459dab94

make guess_init() and guess_impl_register() static functions.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Thu, 12 Jun 2008 22:54:49 +0900
parents ff05c6c659cb
children c61a7765c8f5
files guess.c libguess.h test.c
diffstat 3 files changed, 7 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/guess.c	Thu Jun 12 20:22:07 2008 +0900
+++ b/guess.c	Thu Jun 12 22:54:49 2008 +0900
@@ -8,8 +8,9 @@
 
 static guess_impl *guess_impl_list = NULL;
 
-void guess_impl_register(const char *lang,
-    const char *(*impl)(const char *buf, int len))
+static void
+guess_impl_register(const char *lang,
+                    const char *(*impl)(const char *buf, int len))
 {
     guess_impl *iptr = calloc(sizeof(guess_impl), 1);
 
@@ -20,7 +21,8 @@
     guess_impl_list = iptr;
 }
 
-void guess_init(void)
+static void
+guess_init(void)
 {
     /* check if already initialized */
     if (guess_impl_list != NULL)
@@ -37,7 +39,8 @@
     guess_impl_register(GUESS_REGION_HW, guess_hw);
 }
 
-const char *guess_encoding(const char *inbuf, int buflen, const char *lang)
+const char *
+guess_encoding(const char *inbuf, int buflen, const char *lang)
 {
     guess_impl *iter;
 
--- a/libguess.h	Thu Jun 12 20:22:07 2008 +0900
+++ b/libguess.h	Thu Jun 12 22:54:49 2008 +0900
@@ -64,8 +64,5 @@
 #define GUESS_REGION_HW		"hebrew"
 
 const char *guess_encoding(const char *buf, int buflen, const char *lang);
-void guess_init(void);
-void guess_impl_register(const char *name,
-	const char *(impl)(const char *buf, int buflen));
 
 #endif
--- a/test.c	Thu Jun 12 20:22:07 2008 +0900
+++ b/test.c	Thu Jun 12 22:54:49 2008 +0900
@@ -17,9 +17,6 @@
         exit(1);
     }
 
-    //initialize libguess
-    guess_init();
-
     while (fgets(buf, 1024 * 1024 - 1, fp)) {
 //        printf("%s\n", buf);
         printf("length = %d\n", strlen(buf));