[Groonga-commit] groonga/groonga at 9dd7903 [master] highlighter: add grn_highlighter_clear_keywords()

アーカイブの一覧に戻る

Kouhei Sutou null+****@clear*****
Thu Jun 7 12:19:07 JST 2018


Kouhei Sutou	2018-06-07 12:19:07 +0900 (Thu, 07 Jun 2018)

  New Revision: 9dd7903959bc74fa8cbac77a7ba1bec7f50f65ea
  https://github.com/groonga/groonga/commit/9dd7903959bc74fa8cbac77a7ba1bec7f50f65ea

  Message:
    highlighter: add grn_highlighter_clear_keywords()

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

  Modified: include/groonga/highlighter.h (+3 -0)
===================================================================
--- include/groonga/highlighter.h    2018-06-04 13:56:59 +0900 (7b84c42e4)
+++ include/groonga/highlighter.h    2018-06-07 12:19:07 +0900 (56c6b3089)
@@ -47,6 +47,9 @@ grn_highlighter_add_keyword(grn_ctx *ctx,
                             grn_highlighter *highlighter,
                             const char *keyword,
                             int64_t keyword_length);
+GRN_API grn_rc
+grn_highlighter_clear_keywords(grn_ctx *ctx,
+                               grn_highlighter *highlighter);
 
 
 #ifdef __cplusplus

  Modified: lib/highlighter.c (+15 -0)
===================================================================
--- lib/highlighter.c    2018-06-04 13:56:59 +0900 (f5a1f8f94)
+++ lib/highlighter.c    2018-06-07 12:19:07 +0900 (4e14918db)
@@ -802,3 +802,18 @@ grn_highlighter_add_keyword(grn_ctx *ctx,
 exit :
   GRN_API_RETURN(ctx->rc);
 }
+
+grn_rc
+grn_highlighter_clear_keywords(grn_ctx *ctx,
+                               grn_highlighter *highlighter)
+{
+  grn_obj *raw_keywords = &(highlighter->raw_keywords);
+
+  GRN_API_ENTER;
+
+  GRN_BULK_REWIND(raw_keywords);
+  highlighter->need_prepared = GRN_TRUE;
+
+exit :
+  GRN_API_RETURN(ctx->rc);
+}
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180607/fba1172b/attachment.htm 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る