summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Woelders <kim@woelders.dk>2021-01-18 17:36:21 +0100
committerKim Woelders <kim@woelders.dk>2021-01-18 19:04:01 +0100
commitc4750cbcb7f54a4b87d579cdb586cf82e00caec1 (patch)
treecd5e9d7d5c337ec00a2a9d755cc6d5e2975dea7d
parentea6b387f7dc3cda5cd6bddc757b1c35f040268ef (diff)
EET loader: Fix build + stuff
Several changes were not properly incorporated in this loader. Noted by Andrew Savchenko Also add back im->key check previously dropped by mistake.
-rw-r--r--src/modules/loaders/loader_eet.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/src/modules/loaders/loader_eet.c b/src/modules/loaders/loader_eet.c
index 95f9d33..ea7e62d 100644
--- a/src/modules/loaders/loader_eet.c
+++ b/src/modules/loaders/loader_eet.c
@@ -6,11 +6,6 @@
6 6
7#include "loader_common.h" 7#include "loader_common.h"
8 8
9#define SWAP32(x) (x) = \
10((((x) & 0x000000ff ) << 24) |\
11 (((x) & 0x0000ff00 ) << 8) |\
12 (((x) & 0x00ff0000 ) >> 8) |\
13 (((x) & 0xff000000 ) >> 24))
14#include <Eet.h> 9#include <Eet.h>
15#include <sys/types.h> 10#include <sys/types.h>
16#include <sys/stat.h> 11#include <sys/stat.h>
@@ -42,11 +37,7 @@ exists(char *file)
42static int 37static int
43can_read(char *file) 38can_read(char *file)
44{ 39{
45#ifndef __EMX__
46 if (!(permissions(file) & (S_IRUSR | S_IRGRP | S_IROTH))) 40 if (!(permissions(file) & (S_IRUSR | S_IRGRP | S_IROTH)))
47#else
48 if (!(permissions(file)))
49#endif
50 return 0; 41 return 0;
51 return (1 + access(file, R_OK)); 42 return (1 + access(file, R_OK));
52} 43}
@@ -54,11 +45,7 @@ can_read(char *file)
54static int 45static int
55can_write(char *file) 46can_write(char *file)
56{ 47{
57#ifndef __EMX__
58 if (!(permissions(file) & (S_IWUSR | S_IWGRP | S_IWOTH))) 48 if (!(permissions(file) & (S_IWUSR | S_IWGRP | S_IWOTH)))
59#else
60 if (!(permissions(file)))
61#endif
62 return 0; 49 return 0;
63 return (1 + access(file, W_OK)); 50 return (1 + access(file, W_OK));
64} 51}
@@ -73,6 +60,9 @@ load(ImlibImage * im, ImlibProgressFunction progress,
73 DATA32 *ret; 60 DATA32 *ret;
74 DATA32 *body; 61 DATA32 *body;
75 62
63 if (!im->key)
64 return 0;
65
76 strcpy(file, im->real_file); 66 strcpy(file, im->real_file);
77 strcpy(key, im->key); 67 strcpy(key, im->key);
78 if (!can_read(file)) 68 if (!can_read(file))
@@ -372,18 +362,12 @@ save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
372 /* finish off */ 362 /* finish off */
373 eet_close(ef); 363 eet_close(ef);
374 return 1; 364 return 1;
375 progress_granularity = 0;
376} 365}
377 366
378void 367void
379formats(ImlibLoader * l) 368formats(ImlibLoader * l)
380{ 369{
381 static const char *const list_formats[] = { "eet" }; 370 static const char *const list_formats[] = { "ani" };
382 int i; 371 __imlib_LoaderSetFormats(l, list_formats,
383 372 sizeof(list_formats) / sizeof(char *));
384 l->num_formats = sizeof(list_formats) / sizeof(char *);
385 l->formats = malloc(sizeof(char *) * l->num_formats);
386
387 for (i = 0; i < l->num_formats; i++)
388 l->formats[i] = strdup(list_formats[i]);
389} 373}