### Method

# GIRepository Repository require_private

since: 2.80

#### Declaration

    GITypelib*
    gi_repository_require_private (
      GIRepository* repository,
      const char* typelib_dir,
      const char* namespace_,
      const char* version,
      GIRepositoryLoadFlags flags,
      GError** error
    )

#### Description

Force the namespace `namespace_` to be loaded if it isn’t already.

If `namespace_` is not loaded, this function will search for a `.typelib` file within the private directory only. In addition, a version `version` of namespace should be specified. If `version` is not specified, the latest will be used.

Available since: 2.80

#### Parameters

`typelib_dir`

  Type: `const char*`

  Private directory where to find the requested typelib.

  The data is owned by the caller of the method.
  The value is a file system path, using the OS encoding.

`namespace_`

  Type: `const char*`

  GI namespace to use, e.g. `Gtk`

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`version`

  Type: `const char*`

  Version of namespace, may be `NULL` for latest.

  The argument can be `NULL`.
  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`flags`

  Type: `GIRepositoryLoadFlags`

  Set of `GIRepositoryLoadFlags`, may be 0

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: `GITypelib`

A pointer to the `GITypelib` if successful, `NULL` otherwise.

The data is owned by the instance.