Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/evas
Dir : e17/libs/evas/src/lib/engines/common
Modified Files:
evas_image_load.c evas_image_main.c
Log Message:
resolve symlinks...
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_image_load.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- evas_image_load.c 14 Nov 2002 05:38:10 -0000 1.2
+++ evas_image_load.c 10 Jan 2003 02:05:37 -0000 1.3
@@ -1097,7 +1097,10 @@
}
im->timestamp = mod_time;
if (file)
- im->info.file = strdup(file);
+ {
+ im->info.file = strdup(file);
+ im->info.real_file = evas_file_path_resolve(file);
+ }
if (key)
im->info.key = strdup(key);
evas_common_image_ref(im);
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_image_main.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- evas_image_main.c 14 Nov 2002 05:38:10 -0000 1.2
+++ evas_image_main.c 10 Jan 2003 02:05:37 -0000 1.3
@@ -138,6 +138,7 @@
}
if (im->mipmaps.levels) free(im->mipmaps.levels);
if (im->info.file) free(im->info.file);
+ if (im->info.real_file) free(im->info.real_file);
if (im->info.key) free(im->info.key);
if (im->info.comment) free(im->info.comment);
free(im);
@@ -244,7 +245,8 @@
if (im->flags & RGBA_IMAGE_INDEXED) return;
if ((!im->info.file) && (!im->info.key)) return;
l1 = 0;
- if (im->info.file) l1 = strlen(im->info.file);
+ if (im->info.real_file) l1 = strlen(im->info.real_file);
+ else if (im->info.file) l1 = strlen(im->info.file);
l2 = 0;
if (im->info.key) l2 = strlen(im->info.key);
snprintf(buf, sizeof(buf), "%llx", im->timestamp);
@@ -252,7 +254,8 @@
key = malloc(l1 + 3 + l2 + 3 + l3 +1);
if (!key) return;
key[0] = 0;
- if (im->info.file) strcpy(key, im->info.file);
+ if (im->info.real_file) strcpy(key, im->info.real_file);
+ else if (im->info.file) strcpy(key, im->info.file);
strcat(key, "/:/");
if (im->info.key) strcat(key, im->info.key);
strcat(key, "/:/");
@@ -272,7 +275,8 @@
if (!(im->flags & RGBA_IMAGE_INDEXED)) return;
if ((!im->info.file) && (!im->info.key)) return;
l1 = 0;
- if (im->info.file) l1 = strlen(im->info.file);
+ if (im->info.real_file) l1 = strlen(im->info.real_file);
+ else if (im->info.file) l1 = strlen(im->info.file);
l2 = 0;
if (im->info.key) l2 = strlen(im->info.key);
snprintf(buf, sizeof(buf), "%llx", im->timestamp);
@@ -280,7 +284,8 @@
key = malloc(l1 + 3 + l2 + 3 + l3 +1);
if (!key) return;
key[0] = 0;
- if (im->info.file) strcpy(key, im->info.file);
+ if (im->info.real_file) strcpy(key, im->info.real_file);
+ else if (im->info.file) strcpy(key, im->info.file);
strcat(key, "/:/");
if (im->info.key) strcat(key, im->info.key);
strcat(key, "/:/");
@@ -294,6 +299,7 @@
RGBA_Image *
evas_common_image_find(const char *filename, const char *key, DATA64 timestamp)
{
+ char *real_filename;
Evas_Object_List *l;
RGBA_Image *im;
char *str;
@@ -301,8 +307,10 @@
char buf[256];
if ((!filename) && (!key)) return NULL;
+ real_filename = evas_file_path_resolve(filename);
l1 = 0;
- if (filename) l1 = strlen(filename);
+ if (real_filename) l1 = strlen(real_filename);
+ else if (filename) l1 = strlen(filename);
l2 = 0;
if (key) l2 = strlen(key);
sprintf(buf, "%llx", timestamp);
@@ -325,11 +333,20 @@
im = (RGBA_Image *)l;
ok = 0;
- if ((filename) && (im->info.file) &&
- (!strcmp(filename, im->info.file)))
- ok++;
- if ((!filename) && (!im->info.file))
- ok++;
+ if (real_filename)
+ {
+ if ((im->info.real_file) &&
+ (!strcmp(real_filename, im->info.real_file)))
+ ok++;
+ }
+ else
+ {
+ if ((filename) && (im->info.file) &&
+ (!strcmp(filename, im->info.file)))
+ ok++;
+ if ((!filename) && (!im->info.file))
+ ok++;
+ }
if ((key) && (im->info.key) &&
(!strcmp(key, im->info.key)))
ok++;
@@ -350,6 +367,7 @@
ram += sizeof(struct _RGBA_Image);
if (im->info.file) ram += strlen(im->info.file);
+ if (im->info.real_file) ram += strlen(im->info.real_file);
if (im->info.key) ram += strlen(im->info.key);
if (im->info.comment) ram += strlen(im->info.comment);
if ((im->image) && (im->image->data) && (!im->image->no_free))
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs