1 | /* |
---|
2 | * cabocha.h |
---|
3 | * |
---|
4 | * 2009.3.15 by naoya_t |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | /* Prologue */ |
---|
9 | #ifndef GAUCHE_CABOCHA_H |
---|
10 | #define GAUCHE_CABOCHA_H |
---|
11 | |
---|
12 | #include <gauche.h> |
---|
13 | #include <gauche/extend.h> |
---|
14 | |
---|
15 | SCM_DECL_BEGIN |
---|
16 | |
---|
17 | /* cabocha_t wrapper */ |
---|
18 | typedef struct ScmCaboChaRec { |
---|
19 | SCM_HEADER; |
---|
20 | cabocha_t *c; /* NULL if closed */ |
---|
21 | } ScmCaboCha; |
---|
22 | SCM_CLASS_DECL(Scm_CaboChaClass); |
---|
23 | #define SCM_CLASS_CABOCHA (&Scm_CaboChaClass) |
---|
24 | #define SCM_CABOCHA(obj) ((ScmCaboCha*)(obj)) |
---|
25 | #define SCM_CABOCHAP(obj) (SCM_XTYPEP(obj, SCM_CLASS_CABOCHA)) |
---|
26 | extern cabocha_t* unwrap_cabocha_t(ScmObj obj); |
---|
27 | extern ScmObj wrap_cabocha_t(cabocha_t *m); |
---|
28 | |
---|
29 | /* cabocha_tree_t wrapper */ |
---|
30 | typedef struct ScmCaboChaTreeRec { |
---|
31 | SCM_HEADER; |
---|
32 | cabocha_tree_t *ctree; /* NULL if closed */ |
---|
33 | } ScmCaboChaTree; |
---|
34 | SCM_CLASS_DECL(Scm_CaboChaTreeClass); |
---|
35 | #define SCM_CLASS_CABOCHA_TREE (&Scm_CaboChaTreeClass) |
---|
36 | #define SCM_CABOCHA_TREE(obj) ((ScmCaboChaTree*)(obj)) |
---|
37 | #define SCM_CABOCHA_TREEP(obj) (SCM_XTYPEP(obj, SCM_CLASS_CABOCHA_TREE)) |
---|
38 | extern cabocha_tree_t* unwrap_cabocha_tree_t(ScmObj obj); |
---|
39 | extern ScmObj wrap_cabocha_tree_t(cabocha_tree_t *m); |
---|
40 | |
---|
41 | /* cabocha_chunk_t wrapper */ |
---|
42 | typedef struct ScmCaboChaChunkRec { |
---|
43 | SCM_HEADER; |
---|
44 | cabocha_chunk_t *cchunk; /* NULL if closed */ |
---|
45 | } ScmCaboChaChunk; |
---|
46 | SCM_CLASS_DECL(Scm_CaboChaChunkClass); |
---|
47 | #define SCM_CLASS_CABOCHA_CHUNK (&Scm_CaboChaChunkClass) |
---|
48 | #define SCM_CABOCHA_CHUNK(obj) ((ScmCaboChaChunk*)(obj)) |
---|
49 | #define SCM_CABOCHA_CHUNKP(obj) (SCM_XTYPEP(obj, SCM_CLASS_CABOCHA_CHUNK)) |
---|
50 | extern cabocha_chunk_t* unwrap_cabocha_chunk_t(ScmObj obj); |
---|
51 | extern ScmObj wrap_cabocha_chunk_t(cabocha_chunk_t *m); |
---|
52 | |
---|
53 | /* cabocha_token_t wrapper */ |
---|
54 | typedef struct ScmCaboChaTokenRec { |
---|
55 | SCM_HEADER; |
---|
56 | cabocha_token_t *ctok; /* NULL if closed */ |
---|
57 | } ScmCaboChaToken; |
---|
58 | SCM_CLASS_DECL(Scm_CaboChaTokenClass); |
---|
59 | #define SCM_CLASS_CABOCHA_TOKEN (&Scm_CaboChaTokenClass) |
---|
60 | #define SCM_CABOCHA_TOKEN(obj) ((ScmCaboChaToken*)(obj)) |
---|
61 | #define SCM_CABOCHA_TOKENP(obj) (SCM_XTYPEP(obj, SCM_CLASS_CABOCHA_TOKEN)) |
---|
62 | extern cabocha_token_t* unwrap_cabocha_token_t(ScmObj obj); |
---|
63 | extern ScmObj wrap_cabocha_token_t(cabocha_token_t *m); |
---|
64 | |
---|
65 | |
---|
66 | /* APIs with (int argc, char **argv) */ |
---|
67 | typedef cabocha_t *(*cabocha_func_with_args)(int argc, char **argv); |
---|
68 | // typedef int (*int_func_with_args)(int argc, char **argv); |
---|
69 | extern cabocha_t *cabocha_call_cabocha_func(cabocha_func_with_args fn, ScmObj args); |
---|
70 | extern int cabocha_call_int_func(int_func_with_args fn, ScmObj args); |
---|
71 | |
---|
72 | /* Epilogue */ |
---|
73 | SCM_DECL_END |
---|
74 | |
---|
75 | #endif /* GAUCHE_CABOCHA_H */ |
---|