You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
546 B
C
31 lines
546 B
C
#include "collection.h"
|
|
#include "object.h"
|
|
|
|
// Standard Library
|
|
#include <stddef.h>
|
|
|
|
struct ap_object* ap_collection_from_uri( const char* uri )
|
|
{
|
|
struct ap_object* col = ap_object_fetch(uri);
|
|
if( !col ) { return NULL; }
|
|
|
|
ap_object_ptr_or_ref_force_embedded( &col->first );
|
|
return col;
|
|
}
|
|
|
|
void ap_collection_iterate( struct ap_object** page )
|
|
{
|
|
if( !*page ) { return; }
|
|
|
|
// Load the next page
|
|
ap_object_ptr_or_ref_force_embedded( &(*page)->next );
|
|
if( (*page)->next.ptr ) {
|
|
*page = (*page)->next.ptr;
|
|
} else {
|
|
*page = NULL;
|
|
}
|
|
}
|
|
|
|
|
|
|