rroonga 10.0.6 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +24 -0
  3. data/doc/text/news.md +12 -0
  4. data/ext/groonga/extconf.rb +12 -2
  5. data/ext/groonga/rb-grn-accessor.c +2 -2
  6. data/ext/groonga/rb-grn-column-cache.c +3 -3
  7. data/ext/groonga/rb-grn-column.c +4 -4
  8. data/ext/groonga/rb-grn-context.c +82 -58
  9. data/ext/groonga/rb-grn-data-column.c +4 -4
  10. data/ext/groonga/rb-grn-database.c +45 -26
  11. data/ext/groonga/rb-grn-double-array-trie.c +2 -2
  12. data/ext/groonga/rb-grn-encoding-support.c +2 -2
  13. data/ext/groonga/rb-grn-exception.c +14 -0
  14. data/ext/groonga/rb-grn-expression.c +3 -3
  15. data/ext/groonga/rb-grn-fix-size-column.c +2 -2
  16. data/ext/groonga/rb-grn-flushable.c +2 -1
  17. data/ext/groonga/rb-grn-hash.c +2 -2
  18. data/ext/groonga/rb-grn-index-column.c +3 -3
  19. data/ext/groonga/rb-grn-index-cursor.c +2 -2
  20. data/ext/groonga/rb-grn-inverted-index-cursor.c +3 -3
  21. data/ext/groonga/rb-grn-object.c +30 -9
  22. data/ext/groonga/rb-grn-operator.c +100 -259
  23. data/ext/groonga/rb-grn-patricia-trie.c +2 -2
  24. data/ext/groonga/rb-grn-plugin.c +34 -22
  25. data/ext/groonga/rb-grn-request-timer-id.c +2 -2
  26. data/ext/groonga/rb-grn-snippet.c +3 -3
  27. data/ext/groonga/rb-grn-table-cursor-key-support.c +2 -2
  28. data/ext/groonga/rb-grn-table-cursor.c +3 -3
  29. data/ext/groonga/rb-grn-table-key-support.c +3 -3
  30. data/ext/groonga/rb-grn-table.c +63 -45
  31. data/ext/groonga/rb-grn-variable-size-column.c +2 -2
  32. data/ext/groonga/rb-grn-variable.c +2 -2
  33. data/ext/groonga/rb-grn.h +7 -4
  34. data/ext/groonga/rb-groonga.c +5 -1
  35. data/lib/groonga/context.rb +32 -0
  36. data/rroonga-build.rb +5 -4
  37. data/rroonga.gemspec +5 -2
  38. data/test/groonga-test-utils.rb +3 -0
  39. data/test/test-index-column.rb +3 -3
  40. data/test/test-ractor.rb +65 -0
  41. data/test/test-remote.rb +2 -0
  42. data/test/test-table-arrow.rb +21 -9
  43. metadata +85 -69
@@ -1,7 +1,7 @@
1
1
  /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
2
  /* vim: set sts=4 sw=4 ts=8 noet: */
3
3
  /*
4
- Copyright (C) 2009-2014 Kouhei Sutou <kou@clear-code.com>
4
+ Copyright (C) 2009-2021 Sutou Kouhei <kou@clear-code.com>
5
5
 
6
6
  This library is free software; you can redistribute it and/or
7
7
  modify it under the terms of the GNU Lesser General Public
@@ -19,7 +19,7 @@
19
19
 
20
20
  #include "rb-grn.h"
21
21
 
22
- #define SELF(object) ((RbGrnTableKeySupport *)DATA_PTR(object))
22
+ #define SELF(object) ((RbGrnTableKeySupport *)RTYPEDDATA_DATA(object))
23
23
 
24
24
  VALUE rb_cGrnPatriciaTrie;
25
25
 
@@ -1,6 +1,6 @@
1
1
  /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
2
  /*
3
- Copyright (C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
3
+ Copyright (C) 2011-2021 Sutou Kouhei <kou@clear-code.com>
4
4
  Copyright (C) 2016 Masafumi Yokoyama <yokoyama@clear-code.com>
5
5
 
6
6
  This library is free software; you can redistribute it and/or
@@ -17,34 +17,19 @@
17
17
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
18
  */
