Stub implementations added

This commit is contained in:
Stuart Longland 2008-01-04 22:49:41 +10:00
parent 86eb0e9598
commit c58ab45e1f
2 changed files with 57 additions and 0 deletions

6
.gitignore vendored
View File

@ -26,3 +26,9 @@
# Backup files # Backup files
*~ *~
# Object directory
obj/*
# Output binary
gallery.cgi

51
src/galleries.c Normal file
View File

@ -0,0 +1,51 @@
#include <galleries.h>
/* 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 */
}