rroonga 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -51,8 +51,11 @@ base_dir_included_components = %w(AUTHORS Rakefile
51
51
  NEWS.rdoc NEWS.ja.rdoc
52
52
  rroonga-build.rb extconf.rb pkg-config.rb)
53
53
  excluded_components = %w(.cvsignore .gdb_history CVS depend Makefile doc pkg
54
- .svn .git doc vendor data .test-result tmp)
55
- excluded_suffixes = %w(.png .ps .pdf .o .so .a .txt .~)
54
+ .svn .git doc data .test-result tmp)
55
+ excluded_suffixes = %w(.png .ps .pdf .o .so .a .txt .h .~)
56
+ unless ENV["RUBY_CC_VERSION"]
57
+ excluded_components << "vendor"
58
+ end
56
59
  Find.find(base_dir) do |target|
57
60
  target = truncate_base_dir[target]
58
61
  components = target.split(File::SEPARATOR)
@@ -134,6 +137,7 @@ end
134
137
 
135
138
  Rake::ExtensionTask.new("groonga", project.spec) do |ext|
136
139
  ext.cross_compile = true
140
+ ext.cross_platform = 'x86-mingw32'
137
141
  end
138
142
 
139
143
  task :publish_docs => [:prepare_docs_for_publishing]
data/example/bookmark.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  base_dir = File.join(File.dirname(__FILE__), "..")
5
- groonga_ext_dir = File.join(base_dir, 'ext')
5
+ groonga_ext_dir = File.join(base_dir, 'ext', 'groonga')
6
6
  groonga_lib_dir = File.join(base_dir, 'lib')
7
7
  $LOAD_PATH.unshift(groonga_ext_dir)
8
8
  $LOAD_PATH.unshift(groonga_lib_dir)
@@ -145,7 +145,7 @@ records.sort([{:key => ".issued", :order => "descending"}]).each do |record|
145
145
  record[".content"]]
146
146
  end
147
147
 
148
- records.group([".item"]).each do |record|
148
+ records.group("item").each do |record|
149
149
  item = record.key
