1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 20:10:29 +01:00

0.51.1 pre snapshot. Be careful, it may be buggy. It fixes some bugs though.

This commit is contained in:
dan
1999-02-17 11:06:40 +00:00
parent 931a37b124
commit e7495baff7
189 changed files with 16952 additions and 9682 deletions

View File

@@ -111,75 +111,35 @@ wstrdup(char *s)
return strcpy(tmp, s);
}
char**
RSupportedFileFormats(void)
{
char **tmp;
static char *tmp[IM_TYPES+1];
int i = 0;
tmp = malloc(sizeof(char*)*(IM_TYPES+1));
if (!tmp)
return NULL;
memset(tmp, 0, sizeof(char*)*(IM_TYPES+1));
/* built-in */
tmp[i++] = wstrdup("XPM");
if (!tmp[i-1]) {
RFreeStringList(tmp);
return NULL;
}
tmp[i++] = "XPM";
/* built-in */
tmp[i++] = wstrdup("PPM");
if (!tmp[i-1]) {
RFreeStringList(tmp);
return NULL;
}
tmp[i++] = "PPM";
#ifdef USE_TIFF
tmp[i++] = wstrdup("TIFF");
if (!tmp[i-1]) {
RFreeStringList(tmp);
return NULL;
}
tmp[i++] = "TIFF";
#endif
#ifdef USE_PNG
tmp[i++] = wstrdup("PNG");
if (!tmp[i-1]) {
RFreeStringList(tmp);
return NULL;
}
tmp[i++] = "PNG";
#endif
#ifdef USE_JPEG
tmp[i++] = wstrdup("JPEG");
if (!tmp[i-1]) {
RFreeStringList(tmp);
return NULL;
}
tmp[i++] = "JPEG";
#endif
#ifdef USE_GIF
tmp[i++] = wstrdup("GIF");
if (!tmp[i-1]) {
RFreeStringList(tmp);
return NULL;
}
tmp[i++] = "GIF";
#endif
tmp[i] = NULL;
return tmp;
}
void
RFreeStringList(char **list)
{
int i;
for (i = 0; list[i]!=NULL; i++) {
free(list[i]);
}
free(list);
}
static void
init_cache()
{