From c58ab45e1fcbb8080ff1125212e2553b8967172c Mon Sep 17 00:00:00 2001 From: Stuart Longland Date: Fri, 4 Jan 2008 22:49:41 +1000 Subject: [PATCH] Stub implementations added --- .gitignore | 6 ++++++ src/galleries.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 src/galleries.c diff --git a/.gitignore b/.gitignore index c5aa476..0e6c2a2 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,9 @@ # Backup files *~ + +# Object directory +obj/* + +# Output binary +gallery.cgi diff --git a/src/galleries.c b/src/galleries.c new file mode 100644 index 0000000..61699ff --- /dev/null +++ b/src/galleries.c @@ -0,0 +1,51 @@ +#include + +/* create_gallery_info takes the given fields and returns a gallery_info struct + * with them, copying the strings into place. It returns NULL if there's + * insufficient memory. + * + * dest specifies an existing struct to be used. If this is set to NULL, a new + * struct is malloc()'d for use and returned. + */ +struct gallery_info* create_gallery_info( + const char* name, + const char* title, + const char* desc, + struct gallery_info* dest) { + return NULL; /* TODO */ +} +struct gallery_info* copy_gallery_info( struct gallery_info* info ) { + return NULL; /* TODO */ +} + +/* setting fields_only non-zero tells destroy_gallery_info to only free() the + * title, name and desc fields of the struct, rather than the struct itself. + * This is required when the struct is not allocated directly using malloc or + * similar commands. + */ +void destroy_gallery_info( struct gallery_info* info, int fields_only ) { + /* TODO */ +} + +/* Attempt to read the gallery information for a given directory. If it's not a + * gallery, it'll return NULL, otherwise a gallery_info struct will be + * returned. + */ +struct gallery_info* read_gallery( const char* dir ) { + return NULL; /* TODO */ +} + +/* The following function returns a linked-list of galleries known to the + * webapp, or NULL if such a list can't be constructed (due to memory + * constraints). + */ +struct gallery_list* list_galleries() { + return NULL; /* TODO */ +} + +/* Since linked-lists are a PITA to free directly, this function does the dirty + * work for us. + */ +void destroy_gallery_list( struct gallery_list* ) { + /* TODO */ +}