Fixed compile issues in AxWin2 WM
[tpg/acess2.git] / Usermode / Applications / axwin2_src / WM / image.c
1 /*
2  * Acess GUI (AxWin) Version 2
3  * By John Hodge (thePowersGang)
4  * 
5  * Window Manager and Widget Control
6  */
7 #include "common.h"
8 #include <stdlib.h>
9 #include <string.h>
10 #include <uri.h>
11
12 // === IMPORTS ===
13 extern tImage *Image_SIF_Parse(void *Buffer, size_t Size);
14
15 // === CODE ===
16 /**
17  * \brief Open an image from a URI
18  */
19 tImage *Image_Load(const char *URI)
20 {
21         #if 0
22         tURI    *uri;
23          int    filesize;
24         void    *buf;
25         tImage  *img;
26         void    *fp;
27         
28         uri = URI_Parse(URI);
29         
30         fp = URI_Open(URI_MODE_READ, uri);
31         if(!fp) return NULL;
32         free(uri);
33         
34         filesize = URI_GetSize(fp);
35         buf = malloc( filesize );
36         if(!buf) {
37                 URI_Close(fp);
38                 return NULL;
39         }
40         
41         URI_Read(fp, filesize, buf);
42         URI_Close(fp);
43         
44         img = Image_SIF_Parse(buf, filesize);
45         free(buf);
46         
47         return img;
48         #else
49         return NULL;
50         #endif
51 }

UCC git Repository :: git.ucc.asn.au