150
150
  p [record.n_sub_records,
151
151
  item.key,
@@ -155,7 +155,7 @@ end
155
155
  p ruby_comments = @comments.select {|record| record["content"] =~ "Ruby"}
156
156
  p ruby_items = @items.select("*W1:50 title:@Ruby")
157
157
 
158
- p ruby_items = ruby_comments.group([".item"]).union!(ruby_items)
158
+ p ruby_items = ruby_comments.group(".item").union!(ruby_items)
159
159
  ruby_items.sort([{:key => "._score", :order => "descending"}]).each do |record|
160
160
  p [record["._score"], record[".title"]]
161
161
  end
data/lib/groonga.rb CHANGED
@@ -42,7 +42,12 @@ end
42
42
  require 'groonga/view-record'
43
43
  require 'groonga/record'
44
44
  require 'groonga/expression-builder'
45
- require 'groonga.so'
45
+ begin
46
+ major, minor, micro, = RUBY_VERSION.split(/\./)
47
+ require "#{major}.#{minor}/groonga.so"
48
+ rescue LoadError
49
+ require 'groonga.so'
50
+ end
46
51
 
47
52
  ##
48
53
  # Ruby/groonga用のネームスペース。Ruby/groongaのクラスやメソッ
@@ -1,13 +1,13 @@
1
1
  = チュートリアル
2
2
 
3
3
  このページでは簡単なアプリケーションの作成を通して
4
- Ruby/groongaの操作方法を紹介します。
4
+ rroongaの操作方法を紹介します。
5
5
 
6
6
  == インストール
7
7
 
8
8
  Ruby/groongaはRubyGemsでインストールできます。
9
9
 
10
- % sudo gem install groonga
10
+ % sudo gem install rroonga
11
11
 
12
12
  == データベースの作成
13
13
 
@@ -328,7 +328,7 @@ http://qwik.jp/senna/senna2.files/rect4605.png
328
328
  同じitemが何度も出てくると検索結果が見にくいので、item毎にグ
329
329
  ループ化してみます。
330
330
 
331
- >> records.group([".item"]).each do |record|
331
+ >> records.group("item").each do |record|
332
332
  >> item = record.key
333
333
  >> p [record.n_sub_records,
334
334
  >> item.key,
@@ -379,7 +379,7 @@ http://qwik.jp/senna/senna2.files/rect4605.png
379
379
  _ruby_comments_の結果をitem毎にグループ化し、_ruby_items_と
380
380
  unionして出力します。
381
381
 
382
- >> ruby_items = ruby_comments.group([".item"]).union!(ruby_items)
382
+ >> ruby_items = ruby_comments.group("item").union!(ruby_items)
383
383
  #<Groonga::Hash ..., size: <4>>
384
384
  >> ruby_items.sort([{:key => "._score", :order => "descendant"}]).each do |record|
385
385
  >> p [record["._score"], record[".title"]]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 2
9
- version: 0.9.2
8
+ - 3
9
+ version: 0.9.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kouhei Sutou
@@ -57,7 +57,6 @@ files:
57
57
  - example/search/public/css/groonga.css
58
58
  - ext/.gitignore
59
59
  - ext/groonga/extconf.rb
60
- - ext/groonga/mkmf.log
61
60
  - ext/groonga/rb-grn-accessor.c
62
61
  - ext/groonga/rb-grn-array-cursor.c
63
62
  - ext/groonga/rb-grn-array.c
@@ -94,7 +93,6 @@ files:
94
93
  - ext/groonga/rb-grn-view-cursor.c
95
94
  - ext/groonga/rb-grn-view-record.c
96
95
  - ext/groonga/rb-grn-view.c
97
- - ext/groonga/rb-grn.h
98
96
  - ext/groonga/rb-groonga.c
99
97
  - extconf.rb
100
98
  - html/bar.svg
data/ext/groonga/mkmf.log DELETED
@@ -1,99 +0,0 @@
1
- checking for GCC... -------------------- yes
2
-
3
- "cc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/home/kou/work/ruby/rroonga/ext/groonga -fno-strict-aliasing -g -g -O2 -fPIC -I/tmp/local/include/groonga -c conftest.c"
4
- checked program was:
5
- /* begin */
6
- 1: /*top*/
7
- 2: #ifndef __GNUC__
8
- 3: # error
9
- 4: >>>>>> __GNUC__ undefined <<<<<<
10
- 5: #endif
11
- /* end */
12
-
13
- --------------------
14
-
15
- checking for Win32 OS... -------------------- no
16
-
17
- --------------------
18
-
19
- have_macro: checking for HAVE_RUBY_ST_H in ruby.h... -------------------- no
20
-
21
- "cc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/home/kou/work/ruby/rroonga/ext/groonga -fno-strict-aliasing -g -g -O2 -fPIC -I/tmp/local/include/groonga -Wall -c conftest.c"
22
- conftest.c:4:3: error: #error
23
- conftest.c:5: error: expected identifier or ‘(’ before ‘>>’ token
24
- checked program was:
25
- /* begin */
26
- 1: #include <ruby.h>
27
- 2: /*top*/
28
- 3: #ifndef HAVE_RUBY_ST_H
29
- 4: # error
30
- 5: >>>>>> HAVE_RUBY_ST_H undefined <<<<<<
31
- 6: #endif
32
- /* end */
33
-
34
- --------------------
35
-
36
- have_header: checking for ruby/st.h... -------------------- no
37
-
38
- "cc -E -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/home/kou/work/ruby/rroonga/ext/groonga -fno-strict-aliasing -g -g -O2 -fPIC -I/tmp/local/include/groonga -Wall conftest.c -o conftest.i"
39
- conftest.c:1:21: error: ruby/st.h: そのようなファイルやディレクトリはありません
40
- checked program was:
41
- /* begin */
42
- 1: #include <ruby/st.h>
43
- /* end */
44
-
45
- --------------------
46
-
47
- have_func: checking for rb_errinfo() in ruby.h... -------------------- no
48
-
49
- "cc -o conftest -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/home/kou/work/ruby/rroonga/ext/groonga -fno-strict-aliasing -g -g -O2 -fPIC -I/tmp/local/include/groonga -Wall conftest.c -L. -L/usr/lib -L. -rdynamic -Wl,-export-dynamic -L/tmp/local/lib -lgroonga -lruby1.8-static -lgroonga -lpthread -lrt -ldl -lcrypt -lm -lc"
50
- conftest.c: In function ‘t’:
51
- conftest.c:5: error: ‘rb_errinfo’ undeclared (first use in this function)
52
- conftest.c:5: error: (Each undeclared identifier is reported only once
53
- conftest.c:5: error: for each function it appears in.)
54
- checked program was:
55
- /* begin */
56
- 1: #include <ruby.h>
57
- 2:
58
- 3: /*top*/
59
- 4: int main() { return 0; }
60
- 5: int t() { void ((*volatile p)()); p = (void ((*)()))rb_errinfo; return 0; }
61
- /* end */
62
-
63
- "cc -o conftest -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/home/kou/work/ruby/rroonga/ext/groonga -fno-strict-aliasing -g -g -O2 -fPIC -I/tmp/local/include/groonga -Wall conftest.c -L. -L/usr/lib -L. -rdynamic -Wl,-export-dynamic -L/tmp/local/lib -lgroonga -lruby1.8-static -lgroonga -lpthread -lrt -ldl -lcrypt -lm -lc"
64
- conftest.c: In function ‘t’:
65
- conftest.c:5: warning: implicit declaration of function ‘rb_errinfo’
66
- /tmp/cc2CE3Yu.o: In function `t':
67
- /home/kou/work/ruby/rroonga/ext/groonga/conftest.c:5: undefined reference to `rb_errinfo'
68
- collect2: ld returned 1 exit status
69
- checked program was:
70
- /* begin */
71
- 1: #include <ruby.h>
72
- 2:
73
- 3: /*top*/
74
- 4: int main() { return 0; }
75
- 5: int t() { rb_errinfo(); return 0; }
76
- /* end */
77
-
78
- --------------------
79
-
80
- have_type: checking for enum ruby_value_type in ruby.h... -------------------- no
81
-
82
- "cc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/home/kou/work/ruby/rroonga/ext/groonga -fno-strict-aliasing -g -g -O2 -fPIC -I/tmp/local/include/groonga -Wall -c conftest.c"
83
- conftest.c:5: error: invalid application of ‘sizeof’ to incomplete type ‘conftest_type’
84
- conftest.c:5: error: size of array ‘conftestval’ is negative
85
- checked program was:
86
- /* begin */
87
- 1: #include <ruby.h>
88
- 2:
89
- 3: /*top*/
90
- 4: typedef enum ruby_value_type conftest_type;
91
- 5: int conftestval[sizeof(conftest_type)?1:-1];
92
- /* end */
93
-
94
- --------------------
95
-
96
- checking for debug flag... -------------------- no
97
-
98
- --------------------
99
-
data/ext/groonga/rb-grn.h DELETED
@@ -1,698 +0,0 @@
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