[Groonga-commit] groonga/groonga at 7aa91a9 [master] grn_ts: add logical operators

Back to archive index

susumu.yata null+****@clear*****
Mon Sep 7 17:22:23 JST 2015


susumu.yata	2015-09-07 17:22:23 +0900 (Mon, 07 Sep 2015)

  New Revision: 7aa91a94c86980e73e574955a218fc1c5ebce9c7
  https://github.com/groonga/groonga/commit/7aa91a94c86980e73e574955a218fc1c5ebce9c7

  Message:
    grn_ts: add logical operators
    
    GitHub: #385

  Modified files:
    lib/ts.c

  Modified: lib/ts.c (+18 -0)
===================================================================
--- lib/ts.c    2015-09-07 16:58:49 +0900 (b126639)
+++ lib/ts.c    2015-09-07 17:22:23 +0900 (edc6d29)
@@ -409,6 +409,24 @@ grn_ts_data_kind_to_type(grn_ts_data_kind kind) {
  * Operators.
  */
 
+/* Logical Not operator (!X). */
+inline static grn_bool
+grn_ts_op_logical_not(grn_bool arg) {
+  return !arg;
+}
+
+/* Logical And operator (X && Y). */
+inline static grn_bool
+grn_ts_op_logical_and(grn_bool arg1, grn_bool arg2) {
+  return arg1 & arg2;
+}
+
+/* Logical Or operator (X || Y). */
+inline static grn_bool
+grn_ts_op_logical_or(grn_bool arg1, grn_bool arg2) {
+  return arg1 | arg2;
+}
+
 /* grn_ts_op_get_n_args() returns the number of arguments. */
 static size_t
 grn_ts_op_get_n_args(grn_ts_op_type op_type) {
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index