1 --- epsilon-0.3.0.013-20080813/src/bin/epsilon_thumbd.c.orig 2008-05-22 05:36:25.000000000 +0200
2 +++ epsilon-0.3.0.013-20080813/src/bin/epsilon_thumbd.c 2012-01-22 14:01:15.587000345 +0100
4 #include "epsilon_private.h"
6 -#include <Ecore_Data.h>
12 @@ -36,7 +36,7 @@ struct _Epsilon_Client
15 Ecore_Ipc_Client *client;
19 Epsilon_Ipc_End ipcend;
21 @@ -60,7 +60,7 @@ struct _Epsilon_Entry
22 typedef struct _Epsilon_Worker Epsilon_Worker;
23 struct _Epsilon_Worker
29 Ecore_Ipc_Server *server;
30 @@ -92,13 +92,13 @@ static Ecore_Event_Handler *worker_add =
31 static Ecore_Event_Handler *worker_del = NULL;
32 static Ecore_Event_Handler *worker_data = NULL;
34 -static Ecore_List *queued_workers;
35 -static Ecore_List *gworkers = NULL;
36 +static Eina_List *queued_workers;
37 +static Eina_List *gworkers = NULL;
39 static Ecore_Ipc_Server *thumb_server = NULL;
40 static Ecore_Ipc_Server *thumbd_server = NULL;
42 -static Ecore_List *response_queue = NULL;
43 +static Eina_List *response_queue = NULL;
45 static char *epsilond_socket_path(char *name);
46 /* static int epsilond_entry_free(Epsilon_Entry *thumb); */
47 @@ -109,7 +109,7 @@ int epsilond_cb_worker_add(void *data, i
48 int epsilond_cb_worker_del(void *data, int type, void *event);
49 int epsilond_cb_worker_data(void *data, int type, void *event);
51 -void epsilond_init_thumbd_server(Ecore_List* workers)
52 +void epsilond_init_thumbd_server(Eina_List* workers)
56 @@ -162,7 +162,7 @@ epsilond_cb_client_add(void *data, int t
59 Ecore_Ipc_Event_Client_Add *e;
60 - Ecore_List *clients = data;
61 + Eina_List *clients = data;
65 @@ -178,7 +178,7 @@ epsilond_cb_client_add(void *data, int t
68 cl->client = e->client;
69 - ecore_list_append(clients, cl);
70 + clients = eina_list_append(clients, cl);
72 if (debug) printf("Added client %d\n", cl->id);
74 @@ -193,7 +193,7 @@ epsilond_cb_worker_add(void *data, int t
77 Ecore_Ipc_Event_Client_Add *e;
78 - Ecore_List *workers = data;
79 + Eina_List *workers = data;
83 @@ -210,7 +210,7 @@ epsilond_cb_worker_add(void *data, int t
86 cl->client = e->client;
87 - ecore_list_append(workers, cl);
88 + workers = eina_list_append(workers, cl);
90 if (debug) printf("Added worker client %d\n", cl->id);
92 @@ -222,7 +222,7 @@ epsilond_cb_client_del(void *data, int t
94 Ecore_Ipc_Event_Client_Del *e;
96 - Ecore_List *clients = data;
97 + Eina_List *clients = data, *le;
101 @@ -234,10 +234,11 @@ epsilond_cb_client_del(void *data, int t
103 * Search for the disconnecting client
105 - ecore_list_first_goto(clients);
106 - while ((cl = ecore_list_current(clients))) {
110 if (cl->client == e->client) {
111 - ecore_list_remove(clients);
112 + clients = eina_list_remove_list(clients, le);
115 * Free thumbnail data associated with this client.
116 @@ -247,7 +248,7 @@ epsilond_cb_client_del(void *data, int t
120 - ecore_list_next(clients);
121 + le = eina_list_next(le);
124 ecore_ipc_client_del(e->client);
125 @@ -260,7 +261,7 @@ epsilond_cb_worker_del(void *data, int t
127 Ecore_Ipc_Event_Client_Del *e;
129 - Ecore_List *workers = data;
130 + Eina_List *workers = data, *le;
134 @@ -272,10 +273,11 @@ epsilond_cb_worker_del(void *data, int t
136 * Search for the disconnecting client
138 - ecore_list_first_goto(workers);
139 - while ((cl = ecore_list_current(workers))) {
143 if (cl->client == e->client) {
144 - ecore_list_remove(workers);
145 + workers = eina_list_remove_list(workers, le);
148 * Free thumbnail data associated with this client.
149 @@ -285,7 +287,7 @@ epsilond_cb_worker_del(void *data, int t
153 - ecore_list_next(workers);
154 + le = eina_list_next(le);
157 ecore_ipc_client_del(e->client);
158 @@ -306,10 +308,8 @@ epsilon_client_thumb_add(Epsilon_Client
159 thumb->path = strdup(path);
160 thumb->size = strlen(path) + 1;
163 - cl->thumbs = ecore_list_new();
164 if (debug) printf("Queueing %s\n", thumb->path);
165 - ecore_list_append(cl->thumbs, thumb);
166 + cl->thumbs = eina_list_append(cl->thumbs, thumb);
170 @@ -321,7 +321,7 @@ epsilond_cb_client_data(void *data, int
172 Ecore_Ipc_Event_Client_Data *e;
174 - Ecore_List *clients = data;
175 + Eina_List *clients = data, *le;
179 @@ -335,8 +335,9 @@ epsilond_cb_client_data(void *data, int
181 * Match the client sending the data.
183 - ecore_list_first_goto(clients);
184 - while ((cl = ecore_list_next(clients))) {
188 if (cl->client == e->client)
191 @@ -354,10 +355,8 @@ epsilond_cb_client_data(void *data, int
192 memcpy(msg2,msg,sizeof(Epsilon_Message)+msg->bufsize);
194 if (debug) printf("** Received %d : %s **\n",msg->mid, ((char *)msg + sizeof(Epsilon_Message)));
196 - cl->thumbs = ecore_list_new();
198 - ecore_list_append(cl->thumbs, msg2);
199 + cl->thumbs = eina_list_append(cl->thumbs, msg2);
202 if (debug) printf("ERROR: No matching client for data\n");
203 @@ -371,7 +370,7 @@ epsilond_cb_worker_data(void *data, int
205 Ecore_Ipc_Event_Client_Data *e;
207 - Ecore_List *workers;
208 + Eina_List *workers, *le;
212 @@ -384,8 +383,9 @@ epsilond_cb_worker_data(void *data, int
214 * Match the client data.
216 - ecore_list_first_goto(workers);
217 - while ((cl = ecore_list_next(workers))) {
219 + while (le = eina_list_next(le)) {
221 if (cl->client == e->client)
224 @@ -406,7 +406,7 @@ epsilond_cb_worker_data(void *data, int
225 response->client = cl;
226 response->msg = calloc(1,sizeof(Epsilon_Message)+msg->bufsize);
227 memcpy(response->msg, msg, sizeof(Epsilon_Message)+msg->bufsize);
228 - ecore_list_append(response_queue, response);
229 + response_queue = eina_list_append(response_queue, response);
233 @@ -425,33 +425,35 @@ epsilond_client_dispatch(Epsilon_Client
235 * Iterate over the thumbnails splitting them between threads.
237 - while (ecore_list_count(cl->thumbs) > 0) {
238 - available = ecore_list_count(queued_workers);
240 - while ((worker = ecore_list_current(queued_workers))) {
241 + while (eina_list_count(cl->thumbs) > 0) {
242 + available = eina_list_count(queued_workers);
244 + Eina_List *le = queued_workers;
248 * Don't dispatch work to active workers.
250 - if (!worker->child && !ecore_list_count(worker->thumbs)) {
251 + if (!worker->child && !eina_list_count(worker->thumbs)) {
252 Epsilon_Message *msg;
255 * Get the next message on the queue and break
256 * out of the inner loop if NULL.
258 - msg = ecore_list_first_remove(cl->thumbs);
259 + msg = cl->thumbs->data;
260 + cl->thumbs = eina_list_remove_list(cl->thumbs, cl->thumbs);
264 if (debug) printf("Dispatching message %d\n", msg->mid);
265 - ecore_list_append(worker->thumbs, msg);
266 + worker->thumbs = eina_list_append(worker->thumbs, msg);
268 if (debug) printf("Assigning %s to worker %p\n",
269 ((char *)msg + sizeof(Epsilon_Message)), worker);
270 if (debug) printf("Dispatched message %d\n", msg->mid);
272 - ecore_list_next(queued_workers);
273 + le = eina_list_next(le);
277 @@ -465,7 +467,7 @@ epsilond_client_dispatch(Epsilon_Client
278 * Only start over in the list if we reached the end.
281 - ecore_list_first_goto(queued_workers);
282 + le = queued_workers;
286 @@ -478,18 +480,22 @@ static int
287 epsilond_worker_run(void *data)
289 Epsilon_Worker *worker;
290 - Epsilon_Message *msg;
291 + Epsilon_Message *msg = NULL;
294 if (debug) printf("Running worker thread %p for %d thumbnails\n", worker,
295 - ecore_list_count(worker->thumbs));
296 + eina_list_count(worker->thumbs));
298 /* FIXME: Do we want the fast exit point here?
299 - if (!ecore_list_count(worker->thumbs))
300 + if (!eina_list_count(worker->thumbs))
304 - while ((msg = ecore_list_first_remove(worker->thumbs))) {
305 + if(worker->thumbs != NULL) {
306 + msg = worker->thumbs->data;
307 + worker->thumbs = eina_list_remove_list(worker->thumbs, worker->thumbs);
313 @@ -538,6 +544,11 @@ epsilond_worker_run(void *data)
314 ecore_ipc_server_flush(worker->server);
317 + if(worker->thumbs != NULL) {
318 + msg = worker->thumbs->data;
319 + worker->thumbs = eina_list_remove_list(worker->thumbs, worker->thumbs);
323 ecore_ipc_server_flush(worker->server);
324 ecore_main_loop_quit();
325 @@ -553,7 +564,6 @@ epsilond_worker_fork(Epsilon_Worker *wor
327 * Begin iteration of the thumb list.
329 - ecore_list_first_goto(worker->thumbs);
331 worker->runtime = ecore_time_get();
332 worker->child = fork();
333 @@ -611,9 +621,9 @@ epsilond_idle_enterer(void *data)
337 - Epsilon_Response *response;
338 + Epsilon_Response *response = NULL;
339 Epsilon_Worker *worker;
340 - Ecore_List *clients = data;
341 + Eina_List *clients = data, *cle, *wle;
343 if (debug) printf("Idle state entered\n");
345 @@ -621,12 +631,16 @@ epsilond_idle_enterer(void *data)
346 * Send responses for completed thumbnails
348 if (debug) printf("Preparing %d responses\n",
349 - ecore_list_count(response_queue));
350 - while ((response = ecore_list_first_remove(response_queue))) {
351 + eina_list_count(response_queue));
352 + if(response_queue != NULL) {
353 + response = response_queue->data;
354 + response_queue = eina_list_remove_list(response_queue, response_queue);
357 Epsilon_Message *msg = response->msg;
359 - ecore_list_first_goto(clients);
360 - while ((cl = ecore_list_next(clients))) {
362 + while (cle = eina_list_next(cle)) {
363 if (cl->id == msg->nid)
366 @@ -643,14 +657,20 @@ epsilond_idle_enterer(void *data)
367 if (debug) printf("Client: %p, Msg: %p\n",cl,msg);
370 + if(response_queue != NULL) {
371 + response = response_queue->data;
372 + response_queue = eina_list_remove_list(response_queue, response_queue);
376 if (debug) printf("Finished responses\n");
379 * Collect completed worker threads.
381 - ecore_list_first_goto(queued_workers);
382 - while ((worker = ecore_list_next(queued_workers))) {
383 + wle = queued_workers;
384 + while (wle = eina_list_next(wle)) {
385 + worker = wle->data;
389 @@ -675,7 +695,7 @@ epsilond_idle_enterer(void *data)
391 if (debug) printf("Worker %d runtime: %f\n", worker->child, ecore_time_get() - worker->runtime);
393 - if (debug) printf("Worker child pid not set, thumbs is: %d\n", ecore_list_count(worker->thumbs));
394 + if (debug) printf("Worker child pid not set, thumbs is: %d\n", eina_list_count(worker->thumbs));
398 @@ -684,11 +704,12 @@ epsilond_idle_enterer(void *data)
399 * hope of spreading the workload evenly and avoid stalling any one
400 * particular client longer than others.
402 - ecore_list_first_goto(clients);
403 - while ((cl = ecore_list_next(clients))) {
404 - int available = ecore_list_count(queued_workers);
406 + while (cle = eina_list_next(cle)) {
408 + int available = eina_list_count(queued_workers);
410 - if (cl->thumbs && ecore_list_count(cl->thumbs)) {
411 + if (cl->thumbs && eina_list_count(cl->thumbs)) {
412 available = epsilond_client_dispatch(cl);
415 @@ -702,17 +723,18 @@ epsilond_idle_enterer(void *data)
419 - idle = ecore_list_count(queued_workers);
420 + idle = eina_list_count(queued_workers);
422 if (debug) printf("Idle: %d\n", idle);
425 * Fork off worker threads to begin thumbnailing.
427 - ecore_list_first_goto(queued_workers);
428 - while ((worker = ecore_list_next(queued_workers))) {
429 + wle = queued_workers;
430 + while (wle = eina_list_next(wle)) {
431 + worker = wle->data;
432 if (!worker->child) {
433 - if (ecore_list_count(worker->thumbs)) {
434 + if (eina_list_count(worker->thumbs)) {
438 @@ -733,7 +755,7 @@ epsilond_idle_enterer(void *data)
440 * FIXME: Detect idle time and exit after a specified interval
442 - if (idle == ecore_list_count(queued_workers)) {
443 + if (idle == eina_list_count(queued_workers)) {
444 double now = ecore_time_get();
447 @@ -751,17 +773,17 @@ epsilond_init()
451 - Ecore_List *clients = NULL;
452 + Eina_List *clients = NULL;
457 * Create the accounting data for the clients and thumbnail queue.
459 - clients = ecore_list_new();
460 - gworkers = ecore_list_new();
461 - response_queue = ecore_list_new();
462 - queued_workers = ecore_list_new();
465 + response_queue = NULL;
466 + queued_workers = NULL;
469 * Retrieve the safe socket name for the clients.
470 @@ -794,8 +816,8 @@ epsilond_init()
471 Epsilon_Worker *worker;
473 worker = calloc(1, sizeof(Epsilon_Worker));
474 - worker->thumbs = ecore_list_new();
475 - ecore_list_append(queued_workers, worker);
476 + worker->thumbs = NULL;
477 + queued_workers = eina_list_append(queued_workers, worker);
480 ecore_idle_enterer_add(epsilond_idle_enterer, clients);
481 @@ -838,10 +860,8 @@ epsilond_client_clean(Epsilon_Client *cl
483 Epsilon_Message *msg;
485 - while ((msg = ecore_list_first_remove(cl->thumbs))) {
486 + EINA_LIST_FREE(cl->thumbs, msg)
489 - ecore_list_destroy(cl->thumbs);
493 @@ -853,7 +873,7 @@ epsilond_worker_clean(Epsilon_Worker *wo
495 Epsilon_Message *msg;
497 - while ((msg = ecore_list_first_remove(worker->thumbs)))
498 + EINA_LIST_FREE(worker->thumbs, msg)
502 --- epsilon-0.3.0.013-20080813/src/bin/epsilon_thumb_test.c.orig 2007-11-02 09:03:45.000000000 +0100
503 +++ epsilon-0.3.0.013-20080813/src/bin/epsilon_thumb_test.c 2012-01-22 14:07:09.703678869 +0100
506 -#include <Ecore_Data.h>
507 #include <Ecore_File.h>
509 #include "Epsilon_Request.h"
512 @@ -34,7 +34,7 @@ int thumb_complete_cb(void *data, int ty
513 int main(int argc, char** argv)
517 + Eina_List *files, *le;
521 @@ -55,8 +55,9 @@ int main(int argc, char** argv)
523 start = ecore_time_get();
525 - ecore_list_first_goto(files);
526 - while ((file = ecore_list_next(files))) {
528 + while (le = eina_list_next(le)) {
531 char fullpath[PATH_MAX];
533 @@ -68,7 +69,7 @@ int main(int argc, char** argv)
537 - ecore_list_destroy(files);
538 + files = eina_list_free(files);
540 ecore_main_loop_begin();
542 --- epsilon-0.3.0.013-20080813/src/lib/epsilon_thumb.c.orig 2008-05-10 06:56:12.000000000 +0200
543 +++ epsilon-0.3.0.013-20080813/src/lib/epsilon_thumb.c 2012-01-22 13:35:47.680282519 +0100
548 -#include <Ecore_Data.h>
549 #include <Ecore_Ipc.h>
550 #include <Ecore_File.h>
553 #include "Epsilon_Request.h"
554 #include "epsilon_private.h"
555 @@ -20,7 +20,7 @@ static int debug = 0;
556 static int epsilon_init_count = 0;
557 static unsigned long epsilon_mid = 0;
559 -static Ecore_DList *epsilon_request_queue = NULL;
560 +static Eina_List *epsilon_request_queue = NULL;
562 static Ecore_Ipc_Server *epsilon_server = NULL;
564 @@ -51,7 +51,7 @@ epsilon_request_init(void)
565 * Allocate a list for queueing requests.
567 if (!epsilon_init_count) {
568 - epsilon_request_queue = ecore_dlist_new();
569 + epsilon_request_queue = NULL;
570 if (!epsilon_request_queue) goto queue_error;
573 @@ -91,7 +91,7 @@ handler_data_error:
575 ecore_event_handler_del(epsilon_server_add);
577 - ecore_dlist_destroy(epsilon_request_queue);
578 + epsilon_request_queue = eina_list_free(epsilon_request_queue);
580 ecore_ipc_shutdown();
582 @@ -110,7 +110,7 @@ epsilon_request_shutdown(void)
583 ecore_event_handler_del(epsilon_server_data);
584 ecore_event_handler_del(epsilon_server_del);
585 ecore_event_handler_del(epsilon_server_add);
586 - ecore_dlist_destroy(epsilon_request_queue);
587 + epsilon_request_queue = eina_list_free(epsilon_request_queue);
590 ecore_ipc_shutdown();
591 @@ -230,15 +230,16 @@ epsilon_cb_server_data(void *data, int t
592 * Find the thumbnail request matching this message response.
595 - ecore_dlist_first_goto(epsilon_request_queue);
596 - while ((thumb = ecore_dlist_current(epsilon_request_queue))) {
597 + Eina_List *rl = epsilon_request_queue;
600 if (thumb->id == msg->mid) {
601 if (debug) printf("Removing %d from queue\n", thumb->id);
602 thumb->status = msg->status;
603 - ecore_dlist_remove(epsilon_request_queue);
604 + epsilon_request_queue = eina_list_remove_list(epsilon_request_queue, rl);
607 - ecore_dlist_next(epsilon_request_queue);
608 + rl = eina_list_next(rl);
609 if (debug) printf("Cycling %d times looking for %d, current is %d\n", i++, msg->mid, thumb->id);
612 @@ -345,7 +346,7 @@ epsilon_request_add(const char *path, Ep
613 if (debug) printf("!! requesting thumbnail for %s (request %d)!!, %d\n", path, msg->mid, sizeof(Epsilon_Message)+msg->bufsize);
614 if (ecore_ipc_server_send(epsilon_server, 1,1,1,1,1,msg,sizeof(Epsilon_Message)+msg->bufsize)) {
615 thumb->id = msg->mid;
616 - ecore_dlist_append(epsilon_request_queue, thumb);
617 + epsilon_request_queue = eina_list_append(epsilon_request_queue, thumb);
621 @@ -376,13 +377,14 @@ epsilon_request_del(Epsilon_Request *thu
622 * remove it, at this point we don't bother cancelling the outstanding
623 * request to the daemon.
625 - ecore_dlist_first_goto(epsilon_request_queue);
626 - while ((temp = ecore_dlist_current(epsilon_request_queue))) {
627 + Eina_List *rl = epsilon_request_queue;
630 if (temp->id == thumb->id) {
631 - ecore_dlist_remove(epsilon_request_queue);
632 + epsilon_request_queue = eina_list_remove_list(epsilon_request_queue, rl);
635 - ecore_dlist_next(epsilon_request_queue);
636 + rl = eina_list_next(rl);
640 --- epsilon-0.3.0.013-20080813/src/lib/Epsilon_Plugin.h.orig 2008-05-22 05:36:25.000000000 +0200
641 +++ epsilon-0.3.0.013-20080813/src/lib/Epsilon_Plugin.h 2012-01-22 12:06:12.980102554 +0100
643 #ifndef _EPSILON_PLUGIN_H_
644 #define _EPSILON_PLUGIN_H_
646 -#include "Ecore_Data.h"
649 typedef struct _Epsilon_Image Epsilon_Image;
650 typedef struct _Epsilon_Plugin Epsilon_Plugin;
651 @@ -15,7 +15,7 @@ struct _Epsilon_Image
653 struct _Epsilon_Plugin
655 - Ecore_List* mime_types;
656 + Eina_List* mime_types;
657 Epsilon_Image *(*epsilon_generate_thumb)(Epsilon*);
660 --- epsilon-0.3.0.013-20080813/src/lib/Epsilon.c.orig 2008-07-26 14:16:41.000000000 +0200
661 +++ epsilon-0.3.0.013-20080813/src/lib/Epsilon.c 2012-01-22 13:07:05.106891508 +0100
663 #include "exiftags/exif.h"
669 #include <Ecore_Evas.h>
670 @@ -47,7 +48,7 @@ static unsigned LEN_DIR_CUSTOM = 0;
671 static unsigned LEN_DIR_FAIL = 0;
674 -static Ecore_Hash* plugins_mime;
675 +static Eina_Hash* plugins_mime;
677 extern int epsilon_info_exif_props_as_int_get (Epsilon_Info * ei, unsigned
678 short lvl, long prop);
679 @@ -137,7 +138,7 @@ epsilon_init (void)
686 Epsilon_Plugin *plugin;
687 char plugin_path[PATH_MAX];
688 @@ -166,7 +167,7 @@ epsilon_init (void)
689 ecore_file_mkpath(PATH_DIR_NORMAL);
690 ecore_file_mkpath(PATH_DIR_FAIL);
692 - plugins_mime = ecore_hash_new(ecore_str_hash, ecore_str_compare);
693 + plugins_mime = eina_hash_string_superfast_new(NULL);
695 /*Initialise plugins*/
696 dir = opendir(PACKAGE_LIB_DIR "/epsilon/plugins/");
697 @@ -178,9 +179,9 @@ epsilon_init (void)
699 if ((plugin = epsilon_plugin_load(plugin_path))) {
700 /*Append the mime types for this plugin*/
701 - ecore_list_first_goto(plugin->mime_types);
702 - while ( (type = ecore_list_next(plugin->mime_types))) {
703 - ecore_hash_set(plugins_mime, type, plugin);
704 + tl = plugin->mime_types;
705 + while ( (tl = eina_list_next(tl))) {
706 + eina_hash_set(plugins_mime, tl->data, plugin);
710 @@ -593,7 +594,7 @@ epsilon_generate (Epsilon * e)
713 mime = epsilon_mime_for_extension_get(ext + 1);
714 - if ((plugin = ecore_hash_get(plugins_mime, mime)))
715 + if ((plugin = eina_hash_find(plugins_mime, mime)))
716 img_thm = (plugin->epsilon_generate_thumb)(e);
719 @@ -836,7 +837,7 @@ _epsilon_png_write (const char *file, un
720 png_destroy_write_struct (&png_ptr, (png_infopp) NULL);
723 - if (setjmp (png_ptr->jmpbuf))
724 + if (setjmp (png_jmpbuf(png_ptr)))
726 png_destroy_write_struct (&png_ptr, &info_ptr);