[Groonga-commit] groonga/groonga at ec4ee41 [master] Add GRN_RAW_STRING_SET

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Feb 3 16:09:05 JST 2017


Kouhei Sutou	2017-02-03 16:09:05 +0900 (Fri, 03 Feb 2017)

  New Revision: ec4ee41fd25aa63a10e6bf0c3d52c7bbca1aa8a3
  https://github.com/groonga/groonga/commit/ec4ee41fd25aa63a10e6bf0c3d52c7bbca1aa8a3

  Message:
    Add GRN_RAW_STRING_SET
    
    It always sets value. GRN_RAW_STRING_FILL sets value only when input is
    specified.

  Modified files:
    lib/grn_raw_string.h

  Modified: lib/grn_raw_string.h (+10 -1)
===================================================================
--- lib/grn_raw_string.h    2017-02-03 14:52:03 +0900 (f3eec40)
+++ lib/grn_raw_string.h    2017-02-03 16:09:05 +0900 (9aa3e81)
@@ -29,11 +29,20 @@ extern "C" {
     string.length = 0;                          \
   } while (GRN_FALSE)
 
+#define GRN_RAW_STRING_SET(string, bulk)         \
+  if (bulk && GRN_TEXT_LEN(bulk) > 0) {          \
+    string.value = GRN_TEXT_VALUE(bulk);         \
+    string.length = GRN_TEXT_LEN(bulk);          \
+  } else {                                       \
+    string.value = NULL;                         \
+    string.length = 0;                           \
+  }
+
 #define GRN_RAW_STRING_FILL(string, bulk)        \
   if (bulk && GRN_TEXT_LEN(bulk) > 0) {          \
     string.value = GRN_TEXT_VALUE(bulk);         \
     string.length = GRN_TEXT_LEN(bulk);          \
-  }                                              \
+  }
 
 typedef struct {
   const char *value;
-------------- next part --------------
HTML����������������������������...
下載 



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