rroonga 0.9.2-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. data/AUTHORS +5 -0
  2. data/NEWS.ja.rdoc +114 -0
  3. data/NEWS.rdoc +116 -0
  4. data/README.ja.rdoc +65 -0
  5. data/README.rdoc +66 -0
  6. data/Rakefile +206 -0
  7. data/benchmark/common.rb +49 -0
  8. data/benchmark/read-write-many-small-items.rb +144 -0
  9. data/benchmark/write-many-small-items.rb +135 -0
  10. data/example/bookmark.rb +161 -0
  11. data/example/index-html.rb +89 -0
  12. data/example/search/config.ru +230 -0
  13. data/example/search/public/css/groonga.css +122 -0
  14. data/ext/.gitignore +2 -0
  15. data/ext/groonga/extconf.rb +93 -0
  16. data/ext/groonga/rb-grn-accessor.c +52 -0
  17. data/ext/groonga/rb-grn-array-cursor.c +36 -0
  18. data/ext/groonga/rb-grn-array.c +210 -0
  19. data/ext/groonga/rb-grn-column.c +573 -0
  20. data/ext/groonga/rb-grn-context.c +662 -0
  21. data/ext/groonga/rb-grn-database.c +472 -0
  22. data/ext/groonga/rb-grn-encoding-support.c +64 -0
  23. data/ext/groonga/rb-grn-encoding.c +257 -0
  24. data/ext/groonga/rb-grn-exception.c +1110 -0
  25. data/ext/groonga/rb-grn-expression-builder.c +75 -0
  26. data/ext/groonga/rb-grn-expression.c +731 -0
  27. data/ext/groonga/rb-grn-fix-size-column.c +166 -0
  28. data/ext/groonga/rb-grn-hash-cursor.c +38 -0
  29. data/ext/groonga/rb-grn-hash.c +294 -0
  30. data/ext/groonga/rb-grn-index-column.c +488 -0
  31. data/ext/groonga/rb-grn-logger.c +504 -0
  32. data/ext/groonga/rb-grn-object.c +1369 -0
  33. data/ext/groonga/rb-grn-operation.c +198 -0
  34. data/ext/groonga/rb-grn-patricia-trie-cursor.c +39 -0
  35. data/ext/groonga/rb-grn-patricia-trie.c +488 -0
  36. data/ext/groonga/rb-grn-procedure.c +52 -0
  37. data/ext/groonga/rb-grn-query.c +260 -0
  38. data/ext/groonga/rb-grn-record.c +40 -0
  39. data/ext/groonga/rb-grn-snippet.c +334 -0
  40. data/ext/groonga/rb-grn-table-cursor-key-support.c +69 -0
  41. data/ext/groonga/rb-grn-table-cursor.c +247 -0
  42. data/ext/groonga/rb-grn-table-key-support.c +714 -0
  43. data/ext/groonga/rb-grn-table.c +1977 -0
  44. data/ext/groonga/rb-grn-type.c +181 -0
  45. data/ext/groonga/rb-grn-utils.c +769 -0
  46. data/ext/groonga/rb-grn-variable-size-column.c +36 -0
  47. data/ext/groonga/rb-grn-variable.c +108 -0
  48. data/ext/groonga/rb-grn-view-accessor.c +53 -0
  49. data/ext/groonga/rb-grn-view-cursor.c +35 -0
  50. data/ext/groonga/rb-grn-view-record.c +41 -0
  51. data/ext/groonga/rb-grn-view.c +421 -0
  52. data/ext/groonga/rb-grn.h +698 -0
  53. data/ext/groonga/rb-groonga.c +107 -0
  54. data/extconf.rb +130 -0
  55. data/html/bar.svg +153 -0
  56. data/html/developer.html +117 -0
  57. data/html/developer.svg +469 -0
  58. data/html/download.svg +253 -0
  59. data/html/favicon.ico +0 -0
  60. data/html/favicon.xcf +0 -0
  61. data/html/footer.html.erb +28 -0
  62. data/html/head.html.erb +4 -0
  63. data/html/header.html.erb +17 -0
  64. data/html/index.html +147 -0
  65. data/html/install.svg +636 -0
  66. data/html/logo.xcf +0 -0
  67. data/html/ranguba.css +250 -0
  68. data/html/tutorial.svg +559 -0
  69. data/lib/1.8/groonga.so +0 -0
  70. data/lib/1.9/groonga.so +0 -0
  71. data/lib/groonga.rb +90 -0
  72. data/lib/groonga/context.rb +184 -0
  73. data/lib/groonga/expression-builder.rb +324 -0
  74. data/lib/groonga/patricia-trie.rb +85 -0
  75. data/lib/groonga/record.rb +311 -0
  76. data/lib/groonga/schema.rb +1191 -0
  77. data/lib/groonga/view-record.rb +56 -0
  78. data/license/GPL +340 -0
  79. data/license/LGPL +504 -0
  80. data/license/RUBY +59 -0
  81. data/misc/grnop2ruby.rb +49 -0
  82. data/pkg-config.rb +333 -0
  83. data/rroonga-build.rb +57 -0
  84. data/test-unit/Rakefile +40 -0
  85. data/test-unit/TODO +5 -0
  86. data/test-unit/bin/testrb +5 -0
  87. data/test-unit/html/classic.html +15 -0
  88. data/test-unit/html/index.html +25 -0
  89. data/test-unit/html/index.html.ja +27 -0
  90. data/test-unit/lib/test/unit.rb +323 -0
  91. data/test-unit/lib/test/unit/assertionfailederror.rb +25 -0
  92. data/test-unit/lib/test/unit/assertions.rb +1230 -0
  93. data/test-unit/lib/test/unit/attribute.rb +125 -0
  94. data/test-unit/lib/test/unit/autorunner.rb +360 -0
  95. data/test-unit/lib/test/unit/collector.rb +36 -0
  96. data/test-unit/lib/test/unit/collector/descendant.rb +23 -0
  97. data/test-unit/lib/test/unit/collector/dir.rb +108 -0
  98. data/test-unit/lib/test/unit/collector/load.rb +144 -0
  99. data/test-unit/lib/test/unit/collector/objectspace.rb +34 -0
  100. data/test-unit/lib/test/unit/color-scheme.rb +102 -0
  101. data/test-unit/lib/test/unit/color.rb +96 -0
  102. data/test-unit/lib/test/unit/diff.rb +724 -0
  103. data/test-unit/lib/test/unit/error.rb +130 -0
  104. data/test-unit/lib/test/unit/exceptionhandler.rb +39 -0
  105. data/test-unit/lib/test/unit/failure.rb +136 -0
  106. data/test-unit/lib/test/unit/fixture.rb +176 -0
  107. data/test-unit/lib/test/unit/notification.rb +129 -0
  108. data/test-unit/lib/test/unit/omission.rb +191 -0
  109. data/test-unit/lib/test/unit/pending.rb +150 -0
  110. data/test-unit/lib/test/unit/priority.rb +180 -0
  111. data/test-unit/lib/test/unit/runner/console.rb +52 -0
  112. data/test-unit/lib/test/unit/runner/emacs.rb +8 -0
  113. data/test-unit/lib/test/unit/runner/tap.rb +8 -0
  114. data/test-unit/lib/test/unit/testcase.rb +476 -0
  115. data/test-unit/lib/test/unit/testresult.rb +89 -0
  116. data/test-unit/lib/test/unit/testsuite.rb +110 -0
  117. data/test-unit/lib/test/unit/ui/console/outputlevel.rb +14 -0
  118. data/test-unit/lib/test/unit/ui/console/testrunner.rb +466 -0
  119. data/test-unit/lib/test/unit/ui/emacs/testrunner.rb +63 -0
  120. data/test-unit/lib/test/unit/ui/tap/testrunner.rb +92 -0
  121. data/test-unit/lib/test/unit/ui/testrunner.rb +28 -0
  122. data/test-unit/lib/test/unit/ui/testrunnermediator.rb +77 -0
  123. data/test-unit/lib/test/unit/ui/testrunnerutilities.rb +41 -0
  124. data/test-unit/lib/test/unit/util/backtracefilter.rb +41 -0
  125. data/test-unit/lib/test/unit/util/method-owner-finder.rb +28 -0
  126. data/test-unit/lib/test/unit/util/observable.rb +90 -0
  127. data/test-unit/lib/test/unit/util/procwrapper.rb +48 -0
  128. data/test-unit/lib/test/unit/version.rb +7 -0
  129. data/test-unit/sample/adder.rb +13 -0
  130. data/test-unit/sample/subtracter.rb +12 -0
  131. data/test-unit/sample/test_adder.rb +20 -0
  132. data/test-unit/sample/test_subtracter.rb +20 -0
  133. data/test-unit/sample/test_user.rb +23 -0
  134. data/test-unit/test/collector/test-descendant.rb +133 -0
  135. data/test-unit/test/collector/test-load.rb +442 -0
  136. data/test-unit/test/collector/test_dir.rb +406 -0
  137. data/test-unit/test/collector/test_objectspace.rb +100 -0
  138. data/test-unit/test/run-test.rb +15 -0
  139. data/test-unit/test/test-attribute.rb +86 -0
  140. data/test-unit/test/test-color-scheme.rb +67 -0
  141. data/test-unit/test/test-color.rb +47 -0
  142. data/test-unit/test/test-diff.rb +518 -0
  143. data/test-unit/test/test-emacs-runner.rb +60 -0
  144. data/test-unit/test/test-fixture.rb +287 -0
  145. data/test-unit/test/test-notification.rb +33 -0
  146. data/test-unit/test/test-omission.rb +81 -0
  147. data/test-unit/test/test-pending.rb +70 -0
  148. data/test-unit/test/test-priority.rb +119 -0
  149. data/test-unit/test/test-testcase.rb +544 -0
  150. data/test-unit/test/test_assertions.rb +1151 -0
  151. data/test-unit/test/test_error.rb +26 -0
  152. data/test-unit/test/test_failure.rb +33 -0
  153. data/test-unit/test/test_testresult.rb +113 -0
  154. data/test-unit/test/test_testsuite.rb +129 -0
  155. data/test-unit/test/testunit-test-util.rb +14 -0
  156. data/test-unit/test/ui/test_testrunmediator.rb +20 -0
  157. data/test-unit/test/util/test-method-owner-finder.rb +38 -0
  158. data/test-unit/test/util/test_backtracefilter.rb +41 -0
  159. data/test-unit/test/util/test_observable.rb +102 -0
  160. data/test-unit/test/util/test_procwrapper.rb +36 -0
  161. data/test/.gitignore +1 -0
  162. data/test/groonga-test-utils.rb +134 -0
  163. data/test/run-test.rb +58 -0
  164. data/test/test-array.rb +90 -0
  165. data/test/test-column.rb +316 -0
  166. data/test/test-context-select.rb +93 -0
  167. data/test/test-context.rb +73 -0
  168. data/test/test-database.rb +113 -0
  169. data/test/test-encoding.rb +33 -0
  170. data/test/test-exception.rb +93 -0
  171. data/test/test-expression-builder.rb +217 -0
  172. data/test/test-expression.rb +134 -0
  173. data/test/test-fix-size-column.rb +65 -0
  174. data/test/test-gqtp.rb +72 -0
  175. data/test/test-hash.rb +305 -0
  176. data/test/test-index-column.rb +81 -0
  177. data/test/test-logger.rb +37 -0
  178. data/test/test-patricia-trie.rb +205 -0
  179. data/test/test-procedure.rb +37 -0
  180. data/test/test-query.rb +22 -0
  181. data/test/test-record.rb +243 -0
  182. data/test/test-remote.rb +54 -0
  183. data/test/test-schema-view.rb +90 -0
  184. data/test/test-schema.rb +459 -0
  185. data/test/test-snippet.rb +130 -0
  186. data/test/test-table-cursor.rb +153 -0
  187. data/test/test-table-offset-and-limit.rb +102 -0
  188. data/test/test-table-select-normalize.rb +53 -0
  189. data/test/test-table-select.rb +150 -0
  190. data/test/test-table.rb +594 -0
  191. data/test/test-type.rb +71 -0
  192. data/test/test-variable-size-column.rb +98 -0
  193. data/test/test-variable.rb +28 -0
  194. data/test/test-vector-column.rb +76 -0
  195. data/test/test-version.rb +31 -0
  196. data/test/test-view.rb +72 -0
  197. data/text/TUTORIAL.ja.rdoc +392 -0
  198. data/text/expression.rdoc +284 -0
  199. metadata +276 -0
