EDataBook.BookSqlite.cursor_step

### Method

# EDataBook BookSqlitecursor_step

since: 3.12

#### Declaration [src]

    gint
    e_book_sqlite_cursor_step (
      EBookSqlite* ebsql,
      EbSqlCursor* cursor,
      EbSqlCursorStepFlags flags,
      EbSqlCursorOrigin origin,
      gint count,
      GSList** results,
      GCancellable* cancellable,
      GError** error
    )

#### Description [src]

Steps `cursor` through its sorted query by a maximum of `count` contacts starting from `origin`.

If `count` is negative, then the cursor will move through the list in reverse.

If `cursor` reaches the beginning or end of the query results, then the returned list might not contain the amount of desired contacts, or might return no results if the cursor currently points to the last contact. Reaching the end of the list is not considered an error condition. Attempts to step beyond the end of the list after having reached the end of the list will however trigger an `E_BOOK_SQLITE_ERROR_END_OF_LIST` error.

If `EBSQL_CURSOR_STEP_FETCH` is specified in `flags`, a pointer to a `NULL` `GSList` pointer should be provided for the `results` parameter.

The result list will be stored to `results` and should be freed with `g_slist_free()` and all elements freed with e_book_sqlite_search_data_free().

Available since: 3.12

This method is not directly available to language bindings.

#### Parameters

`cursor`

  Type: `EbSqlCursor`

  The `EbSqlCursor` to use.

  The data is owned by the caller of the method.

`flags`

  Type: `EbSqlCursorStepFlags`

  The `EbSqlCursorStepFlags` for this step.

`origin`

  Type: `EbSqlCursorOrigin`

  The `EbSqlCursorOrigin` from whence to step.

`count`

  Type: `gint`

  A positive or negative amount of contacts to try and fetch.

`results`

  Type: A list of `None`

  A return location to store the results, or `NULL` if `EBSQL_CURSOR_STEP_FETCH` is not specified in `flags`.

  The argument will be set by the function.
  The argument can be set to `NULL` by the method.
  The caller of the method takes ownership of the returned data, and is responsible for freeing it.

`cancellable`

  Type: `GCancellable`

  A `GCancellable`.

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

The number of contacts traversed if successful, otherwise -1 is returned and `error` is set.