Secret.Schema.new
Description: Reference for Secret.Schema.new

### Function

# Secret Schemanew

#### Declaration [src]

    SecretSchema*
    secret_schema_new (
      const gchar* name,
      SecretSchemaFlags flags,
      ...
    )

#### Description [src]

Using this function is not normally necessary from C code.

A schema represents a set of attributes that are stored with an item. These schemas are used for interoperability between various services storing the same types of items.

Each schema has an `name` like `org.gnome.keyring.NetworkPassword`, and defines a set of attributes names, and types (string, integer, boolean) for those attributes.

The variable argument list should contain pairs of a) The attribute name as a null-terminated string, followed by b) integers from the `SecretSchemaAttributeType` enumeration, representing the attribute type for each attribute name. The list of attributes should be terminated with a `NULL`.

Normally when looking up passwords only those with matching schema names are returned. If the schema `flags` contain the `SECRET_SCHEMA_DONT_MATCH_NAME` flag, then lookups will not check that the schema name matches that on the item, only the schema’s attributes are matched. This is useful when you are looking up items that are not stored by the libsecret library. Other libraries such as libgnome-keyring don’t store the schema name.

This function is not directly available to language bindings.

The implementation of this function is provided by `()` in language bindings.

#### Parameters

`name`

  Type: `const gchar*`

  The dotted name of the schema.

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

`flags`

  Type: `SecretSchemaFlags`

  The flags for the schema.

`...`

  Type: ``

  The attribute names and types, terminated with `NULL`.

#### Return value

Type: `SecretSchema`

The new schema, which should be unreferenced with `secret_schema_unref()` when done.

The caller of the function takes ownership of the data, and is responsible for freeing it.