@@ -0,0 +1,698 @@
1
+ /* -*- c-file-style: "ruby" -*- */
2
+ /*
3
+ Copyright (C) 2009-2010 Kouhei Sutou <kou@clear-code.com>
4
+
5
+ This library is free software; you can redistribute it and/or
6
+ modify it under the terms of the GNU Lesser General Public
7
+ License version 2.1 as published by the Free Software Foundation.
8
+
9
+ This library is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ Lesser General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Lesser General Public
15
+ License along with this library; if not, write to the Free Software
16
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
+ */
18
+
19
+ #ifndef __RB_GRN_H__
20
+ #define __RB_GRN_H__
21
+
22
+ #include <ruby.h>
23
+
24
+ #ifdef HAVE_RUBY_ENCODING_H
25
+ # include <ruby/encoding.h>
26
+ #endif
27
+
28
+ #include <groonga.h>
29
+
30
+ #if defined(__cplusplus)
31
+ # define RB_GRN_BEGIN_DECLS extern "C" {
32
+ # define RB_GRN_END_DECLS }
33
+ #else
34
+ # define RB_GRN_BEGIN_DECLS
35
+ # define RB_GRN_END_DECLS
36
+ #endif
37
+
38
+ RB_GRN_BEGIN_DECLS
39
+
40
+ #if __GNUC__ >= 4
41
+ # define RB_GRN_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
42
+ #else
43
+ # define RB_GRN_GNUC_NULL_TERMINATED
44
+ #endif
45
+
46
+ #if defined(RUBY_GRN_PLATFORM_WIN32) && !defined(RB_GRN_PLATFORM_WIN32)
47
+ # define RB_GRN_PLATFORM_WIN32 RUBY_GRN_PLATFORM_WIN32
48
+ #endif
49
+
50
+ #if defined(RUBY_GRN_STATIC_COMPILATION) && !defined(RB_GRN_STATIC_COMPILATION)
51
+ # define RB_GRN_STATIC_COMPILATION RUBY_GRN_STATIC_COMPILATION
52
+ #endif
53
+
54
+ #if defined(RB_GRN_PLATFORM_WIN32) && !defined(RB_GRN_STATIC_COMPILATION)
55
+ # ifdef RB_GRN_COMPILATION
56
+ # define RB_GRN_VAR __declspec(dllexport)
57
+ # else
58
+ # define RB_GRN_VAR extern __declspec(dllimport)
59
+ # endif
60
+ #else
61
+ # define RB_GRN_VAR extern
62
+ #endif
63
+
64
+ #ifdef RB_GRN_DEBUG
65
+ # define debug(...) fprintf(stderr, __VA_ARGS__)
66
+ #else
67
+ # define debug(...)
68
+ #endif
69
+
70
+ #define RB_GRN_MAJOR_VERSION 0
71
+ #define RB_GRN_MINOR_VERSION 9
72
+ #define RB_GRN_MICRO_VERSION 2
73
+
74
+ typedef int rb_grn_boolean;
75
+ #define RB_GRN_FALSE (0)
76
+ #define RB_GRN_TRUE (!RB_GRN_FALSE)
77
+
78
+ #define RB_GRN_QUERY_DEFAULT_MAX_EXPRESSIONS 32
79
+
80
+ #include <stdint.h>
81
+
82
+ #define RB_GRN_OBJECT(object) ((RbGrnObject *)(object))
83
+ #define RB_GRN_NAMED_OBJECT(object) ((RbGrnNamedObject *)(object))
84
+ #define RB_GRN_TABLE(object) ((RbGrnTable *)(object))
85
+ #define RB_GRN_TABLE_KEY_SUPPORT(object) ((RbGrnTableKeySupport *)(object))
86
+ #define RB_GRN_TABLE_CURSOR(object) ((RbGrnTableCursort *)(object))
87
+ #define RB_GRN_COLUMN(object) ((RbGrnColumn *)(object))
88
+ #define RB_GRN_INDEX_COLUMN(object) ((RbGrnIndexColumn *)(object))
89
+ #define RB_GRN_ACCESSOR(object) ((RbGrnAccessor *)(object))
90
+ #define RB_GRN_ACCESSOR_VIEW(object) ((RbGrnAccessor *)(object))
91
+ #define RB_GRN_EXPRESSION(object) ((RbGrnExpression *)(object))
92
+ #define RB_GRN_UNBIND_FUNCTION(function) ((RbGrnUnbindFunction)(function))
93
+
94
+ typedef void (*RbGrnUnbindFunction) (void *object);
95
+
96
+ typedef struct _RbGrnContext RbGrnContext;
97
+ struct _RbGrnContext
98
+ {
99
+ grn_ctx *context;
100
+ VALUE self;
101
+ };
102
+
103
+ typedef struct _RbGrnObject RbGrnObject;
104
+ struct _RbGrnObject
105
+ {
106
+ VALUE self;
107
+ grn_ctx *context;
108
+ grn_obj *object;
109
+ grn_obj *domain;
110
+ grn_id domain_id;
111
+ grn_obj *range;
112
+ grn_id range_id;
113
+ rb_grn_boolean need_close;
114
+ rb_grn_boolean have_finalizer;
115
+ };
116
+
117
+ typedef struct _RbGrnNamedObject RbGrnNamedObject;
118
+ struct _RbGrnNamedObject
119
+ {
120
+ RbGrnObject parent;
121
+ char *name;
122
+ unsigned name_size;
123
+ };
124
+
125
+ typedef struct _RbGrnTable RbGrnTable;
126
+ struct _RbGrnTable
127
+ {
128
+ RbGrnObject parent;
129
+ grn_obj *value;
130
+ VALUE columns;
131
+ };
132
+
133
+ typedef struct _RbGrnTableKeySupport RbGrnTableKeySupport;
134
+ struct _RbGrnTableKeySupport
135
+ {
136
+ RbGrnTable parent;
137
+ grn_obj *key;
138
+ };
139
+
140
+ typedef struct _RbGrnColumn RbGrnColumn;
141
+ struct _RbGrnColumn
142
+ {
143
+ RbGrnNamedObject parent;
144
+ grn_obj *value;
145
+ };
146
+
147
+ typedef struct _RbGrnIndexColumn RbGrnIndexColumn;
148
+ struct _RbGrnIndexColumn
149
+ {
150
+ RbGrnColumn parent;
151
+ grn_obj *old_value;
152
+ grn_obj *id_query;
153
+ grn_obj *string_query;
154
+ };
155
+
156
+ typedef struct _RbGrnAccessor RbGrnAccessor;
157
+ struct _RbGrnAccessor
158
+ {
159
+ RbGrnNamedObject parent;
160
+ };
161
+
162
+ typedef struct _RbGrnTableCursor RbGrnTableCursor;
163
+ struct _RbGrnTableCursor
164
+ {
165
+ RbGrnObject parent;
166
+ };
167
+
168
+ typedef struct _RbGrnVariable RbGrnVariable;
169
+ struct _RbGrnVariable
170
+ {
171
+ RbGrnObject parent;
172
+ };
173
+
174
+ typedef struct _RbGrnExpression RbGrnExpression;
175
+ struct _RbGrnExpression
176
+ {
177
+ RbGrnObject parent;
178
+ grn_obj *value;
179
+ };
180
+
181
+ RB_GRN_VAR rb_grn_boolean rb_grn_exited;
182
+
183
+ RB_GRN_VAR VALUE rb_eGrnError;
184
+ RB_GRN_VAR VALUE rb_eGrnObjectClosed;
185
+ RB_GRN_VAR VALUE rb_eGrnNoSuchColumn;
186
+ RB_GRN_VAR VALUE rb_eGrnInvalidArgument;
187
+ RB_GRN_VAR VALUE rb_cGrnObject;
188
+ RB_GRN_VAR VALUE rb_mGrnEncodingSupport;
189
+ RB_GRN_VAR VALUE rb_cGrnDatabase;
190
+ RB_GRN_VAR VALUE rb_cGrnTable;
191
+ RB_GRN_VAR VALUE rb_mGrnTableKeySupport;
192
+ RB_GRN_VAR VALUE rb_cGrnHash;
193
+ RB_GRN_VAR VALUE rb_cGrnPatriciaTrie;
194
+ RB_GRN_VAR VALUE rb_cGrnArray;
195
+ RB_GRN_VAR VALUE rb_cGrnView;
196
+ RB_GRN_VAR VALUE rb_cGrnTableCursor;
197
+ RB_GRN_VAR VALUE rb_mGrnTableCursorKeySupport;
198
+ RB_GRN_VAR VALUE rb_cGrnHashCursor;
199
+ RB_GRN_VAR VALUE rb_cGrnPatriciaTrieCursor;
200
+ RB_GRN_VAR VALUE rb_cGrnViewCursor;
201
+ RB_GRN_VAR VALUE rb_cGrnArrayCursor;
202
+ RB_GRN_VAR VALUE rb_cGrnType;
203
+ RB_GRN_VAR VALUE rb_cGrnProcedure;
204
+ RB_GRN_VAR VALUE rb_cGrnColumn;
205
+ RB_GRN_VAR VALUE rb_cGrnFixSizeColumn;
206
+ RB_GRN_VAR VALUE rb_cGrnVariableSizeColumn;
207
+ RB_GRN_VAR VALUE rb_cGrnIndexColumn;
208
+ RB_GRN_VAR VALUE rb_cGrnAccessor;
209
+ RB_GRN_VAR VALUE rb_cGrnViewAccessor;
210
+ RB_GRN_VAR VALUE rb_cGrnRecord;
211
+ RB_GRN_VAR VALUE rb_cGrnViewRecord;
212
+ RB_GRN_VAR VALUE rb_cGrnQuery;
213
+ RB_GRN_VAR VALUE rb_cGrnLogger;
214
+ RB_GRN_VAR VALUE rb_cGrnSnippet;
215
+ RB_GRN_VAR VALUE rb_cGrnVariable;
216
+ RB_GRN_VAR VALUE rb_cGrnOperation;
217
+ RB_GRN_VAR VALUE rb_cGrnExpression;
218
+ RB_GRN_VAR VALUE rb_cGrnRecordExpressionBuilder;
219
+ RB_GRN_VAR VALUE rb_cGrnColumnExpressionBuilder;
220
+
221
+ void rb_grn_init_utils (VALUE mGrn);
222
+ void rb_grn_init_exception (VALUE mGrn);
223
+ void rb_grn_init_encoding (VALUE mGrn);
224
+ void rb_grn_init_encoding_support (VALUE mGrn);
225
+ void rb_grn_init_context (VALUE mGrn);
226
+ void rb_grn_init_object (VALUE mGrn);
227
+ void rb_grn_init_database (VALUE mGrn);
228
+ void rb_grn_init_table (VALUE mGrn);
229
+ void rb_grn_init_table_key_support (VALUE mGrn);
230
+ void rb_grn_init_array (VALUE mGrn);
231
+ void rb_grn_init_hash (VALUE mGrn);
232
+ void rb_grn_init_patricia_trie (VALUE mGrn);
233
+ void rb_grn_init_view (VALUE mGrn);
234
+ void rb_grn_init_table_cursor (VALUE mGrn);
235
+ void rb_grn_init_table_cursor_key_support (VALUE mGrn);
236
+ void rb_grn_init_array_cursor (VALUE mGrn);
237
+ void rb_grn_init_hash_cursor (VALUE mGrn);
238
+ void rb_grn_init_patricia_trie_cursor (VALUE mGrn);
239
+ void rb_grn_init_view_cursor (VALUE mGrn);
240
+ void rb_grn_init_type (VALUE mGrn);
241
+ void rb_grn_init_procedure (VALUE mGrn);
242
+ void rb_grn_init_column (VALUE mGrn);
243
+ void rb_grn_init_fix_size_column (VALUE mGrn);
244
+ void rb_grn_init_variable_size_column (VALUE mGrn);
245
+ void rb_grn_init_index_column (VALUE mGrn);
246
+ void rb_grn_init_accessor (VALUE mGrn);
247
+ void rb_grn_init_view_accessor (VALUE mGrn);
248
+ void rb_grn_init_record (VALUE mGrn);
249
+ void rb_grn_init_view_record (VALUE mGrn);
250
+ void rb_grn_init_query (VALUE mGrn);
251
+ void rb_grn_init_variable (VALUE mGrn);
252
+ void rb_grn_init_operation (VALUE mGrn);
253
+ void rb_grn_init_expression (VALUE mGrn);
254
+ void rb_grn_init_expression_builder (VALUE mGrn);
255
+ void rb_grn_init_logger (VALUE mGrn);
256
+ void rb_grn_init_snippet (VALUE mGrn);
257
+
258
+ VALUE rb_grn_rc_to_exception (grn_rc rc);
259
+ const char *rb_grn_rc_to_message (grn_rc rc);
260
+ void rb_grn_rc_check (grn_rc rc,
261
+ VALUE related_object);
262
+
263
+ void rb_grn_context_fin (grn_ctx *context);
264
+ grn_ctx *rb_grn_context_ensure (VALUE *context);
265
+ VALUE rb_grn_context_get_default (void);
266
+ VALUE rb_grn_context_to_exception (grn_ctx *context,
267
+ VALUE related_object);
268
+ void rb_grn_context_check (grn_ctx *context,
269
+ VALUE related_object);
270
+ grn_obj *rb_grn_context_get_backward_compatibility
271
+ (grn_ctx *context,
272
+ const char *name,
273
+ unsigned int name_size);
274
+
275
+ const char *rb_grn_inspect (VALUE object);
276
+ void rb_grn_scan_options (VALUE options, ...)
277
+ RB_GRN_GNUC_NULL_TERMINATED;
278
+ rb_grn_boolean rb_grn_equal_option (VALUE option,
279
+ const char *key);
280
+
281
+ VALUE rb_grn_object_alloc (VALUE klass);
282
+ void rb_grn_object_bind (VALUE self,
283
+ VALUE rb_context,
284
+ RbGrnObject *rb_grn_object,
285
+ grn_ctx *context,
286
+ grn_obj *object);
287
+ void rb_grn_object_free (RbGrnObject *rb_grn_object);
288
+ void rb_grn_object_assign (VALUE klass,
289
+ VALUE self,
290
+ VALUE rb_context,
291
+ grn_ctx *context,
292
+ grn_obj *object);
293
+ void rb_grn_object_deconstruct (RbGrnObject *rb_grn_object,
294
+ grn_obj **object,
295
+ grn_ctx **context,
296
+ grn_id *domain_id,
297
+ grn_obj **domain,
298
+ grn_id *range_id,
299
+ grn_obj **range);
300
+
301
+ VALUE rb_grn_object_get_id (VALUE object);
302
+ VALUE rb_grn_object_array_reference (VALUE object,
303
+ VALUE rb_id);
304
+ VALUE rb_grn_object_set_raw (RbGrnObject *rb_grn_object,
305
+ grn_id id,
306
+ VALUE rb_value,
307
+ int flags,
308
+ VALUE related_object);
309
+ VALUE rb_grn_object_close (VALUE object);
310
+ VALUE rb_grn_object_closed_p (VALUE object);
311
+ VALUE rb_grn_object_inspect_object (VALUE inspected,
312
+ grn_ctx *context,
313
+ grn_obj *object);
314
+ VALUE rb_grn_object_inspect_object_content (VALUE inspected,
315
+ grn_ctx *context,
316
+ grn_obj *object);
317
+ VALUE rb_grn_object_inspect_header (VALUE object,
318
+ VALUE inspected);
319
+ VALUE rb_grn_object_inspect_content (VALUE object,
320
+ VALUE inspected);
321
+ VALUE rb_grn_object_inspect_footer (VALUE object,
322
+ VALUE inspected);
323
+
324
+ void rb_grn_named_object_bind (RbGrnNamedObject *rb_grn_named_object,
325
+ grn_ctx *context,
326
+ grn_obj *object);
327
+ void rb_grn_named_object_finalizer (grn_ctx *context,
328
+ grn_obj *column,
329
+ RbGrnNamedObject *rb_grn_named_object);
330
+ void rb_grn_named_object_set_name (RbGrnNamedObject *rb_grn_named_object,
331
+ const char *name,
332
+ unsigned name_size);
333
+
334
+ void rb_grn_table_bind (RbGrnTable *rb_grn_table,
335
+ grn_ctx *context,
336
+ grn_obj *table_key_support);
337
+ void rb_grn_table_finalizer (grn_ctx *context,
338
+ grn_obj *grn_object,
339
+ RbGrnTable *rb_grn_table);
340
+ void rb_grn_table_deconstruct (RbGrnTable *rb_grn_table,
341
+ grn_obj **table,
342
+ grn_ctx **context,
343
+ grn_id *domain_id,
344
+ grn_obj **domain,
345
+ grn_obj **value,
346
+ grn_id *range_id,
347
+ grn_obj **range,
348
+ VALUE *columns);
349
+
350
+ VALUE rb_grn_table_delete (VALUE self,
351
+ VALUE rb_id);
352
+ VALUE rb_grn_table_array_reference (VALUE self,
353
+ VALUE rb_id);
354
+ VALUE rb_grn_table_array_set (VALUE self,
355
+ VALUE rb_id,
356
+ VALUE rb_value);
357
+ VALUE rb_grn_table_get_value (VALUE self,
358
+ VALUE rb_id);
359
+ VALUE rb_grn_table_set_value (VALUE self,
360
+ VALUE rb_id,
361
+ VALUE rb_value);
362
+ VALUE rb_grn_table_get_column (VALUE self,
363
+ VALUE rb_name);
364
+ VALUE rb_grn_table_get_column_surely (VALUE self,
365
+ VALUE rb_name);
366
+ VALUE rb_grn_table_get_column_value_raw (VALUE self,
367
+ grn_id id,
368
+ VALUE rb_name);
369
+ VALUE rb_grn_table_get_column_value (VALUE self,
370
+ VALUE rb_id,
371
+ VALUE rb_name);
372
+ VALUE rb_grn_table_set_column_value_raw (VALUE self,
373
+ grn_id id,
374
+ VALUE rb_name,
375
+ VALUE rb_value);
376
+ VALUE rb_grn_table_set_column_value (VALUE self,
377
+ VALUE rb_id,
378
+ VALUE rb_name,
379
+ VALUE rb_value);
380
+
381
+ grn_ctx *rb_grn_table_cursor_ensure_context (VALUE cursor,
382
+ VALUE *rb_context);
383
+
384
+ void rb_grn_table_key_support_bind (RbGrnTableKeySupport *rb_grn_table_key_support,
385
+ grn_ctx *context,
386
+ grn_obj *table_key_support);
387
+ void rb_grn_table_key_support_finalizer (grn_ctx *context,
388
+ grn_obj *grn_object,
389
+ RbGrnTableKeySupport *rb_grn_table_key_support);
390
+ void rb_grn_table_key_support_deconstruct (RbGrnTableKeySupport *rb_grn_table_key_support,
391
+ grn_obj **table_key_support,
392
+ grn_ctx **context,
393
+ grn_obj **key,
394
+ grn_id *domain_id,
395
+ grn_obj **domain,
396
+ grn_obj **value,
397
+ grn_id *range_id,
398
+ grn_obj **range,
399
+ VALUE *columns);
400
+ grn_id rb_grn_table_key_support_get (VALUE self,
401
+ VALUE rb_key);
402
+
403
+ void rb_grn_column_bind (RbGrnColumn *rb_grn_column,
404
+ grn_ctx *context,
405
+ grn_obj *column);
406
+ void rb_grn_column_finalizer (grn_ctx *context,
407
+ grn_obj *column,
408
+ RbGrnColumn *rb_grn_column);
409
+ void rb_grn_column_deconstruct (RbGrnColumn *rb_grn_column,
410
+ grn_obj **column,
411
+ grn_ctx **context,
412
+ grn_id *domain_id,
413
+ grn_obj **domain,
414
+ grn_obj **value,
415
+ grn_id *range_id,
416
+ grn_obj **range);
417
+
418
+ void rb_grn_index_column_bind (RbGrnIndexColumn *rb_grn_index_column,
419
+ grn_ctx *context,
420
+ grn_obj *object);
421
+ void rb_grn_index_column_finalizer (grn_ctx *context,
422
+ grn_obj *grn_object,
423
+ RbGrnIndexColumn *rb_grn_index_column);
424
+ void rb_grn_index_column_deconstruct (RbGrnIndexColumn *rb_grn_index_column,
425
+ grn_obj **column,
426
+ grn_ctx **context,
427
+ grn_id *domain_id,
428
+ grn_obj **domain,
429
+ grn_obj **value,
430
+ grn_obj **old_value,
431
+ grn_id *range_id,
432
+ grn_obj **range,
433
+ grn_obj **id_query,
434
+ grn_obj **string_query);
435
+
436
+ void rb_grn_accessor_bind (RbGrnAccessor *rb_grn_accessor,
437
+ grn_ctx *context,
438
+ grn_obj *accessor);
439
+ void rb_grn_accessor_finalizer (grn_ctx *context,
440
+ grn_obj *accessor,
441
+ RbGrnAccessor *rb_grn_accessor);
442
+
443
+ void rb_grn_expression_bind (RbGrnExpression *rb_grn_expression,
444
+ grn_ctx *context,
445
+ grn_obj *expression);
446
+ void rb_grn_expression_finalizer (grn_ctx *context,
447
+ grn_obj *grn_object,
448
+ RbGrnExpression *rb_grn_expression);
449
+
450
+ VALUE rb_grn_record_new (VALUE table,
451
+ grn_id id,
452
+ VALUE values);
453
+ VALUE rb_grn_record_new_raw (VALUE table,
454
+ VALUE id,
455
+ VALUE values);
456
+
457
+ VALUE rb_grn_view_record_new (VALUE view,
458
+ grn_obj *id);
459
+ VALUE rb_grn_view_record_new_raw (VALUE view,
460
+ VALUE id);
461
+
462
+ VALUE rb_grn_record_expression_builder_new (VALUE table,
463
+ VALUE name);
464
+ VALUE rb_grn_record_expression_builder_build
465
+ (VALUE self);
466
+ VALUE rb_grn_column_expression_builder_new (VALUE column,
467
+ VALUE name,
468
+ VALUE query);
469
+ VALUE rb_grn_column_expression_builder_build
470
+ (VALUE self);
471
+
472
+
473
+ #define RB_GRN_INTERN(string) (ID2SYM(rb_intern(string)))
474
+
475
+ #define RVAL2CBOOL(object) (RTEST(object))
476
+ #define CBOOL2RVAL(boolean) ((boolean) ? Qtrue : Qfalse)
477
+
478
+ #define RVAL2GRNENCODING(object, context) \
479
+ (rb_grn_encoding_from_ruby_object(object, context))
480
+ #define GRNENCODING2RVAL(encoding) (rb_grn_encoding_to_ruby_object(encoding))
481
+
482
+ #define RVAL2GRNCONTEXT(object) (rb_grn_context_from_ruby_object(object))
483
+ #define GRNCONTEXT2RVAL(context) (rb_grn_context_to_ruby_object(context))
484
+
485
+ #define RVAL2GRNOBJECT(rb_object, context) \
486
+ (rb_grn_object_from_ruby_object(rb_object, context))
487
+ #define GRNOBJECT2RVAL(klass, context, object, owner) \
488
+ (rb_grn_object_to_ruby_object(klass, context, object, owner))
489
+ #define GRNOBJECT2RCLASS(object) (rb_grn_object_to_ruby_class(object))
490
+
491
+ /* TODO: MORE BETTER NAME!!! PLEASE!!! */
492
+ #define RVAL2GRNOBJ(rb_object, context, object) \
493
+ (rb_grn_obj_from_ruby_object(rb_object, context, object))
494
+ #define GRNOBJ2RVAL(klass, context, object, related_object) \
495
+ (rb_grn_obj_to_ruby_object(klass, context, object, related_object))
496
+
497
+ #define RVAL2GRNDB(object) (rb_grn_database_from_ruby_object(object))
498
+ #define GRNDB2RVAL(context, db, owner) \
499
+ (rb_grn_database_to_ruby_object(context, db, owner))
500
+
501
+ #define RVAL2GRNTABLE(object, context)(rb_grn_table_from_ruby_object(object, context))
502
+ #define GRNTABLE2RVAL(context, table, owner) \
503
+ (rb_grn_table_to_ruby_object(context, table, owner))
504
+
505
+ #define RVAL2GRNTABLECURSOR(object) (rb_grn_table_cursor_from_ruby_object(object))
506
+ #define GRNTABLECURSOR2RVAL(klass, context, cursor) \
507
+ (rb_grn_table_cursor_to_ruby_object(klass, context, cursor, RB_GRN_TRUE))
508
+ #define GRNTABLECURSOR2RCLASS(object) (rb_grn_table_cursor_to_ruby_class(object))
509
+
510
+ #define RVAL2GRNCOLUMN(object, context) \
511
+ (rb_grn_column_from_ruby_object(object, context))
512
+ #define GRNCOLUMN2RVAL(klass, context, column, owner) \
513
+ (rb_grn_column_to_ruby_object(klass, context, column, owner))
514
+
515
+ #define RVAL2GRNQUERY(object) (rb_grn_query_from_ruby_object(object))
516
+ #define GRNQUERY2RVAL(context, column)(rb_grn_query_to_ruby_object(context, column))
517
+
518
+ #define RVAL2GRNOPERATOR(object) (rb_grn_operator_from_ruby_object(object))
519
+
520
+ #define RVAL2GRNLOGGER(object) (rb_grn_logger_from_ruby_object(object))
521
+
522
+ #define RVAL2GRNBULK(object, context, bulk) \
523
+ (rb_grn_bulk_from_ruby_object(object, context, bulk))
524
+ #define RVAL2GRNBULK_WITH_TYPE(object, context, bulk, type_id, type) \
525
+ (rb_grn_bulk_from_ruby_object_with_type(object, context, bulk, type_id, type))
526
+ #define GRNBULK2RVAL(context, bulk, range, related_object) \
527
+ (rb_grn_bulk_to_ruby_object(context, bulk, range, related_object))
528
+
529
+ #define RVAL2GRNVECTOR(object, context, vector) \
530
+ (rb_grn_vector_from_ruby_object(object, context, vector))
531
+ #define GRNVECTOR2RVAL(context, vector) \
532
+ (rb_grn_vector_to_ruby_object(context, vector))
533
+
534
+ #define RVAL2GRNUVECTOR(object, context, uvector, related_object) \
535
+ (rb_grn_uvector_from_ruby_object(object, context, uvector, related_object))
536
+ #define GRNUVECTOR2RVAL(context, uvector) \
537
+ (rb_grn_uvector_to_ruby_object(context, uvector))
538
+
539
+ #define GRNVALUE2RVAL(context, value, range, related_object) \
540
+ (rb_grn_value_to_ruby_object(context, value, range, related_object))
541
+
542
+ #define RVAL2GRNID(object, context, table, related_object) \
543
+ (rb_grn_id_from_ruby_object(object, context, table, related_object))
544
+
545
+ #define GRNKEY2RVAL(context, key, key_size, table, related_object) \
546
+ (rb_grn_key_to_ruby_object(context, key, key_size, table, related_object))
547
+ #define RVAL2GRNKEY(object, context, key, domain_id, domain, related_object) \
548
+ (rb_grn_key_from_ruby_object(object, context, key, domain_id, \
549
+ domain, related_object))
550
+
551
+ #define GRNVARIABLE2RVAL(context, variable) \
552
+ (rb_grn_variable_to_ruby_object(context, variable))
553
+ #define RVAL2GRNVARIABLE(object, context) \
554
+ (rb_grn_variable_from_ruby_object(object, context))
555
+
556
+ #define GRNSNIPPET2RVAL(context, snippet, owner) \
557
+ (rb_grn_snippet_to_ruby_object(context, snippet, owner))
558
+ #define RVAL2GRNSNIPPET(snippet) \
559
+ (rb_grn_snippet_from_ruby_object(snippet))
560
+
561
+
562
+ grn_encoding rb_grn_encoding_from_ruby_object (VALUE object,
563
+ grn_ctx *context);
564
+ VALUE rb_grn_encoding_to_ruby_object (grn_encoding encoding);
565
+ #ifdef HAVE_RUBY_ENCODING_H
566
+ rb_encoding *rb_grn_encoding_to_ruby_encoding (grn_encoding encoding);
567
+ #endif
568
+
569
+ grn_ctx *rb_grn_context_from_ruby_object (VALUE object);
570
+ VALUE rb_grn_context_to_ruby_object (grn_ctx *context);
571
+ VALUE rb_grn_context_rb_string_new (grn_ctx *context,
572
+ const char *string,
573
+ long length);
574
+ VALUE rb_grn_context_rb_string_encode (grn_ctx *context,
575
+ VALUE rb_string);
576
+ void rb_grn_context_text_set (grn_ctx *context,
577
+ grn_obj *bulk,
578
+ VALUE rb_string);
579
+
580
+ grn_obj *rb_grn_object_from_ruby_object (VALUE object,
581
+ grn_ctx **context);
582
+ VALUE rb_grn_object_to_ruby_object (VALUE klass,
583
+ grn_ctx *context,
584
+ grn_obj *object,
585
+ rb_grn_boolean owner);
586
+ VALUE rb_grn_object_to_ruby_class (grn_obj *object);
587
+
588
+ grn_obj *rb_grn_database_from_ruby_object (VALUE object);
589
+ VALUE rb_grn_database_to_ruby_object (grn_ctx *context,
590
+ grn_obj *db,
591
+ rb_grn_boolean owner);
592
+
593
+ grn_obj *rb_grn_table_from_ruby_object (VALUE object,
594
+ grn_ctx **context);
595
+ VALUE rb_grn_table_to_ruby_object (grn_ctx *context,
596
+ grn_obj *table,
597
+ rb_grn_boolean owner);
598
+
599
+ grn_table_cursor *
600
+ rb_grn_table_cursor_from_ruby_object (VALUE object,
601
+ grn_ctx **context);
602
+ VALUE rb_grn_table_cursor_to_ruby_object (VALUE klass,
603
+ grn_ctx *context,
604
+ grn_table_cursor *cursor,
605
+ rb_grn_boolean owner);
606
+ VALUE rb_grn_table_cursor_to_ruby_class (grn_table_cursor *cursor);
607
+ void rb_grn_table_cursor_deconstruct (RbGrnTableCursor *rb_grn_table_cursor,
608
+ grn_table_cursor **cursor,
609
+ grn_ctx **context,
610
+ grn_id *domain_id,
611
+ grn_obj **domain,
612
+ grn_id *range_id,
613
+ grn_obj **range);
614
+
615
+ grn_obj *rb_grn_column_from_ruby_object (VALUE object,
616
+ grn_ctx **context);
617
+ VALUE rb_grn_column_to_ruby_object (VALUE klass,
618
+ grn_ctx *context,
619
+ grn_obj *column,
620
+ rb_grn_boolean owner);
621
+
622
+ grn_query *rb_grn_query_from_ruby_object (VALUE object);
623
+ VALUE rb_grn_query_to_ruby_object (grn_ctx *context,
624
+ grn_query *query);
625
+
626
+ grn_operator rb_grn_operator_from_ruby_object (VALUE object);
627
+
628
+ grn_logger_info *
629
+ rb_grn_logger_from_ruby_object (VALUE object);
630
+
631
+ grn_obj *rb_grn_bulk_from_ruby_object (VALUE object,
632
+ grn_ctx *context,
633
+ grn_obj *bulk);
634
+ grn_obj *rb_grn_bulk_from_ruby_object_with_type
635
+ (VALUE object,
636
+ grn_ctx *context,
637
+ grn_obj *bulk,
638
+ grn_id type_id,
639
+ grn_obj *type);
640
+ VALUE rb_grn_bulk_to_ruby_object (grn_ctx *context,
641
+ grn_obj *bulk,
642
+ grn_obj *range,
643
+ VALUE related_object);
644
+ grn_obj *rb_grn_vector_from_ruby_object (VALUE object,
645
+ grn_ctx *context,
646
+ grn_obj *vector);
647
+ VALUE rb_grn_vector_to_ruby_object (grn_ctx *context,
648
+ grn_obj *vector);
649
+ grn_obj *rb_grn_uvector_from_ruby_object (VALUE object,
650
+ grn_ctx *context,
651
+ grn_obj *uvector,
652
+ VALUE related_object);
653
+ VALUE rb_grn_uvector_to_ruby_object (grn_ctx *context,
654
+ grn_obj *uvector);
655
+
656
+ VALUE rb_grn_value_to_ruby_object (grn_ctx *context,
657
+ grn_obj *value,
658
+ grn_obj *range,
659
+ VALUE related_object);
660
+
661
+ grn_id rb_grn_id_from_ruby_object (VALUE object,
662
+ grn_ctx *context,
663
+ grn_obj *table,
664
+ VALUE related_object);
665
+
666
+ VALUE rb_grn_key_to_ruby_object (grn_ctx *context,
667
+ const void *key,
668
+ int key_size,
669
+ grn_obj *table,
670
+ VALUE related_object);
671
+ grn_obj *rb_grn_key_from_ruby_object (VALUE rb_key,
672
+ grn_ctx *context,
673
+ grn_obj *key,
674
+ grn_id domain_id,
675
+ grn_obj *domain,
676
+ VALUE related_object);
677
+
678
+ VALUE rb_grn_variable_to_ruby_object (grn_ctx *context,
679
+ grn_obj *variable);
680
+ grn_obj *rb_grn_variable_from_ruby_object (VALUE rb_variable,
681
+ grn_ctx **context);
682
+
683
+ grn_obj *rb_grn_obj_from_ruby_object (VALUE rb_object,
684
+ grn_ctx *context,
685
+ grn_obj **obj);
686
+ VALUE rb_grn_obj_to_ruby_object (VALUE klass,
687
+ grn_ctx *context,
688
+ grn_obj *obj,
689
+ VALUE related_object);
690
+
691
+ grn_snip *rb_grn_snippet_from_ruby_object (VALUE rb_snippet);
692
+ VALUE rb_grn_snippet_to_ruby_object (grn_ctx *context,
693
+ grn_snip *snippet,
694
+ rb_grn_boolean owner);
695
+
696
+ RB_GRN_END_DECLS
697
+
698
+ #endif