Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs
Dir : e17/apps/evfs/src/lib Modified Files: evfs_commands.c libevfs.c Log Message: * Attach a generated identifer to each command, for tracking purposes =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/lib/evfs_commands.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- evfs_commands.c 3 Apr 2006 10:10:11 -0000 1.24 +++ evfs_commands.c 5 Apr 2006 05:39:05 -0000 1.25 @@ -3,7 +3,7 @@ void evfs_monitor_add(evfs_connection * conn, evfs_filereference * ref) { - evfs_command *command = NEW(evfs_command); + evfs_command *command = evfs_client_command_new(); /*printf("Adding a monitor on: '%s' using '%s'\n", ref->path, ref->plugin_uri); */ @@ -22,7 +22,7 @@ void evfs_monitor_remove(evfs_connection * conn, evfs_filereference * ref) { - evfs_command *command = NEW(evfs_command); + evfs_command *command = evfs_client_command_new(); command->type = EVFS_CMD_STOPMON_FILE; command->file_command.num_files = 1; @@ -38,7 +38,7 @@ void evfs_client_file_remove(evfs_connection * conn, evfs_filereference * ref) { - evfs_command *command = NEW(evfs_command); + evfs_command *command = evfs_client_command_new(); command->type = EVFS_CMD_REMOVE_FILE; command->file_command.num_files = 1; @@ -56,7 +56,7 @@ evfs_client_file_rename(evfs_connection * conn, evfs_filereference * from, evfs_filereference * to) { - evfs_command *command = NEW(evfs_command); + evfs_command *command = evfs_client_command_new(); printf("Renaming a file..\n"); @@ -76,7 +76,7 @@ void evfs_client_file_stat(evfs_connection * conn, evfs_filereference * file) { - evfs_command *command = NEW(evfs_command); + evfs_command *command = evfs_client_command_new(); command->type = EVFS_CMD_FILE_STAT; command->file_command.num_files = 1; @@ -93,7 +93,7 @@ void evfs_client_dir_list(evfs_connection * conn, evfs_filereference * file) { - evfs_command *command = NEW(evfs_command); + evfs_command *command = evfs_client_command_new(); printf("Listing a directory..\n"); @@ -114,7 +114,7 @@ evfs_filereference * to) { - evfs_command *command = NEW(evfs_command); + evfs_command *command = evfs_client_command_new(); /*printf("Copying a file..\n"); */ @@ -133,7 +133,7 @@ void evfs_client_file_open(evfs_connection * conn, evfs_filereference * file) { - evfs_command *command = NEW(evfs_command); + evfs_command *command = evfs_client_command_new(); fprintf(stderr, "Opening a file..\n"); @@ -152,7 +152,7 @@ evfs_client_file_read(evfs_connection * conn, evfs_filereference * file, int read_size) { - evfs_command *command = NEW(evfs_command); + evfs_command *command = evfs_client_command_new(); //printf("Reading a file..\n"); @@ -172,7 +172,7 @@ void evfs_client_directory_create(evfs_connection * conn, evfs_filereference * file) { - evfs_command *command = NEW(evfs_command); + evfs_command *command = evfs_client_command_new(); //printf("Reading a file..\n"); @@ -192,7 +192,7 @@ evfs_client_operation_respond(evfs_connection * conn, long opid, evfs_operation_response response) { - evfs_command *command = NEW(evfs_command); + evfs_command *command = evfs_client_command_new(); //printf("Reading a file..\n"); =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/lib/libevfs.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -3 -r1.36 -r1.37 --- libevfs.c 4 Mar 2006 04:54:15 -0000 1.36 +++ libevfs.c 5 Apr 2006 05:39:05 -0000 1.37 @@ -3,7 +3,22 @@ #define MAX_ATTEMPTS 5 Ecore_List *client_list = NULL; -static int libevfs_registered_callback = 0; +static int _libevfs_init = 0; +static long _libevfs_next_command_id; + + +long libevfs_next_command_id_get() +{ + return _libevfs_next_command_id++; +} + +evfs_command* evfs_client_command_new() +{ + evfs_command* command = NEW(evfs_command); + command->client_identifier = libevfs_next_command_id_get(); + + return command; +} /*It would seem a good idea to convert this to a hash - but we'd need the actual pointer to the int, or make an ecore_int_hash*/ evfs_connection * @@ -156,9 +171,12 @@ evfs_io_initialise(); evfs_vfolder_initialise(); - if (!libevfs_registered_callback) + if (!_libevfs_init) { - libevfs_registered_callback = 1; + _libevfs_init = 1; + _libevfs_next_command_id = 1; + + /*Register the callback*/ ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DATA, evfs_server_data, NULL); client_list = ecore_list_new(); ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs