[Groonga-commit] groonga/groonga at f3a3d36 [master] Add grn_type_size()

アーカイブの一覧に戻る

Kouhei Sutou null+****@clear*****
Tue Jan 12 12:23:57 JST 2016


Kouhei Sutou	2016-01-12 12:23:57 +0900 (Tue, 12 Jan 2016)

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

  Message:
    Add grn_type_size()

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

  Modified: include/groonga/type.h (+1 -0)
===================================================================
--- include/groonga/type.h    2016-01-12 12:00:25 +0900 (d248787)
+++ include/groonga/type.h    2016-01-12 12:23:57 +0900 (bbbd97d)
@@ -24,6 +24,7 @@ extern "C" {
 
 GRN_API grn_obj *grn_type_create(grn_ctx *ctx, const char *name, unsigned int name_size,
                                  grn_obj_flags flags, unsigned int size);
+GRN_API uint32_t grn_type_size(grn_ctx *ctx, grn_obj *type);
 
 #ifdef __cplusplus
 }

  Modified: lib/type.c (+14 -0)
===================================================================
--- lib/type.c    2016-01-12 12:00:25 +0900 (01ca0ce)
+++ lib/type.c    2016-01-12 12:23:57 +0900 (af3edef)
@@ -54,3 +54,17 @@ grn_type_create(grn_ctx *ctx, const char *name, unsigned int name_size,
   GRN_API_RETURN((grn_obj *)res);
 }
 
+uint32_t
+grn_type_size(grn_ctx *ctx, grn_obj *type)
+{
+  uint32_t size;
+
+  GRN_API_ENTER;
+  if (!type) {
+    ERR(GRN_INVALID_ARGUMENT, "[type][size] type is NULL");
+    GRN_API_RETURN(0);
+  }
+  size = GRN_TYPE_SIZE(DB_OBJ(type));
+  GRN_API_RETURN(size);
+}
+
-------------- next part --------------
HTML����������������������������...
ダウンロード 



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