Method

EDataBookBookCachecursor_step

since: 3.26

Declaration [src]

gint
e_book_cache_cursor_step (
  EBookCache* book_cache,
  EBookCacheCursor* cursor,
  EBookCacheCursorStepFlags flags,
  EBookCacheCursorOrigin origin,
  gint count,
  GSList** out_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_CACHE_ERROR_END_OF_LIST error.

If E_BOOK_CACHE_CURSOR_STEP_FETCH is specified in flags, a pointer to a NULL GSList pointer should be provided for the out_results parameter.

The result list will be stored to out_results and should be freed with g_slist_free_full (results, e_book_cache_search_data_free); when no longer needed.

Available since: 3.26

Parameters

cursor

Type: EBookCacheCursor

The EBookCacheCursor to use.

The data is owned by the caller of the method.
flags

Type: EBookCacheCursorStepFlags

The EBookCacheCursorStepFlags for this step.

origin

Type: EBookCacheCursorOrigin

The EBookCacheCursorOrigin from whence to step.

count

Type: gint

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

out_results

Type: A list of None

A return location to store the results, or NULL if E_BOOK_CACHE_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

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

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