[Groonga-commit] groonga/groonga at d7402e5 [master] Add accessor for flags of the current query logger

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Jun 25 00:02:00 JST 2017


Kouhei Sutou	2017-06-25 00:02:00 +0900 (Sun, 25 Jun 2017)

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

  Message:
    Add accessor for flags of the current query logger
    
    They are new API.

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

  Modified: include/groonga/groonga.h (+4 -0)
===================================================================
--- include/groonga/groonga.h    2017-06-24 15:19:57 +0900 (ff4890b)
+++ include/groonga/groonga.h    2017-06-25 00:02:00 +0900 (790ca4a)
@@ -1122,6 +1122,10 @@ struct _grn_query_logger {
 };
 
 GRN_API grn_rc grn_query_logger_set(grn_ctx *ctx, const grn_query_logger *logger);
+GRN_API void grn_query_logger_set_flags(grn_ctx *ctx, unsigned int flags);
+GRN_API void grn_query_logger_add_flags(grn_ctx *ctx, unsigned int flags);
+GRN_API void grn_query_logger_remove_flags(grn_ctx *ctx, unsigned int flags);
+GRN_API unsigned int grn_query_logger_get_flags(grn_ctx *ctx);
 
 GRN_API void grn_query_logger_put(grn_ctx *ctx, unsigned int flag,
                                   const char *mark,

  Modified: lib/logger.c (+24 -0)
===================================================================
--- lib/logger.c    2017-06-24 15:19:57 +0900 (d294d64)
+++ lib/logger.c    2017-06-25 00:02:00 +0900 (de1540b)
@@ -624,6 +624,30 @@ grn_query_logger_set(grn_ctx *ctx, const grn_query_logger *logger)
   return GRN_SUCCESS;
 }
 
+void
+grn_query_logger_set_flags(grn_ctx *ctx, unsigned int flags)
+{
+  current_query_logger.flags = flags;
+}
+
+void
+grn_query_logger_add_flags(grn_ctx *ctx, unsigned int flags)
+{
+  current_query_logger.flags |= flags;
+}
+
+void
+grn_query_logger_remove_flags(grn_ctx *ctx, unsigned int flags)
+{
+  current_query_logger.flags &= ~flags;
+}
+
+unsigned int
+grn_query_logger_get_flags(grn_ctx *ctx)
+{
+  return current_query_logger.flags;
+}
+
 grn_bool
 grn_query_logger_pass(grn_ctx *ctx, unsigned int flag)
 {
-------------- next part --------------
HTML����������������������������...
Download 



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