19
19
 
20
- #include "rb-grn.h"
21
-
22
- #define SELF(object) (RVAL2GRNCONTEXT(object))
23
-
24
- static VALUE cGrnPlugin;
25
-
26
20
  /*
27
21
  * Document-class: Groonga::Plugin
28
22
  *
29
- * プラグイン。現在のところ、Rubyでgroongaのプラグインを作成
23
+ * プラグイン。現在のところ、RubyでGroongaのプラグインを作成
30
24
  * することはできず、Cで作成された既存のプラグインを登録する
31
25
  * ことができるだけです。
32
26
  */
33
27
 
34
- grn_id
35
- rb_grn_plugin_from_ruby_object (VALUE object)
36
- {
37
- RbGrnPlugin *rb_grn_plugin;
28
+ #include "rb-grn.h"
38
29
 
39
- if (!RVAL2CBOOL(rb_obj_is_kind_of(object, cGrnPlugin))) {
40
- rb_raise(rb_eTypeError, "not a groonga plugin");
41
- }
30
+ #define SELF(object) (RVAL2GRNCONTEXT(object))
42
31
 
43
- Data_Get_Struct(object, RbGrnPlugin, rb_grn_plugin);
44
- if (!rb_grn_plugin)
45
- rb_raise(rb_eGrnError, "groonga plugin is NULL");
46
- return rb_grn_plugin->id;
47
- }
32
+ static VALUE cGrnPlugin;
48
33
 
49
34
  void
50
35
  rb_grn_plugin_fin (grn_id id)
@@ -59,10 +44,37 @@ rb_grn_plugin_free (void *pointer)
59
44
  xfree(rb_grn_plugin);
60
45
  }
61
46
 
47
+ static rb_data_type_t data_type = {
48
+ "Groonga::Plugin",
49
+ {
50
+ NULL,
51
+ rb_grn_plugin_free,
52
+ NULL,
53
+ },
54
+ NULL,
55
+ NULL,
56
+ RUBY_TYPED_FREE_IMMEDIATELY
57
+ };
58
+
59
+ grn_id
60
+ rb_grn_plugin_from_ruby_object (VALUE object)
61
+ {
62
+ RbGrnPlugin *rb_grn_plugin;
63
+
64
+ if (!RVAL2CBOOL(rb_obj_is_kind_of(object, cGrnPlugin))) {
65
+ rb_raise(rb_eTypeError, "not a groonga plugin");
66
+ }
67
+
68
+ TypedData_Get_Struct(object, RbGrnPlugin, &data_type, rb_grn_plugin);
69
+ if (!rb_grn_plugin)
70
+ rb_raise(rb_eGrnError, "groonga plugin is NULL");
71
+ return rb_grn_plugin->id;
72
+ }
73
+
62
74
  static VALUE
63
75
  rb_grn_plugin_alloc (VALUE klass)
64
76
  {
65
- return Data_Wrap_Struct(klass, NULL, rb_grn_plugin_free, NULL);
77
+ return TypedData_Wrap_Struct(klass, &data_type, NULL);
66
78
  }
67
79
 
