EDataBook.BookCacheCursor.new
Description: Reference for EDataBook.BookCacheCursor.new

### Function

# EDataBook BookCacheCursornew

since: 3.26

#### Declaration [src]

    EBookCacheCursor*
    e_book_cache_cursor_new (
      EBookCache* book_cache,
      const gchar* sexp,
      const EContactField* sort_fields,
      const EBookCursorSortType* sort_types,
      guint n_sort_fields,
      GError** error
    )

#### Description [src]

Creates a new `EBookCacheCursor`.

The cursor should be freed with `e_book_cache_cursor_free()` when no longer needed.

Available since: 3.26

#### Parameters

`book_cache`

  Type: `EBookCache`

  An `EBookCache`.

  The data is owned by the caller of the function.

`sexp`

  Type: `const gchar*`

  Search expression; use `NULL` or an empty string to get all stored contacts.

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

`sort_fields`

  Type: An array of `EContactField`

  An array of `EContactField`(s) as sort keys in order of priority.

  The length of the array is specified in the `n_sort_fields` argument.
  The data is owned by the caller of the function.

`sort_types`

  Type: An array of `EBookCursorSortType`

  An array of `EBookCursorSortTypes`, one for each field in `sort_fields`.

  The length of the array is specified in the `n_sort_fields` argument.
  The data is owned by the caller of the function.

`n_sort_fields`

  Type: `guint`

  The number of fields to sort results by.

`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 function 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: `EBookCacheCursor`

A newly created `EBookCacheCursor`.

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