Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs
Dir : e17/apps/evfs/src/demo Modified Files: evfs_demo.c Log Message: * Fixed free() idiocy =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/demo/evfs_demo.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -3 -r1.26 -r1.27 --- evfs_demo.c 21 Apr 2006 15:10:16 -0000 1.26 +++ evfs_demo.c 23 Apr 2006 14:23:01 -0000 1.27 @@ -1,10 +1,15 @@ #include <evfs.h> #include <string.h> +#include <limits.h> static int mon_current = 0; /*A demo of stopping monitoring, after 10 events */ evfs_file_uri_path *dir_path; evfs_connection *con; +Ecore_List* files; +char buffer[PATH_MAX]; +char *current; + void callback(evfs_event * data, void *obj) { @@ -48,7 +53,14 @@ printf("Title: '%s'\n", ecore_hash_get(data->meta->meta_hash, "title")); printf("Length: '%s'\n", ecore_hash_get(data->meta->meta_hash, "length")); - + current = ecore_list_next(files); + snprintf(buffer,PATH_MAX,"file:///mnt/music/alexmp3/%s", current); + + printf("Getting meta for '%s'...\n", buffer); + + dir_path = evfs_parse_uri(buffer); + evfs_client_metadata_retrieve(con, dir_path->files[0]); + evfs_cleanup_file_uri_path(dir_path); } @@ -66,7 +78,6 @@ * * } */ - exit(0); } int @@ -139,13 +150,17 @@ /*evfs_monitor_add(con, dir_path->files[0]); * evfs_client_file_copy(con, dir_path->files[0], NULL); */ - if (!strcmp(cmd, "DIR")) { - evfs_client_dir_list(con, dir_path->files[0]); - } else if (!strcmp(cmd, "STAT")) { - evfs_client_file_stat(con, dir_path->files[0]); - } else if (!strcmp(cmd, "META")) { - evfs_client_metadata_retrieve(con, dir_path->files[0]); - } + files = ecore_file_ls("/mnt/music/alexmp3"); + + ecore_list_goto_first(files); + current = ecore_list_next(files); + snprintf(buffer,PATH_MAX,"file:///mnt/music/alexmp3/%s", current); + + printf("Getting meta for '%s'...\n", buffer); + + dir_path = evfs_parse_uri(buffer); + evfs_client_metadata_retrieve(con, dir_path->files[0]); + ecore_main_loop_begin(); evfs_disconnect(con); } ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs