### Method

# EDataBook BookCache put_contacts

since: 3.26

#### Declaration [src]

    gboolean
    e_book_cache_put_contacts (
      EBookCache* book_cache,
      const GSList* contacts,
      const GSList* extras,
      const GSList* custom_flags,
      ECacheOfflineFlag offline_flag,
      GCancellable* cancellable,
      GError** error
    )

#### Description [src]

Adds or replaces contacts in `book_cache`.

If `extras` is specified, it must have an equal length as the `contacts` list. Similarly the non-NULL `custom_flags` length should be the same as the length of the `contacts`. Each element from the `extras` list and `custom_flags` list will be stored in association with its corresponding contact in the `contacts` list.

Available since: 3.26

#### Parameters

`contacts`

  Type: A list of `EContact*`

  A list of contacts to add to `book_cache`.

  The data is owned by the caller of the method.

`extras`

  Type: A list of `utf8`

  A list of extra data to store in association with the `contacts`.

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

`custom_flags`

  Type: A list of `guint32`

  Optional custom flags to use for the `contacts`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.

`offline_flag`

  Type: `ECacheOfflineFlag`

  One of `ECacheOfflineFlag`, whether putting these contacts in offline.

`cancellable`

  Type: `GCancellable`

  Optional `GCancellable` object, or `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.

`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: `gboolean`

`TRUE` on success, otherwise `FALSE` is returned and `error` is set appropriately.