X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=libchimara%2Fresource.c;h=b3c98ecbdc1ee9724daed6849b2bee1ad1f46136;hb=db3154e89d7f299cb58265d5359a811394dc03fc;hp=c6b4d34dc0cd4433c74461a48f91b988b2847a2e;hpb=0b85f1dd5993e2ed111ec2ba13bbbb4ebda06ada;p=rodin%2Fchimara.git diff --git a/libchimara/resource.c b/libchimara/resource.c index c6b4d34..b3c98ec 100644 --- a/libchimara/resource.c +++ b/libchimara/resource.c @@ -1,22 +1,25 @@ #include "resource.h" -extern ChimaraGlkPrivate *glk_data; +extern GPrivate *glk_data_key; /** * giblorb_set_resource_map: - * @file The file stream to read the resource map from + * @file: The file stream to read the resource map from * * This function tells the library that the file is indeed the Blorby source * of all resource goodness. Whenever your program calls an image or sound * function, such as glk_image_draw(), the library will search this file for * the resource you request. * - * Do not close the stream after calling this function. The library is - * responsible for closing the stream at shutdown time. + * Do not close the stream after calling this function. + * The library is responsible for closing the stream at shutdown time. + * + * Returns: a Blorb error code. */ giblorb_err_t giblorb_set_resource_map(strid_t file) { + ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key); giblorb_map_t *newmap; /* create map allocates memory */ giblorb_err_t error = giblorb_create_map(file, &newmap); @@ -40,12 +43,16 @@ giblorb_set_resource_map(strid_t file) /** * giblorb_get_resource_map: * - * This function returns the current resource map being used. Returns NULL - * if #giblorb_set_resource_map() has not been called yet. + * This function returns the current resource map being used. Returns %NULL + * if giblorb_set_resource_map() has not been called yet. + * + * Returns: a resource map, or %NULL. */ giblorb_map_t* giblorb_get_resource_map() { + ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key); + if(glk_data->resource_map == NULL) { WARNING("Resource map not set yet.\n"); }