From: <enl...@li...> - 2001-04-07 18:26:32
|
Enlightenment CVS committal Author : cpk Project : e17 Module : apps/efsd Dir : e17/apps/efsd/demo Modified Files: efsddemo.c Log Message: I've changed the way of passing options, because using variadic functions is way too painful when one has to put options together dynamically at runtime (let's say you're passing combinations of 5 options -- you get 2^5 different calls :). So now I leave it up to the user to put things together manually (efsdsh does this), or using a variadic convenience wrapper like this: | v->monitor_id = efsd_start_monitor(e_fs_get_connection(), v->dir, | efsd_ops(2, efsd_op_get_stat(), | efsd_op_get_filetype())); So simply put the number of options and the option calls in the efsd_ops() wrapper. Simple enough. I'll also need to use a hash to keep track of all EfsdFAMMonitors instead of a list soonish. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/efsd/demo/efsddemo.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -3 -r1.33 -r1.34 --- efsddemo.c 2001/04/06 23:55:43 1.33 +++ efsddemo.c 2001/04/07 18:26:02 1.34 @@ -401,7 +401,7 @@ /* Test mv stuff */ if ((id = efsd_move(ec, "yep", "tmp", - 2, efsd_op_force(), efsd_op_recursive())) >= 0) + efsd_ops(2, efsd_op_force(), efsd_op_recursive()))) >= 0) printf("Moving, command ID %i\n", id); else printf("Couldn't issue setmetadata command.\n"); @@ -447,7 +447,7 @@ /* Remove a file */ if ((id = efsd_remove(ec, "some-crappy-file-that-wont-exist", - 2, efsd_op_force(), efsd_op_recursive())) >= 0) + efsd_ops(2, efsd_op_force(), efsd_op_recursive()))) >= 0) printf("Removing file, command ID %i\n", id); else printf("Couldn't issue rm command.\n"); @@ -456,7 +456,7 @@ if ((id = efsd_move(ec, "raster-is-flim.demo", "cK-is-flim.demo", - 2, efsd_op_force(), efsd_op_recursive())) >= 0) + efsd_ops(2, efsd_op_force(), efsd_op_recursive()))) >= 0) printf("Moving file, command ID %i\n", id); else printf("Couldn't issue mv command.\n"); @@ -464,9 +464,9 @@ sleep(2); /* List contents of a directory */ - if ((id = efsd_listdir(ec, getenv("HOME"), 2, - efsd_op_get_stat(), - efsd_op_get_filetype())) >= 0) + if ((id = efsd_listdir(ec, getenv("HOME"), + efsd_ops(2, efsd_op_get_stat(), + efsd_op_get_filetype()))) >= 0) printf("Listing directory, command ID %i\n", id); else printf("Couldn't issue ls command.\n"); @@ -474,9 +474,9 @@ sleep(2); /* List again -- this tests both the stat and filetype caches */ - if ((id = efsd_listdir(ec, getenv("HOME"), 2, - efsd_op_get_stat(), - efsd_op_get_filetype())) >= 0) + if ((id = efsd_listdir(ec, getenv("HOME"), + efsd_ops(2, efsd_op_get_stat(), + efsd_op_get_filetype()))) >= 0) printf("Listing directory, command ID %i\n", id); else printf("Couldn't issue ls command.\n"); @@ -503,7 +503,8 @@ /* Start monitoring home directory */ - if ((id = efsd_start_monitor(ec, "/dev", 1, efsd_op_get_stat())) >= 0) + if ((id = efsd_start_monitor(ec, "/dev", + efsd_ops(1, efsd_op_get_stat()))) >= 0) printf("Starting monitor, command ID %i\n", id); else printf("Couldn't issue startmon command.\n"); |