ファイル内の特定の仕様を照会するためにフィルタ関数を作成し、対象とする仕様を取得します。
tt_file_objects_query を使って、指定されたファイル内のすべてのオブジェクトを見つけます。ToolTalk サービスは、各オブジェクトを見つけるとフィルタ関数を呼び出し、そのオブジェクトの objid とアプリケーションが与えた 2 つのポインタをそのフィルタ関数に渡します。フィルタ関数は演算をいくつか行い、Tt_filter_action の値 (TT_FILTER_CONTINUE
または TT_FILTER_STOP
) を返します。これは照会を続行するか、検出を終了してすぐに復帰するかを示します。
例 12-1 は、仕様リストの取得方法を示します。
tt_file_objects_query 関数内では、アプリケーションは、オブジェクトをスクロールリストに挿入するフィルタ関数 cntl_gather_specs を呼び出します。例 12-2 に objid の挿入方法を示します。