whombx
null+****@clear*****
Wed Aug 7 22:09:45 JST 2013
whombx 2013-08-07 22:09:45 +0900 (Wed, 07 Aug 2013) New Revision: 2d342ab198f82e63f89bf46f052362fafd5c4fe2 https://github.com/groonga/groonga/commit/2d342ab198f82e63f89bf46f052362fafd5c4fe2 Merged d6924a6: Merge branch 'grn-table-create' of https://github.com/whombx/groonga into whombx-grn-table-create Message: doc: move grn_table_create() and grn_table_add() document from groonga.h to Sphinx text Added files: doc/source/reference/api/grn_table.txt Modified files: doc/files.am include/groonga.h Modified: doc/files.am (+4 -0) =================================================================== --- doc/files.am 2013-08-07 13:46:53 +0900 (593766e) +++ doc/files.am 2013-08-07 22:09:45 +0900 (0850714) @@ -350,6 +350,7 @@ absolute_source_files = \ $(top_srcdir)/doc/source/reference/api/grn_ctx.txt \ $(top_srcdir)/doc/source/reference/api/grn_db.txt \ $(top_srcdir)/doc/source/reference/api/grn_expr.txt \ + $(top_srcdir)/doc/source/reference/api/grn_table.txt \ $(top_srcdir)/doc/source/reference/api/grn_table_cursor.txt \ $(top_srcdir)/doc/source/reference/cast.txt \ $(top_srcdir)/doc/source/reference/command.txt \ @@ -814,6 +815,7 @@ source_files_relative_from_doc_dir = \ source/reference/api/grn_ctx.txt \ source/reference/api/grn_db.txt \ source/reference/api/grn_expr.txt \ + source/reference/api/grn_table.txt \ source/reference/api/grn_table_cursor.txt \ source/reference/cast.txt \ source/reference/command.txt \ @@ -1045,6 +1047,7 @@ html_files_relative_from_locale_dir = \ html/_sources/reference/api/grn_ctx.txt \ html/_sources/reference/api/grn_db.txt \ html/_sources/reference/api/grn_expr.txt \ + html/_sources/reference/api/grn_table.txt \ html/_sources/reference/api/grn_table_cursor.txt \ html/_sources/reference/cast.txt \ html/_sources/reference/command.txt \ @@ -1209,6 +1212,7 @@ html_files_relative_from_locale_dir = \ html/reference/api/grn_ctx.html \ html/reference/api/grn_db.html \ html/reference/api/grn_expr.html \ + html/reference/api/grn_table.html \ html/reference/api/grn_table_cursor.html \ html/reference/cast.html \ html/reference/command.html \ Added: doc/source/reference/api/grn_table.txt (+58 -0) 100644 =================================================================== --- /dev/null +++ doc/source/reference/api/grn_table.txt 2013-08-07 22:09:45 +0900 (88667bc) @@ -0,0 +1,58 @@ +.. -*- rst -*- + +.. highlightlang:: none + +``grn_table`` +============= + +Summary +------- + +TODO... + +Example +------- + +TODO... + +Reference +--------- + +.. c:function:: grn_obj *grn_table_create(grn_ctx *ctx, const char *name, unsigned int name_size, const char *path, grn_obj_flags flags, grn_obj *key_type, grn_obj *value_type) + + nameパラメータに対応する新たなtableをctxが使用するdbに定義します。 + + :param name: + 作成するtableの名前を指定します。NULLなら無名tableとなります。 + + persistent dbに対して名前をありのtableを作成するときには、flagsに ``GRN_OBJ_PERSISTENT`` が指定されていなけれなりません。 + :param path: + 作成するtableのファイルパスを指定します。 + flagsに ``GRN_OBJ_PERSISTENT`` が指定されている場合のみ有効です。 + NULLなら自動的にファイルパスが付与されます。 + :param flags: + ``GRN_OBJ_PERSISTENT`` を指定すると永続tableとなります。 + + ``GRN_OBJ_TABLE_PAT_KEY``, ``GRN_OBJ_TABLE_HASH_KEY``, ``GRN_OBJ_TABLE_NO_KEY`` のいずれかを指定します。 + + ``GRN_OBJ_KEY_NORMALIZE`` を指定すると正規化された文字列がkeyとなります。 + + ``GRN_OBJ_KEY_WITH_SIS`` を指定するとkey文字列の全suffixが自動的に登録されます。 + :param key_type: + keyの型を指定します。``GRN_OBJ_TABLE_NO_KEY`` が指定された場合は無効です。 + 既存のtypeあるいはtableを指定できます。 + + key_typeにtable Aを指定してtable Bを作成した場合、Bは必ずAのサブセットとなります。 + :param value_type: + keyに対応する値を格納する領域の型を指定します。 + tableはcolumnとは別に、keyに対応する値を格納する領域を一つだけ持つことができます。 + +.. c:function:: grn_id grn_table_add(grn_ctx *ctx, grn_obj *table, const void *key, unsigned int key_size, int *added) + + keyに対応する新しいrecordをtableに追加し、そのIDを返します。keyに対応するrecordがすでにtableに存在するならば、そのrecordのIDを返します。 + + ``GRN_OBJ_TABLE_NO_KEY`` が指定されたtableでは、key, key_size は無視されます。 + + :param table: 対象tableを指定します。 + :param key: 検索keyを指定します。 + :param added: NULL以外の値が指定された場合、新たにrecordが追加された時には1が、既存recordだった時には0がセットされます。 Modified: include/groonga.h (+0 -32) =================================================================== --- include/groonga.h 2013-08-07 13:46:53 +0900 (9438149) +++ include/groonga.h 2013-08-07 22:09:45 +0900 (f2351d1) @@ -565,27 +565,6 @@ GRN_API grn_obj *grn_proc_get_info(grn_ctx *ctx, grn_user_data *user_data, #define GRN_TABLE_MAX_KEY_SIZE (0x1000) -/** - * grn_table_create: - * @name: 作成するtableの名前。NULLなら無名tableとなる。 - * persistent dbに対して名前をありのtableを作成するときには、 - * flagsにGRN_OBJ_PERSISTENTが指定されていなければならない。 - * @path: 作成するtableのファイルパス。 - * flagsにGRN_OBJ_PERSISTENTが指定されている場合のみ有効。 - * NULLなら自動的にファイルパスが付与される。 - * @flags: GRN_OBJ_PERSISTENTを指定すると永続tableとなる。 - * GRN_OBJ_TABLE_PAT_KEY,GRN_OBJ_TABLE_HASH_KEY,GRN_OBJ_TABLE_NO_KEY - * のいずれかを指定する。 - * GRN_OBJ_KEY_NORMALIZEを指定すると正規化された文字列がkeyとなる。 - * GRN_OBJ_KEY_WITH_SISを指定するとkey文字列の全suffixが自動的に登録される。 - * @key_type: keyの型を指定する。GRN_OBJ_TABLE_NO_KEYが指定された場合は無効。 - * 既存のtypeあるいはtableを指定できる。 - * key_typeにtable Aを指定してtable Bを作成した場合、Bは必ずAのサブセットとなる。 - * @value_type: keyに対応する値を格納する領域の型。tableはcolumnとは別に、 - * keyに対応する値を格納する領域を一つだけ持つことができる。 - * - * nameに対応する新たなtableをctxが使用するdbに定義する。 - **/ GRN_API grn_obj *grn_table_create(grn_ctx *ctx, const char *name, unsigned int name_size, const char *path, grn_obj_flags flags, @@ -595,17 +574,6 @@ GRN_API grn_obj *grn_table_create(grn_ctx *ctx, (((table) = grn_ctx_get((ctx), (name), (name_size))) ||\ ((table) = grn_table_create((ctx), (name), (name_size), (path), (flags), (key_type), (value_type)))) -/** - * grn_table_add: - * @table: 対象table - * @key: 検索key - * @added: NULL以外の値が指定された場合、 - * 新たにrecordが追加された時には1が、既存recordだった時には0がセットされる。 - * - * keyに対応する新しいrecordをtableに追加し、そのIDを返す。 - * keyに対応するrecordがすでにtableに存在するならば、そのrecordのIDを返す。 - * GRN_OBJ_TABLE_NO_KEYが指定されたtableでは、key, key_size は無視される。 - **/ /* TODO: int *added -> grn_bool *added */ GRN_API grn_id grn_table_add(grn_ctx *ctx, grn_obj *table, const void *key, unsigned int key_size, int *added); -------------- next part -------------- HTML����������������������������...Download