rroonga 10.0.1 → 11.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/Rakefile +30 -28
- data/doc/text/news.md +51 -5
- data/doc/text/tutorial.md +1 -1
- data/ext/groonga/extconf.rb +18 -3
- data/ext/groonga/rb-grn-accessor.c +2 -2
- data/ext/groonga/rb-grn-column-cache.c +3 -3
- data/ext/groonga/rb-grn-column.c +4 -4
- data/ext/groonga/rb-grn-context.c +82 -58
- data/ext/groonga/rb-grn-data-column.c +4 -4
- data/ext/groonga/rb-grn-database.c +45 -26
- data/ext/groonga/rb-grn-double-array-trie.c +2 -2
- data/ext/groonga/rb-grn-encoding-support.c +2 -2
- data/ext/groonga/rb-grn-exception.c +14 -0
- data/ext/groonga/rb-grn-expression-builder.c +3 -3
- data/ext/groonga/rb-grn-expression.c +3 -3
- data/ext/groonga/rb-grn-fix-size-column.c +2 -2
- data/ext/groonga/rb-grn-flushable.c +2 -1
- data/ext/groonga/rb-grn-hash.c +2 -2
- data/ext/groonga/rb-grn-index-column.c +3 -3
- data/ext/groonga/rb-grn-index-cursor.c +2 -2
- data/ext/groonga/rb-grn-inverted-index-cursor.c +3 -3
- data/ext/groonga/rb-grn-object.c +30 -9
- data/ext/groonga/rb-grn-operator.c +100 -259
- data/ext/groonga/rb-grn-patricia-trie.c +2 -2
- data/ext/groonga/rb-grn-plugin.c +34 -22
- data/ext/groonga/rb-grn-request-timer-id.c +2 -2
- data/ext/groonga/rb-grn-snippet.c +3 -3
- data/ext/groonga/rb-grn-table-cursor-key-support.c +2 -2
- data/ext/groonga/rb-grn-table-cursor.c +3 -3
- data/ext/groonga/rb-grn-table-key-support.c +6 -4
- data/ext/groonga/rb-grn-table.c +63 -45
- data/ext/groonga/rb-grn-type.c +5 -1
- data/ext/groonga/rb-grn-utils.c +17 -1
- data/ext/groonga/rb-grn-variable-size-column.c +2 -2
- data/ext/groonga/rb-grn-variable.c +2 -2
- data/ext/groonga/rb-grn.h +10 -5
- data/ext/groonga/rb-groonga.c +6 -2
- data/lib/groonga/context.rb +32 -0
- data/rroonga-build.rb +5 -4
- data/rroonga.gemspec +5 -2
- data/test/groonga-test-utils.rb +9 -0
- data/test/run-test.rb +1 -1
- data/test/test-column.rb +12 -1
- data/test/test-index-column.rb +3 -3
- data/test/test-logger.rb +2 -0
- data/test/test-ractor.rb +65 -0
- data/test/test-remote.rb +16 -0
- data/test/test-table-arrow.rb +20 -11
- metadata +84 -68
@@ -325,353 +325,194 @@ rb_grn_init_operator (VALUE mGrn)
|
|
325
325
|
rb_grn_init_prefix_operator(mGrn);
|
326
326
|
rb_grn_init_regexp_operator(mGrn);
|
327
327
|
|
328
|
+
#define OPERATOR_NEW(klass, name, NAME) \
|
329
|
+
rb_obj_freeze(rb_funcall(klass, rb_intern("new"), 2, \
|
330
|
+
rb_obj_freeze(rb_str_new_cstr(name)), \
|
331
|
+
UINT2NUM(GRN_OP_ ## NAME)))
|
332
|
+
|
328
333
|
rb_define_const(rb_cGrnOperator, "PUSH",
|
329
|
-
|
330
|
-
rb_str_new_cstr("push"),
|
331
|
-
UINT2NUM(GRN_OP_PUSH)));
|
334
|
+
OPERATOR_NEW(rb_cGrnOperator, "push", PUSH));
|
332
335
|
rb_define_const(rb_cGrnOperator, "POP",
|
333
|
-
|
334
|
-
rb_str_new_cstr("pop"),
|
335
|
-
UINT2NUM(GRN_OP_POP)));
|
336
|
+
OPERATOR_NEW(rb_cGrnOperator, "pop", POP));
|
336
337
|
rb_define_const(rb_cGrnOperator, "NO_OPERATION",
|
337
|
-
|
338
|
-
rb_str_new_cstr("no-operation"),
|
339
|
-
UINT2NUM(GRN_OP_NOP)));
|
338
|
+
OPERATOR_NEW(rb_cGrnOperator, "no-operation", NOP));
|
340
339
|
rb_define_const(rb_cGrnOperator, "CALL",
|
341
|
-
|
342
|
-
rb_str_new_cstr("call"),
|
343
|
-
UINT2NUM(GRN_OP_CALL)));
|
340
|
+
OPERATOR_NEW(rb_cGrnOperator, "call", CALL));
|
344
341
|
rb_define_const(rb_cGrnOperator, "INTERN",
|
345
|
-
|
346
|
-
rb_str_new_cstr("intern"),
|
347
|
-
UINT2NUM(GRN_OP_INTERN)));
|
342
|
+
OPERATOR_NEW(rb_cGrnOperator, "intern", INTERN));
|
348
343
|
rb_define_const(rb_cGrnOperator, "GET_REFERENCE",
|
349
|
-
|
350
|
-
rb_str_new_cstr("get-reference"),
|
351
|
-
UINT2NUM(GRN_OP_GET_REF)));
|
344
|
+
OPERATOR_NEW(rb_cGrnOperator, "get-reference", GET_REF));
|
352
345
|
rb_define_const(rb_cGrnOperator, "GET_VALUE",
|
353
|
-
|
354
|
-
rb_str_new_cstr("get-value"),
|
355
|
-
UINT2NUM(GRN_OP_GET_VALUE)));
|
346
|
+
OPERATOR_NEW(rb_cGrnOperator, "get-value", GET_VALUE));
|
356
347
|
rb_define_const(rb_cGrnOperator, "AND",
|
357
|
-
|
358
|
-
rb_str_new_cstr("and"),
|
359
|
-
UINT2NUM(GRN_OP_AND)));
|
348
|
+
OPERATOR_NEW(rb_cGrnOperator, "and", AND));
|
360
349
|
rb_define_const(rb_cGrnOperator, "AND_NOT",
|
361
|
-
|
362
|
-
|
363
|
-
UINT2NUM(GRN_OP_AND_NOT)));
|
364
|
-
/* Just for backward compatiblity. TODO: REMOVE ME! */
|
350
|
+
OPERATOR_NEW(rb_cGrnOperator, "and-not", AND_NOT));
|
351
|
+
/* Just for backward compatibility. TODO: REMOVE ME! */
|
365
352
|
rb_define_const(rb_cGrnOperator, "BUT",
|
366
|
-
|
367
|
-
rb_str_new_cstr("but"),
|
368
|
-
UINT2NUM(GRN_OP_BUT)));
|
353
|
+
OPERATOR_NEW(rb_cGrnOperator, "but", BUT));
|
369
354
|
rb_define_const(rb_cGrnOperator, "OR",
|
370
|
-
|
371
|
-
rb_str_new_cstr("or"),
|
372
|
-
UINT2NUM(GRN_OP_OR)));
|
355
|
+
OPERATOR_NEW(rb_cGrnOperator, "or", OR));
|
373
356
|
rb_define_const(rb_cGrnOperator, "ASSIGN",
|
374
|
-
|
375
|
-
rb_str_new_cstr("assign"),
|
376
|
-
UINT2NUM(GRN_OP_ASSIGN)));
|
357
|
+
OPERATOR_NEW(rb_cGrnOperator, "assign", ASSIGN));
|
377
358
|
rb_define_const(rb_cGrnOperator, "STAR_ASSIGN",
|
378
|
-
|
379
|
-
rb_str_new_cstr("star-assign"),
|
380
|
-
UINT2NUM(GRN_OP_STAR_ASSIGN)));
|
359
|
+
OPERATOR_NEW(rb_cGrnOperator, "star-assign", STAR_ASSIGN));
|
381
360
|
rb_define_const(rb_cGrnOperator, "SLASH_ASSIGN",
|
382
|
-
|
383
|
-
rb_str_new_cstr("slash-assign"),
|
384
|
-
UINT2NUM(GRN_OP_SLASH_ASSIGN)));
|
361
|
+
OPERATOR_NEW(rb_cGrnOperator, "slash-assign", SLASH_ASSIGN));
|
385
362
|
rb_define_const(rb_cGrnOperator, "MODULO_ASSIGN",
|
386
|
-
|
387
|
-
rb_str_new_cstr("modulo-assign"),
|
388
|
-
UINT2NUM(GRN_OP_MOD_ASSIGN)));
|
363
|
+
OPERATOR_NEW(rb_cGrnOperator, "modulo-assign", MOD_ASSIGN));
|
389
364
|
rb_define_const(rb_cGrnOperator, "PLUS_ASSIGN",
|
390
|
-
|
391
|
-
rb_str_new_cstr("plus-assign"),
|
392
|
-
UINT2NUM(GRN_OP_PLUS_ASSIGN)));
|
365
|
+
OPERATOR_NEW(rb_cGrnOperator, "plus-assign", PLUS_ASSIGN));
|
393
366
|
rb_define_const(rb_cGrnOperator, "MINUS_ASSIGN",
|
394
|
-
|
395
|
-
rb_str_new_cstr("minus-assign"),
|
396
|
-
UINT2NUM(GRN_OP_MINUS_ASSIGN)));
|
367
|
+
OPERATOR_NEW(rb_cGrnOperator, "minus-assign", MINUS_ASSIGN));
|
397
368
|
rb_define_const(rb_cGrnOperator, "SHIFTL_ASSIGN",
|
398
|
-
|
399
|
-
rb_str_new_cstr("shiftl-assign"),
|
400
|
-
UINT2NUM(GRN_OP_SHIFTL_ASSIGN)));
|
369
|
+
OPERATOR_NEW(rb_cGrnOperator, "shiftl-assign", SHIFTL_ASSIGN));
|
401
370
|
rb_define_const(rb_cGrnOperator, "SHIRTR_ASSIGN",
|
402
|
-
|
403
|
-
rb_str_new_cstr("shirtr-assign"),
|
404
|
-
UINT2NUM(GRN_OP_SHIFTR_ASSIGN)));
|
371
|
+
OPERATOR_NEW(rb_cGrnOperator, "shirtr-assign", SHIFTR_ASSIGN));
|
405
372
|
rb_define_const(rb_cGrnOperator, "SHIFTRR_ASSIGN",
|
406
|
-
|
407
|
-
rb_str_new_cstr("shiftrr-assign"),
|
408
|
-
UINT2NUM(GRN_OP_SHIFTRR_ASSIGN)));
|
373
|
+
OPERATOR_NEW(rb_cGrnOperator, "shiftrr-assign", SHIFTRR_ASSIGN));
|
409
374
|
rb_define_const(rb_cGrnOperator, "AND_ASSIGN",
|
410
|
-
|
411
|
-
rb_str_new_cstr("and-assign"),
|
412
|
-
UINT2NUM(GRN_OP_AND_ASSIGN)));
|
375
|
+
OPERATOR_NEW(rb_cGrnOperator, "and-assign", AND_ASSIGN));
|
413
376
|
rb_define_const(rb_cGrnOperator, "XOR_ASSIGN",
|
414
|
-
|
415
|
-
rb_str_new_cstr("xor-assign"),
|
416
|
-
UINT2NUM(GRN_OP_XOR_ASSIGN)));
|
377
|
+
OPERATOR_NEW(rb_cGrnOperator, "xor-assign", XOR_ASSIGN));
|
417
378
|
rb_define_const(rb_cGrnOperator, "OR_ASSIGN",
|
418
|
-
|
419
|
-
rb_str_new_cstr("or-assign"),
|
420
|
-
UINT2NUM(GRN_OP_OR_ASSIGN)));
|
379
|
+
OPERATOR_NEW(rb_cGrnOperator, "or-assign", OR_ASSIGN));
|
421
380
|
rb_define_const(rb_cGrnOperator, "JUMP",
|
422
|
-
|
423
|
-
rb_str_new_cstr("jump"),
|
424
|
-
UINT2NUM(GRN_OP_JUMP)));
|
381
|
+
OPERATOR_NEW(rb_cGrnOperator, "jump", JUMP));
|
425
382
|
rb_define_const(rb_cGrnOperator, "CJUMP",
|
426
|
-
|
427
|
-
rb_str_new_cstr("cjump"),
|
428
|
-
UINT2NUM(GRN_OP_CJUMP)));
|
383
|
+
OPERATOR_NEW(rb_cGrnOperator, "cjump", CJUMP));
|
429
384
|
rb_define_const(rb_cGrnOperator, "COMMA",
|
430
|
-
|
431
|
-
rb_str_new_cstr("comma"),
|
432
|
-
UINT2NUM(GRN_OP_COMMA)));
|
385
|
+
OPERATOR_NEW(rb_cGrnOperator, "comma", COMMA));
|
433
386
|
rb_define_const(rb_cGrnOperator, "BITWISE_OR",
|
434
|
-
|
435
|
-
rb_str_new_cstr("bitwise-or"),
|
436
|
-
UINT2NUM(GRN_OP_BITWISE_OR)));
|
387
|
+
OPERATOR_NEW(rb_cGrnOperator, "bitwise-or", BITWISE_OR));
|
437
388
|
rb_define_const(rb_cGrnOperator, "BITWISE_XOR",
|
438
|
-
|
439
|
-
rb_str_new_cstr("bitwise-xor"),
|
440
|
-
UINT2NUM(GRN_OP_BITWISE_XOR)));
|
389
|
+
OPERATOR_NEW(rb_cGrnOperator, "bitwise-xor", BITWISE_XOR));
|
441
390
|
rb_define_const(rb_cGrnOperator, "BITWISE_AND",
|
442
|
-
|
443
|
-
rb_str_new_cstr("bitwise-and"),
|
444
|
-
UINT2NUM(GRN_OP_BITWISE_AND)));
|
391
|
+
OPERATOR_NEW(rb_cGrnOperator, "bitwise-and", BITWISE_AND));
|
445
392
|
rb_define_const(rb_cGrnOperator, "BITWISE_NOT",
|
446
|
-
|
447
|
-
rb_str_new_cstr("bitwise-not"),
|
448
|
-
UINT2NUM(GRN_OP_BITWISE_NOT)));
|
393
|
+
OPERATOR_NEW(rb_cGrnOperator, "bitwise-not", BITWISE_NOT));
|
449
394
|
rb_define_const(rb_cGrnOperator, "EQUAL",
|
450
|
-
|
451
|
-
rb_str_new_cstr("equal"),
|
452
|
-
UINT2NUM(GRN_OP_EQUAL)));
|
395
|
+
OPERATOR_NEW(rb_cGrnEqualOperator, "equal", EQUAL));
|
453
396
|
rb_define_const(rb_cGrnOperator, "NOT_EQUAL",
|
454
|
-
|
455
|
-
|
456
|
-
|
397
|
+
OPERATOR_NEW(rb_cGrnNotEqualOperator,
|
398
|
+
"not-equal",
|
399
|
+
NOT_EQUAL));
|
457
400
|
rb_define_const(rb_cGrnOperator, "LESS",
|
458
|
-
|
459
|
-
rb_str_new_cstr("less"),
|
460
|
-
UINT2NUM(GRN_OP_LESS)));
|
401
|
+
OPERATOR_NEW(rb_cGrnLessOperator, "less", LESS));
|
461
402
|
rb_define_const(rb_cGrnOperator, "GREATER",
|
462
|
-
|
463
|
-
rb_str_new_cstr("greater"),
|
464
|
-
UINT2NUM(GRN_OP_GREATER)));
|
403
|
+
OPERATOR_NEW(rb_cGrnGreaterOperator, "greater", GREATER));
|
465
404
|
rb_define_const(rb_cGrnOperator, "LESS_EQUAL",
|
466
|
-
|
467
|
-
|
468
|
-
|
405
|
+
OPERATOR_NEW(rb_cGrnLessEqualOperator,
|
406
|
+
"less-equal",
|
407
|
+
LESS_EQUAL));
|
469
408
|
rb_define_const(rb_cGrnOperator, "GREATER_EQUAL",
|
470
|
-
|
471
|
-
|
472
|
-
|
409
|
+
OPERATOR_NEW(rb_cGrnGreaterEqualOperator,
|
410
|
+
"greater-equal",
|
411
|
+
GREATER_EQUAL));
|
473
412
|
rb_define_const(rb_cGrnOperator, "IN",
|
474
|
-
|
475
|
-
rb_str_new_cstr("in"),
|
476
|
-
UINT2NUM(GRN_OP_IN)));
|
413
|
+
OPERATOR_NEW(rb_cGrnOperator, "in", IN));
|
477
414
|
rb_define_const(rb_cGrnOperator, "MATCH",
|
478
|
-
|
479
|
-
rb_str_new_cstr("match"),
|
480
|
-
UINT2NUM(GRN_OP_MATCH)));
|
415
|
+
OPERATOR_NEW(rb_cGrnMatchOperator, "match", MATCH));
|
481
416
|
rb_define_const(rb_cGrnOperator, "NEAR",
|
482
|
-
|
483
|
-
rb_str_new_cstr("near"),
|
484
|
-
UINT2NUM(GRN_OP_NEAR)));
|
417
|
+
OPERATOR_NEW(rb_cGrnOperator, "near", NEAR));
|
485
418
|
rb_define_const(rb_cGrnOperator, "NEAR2",
|
486
|
-
|
487
|
-
rb_str_new_cstr("near2"),
|
488
|
-
UINT2NUM(GRN_OP_NEAR2)));
|
419
|
+
OPERATOR_NEW(rb_cGrnOperator, "near2", NEAR2));
|
489
420
|
rb_define_const(rb_cGrnOperator, "SIMILAR",
|
490
|
-
|
491
|
-
rb_str_new_cstr("similar"),
|
492
|
-
UINT2NUM(GRN_OP_SIMILAR)));
|
421
|
+
OPERATOR_NEW(rb_cGrnOperator, "similar", SIMILAR));
|
493
422
|
rb_define_const(rb_cGrnOperator, "TERM_EXTRACT",
|
494
|
-
|
495
|
-
rb_str_new_cstr("term-extract"),
|
496
|
-
UINT2NUM(GRN_OP_TERM_EXTRACT)));
|
423
|
+
OPERATOR_NEW(rb_cGrnOperator, "term-extract", TERM_EXTRACT));
|
497
424
|
rb_define_const(rb_cGrnOperator, "SHIFTL",
|
498
|
-
|
499
|
-
rb_str_new_cstr("shiftl"),
|
500
|
-
UINT2NUM(GRN_OP_SHIFTL)));
|
425
|
+
OPERATOR_NEW(rb_cGrnOperator, "shiftl", SHIFTL));
|
501
426
|
rb_define_const(rb_cGrnOperator, "SHIFTR",
|
502
|
-
|
503
|
-
rb_str_new_cstr("shiftr"),
|
504
|
-
UINT2NUM(GRN_OP_SHIFTR)));
|
427
|
+
OPERATOR_NEW(rb_cGrnOperator, "shiftr", SHIFTR));
|
505
428
|
rb_define_const(rb_cGrnOperator, "SHIFTRR",
|
506
|
-
|
507
|
-
rb_str_new_cstr("shiftrr"),
|
508
|
-
UINT2NUM(GRN_OP_SHIFTRR)));
|
429
|
+
OPERATOR_NEW(rb_cGrnOperator, "shiftrr", SHIFTRR));
|
509
430
|
rb_define_const(rb_cGrnOperator, "PLUS",
|
510
|
-
|
511
|
-
rb_str_new_cstr("plus"),
|
512
|
-
UINT2NUM(GRN_OP_PLUS)));
|
431
|
+
OPERATOR_NEW(rb_cGrnOperator, "plus", PLUS));
|
513
432
|
rb_define_const(rb_cGrnOperator, "MINUS",
|
514
|
-
|
515
|
-
rb_str_new_cstr("minus"),
|
516
|
-
UINT2NUM(GRN_OP_MINUS)));
|
433
|
+
OPERATOR_NEW(rb_cGrnOperator, "minus", MINUS));
|
517
434
|
rb_define_const(rb_cGrnOperator, "STAR",
|
518
|
-
|
519
|
-
rb_str_new_cstr("star"),
|
520
|
-
UINT2NUM(GRN_OP_STAR)));
|
435
|
+
OPERATOR_NEW(rb_cGrnOperator, "star", STAR));
|
521
436
|
rb_define_const(rb_cGrnOperator, "SLASH",
|
522
|
-
|
523
|
-
rb_str_new_cstr("slash"),
|
524
|
-
UINT2NUM(GRN_OP_SLASH)));
|
437
|
+
OPERATOR_NEW(rb_cGrnOperator, "slash", SLASH));
|
525
438
|
rb_define_const(rb_cGrnOperator, "MODULO",
|
526
|
-
|
527
|
-
rb_str_new_cstr("modulo"),
|
528
|
-
UINT2NUM(GRN_OP_MOD)));
|
439
|
+
OPERATOR_NEW(rb_cGrnOperator, "modulo", MOD));
|
529
440
|
rb_define_const(rb_cGrnOperator, "DELETE",
|
530
|
-
|
531
|
-
rb_str_new_cstr("delete"),
|
532
|
-
UINT2NUM(GRN_OP_DELETE)));
|
441
|
+
OPERATOR_NEW(rb_cGrnOperator, "delete", DELETE));
|
533
442
|
rb_define_const(rb_cGrnOperator, "INCREMENT",
|
534
|
-
|
535
|
-
rb_str_new_cstr("increment"),
|
536
|
-
UINT2NUM(GRN_OP_INCR)));
|
443
|
+
OPERATOR_NEW(rb_cGrnOperator, "increment", INCR));
|
537
444
|
rb_define_const(rb_cGrnOperator, "DECREMENT",
|
538
|
-
|
539
|
-
rb_str_new_cstr("decrement"),
|
540
|
-
UINT2NUM(GRN_OP_DECR)));
|
445
|
+
OPERATOR_NEW(rb_cGrnOperator, "decrement", DECR));
|
541
446
|
rb_define_const(rb_cGrnOperator, "INCREMENT_POST",
|
542
|
-
|
543
|
-
rb_str_new_cstr("increment-post"),
|
544
|
-
UINT2NUM(GRN_OP_INCR_POST)));
|
447
|
+
OPERATOR_NEW(rb_cGrnOperator, "increment-post", INCR_POST));
|
545
448
|
rb_define_const(rb_cGrnOperator, "DECREMENT_POST",
|
546
|
-
|
547
|
-
rb_str_new_cstr("decrement-post"),
|
548
|
-
UINT2NUM(GRN_OP_DECR_POST)));
|
449
|
+
OPERATOR_NEW(rb_cGrnOperator, "decrement-post", DECR_POST));
|
549
450
|
rb_define_const(rb_cGrnOperator, "NOT",
|
550
|
-
|
551
|
-
rb_str_new_cstr("not"),
|
552
|
-
UINT2NUM(GRN_OP_NOT)));
|
451
|
+
OPERATOR_NEW(rb_cGrnOperator, "not", NOT));
|
553
452
|
rb_define_const(rb_cGrnOperator, "ADJUST",
|
554
|
-
|
555
|
-
rb_str_new_cstr("adjust"),
|
556
|
-
UINT2NUM(GRN_OP_ADJUST)));
|
453
|
+
OPERATOR_NEW(rb_cGrnOperator, "adjust", ADJUST));
|
557
454
|
rb_define_const(rb_cGrnOperator, "EXACT",
|
558
|
-
|
559
|
-
rb_str_new_cstr("exact"),
|
560
|
-
UINT2NUM(GRN_OP_EXACT)));
|
455
|
+
OPERATOR_NEW(rb_cGrnOperator, "exact", EXACT));
|
561
456
|
rb_define_const(rb_cGrnOperator, "LONGEST_COMMON_PREFIX",
|
562
|
-
|
563
|
-
rb_str_new_cstr("longest-common-prefix"),
|
564
|
-
UINT2NUM(GRN_OP_LCP)));
|
457
|
+
OPERATOR_NEW(rb_cGrnOperator, "longest-common-prefix", LCP));
|
565
458
|
rb_define_const(rb_cGrnOperator, "PARTIAL",
|
566
|
-
|
567
|
-
rb_str_new_cstr("partial"),
|
568
|
-
UINT2NUM(GRN_OP_PARTIAL)));
|
459
|
+
OPERATOR_NEW(rb_cGrnOperator, "partial", PARTIAL));
|
569
460
|
rb_define_const(rb_cGrnOperator, "UNSPLIT",
|
570
|
-
|
571
|
-
rb_str_new_cstr("unsplit"),
|
572
|
-
UINT2NUM(GRN_OP_UNSPLIT)));
|
461
|
+
OPERATOR_NEW(rb_cGrnOperator, "unsplit", UNSPLIT));
|
573
462
|
rb_define_const(rb_cGrnOperator, "PREFIX",
|
574
|
-
|
575
|
-
rb_str_new_cstr("prefix"),
|
576
|
-
UINT2NUM(GRN_OP_PREFIX)));
|
463
|
+
OPERATOR_NEW(rb_cGrnPrefixOperator, "prefix", PREFIX));
|
577
464
|
rb_define_const(rb_cGrnOperator, "SUFFIX",
|
578
|
-
|
579
|
-
rb_str_new_cstr("suffix"),
|
580
|
-
UINT2NUM(GRN_OP_SUFFIX)));
|
465
|
+
OPERATOR_NEW(rb_cGrnOperator, "suffix", SUFFIX));
|
581
466
|
rb_define_const(rb_cGrnOperator, "GEO_DISTANCE1",
|
582
|
-
|
583
|
-
rb_str_new_cstr("geo-distance1"),
|
584
|
-
UINT2NUM(GRN_OP_GEO_DISTANCE1)));
|
467
|
+
OPERATOR_NEW(rb_cGrnOperator, "geo-distance1", GEO_DISTANCE1));
|
585
468
|
rb_define_const(rb_cGrnOperator, "GEO_DISTANCE2",
|
586
|
-
|
587
|
-
rb_str_new_cstr("geo-distance2"),
|
588
|
-
UINT2NUM(GRN_OP_GEO_DISTANCE2)));
|
469
|
+
OPERATOR_NEW(rb_cGrnOperator, "geo-distance2", GEO_DISTANCE2));
|
589
470
|
rb_define_const(rb_cGrnOperator, "GEO_DISTANCE3",
|
590
|
-
|
591
|
-
rb_str_new_cstr("geo-distance3"),
|
592
|
-
UINT2NUM(GRN_OP_GEO_DISTANCE3)));
|
471
|
+
OPERATOR_NEW(rb_cGrnOperator, "geo-distance3", GEO_DISTANCE3));
|
593
472
|
rb_define_const(rb_cGrnOperator, "GEO_DISTANCE4",
|
594
|
-
|
595
|
-
rb_str_new_cstr("geo-distance4"),
|
596
|
-
UINT2NUM(GRN_OP_GEO_DISTANCE4)));
|
473
|
+
OPERATOR_NEW(rb_cGrnOperator, "geo-distance4", GEO_DISTANCE4));
|
597
474
|
rb_define_const(rb_cGrnOperator, "GEO_WITHINP5",
|
598
|
-
|
599
|
-
rb_str_new_cstr("geo-withinp5"),
|
600
|
-
UINT2NUM(GRN_OP_GEO_WITHINP5)));
|
475
|
+
OPERATOR_NEW(rb_cGrnOperator, "geo-withinp5", GEO_WITHINP5));
|
601
476
|
rb_define_const(rb_cGrnOperator, "GEO_WITHINP6",
|
602
|
-
|
603
|
-
rb_str_new_cstr("geo-withinp6"),
|
604
|
-
UINT2NUM(GRN_OP_GEO_WITHINP6)));
|
477
|
+
OPERATOR_NEW(rb_cGrnOperator, "geo-withinp6", GEO_WITHINP6));
|
605
478
|
rb_define_const(rb_cGrnOperator, "GEO_WITHINP8",
|
606
|
-
|
607
|
-
rb_str_new_cstr("geo-withinp8"),
|
608
|
-
UINT2NUM(GRN_OP_GEO_WITHINP8)));
|
479
|
+
OPERATOR_NEW(rb_cGrnOperator, "geo-withinp8", GEO_WITHINP8));
|
609
480
|
rb_define_const(rb_cGrnOperator, "OBJECT_SEARCH",
|
610
|
-
|
611
|
-
rb_str_new_cstr("object-search"),
|
612
|
-
UINT2NUM(GRN_OP_OBJ_SEARCH)));
|
481
|
+
OPERATOR_NEW(rb_cGrnOperator, "object-search", OBJ_SEARCH));
|
613
482
|
rb_define_const(rb_cGrnOperator, "EXPRESSION_GET_VARIABLE",
|
614
|
-
|
615
|
-
rb_str_new_cstr("expression-get-variable"),
|
616
|
-
UINT2NUM(GRN_OP_EXPR_GET_VAR)));
|
483
|
+
OPERATOR_NEW(rb_cGrnOperator, "expression-get-variable", EXPR_GET_VAR));
|
617
484
|
rb_define_const(rb_cGrnOperator, "TABLE_CREATE",
|
618
|
-
|
619
|
-
rb_str_new_cstr("table-create"),
|
620
|
-
UINT2NUM(GRN_OP_TABLE_CREATE)));
|
485
|
+
OPERATOR_NEW(rb_cGrnOperator, "table-create", TABLE_CREATE));
|
621
486
|
rb_define_const(rb_cGrnOperator, "TABLE_SELECT",
|
622
|
-
|
623
|
-
rb_str_new_cstr("table-select"),
|
624
|
-
UINT2NUM(GRN_OP_TABLE_SELECT)));
|
487
|
+
OPERATOR_NEW(rb_cGrnOperator, "table-select", TABLE_SELECT));
|
625
488
|
rb_define_const(rb_cGrnOperator, "TABLE_SORT",
|
626
|
-
|
627
|
-
rb_str_new_cstr("table-sort"),
|
628
|
-
UINT2NUM(GRN_OP_TABLE_SORT)));
|
489
|
+
OPERATOR_NEW(rb_cGrnOperator, "table-sort", TABLE_SORT));
|
629
490
|
rb_define_const(rb_cGrnOperator, "TABLE_GROUP",
|
630
|
-
|
631
|
-
rb_str_new_cstr("table-group"),
|
632
|
-
UINT2NUM(GRN_OP_TABLE_GROUP)));
|
491
|
+
OPERATOR_NEW(rb_cGrnOperator, "table-group", TABLE_GROUP));
|
633
492
|
rb_define_const(rb_cGrnOperator, "JSON_PUT",
|
634
|
-
|
635
|
-
rb_str_new_cstr("json-put"),
|
636
|
-
UINT2NUM(GRN_OP_JSON_PUT)));
|
493
|
+
OPERATOR_NEW(rb_cGrnOperator, "json-put", JSON_PUT));
|
637
494
|
rb_define_const(rb_cGrnOperator, "REGEXP",
|
638
|
-
|
639
|
-
rb_str_new_cstr("regexp"),
|
640
|
-
UINT2NUM(GRN_OP_REGEXP)));
|
495
|
+
OPERATOR_NEW(rb_cGrnRegexpOperator, "regexp", REGEXP));
|
641
496
|
rb_define_const(rb_cGrnOperator, "FUZZY",
|
642
|
-
|
643
|
-
rb_str_new_cstr("fuzzy"),
|
644
|
-
UINT2NUM(GRN_OP_FUZZY)));
|
497
|
+
OPERATOR_NEW(rb_cGrnOperator, "fuzzy", FUZZY));
|
645
498
|
|
646
499
|
|
647
500
|
/*
|
648
501
|
rb_define_const(rb_cGrnOperator, "GEO_DISTANCE1",
|
649
|
-
|
650
|
-
rb_str_new_cstr("geo-distance1"),
|
651
|
-
UINT2NUM(GRN_OP_GEO_DISTANCE1)));
|
502
|
+
OPERATOR_NEW(rb_cGrnOperator, "geo-distance1", GEO_DISTANCE1));
|
652
503
|
rb_define_const(rb_cGrnOperator, "GEO_DISTANCE2",
|
653
|
-
|
654
|
-
rb_str_new_cstr("geo-distance2"),
|
655
|
-
UINT2NUM(GRN_OP_GEO_DISTANCE2)));
|
504
|
+
OPERATOR_NEW(rb_cGrnOperator, "geo-distance2", GEO_DISTANCE2));
|
656
505
|
rb_define_const(rb_cGrnOperator, "GEO_DISTANCE3",
|
657
|
-
|
658
|
-
rb_str_new_cstr("geo-distance3"),
|
659
|
-
UINT2NUM(GRN_OP_GEO_DISTANCE3)));
|
506
|
+
OPERATOR_NEW(rb_cGrnOperator, "geo-distance3", GEO_DISTANCE3));
|
660
507
|
rb_define_const(rb_cGrnOperator, "GEO_DISTANCE4",
|
661
|
-
|
662
|
-
rb_str_new_cstr("geo-distance4"),
|
663
|
-
UINT2NUM(GRN_OP_GEO_DISTANCE4)));
|
508
|
+
OPERATOR_NEW(rb_cGrnOperator, "geo-distance4", GEO_DISTANCE4));
|
664
509
|
rb_define_const(rb_cGrnOperator, "GEO_WITHINP5",
|
665
|
-
|
666
|
-
rb_str_new_cstr("geo-withinp5"),
|
667
|
-
UINT2NUM(GRN_OP_GEO_WITHINP5)));
|
510
|
+
OPERATOR_NEW(rb_cGrnOperator, "geo-withinp5", GEO_WITHINP5));
|
668
511
|
rb_define_const(rb_cGrnOperator, "GEO_WITHINP6",
|
669
|
-
|
670
|
-
rb_str_new_cstr("geo-withinp6"),
|
671
|
-
UINT2NUM(GRN_OP_GEO_WITHINP6)));
|
512
|
+
OPERATOR_NEW(rb_cGrnOperator, "geo-withinp6", GEO_WITHINP6));
|
672
513
|
rb_define_const(rb_cGrnOperator, "GEO_WITHINP8",
|
673
|
-
|
674
|
-
rb_str_new_cstr("geo-withinp8"),
|
675
|
-
UINT2NUM(GRN_OP_GEO_WITHINP8)));
|
514
|
+
OPERATOR_NEW(rb_cGrnOperator, "geo-withinp8", GEO_WITHINP8));
|
676
515
|
*/
|
516
|
+
|
517
|
+
#undef OPERATOR_NEW
|
677
518
|
}
|
@@ -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-
|
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 *)
|
22
|
+
#define SELF(object) ((RbGrnTableKeySupport *)RTYPEDDATA_DATA(object))
|
23
23
|
|
24
24
|
VALUE rb_cGrnPatriciaTrie;
|
25
25
|
|
data/ext/groonga/rb-grn-plugin.c
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) 2011-
|
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で
|
23
|
+
* プラグイン。現在のところ、RubyでGroongaのプラグインを作成
|
30
24
|
* することはできず、Cで作成された既存のプラグインを登録する
|
31
25
|
* ことができるだけです。
|
32
26
|
*/
|
33
27
|
|
34
|
-
|
35
|
-
rb_grn_plugin_from_ruby_object (VALUE object)
|
36
|
-
{
|
37
|
-
RbGrnPlugin *rb_grn_plugin;
|
28
|
+
#include "rb-grn.h"
|
38
29
|
|
39
|
-
|
40
|
-
rb_raise(rb_eTypeError, "not a groonga plugin");
|
41
|
-
}
|
30
|
+
#define SELF(object) (RVAL2GRNCONTEXT(object))
|
42
31
|
|
43
|
-
|
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
|
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",
|
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
|
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",
|
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-
|
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 *)
|
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(
|
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
|
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 *)
|
21
|
+
#define SELF(object) ((RbGrnTableCursor *)RTYPEDDATA_DATA(object))
|
22
22
|
|
23
23
|
VALUE rb_mGrnTableCursorKeySupport;
|
24
24
|
|