68
80
  /*
@@ -245,7 +257,7 @@ rb_grn_plugin_s_names (int argc, VALUE *argv, VALUE klass)
245
257
  void
246
258
  rb_grn_init_plugin (VALUE mGrn)
247
259
  {
248
- cGrnPlugin = rb_define_class_under(mGrn, "Plugin", rb_cData);
260
+ cGrnPlugin = rb_define_class_under(mGrn, "Plugin", rb_cObject);
249
261
  rb_define_alloc_func(cGrnPlugin, rb_grn_plugin_alloc);
250
262
 
251
263
  rb_define_singleton_method(cGrnPlugin, "register",
@@ -1,6 +1,6 @@
1
1
  /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
2
  /*
3
- Copyright (C) 2016 Kouhei Sutou <kou@clear-code.com>
3
+ Copyright (C) 2016-2021 Sutou Kouhei <kou@clear-code.com>
4
4
 
5
5
  This library is free software; you can redistribute it and/or
6
6
  modify it under the terms of the GNU Lesser General Public
@@ -60,5 +60,5 @@ void
60
60
  rb_grn_init_request_timer_id (VALUE mGrn)
61
61
  {
62
62
  rb_cGrnRequestTimerID =
63
- rb_define_class_under(mGrn, "RequestTimerID", rb_cData);
63
+ rb_define_class_under(mGrn, "RequestTimerID", rb_cObject);
64
64
  }
@@ -1,6 +1,6 @@
1
1
  /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
2
  /*
3
- Copyright (C) 2009-2014 Kouhei Sutou <kou@clear-code.com>
3
+ Copyright (C) 2009-2021 Sutou Kouhei <kou@clear-code.com>
4
4
 
5
5
  This library is free software; you can redistribute it and/or
6
6
  modify it under the terms of the GNU Lesser General Public
@@ -18,7 +18,7 @@
18
18
 
19
19
  #include "rb-grn.h"
20
20
 
21
- #define SELF(object) ((RbGrnSnippet *)DATA_PTR(object))
21
+ #define SELF(object) ((RbGrnSnippet *)RTYPEDDATA_DATA(object))
22
22
 
23
23
  VALUE rb_cGrnSnippet;
24
24
 
@@ -149,7 +149,7 @@ rb_grn_snippet_initialize (int argc, VALUE *argv, VALUE self)
149
149
  rb_grn_context_check(context, rb_ary_new_from_values(argc, argv));
150
150
 
151
151
  rb_grn_object_assign(Qnil, self, rb_context, context, snippet);
152
- rb_grn_context_register_floating_object(DATA_PTR(self));
152
+ rb_grn_context_register_floating_object(RTYPEDDATA_DATA(self));
153
153
 
154
154
  rb_iv_set(self, "@context", rb_context);
155
155
 
@@ -1,6 +1,6 @@
1
1
  /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
2
  /*
3
- Copyright (C) 2009 Kouhei Sutou <kou@clear-code.com>
3
+ Copyright (C) 2009-2021 Sutou Kouhei <kou@clear-code.com>
4
4
 
5
5
  This library is free software; you can redistribute it and/or
6
6
  modify it under the terms of the GNU Lesser General Public
@@ -18,7 +18,7 @@
18
18
 
19
19
  #include "rb-grn.h"
20
20
 
21
- #define SELF(object) ((RbGrnTableCursor *)DATA_PTR(object))
21
+ #define SELF(object) ((RbGrnTableCursor *)RTYPEDDATA_DATA(object))
22
22
 
23
23
  VALUE rb_mGrnTableCursorKeySupport;
24
24
 
@@ -1,6 +1,6 @@
1
1
  /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
2
  /*
3
- Copyright (C) 2009-2013 Kouhei Sutou <kou@clear-code.com>
3
+ Copyright (C) 2009-2021 Sutou Kouhei <kou@clear-code.com>
4
4
 
5
5
  This library is free software; you can redistribute it and/or
6
6
  modify it under the terms of the GNU Lesser General Public
@@ -18,7 +18,7 @@
18
18
 
19
19
  #include "rb-grn.h"
20
20
 
21
- #define SELF(object) ((RbGrnTableCursor *)DATA_PTR(object))
21
+ #define SELF(object) ((RbGrnTableCursor *)RTYPEDDATA_DATA(object))
22
22
 
23
23
  VALUE rb_cGrnTableCursor;
24
24
 
@@ -277,7 +277,7 @@ rb_grn_table_cursor_each (VALUE self)
277
277
  void
278
278
  rb_grn_init_table_cursor (VALUE mGrn)
279
279
  {
280
- rb_cGrnTableCursor = rb_define_class_under(mGrn, "TableCursor", rb_cData);
280
+ rb_cGrnTableCursor = rb_define_class_under(mGrn, "TableCursor", rb_cObject);
281
281
  rb_define_alloc_func(rb_cGrnTableCursor, rb_grn_object_alloc);
282
282
 
283
283
  rb_include_module(rb_cGrnTableCursor, rb_mEnumerable);
@@ -1,6 +1,6 @@
1
1
  /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
2
  /*
3
- Copyright (C) 2009-2020 Sutou Kouhei <kou@clear-code.com>
3
+ Copyright (C) 2009-2021 Sutou Kouhei <kou@clear-code.com>
4
4
  Copyright (C) 2014-2016 Masafumi Yokoyama <yokoyama@clear-code.com>
5
5
 
6
6
  This library is free software; you can redistribute it and/or
@@ -19,7 +19,7 @@
19
19
 
20
20
  #include "rb-grn.h"
21
21
 
22
- #define SELF(object) ((RbGrnTableKeySupport *)DATA_PTR(object))
22
+ #define SELF(object) ((RbGrnTableKeySupport *)RTYPEDDATA_DATA(object))
23
23
 
24
24
  VALUE rb_mGrnTableKeySupport;
25
25
 
@@ -498,7 +498,7 @@ set_value (RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg))
498
498
  rb_grn_inspect(rb_name), rb_grn_inspect(data->self));
499
499
  }
500
500
 
501
- rb_grn_object = RB_GRN_OBJECT(DATA_PTR(rb_column));
501
+ rb_grn_object = RB_GRN_OBJECT(RTYPEDDATA_DATA(rb_column));
502
502
  return rb_grn_object_set_raw(rb_grn_object,
503
503
  data->id, rb_value, GRN_OBJ_SET, data->self);
504
504
  }
@@ -1,6 +1,6 @@
1
1
  /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
2
  /*
3
- Copyright (C) 2009-2017 Kouhei Sutou <kou@clear-code.com>
3
+ Copyright (C) 2009-2021 Sutou Kouhei <kou@clear-code.com>
4
4
  Copyright (C) 2014-2016 Masafumi Yokoyama <yokoyama@clear-code.com>
5
5
  Copyright (C) 2019 Horimoto Yasuhiro <horimoto@clear-code.com>
6
6
 
@@ -20,13 +20,6 @@
20
20
 
21
21
  #include "rb-grn.h"
22
22
 
23
- #define SELF(object) ((RbGrnTable *)DATA_PTR(object))
24
-
25
- VALUE rb_cGrnTable;
26
-
27
- static ID id_array_reference;
28
- static ID id_array_set;
29
-
30
23
  /*
31
24
  * Document-class: Groonga::Table < Groonga::Object
32
25
  *
@@ -35,6 +28,59 @@ static ID id_array_set;
35
28
  * are extended from this class.
36
29
  */
