0
|
1 /*
|
|
2 * This code is derivative of guess.c of Gauche-0.8.3.
|
|
3 * The following is the original copyright notice.
|
|
4 */
|
|
5
|
|
6 /*
|
|
7 * Copyright (c) 2000-2003 Shiro Kawai, All rights reserved.
|
|
8 *
|
|
9 * Redistribution and use in source and binary forms, with or without
|
|
10 * modification, are permitted provided that the following conditions
|
|
11 * are met:
|
|
12 *
|
|
13 * 1. Redistributions of source code must retain the above copyright
|
|
14 * notice, this list of conditions and the following disclaimer.
|
|
15 *
|
|
16 * 2. Redistributions in binary form must reproduce the above copyright
|
|
17 * notice, this list of conditions and the following disclaimer in the
|
|
18 * documentation and/or other materials provided with the distribution.
|
|
19 *
|
|
20 * 3. Neither the name of the authors nor the names of its contributors
|
|
21 * may be used to endorse or promote products derived from this
|
|
22 * software without specific prior written permission.
|
|
23 *
|
|
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
27 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
28 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
29 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
|
30 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
31 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
32 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
33 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
34 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
35 *
|
|
36 */
|
|
37
|
|
38 #ifndef _LIBGUESS_H
|
|
39 #define _LIBGUESS_H 1
|
|
40
|
|
41 #include <stdlib.h>
|
|
42 #include <string.h>
|
|
43
|
|
44 /* prototypes */
|
|
45 const char *guess_jp(const char *buf, int buflen);
|
|
46 const char *guess_tw(const char *buf, int buflen);
|
|
47 const char *guess_cn(const char *buf, int buflen);
|
|
48 const char *guess_kr(const char *buf, int buflen);
|
|
49 const char *guess_ru(const char *buf, int buflen);
|
|
50 const char *guess_ar(const char *buf, int buflen);
|
|
51 const char *guess_tr(const char *buf, int buflen);
|
|
52 const char *guess_gr(const char *buf, int buflen);
|
|
53 const char *guess_hw(const char *buf, int buflen);
|
|
54 int dfa_validate_utf8(const char *buf, int buflen);
|
|
55
|
|
56 #define GUESS_REGION_JP "japanese"
|
|
57 #define GUESS_REGION_TW "taiwanese"
|
|
58 #define GUESS_REGION_CN "chinese"
|
|
59 #define GUESS_REGION_KR "korean"
|
|
60 #define GUESS_REGION_RU "russian"
|
|
61 #define GUESS_REGION_AR "arabic"
|
|
62 #define GUESS_REGION_TR "turkish"
|
|
63 #define GUESS_REGION_GR "greek"
|
|
64 #define GUESS_REGION_HW "hebrew"
|
|
65
|
|
66 const char *guess_encoding(const char *buf, int buflen, const char *lang);
|
|
67 void guess_init(void);
|
|
68 void guess_impl_register(const char *name,
|
|
69 const char *(impl)(const char *buf, int buflen));
|
|
70
|
|
71 #endif
|