[Groonga-commit] groonga/groonga at 486f4d0 [master] grn_ts: add macros for error handling and debugging

Back to archive index

susumu.yata null+****@clear*****
Mon Oct 5 15:48:30 JST 2015


susumu.yata	2015-10-05 15:48:30 +0900 (Mon, 05 Oct 2015)

  New Revision: 486f4d07c654b5feba504bc18abfe204b66a23a3
  https://github.com/groonga/groonga/commit/486f4d07c654b5feba504bc18abfe204b66a23a3

  Message:
    grn_ts: add macros for error handling and debugging
    
    GitHub: #412

  Modified files:
    lib/ts.c

  Modified: lib/ts.c (+14 -0)
===================================================================
--- lib/ts.c    2015-10-05 14:55:57 +0900 (b67d191)
+++ lib/ts.c    2015-10-05 15:48:30 +0900 (8f81bd1)
@@ -43,6 +43,20 @@
 
 enum { GRN_TS_BATCH_SIZE = 1024 };
 
+/* GRN_TS_DEBUG() logs a message that is useful for debug. */
+#define GRN_TS_DEBUG(...) GRN_LOG(ctx, GRN_LOG_DEBUG, __VA_ARGS__)
+
+/* GRN_TS_WARN() logs a warning. */
+#define GRN_TS_WARN(rc, ...) WARN(rc, __VA_ARGS__)
+
+/* GRN_TS_ERR() reports an error. */
+#define GRN_TS_ERR(rc, ...) ERR(rc, __VA_ARGS__)
+/* GRN_TS_ERR_RETURN() reports an error and returns its error code. */
+#define GRN_TS_ERR_RETURN(rc, ...) do {\
+  GRN_TS_ERR(rc, __VA_ARGS__);\
+  return rc;\
+} while (GRN_FALSE)
+
 /*-------------------------------------------------------------
  * grn_ts_str.
  */
-------------- next part --------------
HTML����������������������������...
Download 



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