37
30
 
31
+ #define SELF(object) ((RbGrnTable *)RTYPEDDATA_DATA(object))
32
+
33
+ VALUE rb_cGrnTable;
34
+
35
+ static ID id_array_reference;
36
+ static ID id_array_set;
37
+
38
+ static void
39
+ rb_grn_table_mark (void *data)
40
+ {
41
+ RbGrnObject *rb_grn_object = data;
42
+ RbGrnTable *rb_grn_table = data;
43
+ grn_ctx *context;
44
+ grn_obj *table;
45
+
46
+ if (!rb_grn_object)
47
+ return;
48
+
49
+ rb_gc_mark(rb_grn_table->columns);
50
+
51
+ context = rb_grn_object->context;
52
+ table = rb_grn_object->object;
53
+ if (!context || !table)
54
+ return;
55
+
56
+ rb_grn_context_mark_grn_id(context, table->header.domain);
57
+ rb_grn_context_mark_grn_id(context, grn_obj_get_range(context, table));
58
+
59
+ if (!grn_obj_path(context, table))
60
+ return;
61
+
62
+ if (grn_obj_name(context, table, NULL, 0) == 0)
63
+ return;
64
+ }
65
+
66
+ static void
67
+ rb_grn_table_free (void *pointer)
68
+ {
69
+ rb_grn_object_free(pointer);
70
+ }
71
+
72
+ static rb_data_type_t data_type = {
73
+ "Groonga::Table",
74
+ {
75
+ rb_grn_table_mark,
76
+ rb_grn_table_free,
77
+ NULL,
78
+ },
79
+ &rb_grn_object_data_type,
80
+ NULL,
81
+ RUBY_TYPED_FREE_IMMEDIATELY
82
+ };
83
+
38
84
  grn_obj *
