## Tcl8.6.17/Tk8.6.17 Documentation > Tcl C API > PkgRequire

### Tcl/Tk Applications | Tcl Commands | Tk Commands | [incr Tcl] Package Commands | SQLite3 Package Commands | TDBC Package Commands | tdbc::mysql Package Commands | tdbc::odbc Package Commands | tdbc::postgres Package Commands | tdbc::sqlite3 Package Commands | Thread Package Commands | Tcl C API | Tk C API | [incr Tcl] Package C API | TDBC Package C API

  NAME
    Tcl_PkgRequire, Tcl_PkgRequireEx, Tcl_PkgRequireProc, Tcl_PkgPresent, Tcl_PkgPresentEx, Tcl_PkgProvide, Tcl_PkgProvideEx — 梱包版の制御 package version control
  SYNOPSIS
    #include <tcl.h>
    const char *
    Tcl_PkgRequire(interp, name, version, exact)
    const char *
    Tcl_PkgRequireEx(interp, name, version, exact, clientDataPtr)
    int
    Tcl_PkgRequireProc(interp, name, objc, objv, clientDataPtr)
    const char *
    Tcl_PkgPresent(interp, name, version, exact)
    const char *
    Tcl_PkgPresentEx(interp, name, version, exact, clientDataPtr)
    int
    Tcl_PkgProvide(interp, name, version)
    int
    Tcl_PkgProvideEx(interp, name, version, clientData)
  引数 ARGUMENTS
    Tcl_Interp *interp (入力in)
    const char *name (入力in)
    const char *version (入力in)
    int exact (入力in)
    const void *clientData (入力in)
    void *clientDataPtr (出力out)
    int objc (入力in)
    Tcl_Obj* objv[] (入力in)
  説明 DESCRIPTION
  KEYWORDS
  SEE ALSO

### NAME

Tcl_PkgRequire, Tcl_PkgRequireEx, Tcl_PkgRequireProc, Tcl_PkgPresent, Tcl_PkgPresentEx, Tcl_PkgProvide, Tcl_PkgProvideEx — 梱包版の制御 package version control

### SYNOPSIS

#include <tcl.h>
const char *
Tcl_PkgRequire(interp, name, version, exact)
const char *
Tcl_PkgRequireEx(interp, name, version, exact, clientDataPtr)
int
Tcl_PkgRequireProc(interp, name, objc, objv, clientDataPtr)
const char *
Tcl_PkgPresent(interp, name, version, exact)
const char *
Tcl_PkgPresentEx(interp, name, version, exact, clientDataPtr)
int
Tcl_PkgProvide(interp, name, version)
int
Tcl_PkgProvideEx(interp, name, version, clientData)

### 引数 ARGUMENTS

Tcl_Interp *interp (入力in)
  梱包が必要か利用可能な解釈実行機能｡ Interpreter where package is needed or available.

const char *name (入力in)
  梱包の名前｡ Name of package.

const char *version (入力in)
  package require の為に記述された版番号を指定する文字列｡ A version specification string as described for package require.

int exact (入力in)
  非-零は､ version によって指定される特定の版番号のみ受容れられる事を意味する｡零は､主版番号が version と同じである限り､version 以外の版番号も受容れられる事を意味する｡ Non-zero means that only the particular version specified by version is acceptable. Zero means that newer versions than version are also acceptable as long as they have the same major version number as version.

const void *clientData (入力in)
  梱包と関係がある任意の値｡ Arbitrary value to be associated with the package.

void *clientDataPtr (出力out)
  合致する梱包に関連する値を保存する場所への指示子｡指示子が NULL でなく､且つ函数が成功裡に完了した場合のみ変更される｡貯蔵域は空指示子と同じ寸法のどの様な型も可能である｡　　 Pointer to place to store the value associated with the matching package. It is only changed if the pointer is not NULL and the function completed successfully. The storage can be any pointer type with the same size as a void pointer.

int objc (入力in)
  要件の個数｡ Number of requirements.

Tcl_Obj* objv[] (入力in)
  要件の配列｡ Array of requirements.

### 説明 DESCRIPTION

これ等の手続函数は､ Tcl 梱包への C-水準相互作用と版番号管理機能を提供する｡ These procedures provide C-level interfaces to Tcl's package and version management facilities.

Tcl_PkgRequire は､ package require 命令と等価であり､ Tcl_PkgPresent は package present 命令と､ Tcl_PkgProvide は package provide 命令と等価である｡ Tcl_PkgRequire is equivalent to the package require command, Tcl_PkgPresent is equivalent to the package present command, and Tcl_PkgProvide is equivalent to the package provide command.

これ等の手続函数がすることの詳細は Tcl 命令の説明書を参照されたい｡ See the documentation for the Tcl commands for details on what these procedures do.

Tcl_PkgPresent 又は Tcl_PkgRequire が成功裡に完了すると､解釈実行機能内に提供された梱包の版番号の版番号文字列のポインターを返す(それは version とは異なるかもしれない); もし不都合が生じると､ NULL を返し不都合伝言文を解釈実行機能の結果に残す｡ If Tcl_PkgPresent or Tcl_PkgRequire complete successfully they return a pointer to the version string for the version of the package that is provided in the interpreter (which may be different than version); if an error occurs they return NULL and leave an error message in the interpreter's result.

Tcl_PkgProvide は成功裡に完了すると TCL_OK を返す; もし不都合が生じると､ TCL_ERROR を返し不都合伝言文を解釈実行機能の結果に残す｡ Tcl_PkgProvide returns TCL_OK if it completes successfully; if an error occurs it returns TCL_ERROR and leaves an error message in the interpreter's result.

Tcl_PkgProvideEx と Tcl_PkgPresentEx と Tcl_PkgRequireEx は梱包に結合した依頼側のデータの設定と取戻しを許容する｡他の側面ではそれらは合致函数と等価である｡ Tcl_PkgProvideEx, Tcl_PkgPresentEx and Tcl_PkgRequireEx allow the setting and retrieving of the client data associated with the package. In all other respects they are equivalent to the matching functions.

Tcl_PkgRequireProc は､複数の要求を処理する package require の形式である｡他の形式は旧版との互換性とこの形式に呼出し方を変換する為にある｡ Tcl_PkgRequireProc is the form of package require handling multiple requirements. The other forms are present for backward compatibility and translate their invocations to this form.

### KEYWORDS

package, present, provide, require, version

### SEE ALSO

package, Tcl_StaticPackage
Copyright © 1996 Sun Microsystems, Inc.