[Groonga-commit] groonga/groonga at 6f3f2d6 [master] Add get a grn_proc_type API

Back to archive index

naoa null+****@clear*****
Fri May 23 19:24:13 JST 2014


naoa	2014-05-23 19:24:13 +0900 (Fri, 23 May 2014)

  New Revision: 6f3f2d6b8a26df35c891a49202c695422bb356bb
  https://github.com/groonga/groonga/commit/6f3f2d6b8a26df35c891a49202c695422bb356bb

  Merged 839dca8: Merge pull request #171 from naoa/add-proc-get-type

  Message:
    Add get a grn_proc_type API
    
    New functions:
      * grn_proc_get_type()

  Modified files:
    include/groonga.h
    lib/db.h
    lib/expr.c

  Modified: include/groonga.h (+2 -1)
===================================================================
--- include/groonga.h    2014-05-23 13:26:34 +0900 (baceb4f)
+++ include/groonga.h    2014-05-23 19:24:13 +0900 (2ad7972)
@@ -469,7 +469,8 @@ typedef struct {
 typedef grn_rc (*grn_plugin_func)(grn_ctx *ctx);
 
 typedef enum {
-  GRN_PROC_TOKENIZER = 1,
+  GRN_PROC_INVALID = 0,
+  GRN_PROC_TOKENIZER,
   GRN_PROC_COMMAND,
   GRN_PROC_FUNCTION,
   GRN_PROC_HOOK,

  Modified: lib/db.h (+2 -0)
===================================================================
--- lib/db.h    2014-05-23 13:26:34 +0900 (11e25ee)
+++ lib/db.h    2014-05-23 19:24:13 +0900 (8193944)
@@ -208,6 +208,8 @@ GRN_API grn_obj *grn_proc_get_or_add_var(grn_ctx *ctx, grn_user_data *user_data,
 GRN_API grn_obj *grn_proc_alloc(grn_ctx *ctx, grn_user_data *user_data,
                                 grn_id domain, grn_obj_flags flags);
 
+GRN_API grn_proc_type grn_proc_get_type(grn_ctx *ctx, grn_obj *proc);
+
 grn_rc grn_proc_set_selector(grn_ctx *ctx, grn_obj *proc,
                              grn_selector_func selector);
 

  Modified: lib/expr.c (+7 -0)
===================================================================
--- lib/expr.c    2014-05-23 13:26:34 +0900 (5126c41)
+++ lib/expr.c    2014-05-23 19:24:13 +0900 (d0bd34d)
@@ -159,6 +159,13 @@ grn_proc_alloc(grn_ctx *ctx, grn_user_data *user_data, grn_id domain, grn_obj_fl
   return pctx->caller ? grn_expr_alloc(ctx, (grn_obj *)pctx->caller, domain, flags) : NULL;
 }
 
+grn_proc_type
+grn_proc_get_type(grn_ctx *ctx, grn_obj *proc)
+{
+  grn_proc *proc_ = (grn_proc *)proc;
+  return proc_ ? proc_->type : GRN_PROC_INVALID;
+}
+
 grn_rc
 grn_proc_set_selector(grn_ctx *ctx, grn_obj *proc, grn_selector_func selector)
 {
-------------- next part --------------
HTML����������������������������...
Descargar 



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