gallery/include/gallery.h

44 lines
1.5 KiB
C

#ifndef _GALLERY_H
#define _GALLERY_H
#include <varray.h>
#include <galleries.h>
/* The following file describes structs that pertain to a specific gallery. */
/* Gallery Contents structure. The following file wraps up a gallery_info
* file along with a listing of all photos in the gallery, stored as a string
* array.
*
* Note that in this structure, the info pointer is neigher copied nor freed.
*/
struct gallery_contents {
struct gallery_info* info;
struct static_string_array* photos;
};
/* Get the contents of a gallery. This takes an existing gallery_info struct,
* opens the directory, then grabs the names of all supported photo types.
*
* A pre-allocated struct may be supplied for storage, otherwise a new one will
* be created (pass NULL as the argument).
*
* Returns a brand new gallery_contents struct, or NULL if creation failed.
*/
struct gallery_contents* read_gallery_contents( struct gallery_info* gallery,
struct gallery_contents* dest );
/* Destroy a gallery_contents struct. The fields_only member tells this
* function that the gallery_contents struct, just its contents.
*/
void destroy_gallery_contents( struct gallery_contents* gc, int fields_only );
/* Duplicate a gallery_contents struct. A pre-allocated struct may be supplied.
*
* This does a deep copy of the structure, returning it, or NULL if it failed.
*/
struct gallery_contents* copy_gallery_contents( struct gallery_contents* gc,
struct gallery_contents* dest );
#endif