39
85
  rb_grn_table_from_ruby_object (VALUE object, grn_ctx **context)
40
86
  {
@@ -101,38 +147,10 @@ rb_grn_table_deconstruct (RbGrnTable *rb_grn_table,
101
147
  *columns = rb_grn_table->columns;
102
148
  }
103
149
 
104
- static void
105
- rb_grn_table_mark (void *data)
106
- {
107
- RbGrnObject *rb_grn_object = data;
108
- RbGrnTable *rb_grn_table = data;
109
- grn_ctx *context;
110
- grn_obj *table;
111
-
112
- if (!rb_grn_object)
113
- return;
114
-
115
- rb_gc_mark(rb_grn_table->columns);
116
-
117
- context = rb_grn_object->context;
118
- table = rb_grn_object->object;
119
- if (!context || !table)
120
- return;
121
-
122
- rb_grn_context_mark_grn_id(context, table->header.domain);
123
- rb_grn_context_mark_grn_id(context, grn_obj_get_range(context, table));
124
-
125
- if (!grn_obj_path(context, table))
126
- return;
127
-
128
- if (grn_obj_name(context, table, NULL, 0) == 0)
129
- return;
130
- }
131
-
132
150
  static VALUE
133
151
  rb_grn_table_alloc (VALUE klass)
134
152
  {
135
- return Data_Wrap_Struct(klass, rb_grn_table_mark, rb_grn_object_free, NULL);
153
+ return TypedData_Wrap_Struct(klass, &data_type, NULL);
136
154
  }
137
155
 
138
156
  static VALUE
@@ -342,7 +360,7 @@ rb_grn_table_define_column (int argc, VALUE *argv, VALUE self)
342
360
 
343
361
  rb_column = GRNCOLUMN2RVAL(Qnil, context, column, GRN_TRUE);
344
362
  rb_ary_push(columns, rb_column);
345
- rb_grn_named_object_set_name(RB_GRN_NAMED_OBJECT(DATA_PTR(rb_column)),
363
+ rb_grn_named_object_set_name(RB_GRN_NAMED_OBJECT(RTYPEDDATA_DATA(rb_column)),
346
364
  name, name_size);
347
365
 
348
366
  return rb_column;
@@ -497,7 +515,7 @@ rb_grn_table_define_index_column (int argc, VALUE *argv, VALUE self)
497
515
  rb_funcall(rb_column, rb_intern("sources="), 1, rb_sources);
498
516
 
499
517
  rb_ary_push(columns, rb_column);
500
- rb_grn_named_object_set_name(RB_GRN_NAMED_OBJECT(DATA_PTR(rb_column)),
518
+ rb_grn_named_object_set_name(RB_GRN_NAMED_OBJECT(RTYPEDDATA_DATA(rb_column)),
501
519
  name, name_size);
502
520
 
503
521
  return rb_column;
@@ -558,7 +576,7 @@ rb_grn_table_get_column (VALUE self, VALUE rb_name)
558
576
  VALUE rb_column = raw_columns[i];
559
577
  RbGrnNamedObject *rb_grn_named_object;
560
578
 
561
- rb_grn_named_object = RB_GRN_NAMED_OBJECT(DATA_PTR(rb_column));
579
+ rb_grn_named_object = RB_GRN_NAMED_OBJECT(RTYPEDDATA_DATA(rb_column));
562
580
  if (name_size == rb_grn_named_object->name_size &&
563
581
  memcmp(name, rb_grn_named_object->name, name_size) == 0) {
564
582
  return rb_column;
@@ -583,9 +601,9 @@ rb_grn_table_get_column (VALUE self, VALUE rb_name)
583
601
  owner = column->header.type == GRN_ACCESSOR;
584
602
  rb_column = GRNCOLUMN2RVAL(Qnil, context, column, owner);
585
603
  if (owner) {
586
- rb_grn_context_register_floating_object(DATA_PTR(rb_column));
604
+ rb_grn_context_register_floating_object(RTYPEDDATA_DATA(rb_column));
587
605
  }
588
- rb_grn_named_object_set_name(RB_GRN_NAMED_OBJECT(DATA_PTR(rb_column)),
606
+ rb_grn_named_object_set_name(RB_GRN_NAMED_OBJECT(RTYPEDDATA_DATA(rb_column)),
589
607
  name, name_size);
590
608
 
591
609
  return rb_column;
@@ -688,7 +706,7 @@ rb_grn_table_get_columns (int argc, VALUE *argv, VALUE self)
688
706
  RbGrnNamedObject *rb_grn_named_object;
689
707
  name_size = grn_column_name(context, column,
690
708
  name, GRN_TABLE_MAX_KEY_SIZE);
691
- rb_grn_named_object = RB_GRN_NAMED_OBJECT(DATA_PTR(rb_column));
709
+ rb_grn_named_object = RB_GRN_NAMED_OBJECT(RTYPEDDATA_DATA(rb_column));
692
710
  rb_grn_named_object_set_name(rb_grn_named_object, name, name_size);
693
711
  }
694
712
 
@@ -1092,7 +1110,7 @@ rb_grn_table_delete_by_expression (VALUE self)
1092
1110
 
1093
1111
  rb_builder = rb_grn_record_expression_builder_new(self, Qnil);
1094
1112
  rb_expression = rb_grn_record_expression_builder_build(rb_builder);
1095
- rb_grn_object_deconstruct(RB_GRN_OBJECT(DATA_PTR(rb_expression)),
1113
+ rb_grn_object_deconstruct(RB_GRN_OBJECT(RTYPEDDATA_DATA(rb_expression)),
1096
1114
  &expression, NULL,
1097
1115
  NULL, NULL, NULL, NULL);
1098
1116
 
@@ -2394,7 +2412,7 @@ rb_grn_table_select (int argc, VALUE *argv, VALUE self)
2394
2412
  rb_funcall(builder, rb_intern("default_column="), 1, rb_default_column);
2395
2413
  rb_expression = rb_grn_record_expression_builder_build(builder);
2396
2414
  }
2397
- rb_grn_object_deconstruct(RB_GRN_OBJECT(DATA_PTR(rb_expression)),
2415
+ rb_grn_object_deconstruct(RB_GRN_OBJECT(RTYPEDDATA_DATA(rb_expression)),
2398
2416
  &expression, NULL,
2399
2417
  NULL, NULL, NULL, NULL);
2400
2418
 
@@ -1,6 +1,6 @@
1
1
  /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
2
  /*
3
- Copyright (C) 2009-2016 Kouhei Sutou <kou@clear-code.com>
3
+ Copyright (C) 2009-2021 Sutou Kouhei <kou@clear-code.com>
4
4
  Copyright (C) 2014-2016 Masafumi Yokoyama <yokoyama@clear-code.com>
5
5
 
6
6
  This library is free software; you can redistribute it and/or
@@ -19,7 +19,7 @@
19
19
 
20
20
  #include "rb-grn.h"
21
21
 
22
- #define SELF(object) ((RbGrnVariableSizeColumn *)DATA_PTR(object))
22
+ #define SELF(object) ((RbGrnVariableSizeColumn *)RTYPEDDATA_DATA(object))
23
23
 
24
24
  VALUE rb_cGrnVariableSizeColumn;
25
25
 
@@ -1,6 +1,6 @@
1
1
  /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
2
  /*
3
- Copyright (C) 2009 Kouhei Sutou <kou@clear-code.com>
3
+ Copyright (C) 2009-2021 Sutou Kouhei <kou@clear-code.com>
4
4
 
5
5
  This library is free software; you can redistribute it and/or
6
6
  modify it under the terms of the GNU Lesser General Public
@@ -18,7 +18,7 @@
18
18
 
19
19
  #include "rb-grn.h"
20
20
 
21
- #define SELF(object) ((RbGrnVariable *)DATA_PTR(object))
21
+ #define SELF(object) ((RbGrnVariable *)RTYPEDDATA_DATA(object))
22
22
 
23
23
  VALUE rb_cGrnVariable;
24
24
 
data/ext/groonga/rb-grn.h CHANGED
@@ -1,6 +1,6 @@
1
1
  /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
2
  /*
3
- Copyright (C) 2009-2020 Sutou Kouhei <kou@clear-code.com>
3
+ Copyright (C) 2009-2021 Sutou Kouhei <kou@clear-code.com>
4
4
  Copyright (C) 2015-2017 Masafumi Yokoyama <yokoyama@clear-code.com>
5
5
 
6
6
  This library is free software; you can redistribute it and/or
@@ -91,9 +91,9 @@ RB_GRN_BEGIN_DECLS
91
91
 
92
92
  #define RB_GRN_HAVE_FLOAT32 GRN_VERSION_OR_LATER(10, 0, 2)
93
93
 
94
- #define RB_GRN_MAJOR_VERSION 10
94
+ #define RB_GRN_MAJOR_VERSION 11
95
95
  #define RB_GRN_MINOR_VERSION 0
96
- #define RB_GRN_MICRO_VERSION 6
96
+ #define RB_GRN_MICRO_VERSION 0
97
97
 
98
98
  #define RB_GRN_OBJECT(object) ((RbGrnObject *)(object))
99
99
  #define RB_GRN_NAMED_OBJECT(object) ((RbGrnNamedObject *)(object))
@@ -314,6 +314,8 @@ RB_GRN_VAR VALUE rb_mGrnRequestTimer;
314
314
  RB_GRN_VAR VALUE rb_cGrnRequestTimerID;
315
315
  RB_GRN_VAR VALUE rb_cGrnColumnCache;
316
316
 
317
+ RB_GRN_VAR rb_data_type_t rb_grn_object_data_type;
318
+
317
319
  void rb_grn_init_utils (VALUE mGrn);
318
320
  void rb_grn_init_exception (VALUE mGrn);
319
321
  void rb_grn_init_encoding (VALUE mGrn);
@@ -779,7 +781,8 @@ rb_encoding *rb_grn_encoding_to_ruby_encoding (grn_encoding encoding);
779
781
  VALUE rb_grn_encoding_to_ruby_encoding_object
780
782
  (grn_encoding encoding);
781
783
 
782
- grn_ctx *rb_grn_context_from_ruby_object (VALUE object);
784
+ RbGrnContext *rb_grn_context_get_struct (VALUE rb_context);
785
+ grn_ctx *rb_grn_context_from_ruby_object (VALUE rb_context);
783
786
  VALUE rb_grn_context_to_ruby_object (grn_ctx *context);
784
787
  VALUE rb_grn_context_rb_string_new (grn_ctx *context,
785
788
  const char *string,