OSDN Git Service

Change a directory tree
[peercast-im/PeerCastIM.git] / core / common / identify_encoding.h
1 /*
2  *
3  * \8a¿\8e\9a\83R\81[\83h\82Ì\94»\95Ê\82µ\81Aiconv \97p\82Ì\95\8e\9a\83G\83\93\83R\81[\83f\83B\83\93\83O\95\8e\9a\97ñ\82ð\95Ô\82·
4  *
5  * 2001/10/24  Remove static variables
6  *             Kazuhiko Iwama <iwama@ymc.ne.jp>
7  * 2001/10/14  First version
8  *             Kazuhiko Iwama <iwama@ymc.ne.jp>
9  *
10  */
11
12 #ifndef IDENTIFY_ENCODING_H
13 #define IDENTIFY_ENCODING_H
14
15 #define IDENTIFY_MAX_LENGTH 256
16
17 enum identify_encoding_order {
18         ieo_EUCJP = 0,
19         ieo_SJIS  = 1
20 };
21
22 typedef struct {
23         int flag;
24         int state;
25         int c_type;
26 } ie_state_t;
27
28 typedef struct {
29         enum identify_encoding_order order;
30         ie_state_t  st_ascii;
31         ie_state_t  st_jis;
32         ie_state_t  st_sjis;
33         ie_state_t  st_eucjp;
34         ie_state_t  st_utf8;
35 } identify_encoding_t;
36
37 identify_encoding_t* identify_encoding_open(enum identify_encoding_order order);
38 void identify_encoding_close(identify_encoding_t* cd);
39 void identify_encoding_reset(identify_encoding_t* cd);
40 const char *identify_encoding(identify_encoding_t *cd, char* instr);
41
42 #endif