# HG changeset patch # User Yoshiki Yazawa # Date 1213278889 -32400 # Node ID 8a64459dab9402907c2257d124d0f3c1f9fdfa4a # Parent ff05c6c659cb93051e4877ba3afef6a72c27e2fc make guess_init() and guess_impl_register() static functions. diff -r ff05c6c659cb -r 8a64459dab94 guess.c --- 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; diff -r ff05c6c659cb -r 8a64459dab94 libguess.h --- 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 diff -r ff05c6c659cb -r 8a64459dab94 test.c --- 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));