![]() |
![]() |
![]() |
Grilo Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <grilo.h> GDateTime * grl_date_time_from_iso8601 (const gchar *date
); GList * grl_list_from_va (gpointer p
,...
); void grl_paging_translate (guint skip
,guint count
,guint max_page_size
,guint *page_size
,guint *page_number
,guint *internal_offset
);
GDateTime * grl_date_time_from_iso8601 (const gchar *date
);
|
a date expressed in iso8601 format |
Returns : |
a newly-allocated GDateTime set to the time corresponding to
date , or NULL if date could not be parsed properly. |
Since 0.2.0
GList * grl_list_from_va (gpointer p
,...
);
Returns a GList containing the va_list pointers. Use NULL
to finalize them,
|
first pointer |
|
va_list pointers |
Returns : |
a GList. |
Since 0.1.6
void grl_paging_translate (guint skip
,guint count
,guint max_page_size
,guint *page_size
,guint *page_number
,guint *internal_offset
);
Grilo browsing implements a paging mechanism through skip
and count
values.
But there are some services (like Jamendo or Flickr) where paging is done through a page number and page size: user request all elements in a page, specifying in most cases what is the page size.
This function is a helper for this task, computing from skip
and count
what
is the optimal value of page size (limited by max_page_size
), which page
should the user request, and where requested data start inside the page.
By optimal we mean that it computes those values so only one page is required to satisfy the data, using the smallest page size. If user is limiting page size, then more requests to services might be needed. But still page size will be an optimal value.
|
number of elements to skip |
|
number of elements to retrieve |
|
maximum value for page size |
|
optimal page size |
|
page which contain the first element to retrieve (starting at 1) |
|
in the page_number , offset where first element can be found (starting at 0) |
Since 0.1.6