Enlightenment CVS committal Author : lordchaos Project : e17 Module : apps/evfs
Dir : e17/apps/evfs/src/common Modified Files: evfs_event_helper.c evfs_io.c Log Message: * file_monitor event -> eet_edd. This should become a filereference =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/common/evfs_event_helper.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -3 -r1.21 -r1.22 --- evfs_event_helper.c 2 Mar 2006 06:11:07 -0000 1.21 +++ evfs_event_helper.c 4 Mar 2006 05:48:33 -0000 1.22 @@ -6,7 +6,7 @@ void evfs_file_monitor_event_create(evfs_client * client, int type, const char *path, - const char *plugin) + int filetype, const char *plugin) { /*Create a reply event for a file mon event, send it , destroy event */ @@ -17,6 +17,7 @@ event->file_monitor.fileev_type = type; event->file_monitor.plugin = strdup(plugin); event->file_monitor.filename_len = strlen(path) + 1; + event->file_monitor.filetype = filetype; evfs_write_event(client, NULL, event); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/common/evfs_io.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -3 -r1.46 -r1.47 --- evfs_io.c 2 Mar 2006 06:11:07 -0000 1.46 +++ evfs_io.c 4 Mar 2006 05:48:33 -0000 1.47 @@ -6,6 +6,7 @@ static Eet_Data_Descriptor *_evfs_filereference_edd; static Eet_Data_Descriptor *_evfs_progress_event_edd; static Eet_Data_Descriptor *_evfs_operation_edd; +static Eet_Data_Descriptor *_evfs_filemonitor_edd; Eet_Data_Descriptor * evfs_io_filereference_edd_get() @@ -99,6 +100,36 @@ EET_DATA_DESCRIPTOR_ADD_BASIC(_evfs_operation_edd, evfs_operation, "response", response, EET_T_INT); + + /*File monitor edd*/ + _evfs_filemonitor_edd = + eet_data_descriptor_new("evfs_filemonitor", sizeof(evfs_event_file_monitor), + (void *(*)(void *))evas_list_next, + (void *(*)(void *, void *))evas_list_append, + (void *(*)(void *))evas_list_data, + (void *(*)(void *))evas_list_free, + (void (*) + (void *, + int (*)(void *, const char *, void *, void *), + void *))evas_hash_foreach, (void *(*)(void *, + const char + *, + void *)) + evas_hash_add, (void (*)(void *))evas_hash_free); + + EET_DATA_DESCRIPTOR_ADD_BASIC(_evfs_filemonitor_edd, evfs_event_file_monitor, "fileev_type", fileev_type, + EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_evfs_filemonitor_edd, evfs_event_file_monitor, + "plugin", plugin, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_evfs_filemonitor_edd, evfs_event_file_monitor, + "filename", filename, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_evfs_filemonitor_edd, evfs_event_file_monitor, + "filename_len", filename_len, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_evfs_filemonitor_edd, evfs_event_file_monitor, + "filetype", filetype, EET_T_INT); + + + return 0; } @@ -138,42 +169,18 @@ void evfs_write_event_file_monitor(evfs_client * client, evfs_event * event) { + int size_ret = 0; + char *data; - /*Write the type */ - evfs_write_ecore_ipc_client_message(client->client, - ecore_ipc_message_new(EVFS_EV_REPLY, - EVFS_EV_PART_FILE_MONITOR_TYPE, - client->id, 0, 0, - &event-> - file_monitor. - fileev_type, - sizeof - (evfs_file_monitor_type))); - - /*Write the filename this is an event for */ - evfs_write_ecore_ipc_client_message(client->client, - ecore_ipc_message_new(EVFS_EV_REPLY, - EVFS_EV_PART_FILE_MONITOR_FILENAME, - client->id, 0, 0, - event-> - file_monitor. - filename, - event-> - file_monitor. - filename_len)); + + /*Write "From" file */ + data = eet_data_descriptor_encode(_evfs_filemonitor_edd, &event->file_monitor, &size_ret); - /*Write the plugin */ evfs_write_ecore_ipc_client_message(client->client, ecore_ipc_message_new(EVFS_EV_REPLY, - EVFS_EV_PART_FILE_MONITOR_PLUGIN, + EVFS_EV_PART_FILE_MONITOR, client->id, 0, 0, - event-> - file_monitor. - plugin, - strlen(event-> - file_monitor. - plugin) + - 1)); + data, size_ret)); } @@ -370,17 +377,16 @@ memcpy(&event->type, msg->data, sizeof(evfs_eventtype)); break; - case EVFS_EV_PART_FILE_MONITOR_TYPE: - memcpy(&event->file_monitor.fileev_type, msg->data, - sizeof(evfs_file_monitor_type)); - break; - case EVFS_EV_PART_FILE_MONITOR_FILENAME: - event->file_monitor.filename = strdup(msg->data); - event->file_monitor.filename_len = strlen(msg->data); - break; - case EVFS_EV_PART_FILE_MONITOR_PLUGIN: - event->file_monitor.plugin = strdup(msg->data); - break; + case EVFS_EV_PART_FILE_MONITOR: { + evfs_event_file_monitor* fmev = + eet_data_descriptor_decode(_evfs_filemonitor_edd, msg->data, + msg->len); + memcpy(&event->file_monitor, fmev, + sizeof(evfs_event_file_monitor)); + + free(fmev); + } + break; case EVFS_EV_PART_STAT_SIZE: ------------------------------------------------------- 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