Enlightenment CVS committal Author : mej Project : e_modules Module : monitor
Dir : e_modules/monitor Modified Files: e_mod_config.c e_mod_config.h e_mod_main.c e_mod_main.h flow_chart.c flow_chart.h linux_2.6.c linux_2.6.h Log Message: Mon Jan 30 14:55:14 2006 Michael Jennings (mej) Indenting monitor this time. ---------------------------------------------------------------------- =================================================================== RCS file: /cvsroot/enlightenment/e_modules/monitor/e_mod_config.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- e_mod_config.c 30 Jan 2006 03:16:41 -0000 1.10 +++ e_mod_config.c 30 Jan 2006 19:55:20 -0000 1.11 @@ -5,49 +5,50 @@ typedef struct _Cfg_File_Data Cfg_File_Data; -int net_interface_count; -int net_interface_number; -Ecore_List *net_interfaces = NULL; - -int wlan_interface_count; -int wlan_interface_number; -Ecore_List *wlan_interfaces = NULL; - -struct _E_Config_Dialog_Data { - double cpu_interval; - double mem_interval; - double net_interval; - double wlan_interval; +int net_interface_count; +int net_interface_number; +Ecore_List *net_interfaces = NULL; + +int wlan_interface_count; +int wlan_interface_number; +Ecore_List *wlan_interfaces = NULL; - char *net_interface; - char *wlan_interface; +struct _E_Config_Dialog_Data +{ + double cpu_interval; + double mem_interval; + double net_interval; + double wlan_interval; + + char *net_interface; + char *wlan_interface; - int mem_real_ignore_cached; - int mem_real_ignore_buffers; + int mem_real_ignore_cached; + int mem_real_ignore_buffers; }; -struct _Cfg_File_Data { - E_Config_Dialog *cfd; - char *file; +struct _Cfg_File_Data +{ + E_Config_Dialog *cfd; + char *file; }; /* Protos */ -static void *_create_data(E_Config_Dialog * cfd); -static void _free_data(E_Config_Dialog * cfd, - E_Config_Dialog_Data * cfdata); -static Evas_Object *_basic_create_widgets(E_Config_Dialog * cfd, Evas * evas, - E_Config_Dialog_Data * cfdata); -static int _basic_apply_data(E_Config_Dialog * cfd, - E_Config_Dialog_Data * cfdata); -static Evas_Object *_advanced_create_widgets(E_Config_Dialog * cfd, Evas * evas, - E_Config_Dialog_Data * cfdata); -static int _advanced_apply_data(E_Config_Dialog * cfd, - E_Config_Dialog_Data * cfdata); +static void *_create_data(E_Config_Dialog *cfd); +static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); +static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, + E_Config_Dialog_Data *cfdata); +static int _basic_apply_data(E_Config_Dialog *cfd, + E_Config_Dialog_Data *cfdata); +static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, + E_Config_Dialog_Data *cfdata); +static int _advanced_apply_data(E_Config_Dialog *cfd, + E_Config_Dialog_Data *cfdata); void -_config_monitor_module(E_Container * con, Monitor_Face * f) +_config_monitor_module(E_Container *con, Monitor_Face *f) { - E_Config_Dialog *cfd; + E_Config_Dialog *cfd; E_Config_Dialog_View *v; v = E_NEW(E_Config_Dialog_View, 1); @@ -63,10 +64,10 @@ } static void -_fill_data(Monitor_Face * f, E_Config_Dialog_Data * cfdata) +_fill_data(Monitor_Face *f, E_Config_Dialog_Data *cfdata) { - char *tmp; - int i; + char *tmp; + int i; i = 0; cfdata->net_interface = f->conf->net_interface; @@ -99,35 +100,35 @@ } } -static void * -_create_data(E_Config_Dialog * cfd) +static void * +_create_data(E_Config_Dialog *cfd) { E_Config_Dialog_Data *cfdata; - Monitor_Face *f; + Monitor_Face *f; f = cfd->data; cfdata = E_NEW(E_Config_Dialog_Data, 1); + _fill_data(f, cfdata); return cfdata; } static void -_free_data(E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata) +_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) { free(cfdata); } static Evas_Object * -_basic_create_widgets(E_Config_Dialog * cfd, Evas * evas, - E_Config_Dialog_Data * cfdata) +_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, + E_Config_Dialog_Data *cfdata) { - Evas_Object *o, *of, *ob, *ob1, *ob2, *ob3, *ob4, *ob5, *ob6, *ob7, - *ot; - E_Radio_Group *rg; - char *tmp; - int i; - Monitor_Face *f; - Monitor *mon; + Evas_Object *o, *of, *ob, *ob1, *ob2, *ob3, *ob4, *ob5, *ob6, *ob7, *ot; + E_Radio_Group *rg; + char *tmp; + int i; + Monitor_Face *f; + Monitor *mon; f = cfd->data; mon = f->mon; @@ -159,9 +160,9 @@ } static int -_basic_apply_data(E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata) +_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) { - Monitor_Face *face; + Monitor_Face *face; face = cfd->data; rebuild_monitor(face); @@ -169,14 +170,14 @@ } static Evas_Object * -_advanced_create_widgets(E_Config_Dialog * cfd, Evas * evas, - E_Config_Dialog_Data * cfdata) +_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, + E_Config_Dialog_Data *cfdata) { - Evas_Object *o, *of, *ob, *ot; - E_Radio_Group *rg; - char *tmp; - int i; - Monitor_Face *f; + Evas_Object *o, *of, *ob, *ot; + E_Radio_Group *rg; + char *tmp; + int i; + Monitor_Face *f; f = cfd->data; @@ -257,11 +258,11 @@ } static int -_advanced_apply_data(E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata) +_advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) { - Monitor_Face *f; - char *tmp; - int i; + Monitor_Face *f; + char *tmp; + int i; f = cfd->data; e_border_button_bindings_ungrab_all(); =================================================================== RCS file: /cvsroot/enlightenment/e_modules/monitor/e_mod_config.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_mod_config.h 30 Jan 2006 03:16:41 -0000 1.2 +++ e_mod_config.h 30 Jan 2006 19:55:20 -0000 1.3 @@ -3,7 +3,6 @@ #ifndef E_MOD_CONFIG_H #define E_MOD_CONFIG_H #include "e_mod_main.h" -EAPI void _config_monitor_module(E_Container * con, - Monitor_Face * face); +EAPI void _config_monitor_module(E_Container *con, Monitor_Face *face); #endif #endif =================================================================== RCS file: /cvsroot/enlightenment/e_modules/monitor/e_mod_main.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- e_mod_main.c 30 Jan 2006 03:16:41 -0000 1.17 +++ e_mod_main.c 30 Jan 2006 19:55:20 -0000 1.18 @@ -6,66 +6,60 @@ /* module private routines */ -static Monitor *_monitor_new(); -static void _monitor_shutdown(Monitor * monitor); -static void _monitor_config_menu_new(Monitor * monitor); - -static Monitor_Face *_monitor_face_new(E_Container * con, Config * config); -static void _monitor_face_free(Monitor_Face * face); -static void _monitor_face_menu_new(Monitor_Face * face); -static void _monitor_face_cb_gmc_change(void *data, - E_Gadman_Client * gmc, - E_Gadman_Change change); -Config_Face *_monitor_face_config_init(Config_Face * conf); -static int _monitor_face_config_cb_timer(void *data); - -static void _monitor_face_cb_menu_edit(void *data, E_Menu * m, - E_Menu_Item * mi); -static void _monitor_cpu_text_update_callcack(Flow_Chart * chart, - void *data); -static void _monitor_mem_real_text_update_callback(Flow_Chart * chart, - void *data); -static void _monitor_mem_swap_text_update_callback(Flow_Chart * chart, - void *data); -static void _monitor_net_in_text_update_callcack(Flow_Chart * chart, - void *data); -static void _monitor_net_out_text_update_callcack(Flow_Chart * chart, - void *data); -static void _monitor_wlan_link_text_update_callcack(Flow_Chart * chart, - void *data); -static void _monitor_menu_cb_configure(void *data, E_Menu * m, - E_Menu_Item * mi); -static void _add_sensor(Monitor_Face * face, Evas_Object * o, - int VerHor); -static int _date_cb_check(void *data); - -static void _monitor_face_cb_mouse_down(void *data, Evas * e, - Evas_Object * obj, - void *event_info); +static Monitor *_monitor_new(); +static void _monitor_shutdown(Monitor *monitor); +static void _monitor_config_menu_new(Monitor *monitor); + +static Monitor_Face *_monitor_face_new(E_Container *con, Config *config); +static void _monitor_face_free(Monitor_Face *face); +static void _monitor_face_menu_new(Monitor_Face *face); +static void _monitor_face_cb_gmc_change(void *data, + E_Gadman_Client *gmc, + E_Gadman_Change change); +Config_Face *_monitor_face_config_init(Config_Face *conf); +static int _monitor_face_config_cb_timer(void *data); + +static void _monitor_face_cb_menu_edit(void *data, E_Menu *m, E_Menu_Item *mi); +static void _monitor_cpu_text_update_callcack(Flow_Chart *chart, void *data); +static void _monitor_mem_real_text_update_callback(Flow_Chart *chart, + void *data); +static void _monitor_mem_swap_text_update_callback(Flow_Chart *chart, + void *data); +static void _monitor_net_in_text_update_callcack(Flow_Chart *chart, void *data); +static void _monitor_net_out_text_update_callcack(Flow_Chart *chart, + void *data); +static void _monitor_wlan_link_text_update_callcack(Flow_Chart *chart, + void *data); +static void _monitor_menu_cb_configure(void *data, E_Menu *m, E_Menu_Item *mi); +static void _add_sensor(Monitor_Face *face, Evas_Object *o, int VerHor); +static int _date_cb_check(void *data); -static int _monitor_count; -static int num_sensors; +static void _monitor_face_cb_mouse_down(void *data, Evas *e, + Evas_Object *obj, void *event_info); + +static int _monitor_count; +static int num_sensors; static E_Config_DD *conf_edd; static E_Config_DD *conf_face_edd; -static Flow_Chart *flow_chart_cpu; -static Flow_Chart *flow_chart_net_in; -static Flow_Chart *flow_chart_net_out; -static Flow_Chart *flow_chart_mem_real; -static Flow_Chart *flow_chart_mem_swap; -static Flow_Chart *flow_chart_wlan_link; +static Flow_Chart *flow_chart_cpu; +static Flow_Chart *flow_chart_net_in; +static Flow_Chart *flow_chart_net_out; +static Flow_Chart *flow_chart_mem_real; +static Flow_Chart *flow_chart_mem_swap; +static Flow_Chart *flow_chart_wlan_link; /* public module routines. all modules must have these */ -EAPI E_Module_Api e_modapi = { +EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Monitor" }; -EAPI void * -e_modapi_init(E_Module * module) +EAPI void * +e_modapi_init(E_Module *module) { - Monitor *monitor; + Monitor *monitor; /* actually init buttons */ monitor = _monitor_new(); @@ -74,9 +68,9 @@ } EAPI int -e_modapi_shutdown(E_Module * module) +e_modapi_shutdown(E_Module *module) { - Monitor *monitor; + Monitor *monitor; if (module->config_menu) module->config_menu = NULL; @@ -89,9 +83,9 @@ } EAPI int -e_modapi_save(E_Module * module) +e_modapi_save(E_Module *module) { - Monitor *monitor; + Monitor *monitor; monitor = module->data; e_config_domain_save("module.monitor", conf_edd, monitor->conf); @@ -99,14 +93,14 @@ } EAPI int -e_modapi_info(E_Module * module) +e_modapi_info(E_Module *module) { module->icon_file = strdup(PACKAGE_DATA_DIR "/module_icon.png"); return 1; } EAPI int -e_modapi_about(E_Module * module) +e_modapi_about(E_Module *module) { e_module_dialog_show(_("Enlightenment Monitor Module"), _ @@ -115,17 +109,17 @@ } EAPI int -e_modapi_config(E_Module * module) +e_modapi_config(E_Module *module) { - Monitor *mon; - Evas_List *l; + Monitor *mon; + Evas_List *l; mon = module->data; if (!mon) return 0; for (l = mon->faces; l; l = l->next) { - Monitor_Face *f; + Monitor_Face *f; f = l->data; if (!f) @@ -146,8 +140,8 @@ return 0; } -Config_Face * -_monitor_face_config_init(Config_Face * conf) +Config_Face * +_monitor_face_config_init(Config_Face *conf) { if (!conf) return NULL; @@ -166,15 +160,16 @@ } /* module private routines */ -static Monitor * +static Monitor * _monitor_new() { - Monitor *monitor; - Evas_List *managers, *l, *l2, *cl; - E_Menu_Item *mi; + Monitor *monitor; + Evas_List *managers, *l, *l2, *cl; + E_Menu_Item *mi; _monitor_count = 0; monitor = E_NEW(Monitor, 1); + if (!monitor) return NULL; @@ -195,6 +190,7 @@ E_CONFIG_VAL(D, T, mem_real_ignore_buffers, INT); conf_edd = E_CONFIG_DD_NEW("Monitor_Config", Config); + #undef T #undef D #define T Config @@ -213,6 +209,7 @@ if (!monitor->conf) { monitor->conf = E_NEW(Config, 1); + monitor->conf->cpu = 0; monitor->conf->mem = 0; monitor->conf->net = 0; @@ -229,13 +226,13 @@ cl = monitor->conf->faces; for (l = managers; l; l = l->next) { - E_Manager *man; + E_Manager *man; man = l->data; for (l2 = man->containers; l2; l2 = l2->next) { - E_Container *con; - Monitor_Face *face; + E_Container *con; + Monitor_Face *face; con = l2->data; num_sensors = 0; @@ -248,9 +245,10 @@ if (!cl) { face->conf = E_NEW(Config_Face, 1); + face->conf = _monitor_face_config_init(face->conf); monitor->conf->faces = - evas_list_append(monitor->conf->faces, face->conf); + evas_list_append(monitor->conf->faces, face->conf); } else { @@ -319,9 +317,9 @@ } static void -_monitor_shutdown(Monitor * monitor) +_monitor_shutdown(Monitor *monitor) { - Evas_List *list; + Evas_List *list; E_CONFIG_DD_FREE(conf_edd); E_CONFIG_DD_FREE(conf_face_edd); @@ -338,26 +336,26 @@ } static void -_monitor_config_menu_new(Monitor * monitor) +_monitor_config_menu_new(Monitor *monitor) { monitor->config_menu = e_menu_new(); } static Monitor_Face * -_monitor_face_new(E_Container * con, Config * config) +_monitor_face_new(E_Container *con, Config *config) { - Monitor_Face *face; - Evas_Object *o; - struct utsname u_buf; - char u_date_time[256]; - struct sysinfo s_info; + Monitor_Face *face; + Evas_Object *o; + struct utsname u_buf; + char u_date_time[256]; + struct sysinfo s_info; sysinfo(&s_info); - long minute = 60; - long hour = minute * 60; - long day = hour * 24; - double megabyte = 1024 * 1024; + long minute = 60; + long hour = minute * 60; + long day = hour * 24; + double megabyte = 1024 * 1024; uname(&u_buf); /* @@ -365,14 +363,15 @@ * is not initialized. Everything will be updated after * the init is complete. */ - double tmp_cpu_interval = 1.0; - double tmp_mem_interval = 1.0; - double tmp_net_interval = 1.0; - double tmp_wlan_interval = 1.0; + double tmp_cpu_interval = 1.0; + double tmp_mem_interval = 1.0; + double tmp_net_interval = 1.0; + double tmp_wlan_interval = 1.0; - Chart_Container *chart_con; + Chart_Container *chart_con; face = E_NEW(Monitor_Face, 1); + if (!face) return NULL; @@ -544,11 +543,11 @@ if (config->time) { - time_t now; - struct tm date; + time_t now; + struct tm date; time(&now); - char curr_time[12]; + char curr_time[12]; date = *localtime(&now); face->time = edje_object_add(con->bg_evas); @@ -589,10 +588,10 @@ } static void -_monitor_cpu_text_update_callcack(Flow_Chart * chart, void *data) +_monitor_cpu_text_update_callcack(Flow_Chart *chart, void *data) { - Monitor_Face *face; - char buf[64]; + Monitor_Face *face; + char buf[64]; face = data; @@ -601,12 +600,12 @@ } static void -_monitor_mem_real_text_update_callback(Flow_Chart * chart, void *data) +_monitor_mem_real_text_update_callback(Flow_Chart *chart, void *data) { - Monitor_Face *face; - char buf[64]; + Monitor_Face *face; + char buf[64]; - long kbytes = mem_real_get(); + long kbytes = mem_real_get(); face = data; @@ -621,12 +620,12 @@ } static void -_monitor_mem_swap_text_update_callback(Flow_Chart * chart, void *data) +_monitor_mem_swap_text_update_callback(Flow_Chart *chart, void *data) { - Monitor_Face *face; - char buf[64]; + Monitor_Face *face; + char buf[64]; - long kbytes = mem_swap_get(); + long kbytes = mem_swap_get(); face = data; @@ -641,12 +640,12 @@ } static void -_monitor_net_in_text_update_callcack(Flow_Chart * chart, void *data) +_monitor_net_in_text_update_callcack(Flow_Chart *chart, void *data) { - Monitor_Face *face; - char buf[64]; + Monitor_Face *face; + char buf[64]; - long bytes = net_bytes_in_get(); + long bytes = net_bytes_in_get(); face = data; @@ -661,12 +660,12 @@ } static void -_monitor_net_out_text_update_callcack(Flow_Chart * chart, void *data) +_monitor_net_out_text_update_callcack(Flow_Chart *chart, void *data) { - Monitor_Face *face; - char buf[64]; + Monitor_Face *face; + char buf[64]; - long bytes = net_bytes_out_get(); + long bytes = net_bytes_out_get(); face = data; @@ -681,11 +680,11 @@ } static void -_monitor_wlan_link_text_update_callcack(Flow_Chart * chart, void *data) +_monitor_wlan_link_text_update_callcack(Flow_Chart *chart, void *data) { - Monitor_Face *face; - char buf[64]; - long link = wlan_link_get(); + Monitor_Face *face; + char buf[64]; + long link = wlan_link_get(); face = data; snprintf(buf, 64, "LNK: %ld", link); @@ -693,7 +692,7 @@ } static void -_monitor_face_free(Monitor_Face * face) +_monitor_face_free(Monitor_Face *face) { e_object_unref(E_OBJECT(face->con)); e_object_del(E_OBJECT(face->gmc)); @@ -737,83 +736,83 @@ } static void -_monitor_face_cb_gmc_change(void *data, E_Gadman_Client * gmc, +_monitor_face_cb_gmc_change(void *data, E_Gadman_Client *gmc, E_Gadman_Change change) { - Monitor_Face *face; - Evas_Coord x, y, w, h; + Monitor_Face *face; + Evas_Coord x, y, w, h; face = data; switch (change) { - case E_GADMAN_CHANGE_MOVE_RESIZE: - e_gadman_client_geometry_get(face->gmc, &x, &y, &w, &h); + case E_GADMAN_CHANGE_MOVE_RESIZE: + e_gadman_client_geometry_get(face->gmc, &x, &y, &w, &h); - evas_object_move(face->monitor_object, x, y); - evas_object_resize(face->monitor_object, w, h); + evas_object_move(face->monitor_object, x, y); + evas_object_resize(face->monitor_object, w, h); + + evas_object_move(face->table_object, x, y); + evas_object_resize(face->table_object, w, h); + + evas_object_move(face->monitor_cover_obj, x, y); + evas_object_resize(face->monitor_cover_obj, w, h); + + if (face->cpu) + evas_object_geometry_get(face->cpu, &x, &y, &w, &h); + if (face->cpu) + chart_container_move(face->chart_cpu, x + 2, y + 2); + if (face->cpu) + chart_container_resize(face->chart_cpu, w - 4, h - 4); - evas_object_move(face->table_object, x, y); - evas_object_resize(face->table_object, w, h); + if (face->mem) + evas_object_geometry_get(face->mem, &x, &y, &w, &h); + if (face->mem) + chart_container_move(face->chart_mem, x + 2, y + 2); + if (face->mem) + chart_container_resize(face->chart_mem, w - 4, h - 4); + + if (face->net) + evas_object_geometry_get(face->net, &x, &y, &w, &h); + if (face->net) + chart_container_move(face->chart_net, x + 2, y + 2); + if (face->net) + chart_container_resize(face->chart_net, w - 4, h - 4); + + if (face->wlan) + evas_object_geometry_get(face->wlan, &x, &y, &w, &h); + if (face->wlan) + chart_container_move(face->chart_wlan, x + 2, y + 2); + if (face->wlan) + chart_container_resize(face->chart_wlan, w - 4, h - 4); - evas_object_move(face->monitor_cover_obj, x, y); - evas_object_resize(face->monitor_cover_obj, w, h); - - if (face->cpu) - evas_object_geometry_get(face->cpu, &x, &y, &w, &h); - if (face->cpu) - chart_container_move(face->chart_cpu, x + 2, y + 2); - if (face->cpu) - chart_container_resize(face->chart_cpu, w - 4, h - 4); - - if (face->mem) - evas_object_geometry_get(face->mem, &x, &y, &w, &h); - if (face->mem) - chart_container_move(face->chart_mem, x + 2, y + 2); - if (face->mem) - chart_container_resize(face->chart_mem, w - 4, h - 4); - - if (face->net) - evas_object_geometry_get(face->net, &x, &y, &w, &h); - if (face->net) - chart_container_move(face->chart_net, x + 2, y + 2); - if (face->net) - chart_container_resize(face->chart_net, w - 4, h - 4); - - if (face->wlan) - evas_object_geometry_get(face->wlan, &x, &y, &w, &h); - if (face->wlan) - chart_container_move(face->chart_wlan, x + 2, y + 2); - if (face->wlan) - chart_container_resize(face->chart_wlan, w - 4, h - 4); - - break; - case E_GADMAN_CHANGE_RAISE: - //evas_object_raise(face->exit_event_object); - break; - case E_GADMAN_CHANGE_EDGE: - case E_GADMAN_CHANGE_ZONE: - /* FIXME - * Must we do something here? - */ - break; + break; + case E_GADMAN_CHANGE_RAISE: + //evas_object_raise(face->exit_event_object); + break; + case E_GADMAN_CHANGE_EDGE: + case E_GADMAN_CHANGE_ZONE: + /* FIXME + * Must we do something here? + */ + break; } e_gadman_client_save(face->gmc); } static void -_monitor_face_cb_menu_edit(void *data, E_Menu * m, E_Menu_Item * mi) +_monitor_face_cb_menu_edit(void *data, E_Menu *m, E_Menu_Item *mi) { - Monitor_Face *face; + Monitor_Face *face; face = data; e_gadman_mode_set(face->gmc->gadman, E_GADMAN_MODE_EDIT); } static void -_monitor_face_cb_mouse_down(void *data, Evas * e, Evas_Object * obj, +_monitor_face_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) { - Monitor_Face *face; + Monitor_Face *face; Evas_Event_Mouse_Down *ev; face = data; @@ -853,10 +852,10 @@ */ static void -_monitor_face_menu_new(Monitor_Face * face) +_monitor_face_menu_new(Monitor_Face *face) { - E_Menu *mn; - E_Menu_Item *mi; + E_Menu *mn; + E_Menu_Item *mi; mn = e_menu_new(); face->menu = mn; @@ -873,7 +872,7 @@ void _monitor_cb_config_updated(void *data) { - Monitor_Face *face; + Monitor_Face *face; face = data; @@ -907,9 +906,9 @@ } static void -_monitor_menu_cb_configure(void *data, E_Menu * m, E_Menu_Item * mi) +_monitor_menu_cb_configure(void *data, E_Menu *m, E_Menu_Item *mi) { - Monitor_Face *f; + Monitor_Face *f; f = data; if (!f) @@ -918,7 +917,7 @@ } static void -_add_sensor(Monitor_Face * face, Evas_Object * o, int VerHor) +_add_sensor(Monitor_Face *face, Evas_Object *o, int VerHor) { if (VerHor) e_table_pack(face->table_object, o, num_sensors, 0, 1, 1); @@ -931,30 +930,30 @@ } void -rebuild_monitor(Monitor_Face * face) +rebuild_monitor(Monitor_Face *face) { - struct utsname u_buf; + struct utsname u_buf; uname(&u_buf); - struct sysinfo s_info; + struct sysinfo s_info; sysinfo(&s_info); - long minute = 60; - long hour = minute * 60; - long day = hour * 24; - double megabyte = 1024 * 1024; - - Chart_Container *chart_con; - Monitor *mon; - Monitor_Face *f; + long minute = 60; + long hour = minute * 60; + long day = hour * 24; + double megabyte = 1024 * 1024; + + Chart_Container *chart_con; + Monitor *mon; + Monitor_Face *f; num_sensors = 0; e_object_del(E_OBJECT(face->menu)); - Evas_Object *o; + Evas_Object *o; evas_event_freeze(face->con->bg_evas); @@ -1175,8 +1174,8 @@ if (face->uptime) evas_object_del(face->uptime); - int num_days, num_hours, num_min; - char u_date_time[256]; + int num_days, num_hours, num_min; + char u_date_time[256]; face->uptime = edje_object_add(face->con->bg_evas); if (!e_theme_edje_object_set @@ -1202,11 +1201,11 @@ if (face->uptime) evas_object_del(face->uptime); - time_t now; - struct tm date; + time_t now; + struct tm date; time(&now); - char curr_time[12]; + char curr_time[12]; date = *localtime(&now); face->time = edje_object_add(face->con->bg_evas); @@ -1235,7 +1234,7 @@ _monitor_face_cb_mouse_down, face); evas_object_show(face->monitor_cover_obj); - int x, y, w, h; + int x, y, w, h; e_gadman_client_geometry_get(face->gmc, &x, &y, &w, &h); @@ -1297,20 +1296,20 @@ static int _date_cb_check(void *data) { - Monitor_Face *face; + Monitor_Face *face; face = data; //Update uptime - char u_date_time[256]; - struct sysinfo s_info; + char u_date_time[256]; + struct sysinfo s_info; sysinfo(&s_info); - long minute = 60; - long hour = minute * 60; - long day = hour * 24; - double megabyte = 1024 * 1024; + long minute = 60; + long hour = minute * 60; + long day = hour * 24; + double megabyte = 1024 * 1024; sprintf(u_date_time, "uptime: %ld days, %ld:%02ld:%02ld", s_info.uptime / day, (s_info.uptime % day) / hour, @@ -1318,11 +1317,11 @@ edje_object_part_text_set(face->uptime, "uptime", u_date_time); //Update time - time_t now; - struct tm date; + time_t now; + struct tm date; time(&now); - char curr_time[12]; + char curr_time[12]; date = *localtime(&now); sprintf(curr_time, "%02d:%02d:%02d", date.tm_hour, date.tm_min, date.tm_sec); =================================================================== RCS file: /cvsroot/enlightenment/e_modules/monitor/e_mod_main.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- e_mod_main.h 30 Jan 2006 03:16:41 -0000 1.10 +++ e_mod_main.h 30 Jan 2006 19:55:20 -0000 1.11 @@ -15,66 +15,70 @@ typedef struct _Monitor Monitor; typedef struct _Monitor_Face Monitor_Face; -struct _Config { - Evas_List *faces; - int cpu; - int mem; - int net; - int wlan; - int hostname; - int Horz; - int uptime; - int time; +struct _Config +{ + Evas_List *faces; + int cpu; + int mem; + int net; + int wlan; + int hostname; + int Horz; + int uptime; + int time; }; -struct _Config_Face { - int config_version; - unsigned char enabled; - - double cpu_interval; - double mem_interval; - double net_interval; - double wlan_interval; +struct _Config_Face +{ + int config_version; + unsigned char enabled; + + double cpu_interval; + double mem_interval; + double net_interval; + double wlan_interval; - char *net_interface; - char *wlan_interface; + char *net_interface; + char *wlan_interface; - int mem_real_ignore_cached; - int mem_real_ignore_buffers; + int mem_real_ignore_cached; + int mem_real_ignore_buffers; }; -struct _Monitor { - Evas_List *faces; - E_Menu *config_menu; +struct _Monitor +{ + Evas_List *faces; + E_Menu *config_menu; - Config *conf; + Config *conf; }; -struct _Monitor_Face { - Monitor *mon; - E_Container *con; - E_Menu *menu; - Config_Face *conf; - Ecore_Timer *date_check_timer; +struct _Monitor_Face +{ + Monitor *mon; + E_Container *con; + E_Menu *menu; + Config_Face *conf; + Ecore_Timer *date_check_timer; - Evas_Object *cpu, *net, *mem, *wlan, *hostname, *uptime, *time; - Evas_Object *table_object, *monitor_object, *monitor_cover_obj; + Evas_Object *cpu, *net, *mem, *wlan, *hostname, *uptime, *time; + Evas_Object *table_object, *monitor_object, *monitor_cover_obj; - Chart_Container *chart_cpu, *chart_net, *chart_mem, *chart_wlan; + Chart_Container *chart_cpu, *chart_net, *chart_mem, *chart_wlan; - E_Gadman_Client *gmc; + E_Gadman_Client *gmc; }; EAPI extern E_Module_Api e_modapi; -EAPI void *e_modapi_init(E_Module * m); -EAPI int e_modapi_shutdown(E_Module * m); -EAPI int e_modapi_save(E_Module * m); -EAPI int e_modapi_info(E_Module * m); -EAPI int e_modapi_about(E_Module * m); -EAPI int e_modapi_config(E_Module * m); +EAPI void *e_modapi_init(E_Module *m); +EAPI int e_modapi_shutdown(E_Module *m); +EAPI int e_modapi_save(E_Module *m); +EAPI int e_modapi_info(E_Module *m); +EAPI int e_modapi_about(E_Module *m); +EAPI int e_modapi_config(E_Module *m); -void _monitor_cb_config_updated(void *data); -void rebuild_monitor(Monitor_Face * face); +void _monitor_cb_config_updated(void *data); +void rebuild_monitor(Monitor_Face *face); #endif =================================================================== RCS file: /cvsroot/enlightenment/e_modules/monitor/flow_chart.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- flow_chart.c 29 Jan 2006 17:53:05 -0000 1.3 +++ flow_chart.c 30 Jan 2006 19:55:20 -0000 1.4 @@ -4,25 +4,25 @@ static int flow_chart_timer(void *data) { - Flow_Chart *chart = (Flow_Chart *) data; + Flow_Chart *chart = (Flow_Chart *)data; - Evas_Object *o; - Evas_Object *last = NULL; - Evas_List *l; - int i, j = 0; - int value = 0, text_value = 0; - double factor = 0.0; - - double start_rel = chart->start_rel; - double end_rel = chart->end_rel; - - int x = chart->x; - int y = chart->y; - int w = chart->w; - int h = chart->h; + Evas_Object *o; + Evas_Object *last = NULL; + Evas_List *l; + int i, j = 0; + int value = 0, text_value = 0; + double factor = 0.0; + + double start_rel = chart->start_rel; + double end_rel = chart->end_rel; + + int x = chart->x; + int y = chart->y; + int w = chart->w; + int h = chart->h; - int dist_right = (int)((double)w * start_rel); - int dist_left = (int)((double)w * (1.0 - end_rel)); + int dist_right = (int)((double)w * start_rel); + int dist_left = (int)((double)w * (1.0 - end_rel)); x = x - dist_right; @@ -65,10 +65,10 @@ for (i = x + w; l && j - 2 < w - dist_right - dist_left; l = l->next, j++) { - Evas_Coord y; - Evas_Object *lo; + Evas_Coord y; + Evas_Object *lo; - lo = (Evas_Object *) evas_list_data(l); + lo = (Evas_Object *)evas_list_data(l); evas_object_geometry_get(lo, NULL, &y, NULL, NULL); @@ -91,12 +91,12 @@ return 1; } -Flow_Chart * +Flow_Chart * flow_chart_new(void) { - Flow_Chart *chart = NULL; + Flow_Chart *chart = NULL; - chart = (Flow_Chart *) calloc(1, sizeof(Flow_Chart)); + chart = (Flow_Chart *)calloc(1, sizeof(Flow_Chart)); if (!chart) return NULL; @@ -128,9 +128,9 @@ } void -flow_chart_color_set(Flow_Chart * chart, int r, int g, int b, int a) +flow_chart_color_set(Flow_Chart *chart, int r, int g, int b, int a) { - unsigned char was_running = 0; + unsigned char was_running = 0; if (chart->is_running) { @@ -148,30 +148,30 @@ } void -flow_chart_layer_set(Flow_Chart * chart, int layer) +flow_chart_layer_set(Flow_Chart *chart, int layer) { chart->layer = layer; } void -flow_chart_alignment_set(Flow_Chart * chart, int align) +flow_chart_alignment_set(Flow_Chart *chart, int align) { chart->alignment_bottom = align; } void -flow_chart_callback_set(Flow_Chart * chart, - void (*cb) (Flow_Chart * chart, void *data), void *data) +flow_chart_callback_set(Flow_Chart *chart, + void (*cb) (Flow_Chart *chart, void *data), void *data) { chart->chart_callback = cb; chart->callback_data = data; } void -flow_chart_get_value_function_set(Flow_Chart * chart, int (*func) (void)) +flow_chart_get_value_function_set(Flow_Chart *chart, int (*func) (void)) { - unsigned char was_running = 0; - int test = -1; + unsigned char was_running = 0; + int test = -1; if (chart->is_running) { @@ -197,9 +197,9 @@ } void -flow_chart_update_rate_set(Flow_Chart * chart, double rate) +flow_chart_update_rate_set(Flow_Chart *chart, double rate) { - unsigned char was_running = 0; + unsigned char was_running = 0; if (chart->is_running) { @@ -217,7 +217,7 @@ } void -flow_chart_set_usage_text_to_edje_part(Flow_Chart * chart, Evas_Object * edje, +flow_chart_set_usage_text_to_edje_part(Flow_Chart *chart, Evas_Object *edje, const char *text_part) { chart->edje = edje; @@ -225,7 +225,7 @@ } void -flow_chart_run(Flow_Chart * chart) +flow_chart_run(Flow_Chart *chart) { if (!chart->is_runable || chart->is_running) return; @@ -237,9 +237,9 @@ } void -flow_chart_stop(Flow_Chart * chart) +flow_chart_stop(Flow_Chart *chart) { - Evas_List *l; + Evas_List *l; if (!chart->is_running) return; @@ -250,7 +250,7 @@ for (l = chart->old_values; l; l = l->next) { - Evas_Object *o; + Evas_Object *o; o = evas_list_data(l); @@ -264,7 +264,7 @@ } void -flow_chart_del(Flow_Chart * chart) +flow_chart_del(Flow_Chart *chart) { if (chart->is_running) flow_chart_stop(chart); @@ -274,14 +274,14 @@ /* Chart Container */ -Chart_Container * -chart_container_new(Evas * evas, int x, int y, int w, int h) +Chart_Container * +chart_container_new(Evas *evas, int x, int y, int w, int h) { - Chart_Container *chart_con = NULL; - Evas_Object *o = NULL; + Chart_Container *chart_con = NULL; + Evas_Object *o = NULL; /* allocat memory return NULL on false */ - chart_con = (Chart_Container *) calloc(1, sizeof(Chart_Container)); + chart_con = (Chart_Container *)calloc(1, sizeof(Chart_Container)); if (!chart_con) return NULL; @@ -308,9 +308,9 @@ } void -chart_container_del(Chart_Container * chart_con) +chart_container_del(Chart_Container *chart_con) { - Evas_List *l = NULL; + Evas_List *l = NULL; if (!chart_con) return; @@ -319,7 +319,7 @@ if (l) for (; l; l = l->next) - flow_chart_del((Flow_Chart *) evas_list_data(l)); + flow_chart_del((Flow_Chart *)evas_list_data(l)); evas_list_free(chart_con->charts); @@ -329,7 +329,7 @@ } void -chart_container_chart_remove(Chart_Container * chart_con, Flow_Chart * chart) +chart_container_chart_remove(Chart_Container *chart_con, Flow_Chart *chart) { if (!chart_con || !chart) return; @@ -349,7 +349,7 @@ } void -chart_container_move(Chart_Container * chart_con, int x, int y) +chart_container_move(Chart_Container *chart_con, int x, int y) { if (!chart_con) return; @@ -360,14 +360,14 @@ evas_object_move(chart_con->clip, x, y); { - Evas_List *l = chart_con->charts; + Evas_List *l = chart_con->charts; if (!l) return; for (; l; l = l->next) { - Flow_Chart *chart = (Flow_Chart *) evas_list_data(l); + Flow_Chart *chart = (Flow_Chart *)evas_list_data(l); flow_chart_stop(chart); chart->x = x; @@ -379,7 +379,7 @@ } void -chart_container_resize(Chart_Container * chart_con, int w, int h) +chart_container_resize(Chart_Container *chart_con, int w, int h) { if (!chart_con) return; @@ -390,14 +390,14 @@ evas_object_resize(chart_con->clip, w, h); { - Evas_List *l = chart_con->charts; + Evas_List *l = chart_con->charts; if (!l) return; for (; l; l = l->next) { - Flow_Chart *chart = (Flow_Chart *) evas_list_data(l); + Flow_Chart *chart = (Flow_Chart *)evas_list_data(l); flow_chart_stop(chart); chart->w = w; @@ -409,7 +409,7 @@ } void -chart_container_chart_add(Chart_Container * chart_con, Flow_Chart * chart) +chart_container_chart_add(Chart_Container *chart_con, Flow_Chart *chart) { chart_con->charts = evas_list_append(chart_con->charts, chart); @@ -426,21 +426,21 @@ } void -chart_container_stop_charts(Chart_Container * chart_con) +chart_container_stop_charts(Chart_Container *chart_con) { - Evas_List *l = chart_con->charts; + Evas_List *l = chart_con->charts; if (l) for (; l; l = l->next) - flow_chart_stop((Flow_Chart *) evas_list_data(l)); + flow_chart_stop((Flow_Chart *)evas_list_data(l)); } void -chart_container_run_charts(Chart_Container * chart_con) +chart_container_run_charts(Chart_Container *chart_con) { - Evas_List *l = chart_con->charts; + Evas_List *l = chart_con->charts; if (l) for (; l; l = l->next) - flow_chart_run((Flow_Chart *) evas_list_data(l)); + flow_chart_run((Flow_Chart *)evas_list_data(l)); } =================================================================== RCS file: /cvsroot/enlightenment/e_modules/monitor/flow_chart.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- flow_chart.h 29 Jan 2006 17:53:05 -0000 1.3 +++ flow_chart.h 30 Jan 2006 19:55:20 -0000 1.4 @@ -10,75 +10,69 @@ #include "e_mod_main.h" -struct _Chart_Container { - Evas *evas; - Evas_Object *clip; +struct _Chart_Container +{ + Evas *evas; + Evas_Object *clip; - int x, y, w, h; + int x, y, w, h; - Evas_List *charts; + Evas_List *charts; }; -struct _Flow_Chart { - Evas *evas; - Evas_Object *clip; - Evas_List *old_values; - - int layer; - - Evas_Object *edje; - const char *edje_text_part; - - int r, g, b, a; - int (*get_value_func) (void); - int current_value; - void (*chart_callback) (Flow_Chart * chart, void *data); - void *callback_data; - - int x, y, w, h; - double start_rel, end_rel; - double update_rate; - - Ecore_Timer *timer; - - unsigned char is_runable:1; - unsigned char is_running:1; - unsigned char alignment_bottom:1; +struct _Flow_Chart +{ + Evas *evas; + Evas_Object *clip; + Evas_List *old_values; + + int layer; + + Evas_Object *edje; + const char *edje_text_part; + + int r, g, b, a; + int (*get_value_func) (void); + int current_value; + void (*chart_callback) (Flow_Chart *chart, void *data); + void *callback_data; + + int x, y, w, h; + double start_rel, end_rel; + double update_rate; + + Ecore_Timer *timer; + + unsigned char is_runable:1; + unsigned char is_running:1; + unsigned char alignment_bottom:1; }; -Flow_Chart *flow_chart_new(void); -void flow_chart_del(Flow_Chart * chart); +Flow_Chart *flow_chart_new(void); +void flow_chart_del(Flow_Chart *chart); -void flow_chart_color_set(Flow_Chart * chart, int r, int g, - int b, int a); -void flow_chart_layer_set(Flow_Chart * chart, int layer); -void flow_chart_get_value_function_set(Flow_Chart * chart, - int (*func) (void)); -void flow_chart_callback_set(Flow_Chart * chart, - void (*cb) (Flow_Chart * chart, - void *data), - void *data); -void flow_chart_alignment_set(Flow_Chart * chart, int alignment); -void flow_chart_range_set(Flow_Chart * chart, double start_rel, - double end_rel); -void flow_chart_update_rate_set(Flow_Chart * chart, double rate); +void flow_chart_color_set(Flow_Chart *chart, int r, int g, int b, int a); +void flow_chart_layer_set(Flow_Chart *chart, int layer); +void flow_chart_get_value_function_set(Flow_Chart *chart, int (*func) (void)); +void flow_chart_callback_set(Flow_Chart *chart, + void (*cb) (Flow_Chart *chart, + void *data), void *data); +void flow_chart_alignment_set(Flow_Chart *chart, int alignment); +void flow_chart_range_set(Flow_Chart *chart, double start_rel, double end_rel); +void flow_chart_update_rate_set(Flow_Chart *chart, double rate); -void flow_chart_run(Flow_Chart * chart); -void flow_chart_stop(Flow_Chart * chart); +void flow_chart_run(Flow_Chart *chart); +void flow_chart_stop(Flow_Chart *chart); //void flow_chart_set_usage_text_to_edje_part(Flow_Chart *chart, Evas_Object *edje, const char *text_part); -Chart_Container *chart_container_new(Evas * evas, int x, int y, int w, - int h); -void chart_container_del(Chart_Container * con); -void chart_container_move(Chart_Container * con, int x, int y); -void chart_container_resize(Chart_Container * chart, int w, - int h); -void chart_container_chart_add(Chart_Container * con, - Flow_Chart * chart); -void chart_container_chart_remove(Chart_Container * con, - Flow_Chart * chart); -void chart_container_stop_charts(Chart_Container * chart_con); -void chart_container_run_charts(Chart_Container * chart_con); +Chart_Container *chart_container_new(Evas *evas, int x, int y, int w, int h); +void chart_container_del(Chart_Container *con); +void chart_container_move(Chart_Container *con, int x, int y); +void chart_container_resize(Chart_Container *chart, int w, int h); +void chart_container_chart_add(Chart_Container *con, Flow_Chart *chart); +void chart_container_chart_remove(Chart_Container *con, Flow_Chart *chart); +void chart_container_stop_charts(Chart_Container *chart_con); +void chart_container_run_charts(Chart_Container *chart_con); #endif =================================================================== RCS file: /cvsroot/enlightenment/e_modules/monitor/linux_2.6.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- linux_2.6.c 29 Jan 2006 17:53:05 -0000 1.2 +++ linux_2.6.c 30 Jan 2006 19:55:20 -0000 1.3 @@ -1,14 +1,14 @@ #include "linux_2.6.h" -static int __monitor_cpu_count = -1; +static int __monitor_cpu_count = -1; int count_cpus(void) { - char tmp[4]; - FILE *stat; - int cpu = -1; + char tmp[4]; + FILE *stat; + int cpu = -1; if (!(stat = fopen("/proc/stat", "r"))) return -1; @@ -28,10 +28,10 @@ four_cpu_numbers(int *uret, int *nret, int *sret, int *iret) { static unsigned long old_u, old_n, old_s, old_i, old_wa, old_hi, old_si; - unsigned long new_u, new_n, new_s, new_i, new_wa = 0, new_hi = 0, new_si = 0, ticks_past; /* avoid div 0 */ - int tmp_u, tmp_n, tmp_s, tmp_i; - char dummy[16]; - FILE *stat; + unsigned long new_u, new_n, new_s, new_i, new_wa = 0, new_hi = 0, new_si = 0, ticks_past; /* avoid div 0 */ + int tmp_u, tmp_n, tmp_s, tmp_i; + char dummy[16]; + FILE *stat; if (!(stat = fopen("/proc/stat", "r"))) { @@ -89,7 +89,7 @@ int cpu_usage_get(void) { - int u, n, s, i, load; + int u, n, s, i, load; if (four_cpu_numbers(&u, &n, &s, &i) == -1) return -1; @@ -100,24 +100,24 @@ return load / __monitor_cpu_count; } -char *net_dev = "eth0"; -long max_in_bytes = 171008; -long max_out_bytes = 28672; -long bytes_in = 0; -long bytes_out = 0; -int in_usage = 0; -int out_usage = 0; -int interface_changed = 1; +char *net_dev = "eth0"; +long max_in_bytes = 171008; +long max_out_bytes = 28672; +long bytes_in = 0; +long bytes_out = 0; +int in_usage = 0; +int out_usage = 0; +int interface_changed = 1; int get_net_input_output(unsigned long *in, unsigned long *out, const char *dev) { - unsigned long new_in, new_out; - unsigned long dummy; - char iface[64]; - char buf[256]; - FILE *stat; - int found_dev = 0; + unsigned long new_in, new_out; + unsigned long dummy; + char iface[64]; + char buf[256]; + FILE *stat; + int found_dev = 0; stat = fopen("/proc/net/dev", "r"); if (!stat) @@ -125,7 +125,7 @@ while (fgets(buf, 256, stat)) { - int i = 0; + int i = 0; /* remove : */ for (; buf[i] != 0; i++) @@ -165,7 +165,7 @@ static unsigned long old_r_total = 0; static unsigned long old_t_total = 0; - unsigned long r_total = 0, t_total = 0; + unsigned long r_total = 0, t_total = 0; if (interface_changed) { @@ -245,15 +245,15 @@ } int -net_interfaces_get(Ecore_List * ifaces) +net_interfaces_get(Ecore_List *ifaces) { - unsigned long int dummy; + unsigned long int dummy; - char *iface; - char buf[256]; - FILE *stat; - int iface_count = 0; - int x = 0; + char *iface; + char buf[256]; + FILE *stat; + int iface_count = 0; + int x = 0; stat = fopen("/proc/net/dev", "r"); if (!stat) @@ -261,7 +261,7 @@ while (fgets(buf, 256, stat)) { - int i = 0; + int i = 0; /* remove : */ for (; buf[i] != 0; i++) @@ -288,21 +288,21 @@ } /* Wireless code */ -char *wlan_dev = "wlan0"; -int wlan_status = 0; -int wlan_link = 0; -int wlan_level = 0; -int wlan_noise = 0; +char *wlan_dev = "wlan0"; +int wlan_status = 0; +int wlan_link = 0; +int wlan_level = 0; +int wlan_noise = 0; void wlan_update(void) { - int new_status, new_link, new_level, new_noise; - unsigned int dummy; - char iface[64]; - char buf[256]; - FILE *stat; - int found_dev = 0; + int new_status, new_link, new_level, new_noise; + unsigned int dummy; + char iface[64]; + char buf[256]; + FILE *stat; + int found_dev = 0; stat = fopen("/proc/net/wireless", "r"); if (!stat) @@ -310,7 +310,7 @@ while (fgets(buf, 256, stat)) { - int i = 0; + int i = 0; /* remove : */ for (; buf[i] != 0; i++) @@ -377,15 +377,15 @@ } int -wlan_interfaces_get(Ecore_List * ifaces) +wlan_interfaces_get(Ecore_List *ifaces) { - unsigned long int dummy; + unsigned long int dummy; - char *iface; - char buf[256]; - FILE *stat; - int iface_count = 0; - int x = 0; + char *iface; + char buf[256]; + FILE *stat; + int iface_count = 0; + int x = 0; stat = fopen("/proc/net/wireless", "r"); if (!stat) @@ -396,7 +396,7 @@ while (fgets(buf, 256, stat)) { - int i = 0; + int i = 0; /* remove : and . */ for (; buf[i] != 0; i++) @@ -419,12 +419,12 @@ return iface_count; } -long mem_real = 0; -long mem_swap = 0; -int mem_real_usage = 0; -int mem_swap_usage = 0; -int mem_real_ignore_buffers = 0; -int mem_real_ignore_cached = 0; +long mem_real = 0; +long mem_swap = 0; +int mem_real_usage = 0; +int mem_swap_usage = 0; +int mem_real_ignore_buffers = 0; +int mem_real_ignore_cached = 0; /* Begin memory monitor code */ @@ -443,13 +443,13 @@ void memory_check(void) { - FILE *pmeminfo = NULL; - int cursor = 0; - char *line, *field; - unsigned char c; - long int value = 0, mtotal = 0, stotal = 0, mfree = 0, sfree = 0; - ldiv_t ldresult; - long int liresult; + FILE *pmeminfo = NULL; + int cursor = 0; + char *line, *field; + unsigned char c; + long int value = 0, mtotal = 0, stotal = 0, mfree = 0, sfree = 0; + ldiv_t ldresult; + long int liresult; /* open /proc/meminfo */ if (!(pmeminfo = fopen("/proc/meminfo", "r"))) =================================================================== RCS file: /cvsroot/enlightenment/e_modules/monitor/linux_2.6.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- linux_2.6.h 29 Jan 2006 17:53:05 -0000 1.2 +++ linux_2.6.h 30 Jan 2006 19:55:20 -0000 1.3 @@ -6,30 +6,30 @@ #include <stdlib.h> #include <Ecore_Data.h> -int cpu_usage_get(void); +int cpu_usage_get(void); -long mem_real_get(void); -long mem_swap_get(void); -int mem_real_usage_get(void); -int mem_swap_usage_get(void); - -void mem_real_ignore_buffers_set(int ignore_buffers); -void mem_real_ignore_cached_set(int ignore_cached); - -int net_in_usage_get(void); -long net_bytes_in_get(void); -int net_out_usage_get(void); -long net_bytes_out_get(void); - -int net_interfaces_get(Ecore_List * ifaces); -void net_interface_set(char *interface_name); - -void wlan_update(void); -int wlan_status_get(void); -int wlan_link_get(void); -int wlan_level_get(void); -int wlan_noise_get(void); -int wlan_interfaces_get(Ecore_List * ifaces); -void wlan_interface_set(char *interface_name); +long mem_real_get(void); +long mem_swap_get(void); +int mem_real_usage_get(void); +int mem_swap_usage_get(void); + +void mem_real_ignore_buffers_set(int ignore_buffers); +void mem_real_ignore_cached_set(int ignore_cached); + +int net_in_usage_get(void); +long net_bytes_in_get(void); +int net_out_usage_get(void); +long net_bytes_out_get(void); + +int net_interfaces_get(Ecore_List *ifaces); +void net_interface_set(char *interface_name); + +void wlan_update(void); +int wlan_status_get(void); +int wlan_link_get(void); +int wlan_level_get(void); +int wlan_noise_get(void); +int wlan_interfaces_get(Ecore_List *ifaces); +void wlan_interface_set(char *interface_name); #endif /* LINUX_2_6 */ ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs