このページを編集する際は、[[編集に関する方針]]に従ってください。
*概要 [#w266122a]
-対象:8.1.4
-言語:C
-宣言:[[postgresql-8.1.4/src/include/utils/elog.h]]
-定義:[[postgresql-8.1.4/src/backend/port/ipc_test.c]]
-定義:[[postgresql-8.1.4/src/backend/utils/error/elog.c]]

**[[postgresql-8.1.4/src/backend/port/ipc_test.c]] [#p457fceb]

-引数fmtが示す文字列を標準エラー出力に出力する。

**[[postgresql-8.1.4/src/backend/utils/error/elog.c]] [#qa8ab6b5]

-(概要を書いてください。)

*引数 [#m8a91d8a]

- const char *fmt --

*実装 [#m1d90037]

**[[postgresql-8.1.4/src/backend/port/ipc_test.c]] [#p44af80a]

int
errmsg_internal(const char *fmt,...)
{
	fprintf(stderr, "ERROR: %s\n", fmt);
-stderr -- 標準エラー出力を示す識別子(「[[ソースコードの中に定義がない①/解読日記]]」を参照)

	return 0;					/* return value does not matter */
}

**[[postgresql-8.1.4/src/backend/utils/error/elog.c]] [#f9aa6e60]

int
errmsg_internal(const char *fmt,...)
{
	ErrorData  *edata = &errordata[errordata_stack_depth];
-[[ErrorData/postgresql-8.1.4]] -- 以下のメンバを持つ構造体
--elevelを、intとして定義
--output_to_serverを、bool(charの別名)として定義
--output_to_clientを、bool(charの別名)として定義
--show_funcnameを、bool(charの別名)として定義
--filenameを、const charへのポインタとして定義
--linenoを、intとして定義
--funcnameを、const charへのポインタとして定義
--sqlerrcodeを、intとして定義
--messageを、charへのポインタとして定義
--detailを、charへのポインタとして定義
--hintを、charへのポインタとして定義
--contextを、charへのポインタとして定義
--cursorposを、intとして定義
--internalposを、intとして定義
--internalqueryを、charへのポインタとして定義
--saved_errnoを、intとして定義

-[[errordata_stack_depth/postgresql-8.1.4]] -- 初期値-1のstatic int変数

	MemoryContext oldcontext;
-[[MemoryContext/postgresql-8.1.4]] -- 下記メンバを持つ構造体。
--NodeTag列挙型の変数type
--下記メンバを持つ構造体型MemoryContextMethodsへのポインタmethods
---void*型の関数ポインタalloc
---void型の関数ポインタfree_p
---void*型の関数ポインタrealloc
---void型の関数ポインタinit
---void型の関数ポインタreset
---void型の関数ポインタdelete
---Size型の関数ポインタget_chunk_space
---bool型の関数ポインタis_empty
---void型の関数ポインタstats
---void型の関数ポインタcheck
--MemoryContextDataへのポインタparent(再帰的使用)
--MemoryContextDataへのポインタfirstchild(再帰的使用)
--MemoryContextDataへのポインタnextchild(再帰的使用)
--char型へのポインタname

	recursion_depth++;
-[[recursion_depth/postgresql-8.1.4]] -- 初期値0のstatic int型変数

	CHECK_STACK_DEPTH();
-[[CHECK_STACK_DEPTH()/postgresql-8.1.4]] -- [[errordata_stack_depth/postgresql-8.1.4]]が負であるとき、これを-1にセットした上で、上位関数[[ereport()/postgresql-8.1.4]]、[[errmsg_internal()/postgresql-8.1.4]]を再帰的に呼び出す。

	oldcontext = MemoryContextSwitchTo(ErrorContext);
-[[MemoryContextSwitchTo()/postgresql-8.1.4]] -- 引数 context の値を、グローバル変数 [[CurrentMemoryContext/postgresql-8.1.4]] に代入して、代入前に入っていた値を戻り値として返す。
-[[ErrorContext/postgresql-8.1.4]] -- 下記メンバを持つ構造体MemoryContextDataへのポインタ型の変数
--NodeTag列挙型の変数type
--下記メンバを持つ構造体型MemoryContextMethodsへのポインタmethods
---void*型の関数ポインタalloc
---void型の関数ポインタfree_p
---void*型の関数ポインタrealloc
---void型の関数ポインタinit
---void型の関数ポインタreset
---void型の関数ポインタdelete
---Size型の関数ポインタget_chunk_space
---bool型の関数ポインタis_empty
---void型の関数ポインタstats
---void型の関数ポインタcheck
--MemoryContextDataへのポインタparent(再帰的使用)
--MemoryContextDataへのポインタfirstchild(再帰的使用)
--MemoryContextDataへのポインタnextchild(再帰的使用)
--char型へのポインタname

	EVALUATE_MESSAGE(message, false);
-[[EVALUATE_MESSAGE()/postgresql-8.1.4]]
-[[message/postgresql-8.1.4]]

	MemoryContextSwitchTo(oldcontext);
-[[MemoryContextSwitchTo()/postgresql-8.1.4]] -- 上記参照。

	recursion_depth--;
-[[recursion_depth/postgresql-8.1.4]] -- 初期値0のstatic int型変数

	return 0;					/* return value does not matter */
}


*呼出元 [#j0cca07f]

-[[errstart()/postgresql-8.1.4]]

*備考 [#f8b428ef]

-[[ソースコードの中に定義がない①/解読日記]]

 /*
 * errmsg_internal --- add a primary error message text to the current error
 *
 * This is exactly like errmsg() except that strings passed to errmsg_internal
 * are customarily left out of the internationalization message dictionary.
 * This should be used for "can't happen" cases that are probably not worth
 * spending translation effort on.
 */

*履歴 [#od60161f]
-作者:[[testnoda/ページ作者]]
-日付:????/?/?
|更新日|更新者|更新内容|
|2007/4/24|[[testnoda/ページ作者]]|解読を一旦中止([[関数ポインタ①/解読日記]]を参照)|
||||

*コメント [#yf4acad6]
#comment

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS