[Groonga-commit] groonga/groonga at 0591f3c [master] plugin: add grn_plugin_clear_error() and GRN_PLUGIN_CLEAR_ERROR()

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Apr 10 22:29:34 JST 2016


Kouhei Sutou	2016-04-10 22:29:34 +0900 (Sun, 10 Apr 2016)

  New Revision: 0591f3cd735cf911b3a56348c5a3896bd4b39be9
  https://github.com/groonga/groonga/commit/0591f3cd735cf911b3a56348c5a3896bd4b39be9

  Message:
    plugin: add grn_plugin_clear_error() and GRN_PLUGIN_CLEAR_ERROR()

  Modified files:
    include/groonga/plugin.h
    lib/plugin.c

  Modified: include/groonga/plugin.h (+6 -0)
===================================================================
--- include/groonga/plugin.h    2016-04-10 22:23:05 +0900 (37fc11d)
+++ include/groonga/plugin.h    2016-04-10 22:29:34 +0900 (24eab5d)
@@ -96,6 +96,8 @@ GRN_API void grn_plugin_set_error(grn_ctx *ctx, grn_log_level level,
                                   grn_rc error_code,
                                   const char *file, int line, const char *func,
                                   const char *format, ...) GRN_ATTRIBUTE_PRINTF(7);
+GRN_API void grn_plugin_clear_error(grn_ctx *ctx);
+
 
 /*
   Don't call these functions directly. grn_plugin_backtrace() and
@@ -119,6 +121,10 @@ GRN_API void grn_plugin_logtrace(grn_ctx *ctx, grn_log_level level);
 #define GRN_PLUGIN_ERROR(ctx, error_code, ...) \
   GRN_PLUGIN_SET_ERROR(ctx, GRN_LOG_ERROR, error_code, __VA_ARGS__)
 
+#define GRN_PLUGIN_CLEAR_ERROR(ctx) do { \
+  grn_plugin_clear_error((ctx)); \
+} while (0)
+
 typedef struct _grn_plugin_mutex grn_plugin_mutex;
 
 GRN_API grn_plugin_mutex *grn_plugin_mutex_open(grn_ctx *ctx);

  Modified: lib/plugin.c (+6 -0)
===================================================================
--- lib/plugin.c    2016-04-10 22:23:05 +0900 (503f136)
+++ lib/plugin.c    2016-04-10 22:29:34 +0900 (e811cde)
@@ -1111,6 +1111,12 @@ grn_plugin_set_error(grn_ctx *ctx, grn_log_level level, grn_rc error_code,
 }
 
 void
+grn_plugin_clear_error(grn_ctx *ctx)
+{
+  ERRCLR(ctx);
+}
+
+void
 grn_plugin_backtrace(grn_ctx *ctx)
 {
   BACKTRACE(ctx);
-------------- next part --------------
HTML����������������������������...
Download 



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