root/lang/gauche/bindings/cabocha/trunk/cabocha.h @ 97

Revision 89, 2.4 kB (checked in by naoya_t, 16 years ago)

cabocha: +tree +token +chunk

Line 
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
15SCM_DECL_BEGIN
16
17/* cabocha_t wrapper */
18typedef struct ScmCaboChaRec {
19  SCM_HEADER;
20  cabocha_t *c; /* NULL if closed */
21} ScmCaboCha;
22SCM_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))
26extern cabocha_t* unwrap_cabocha_t(ScmObj obj);
27extern ScmObj wrap_cabocha_t(cabocha_t *m);
28
29/* cabocha_tree_t wrapper */
30typedef struct ScmCaboChaTreeRec {
31  SCM_HEADER;
32  cabocha_tree_t *ctree; /* NULL if closed */
33} ScmCaboChaTree;
34SCM_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))
38extern cabocha_tree_t* unwrap_cabocha_tree_t(ScmObj obj);
39extern ScmObj wrap_cabocha_tree_t(cabocha_tree_t *m);
40
41/* cabocha_chunk_t wrapper */
42typedef struct ScmCaboChaChunkRec {
43  SCM_HEADER;
44  cabocha_chunk_t *cchunk; /* NULL if closed */
45} ScmCaboChaChunk;
46SCM_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))
50extern cabocha_chunk_t* unwrap_cabocha_chunk_t(ScmObj obj);
51extern ScmObj wrap_cabocha_chunk_t(cabocha_chunk_t *m);
52
53/* cabocha_token_t wrapper */
54typedef struct ScmCaboChaTokenRec {
55  SCM_HEADER;
56  cabocha_token_t *ctok; /* NULL if closed */
57} ScmCaboChaToken;
58SCM_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))
62extern cabocha_token_t* unwrap_cabocha_token_t(ScmObj obj);
63extern ScmObj wrap_cabocha_token_t(cabocha_token_t *m);
64
65
66/* APIs with (int argc, char **argv) */
67typedef cabocha_t *(*cabocha_func_with_args)(int argc, char **argv);
68// typedef int (*int_func_with_args)(int argc, char **argv);
69extern cabocha_t *cabocha_call_cabocha_func(cabocha_func_with_args fn, ScmObj args);
70extern int cabocha_call_int_func(int_func_with_args fn, ScmObj args);
71
72/* Epilogue */
73SCM_DECL_END
74
75#endif  /* GAUCHE_CABOCHA_H */
Note: See TracBrowser for help on using the browser.