(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/conversations_table.c) |
| |
| 1199 | | | init_ct_table_page(conversations_table *conversations, GtkWidget *vbox, gboolean hide_ports, const char *table_name, const char *tap_name, const char *filter, tap_packet_cb packet_func) |
| 1200 | | | { |
| 1201 | | | int i; |
| 1202 | | | column_arrows *col_arrows; |
| 1203 | | | GtkStyle *win_style; |
| 1204 | | | GtkWidget *column_lb; |
| 1205 | | | GString *error_string; |
| 1206 | | | char title[256]; |
| 1207 | | | |
| 1208 | | | conversations->page_lb=NULL; |
| 1209 | | | conversations->resolve_names=TRUE; |
| 1210 | | | conversations->has_ports=!hide_ports; |
| 1211 | | | conversations->num_columns=NUM_COLS; |
| 1212 | | | conversations->default_titles[0]="Address A", |
| 1213 | | | conversations->default_titles[1]="Port A"; |
| 1214 | | | conversations->default_titles[2]="Address B"; |
| 1215 | | | conversations->default_titles[3]="Port B"; |
| 1216 | | | conversations->default_titles[4]="Packets"; |
| 1217 | | | conversations->default_titles[5]="Bytes"; |
| 1218 | | | conversations->default_titles[6]="Packets A->B"; |
| 1219 | | | conversations->default_titles[7]="Bytes A->B"; |
| 1220 | | | conversations->default_titles[8]="Packets A<-B"; |
| 1221 | | | conversations->default_titles[9]="Bytes A<-B"; |
| 1222 | | | conversations->default_titles[10]="Rel Start"; |
| 1223 | | | conversations->default_titles[11]="Duration"; |
| 1224 | | | conversations->default_titles[12]="bps A->B"; |
| 1225 | | | conversations->default_titles[13]="bps A<-B"; |
| 1226 | | | if (strcmp(table_name, "NCP")==0) { |
| 1227 | | | conversations->default_titles[1]="Connection A"; |
| 1228 | | | conversations->default_titles[3]="Connection B"; |
| 1229 | | | } |
| 1230 | | | |
| 1231 | | | g_snprintf(title, sizeof(title), "%s Conversations", table_name); |
| 1232 | | | conversations->name_lb=gtk_label_new(title); |
| 1233 | | | gtk_box_pack_start(GTK_BOX(vbox), conversations->name_lb, FALSE, FALSE, 0);
x /usr/include/gtk-2.0/gtk/gtkbox.h |
| |
42 | #define GTK_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BOX, GtkBox)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
482 | #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
1678 | # define _G_TYPE_CIC(ip, gt, ct) \ |
1679 | ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) |
| |
x /usr/include/gtk-2.0/gtk/gtkbox.h |
| |
41 | #define GTK_TYPE_BOX (gtk_box_get_type ()) |
| |
|
| 1234 | | | |
| 1235 | | | |
| 1236 | | | conversations->scrolled_window=scrolled_window_new(NULL, NULL); |
| 1237 | | | gtk_box_pack_start(GTK_BOX(vbox), conversations->scrolled_window, TRUE, TRUE, 0);
x /usr/include/gtk-2.0/gtk/gtkbox.h |
| |
42 | #define GTK_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BOX, GtkBox)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
482 | #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
1678 | # define _G_TYPE_CIC(ip, gt, ct) \ |
1679 | ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) |
| |
x /usr/include/gtk-2.0/gtk/gtkbox.h |
| |
41 | #define GTK_TYPE_BOX (gtk_box_get_type ()) |
| |
|
| 1238 | | | |
| 1239 | | | conversations->table=(GtkCList *)gtk_clist_new(NUM_COLS); |
| 1240 | | | g_object_set_data(G_OBJECT(conversations->table), CONV_PTR_KEY, conversations);
x /usr/include/glib-2.0/gobject/gobject.h |
| |
52 | #define G_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_OBJECT, GObject)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
482 | #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
1678 | # define _G_TYPE_CIC(ip, gt, ct) \ |
1679 | ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
181 | #define G_TYPE_OBJECT G_TYPE_MAKE_FUNDAMENTAL (20) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
222 | #define G_TYPE_MAKE_FUNDAMENTAL(x) ((GType) ((x) << G_TYPE_FUNDAMENTAL_SHIFT)) |
| |
|
| 1241 | | | |
| 1242 | | | col_arrows = (column_arrows *) g_malloc(sizeof(column_arrows) * NUM_COLS); |
| 1243 | | | win_style = gtk_widget_get_style(conversations->scrolled_window); |
Unused Value
The value assigned to win_style is never subsequently used on any execution path. |
|
| 1244 | | | for (i = 0; i < NUM_COLS; i++) { |
| 1245 | | | col_arrows[i].table = gtk_table_new(2, 2, FALSE); |
| 1246 | | | gtk_table_set_col_spacings(GTK_TABLE(col_arrows[i].table), 5);
x /usr/include/gtk-2.0/gtk/gtktable.h |
| |
41 | #define GTK_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TABLE, GtkTable)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
482 | #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
1678 | # define _G_TYPE_CIC(ip, gt, ct) \ |
1679 | ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) |
| |
x /usr/include/gtk-2.0/gtk/gtktable.h |
| |
40 | #define GTK_TYPE_TABLE (gtk_table_get_type ()) |
| |
|
| 1247 | | | column_lb = gtk_label_new(conversations->default_titles[i]); |
| 1248 | | | gtk_table_attach(GTK_TABLE(col_arrows[i].table), column_lb, 0, 1, 0, 2, GTK_SHRINK, GTK_SHRINK, 0, 0);
x /usr/include/gtk-2.0/gtk/gtktable.h |
| |
41 | #define GTK_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TABLE, GtkTable)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
482 | #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
1678 | # define _G_TYPE_CIC(ip, gt, ct) \ |
1679 | ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) |
| |
x /usr/include/gtk-2.0/gtk/gtktable.h |
| |
40 | #define GTK_TYPE_TABLE (gtk_table_get_type ()) |
| |
|
| 1249 | | | gtk_widget_show(column_lb); |
| 1250 | | | |
| 1251 | | | col_arrows[i].ascend_pm = xpm_to_widget((const char **) clist_ascend_xpm); |
| 1252 | | | gtk_table_attach(GTK_TABLE(col_arrows[i].table), col_arrows[i].ascend_pm, 1, 2, 1, 2, GTK_SHRINK, GTK_SHRINK, 0, 0);
x /usr/include/gtk-2.0/gtk/gtktable.h |
| |
41 | #define GTK_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TABLE, GtkTable)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
482 | #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
1678 | # define _G_TYPE_CIC(ip, gt, ct) \ |
1679 | ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) |
| |
x /usr/include/gtk-2.0/gtk/gtktable.h |
| |
40 | #define GTK_TYPE_TABLE (gtk_table_get_type ()) |
| |
|
| 1253 | | | col_arrows[i].descend_pm = xpm_to_widget((const char **) clist_descend_xpm); |
| 1254 | | | gtk_table_attach(GTK_TABLE(col_arrows[i].table), col_arrows[i].descend_pm, 1, 2, 0, 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
x /usr/include/gtk-2.0/gtk/gtktable.h |
| |
41 | #define GTK_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TABLE, GtkTable)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
482 | #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
1678 | # define _G_TYPE_CIC(ip, gt, ct) \ |
1679 | ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) |
| |
x /usr/include/gtk-2.0/gtk/gtktable.h |
| |
40 | #define GTK_TYPE_TABLE (gtk_table_get_type ()) |
| |
|
| 1255 | | | |
| 1256 | | | if (i == 4) { |
| 1257 | | | gtk_widget_show(col_arrows[i].ascend_pm); |
| 1258 | | | } |
| 1259 | | | gtk_clist_set_column_widget(GTK_CLIST(conversations->table), i, col_arrows[i].table);
x /usr/include/gtk-2.0/gtk/gtkclist.h |
| |
87 | #define GTK_CLIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CLIST, GtkCList)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
482 | #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
1678 | # define _G_TYPE_CIC(ip, gt, ct) \ |
1679 | ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) |
| |
x /usr/include/gtk-2.0/gtk/gtkclist.h |
| |
86 | #define GTK_TYPE_CLIST (gtk_clist_get_type ()) |
| |
|
| 1260 | | | gtk_widget_show(col_arrows[i].table); |
| 1261 | | | } |
| 1262 | | | gtk_clist_column_titles_show(GTK_CLIST(conversations->table));
x /usr/include/gtk-2.0/gtk/gtkclist.h |
| |
87 | #define GTK_CLIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CLIST, GtkCList)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
482 | #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
1678 | # define _G_TYPE_CIC(ip, gt, ct) \ |
1679 | ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) |
| |
x /usr/include/gtk-2.0/gtk/gtkclist.h |
| |
86 | #define GTK_TYPE_CLIST (gtk_clist_get_type ()) |
| |
|
| 1263 | | | |
| 1264 | | | gtk_clist_set_compare_func(conversations->table, ct_sort_column); |
| 1265 | | | gtk_clist_set_sort_column(conversations->table, 4); |
| 1266 | | | gtk_clist_set_sort_type(conversations->table, GTK_SORT_ASCENDING); |
| 1267 | | | |
| 1268 | | | |
| 1269 | | | for (i = 0; i < NUM_COLS; i++) { |
| 1270 | | | gtk_clist_set_column_auto_resize(conversations->table, i, TRUE); |
| 1271 | | | } |
| 1272 | | | |
| 1273 | | | gtk_clist_set_shadow_type(conversations->table, GTK_SHADOW_IN); |
| 1274 | | | gtk_clist_column_titles_show(conversations->table); |
| 1275 | | | gtk_container_add(GTK_CONTAINER(conversations->scrolled_window), (GtkWidget *)conversations->table);
x /usr/include/gtk-2.0/gtk/gtkcontainer.h |
| |
42 | #define GTK_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CONTAINER, GtkContainer)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
482 | #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
1678 | # define _G_TYPE_CIC(ip, gt, ct) \ |
1679 | ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) |
| |
x /usr/include/gtk-2.0/gtk/gtkcontainer.h |
| |
41 | #define GTK_TYPE_CONTAINER (gtk_container_get_type ()) |
| |
|
| 1276 | | | |
| 1277 | | | g_signal_connect(conversations->table, "click-column", G_CALLBACK(ct_click_column_cb), col_arrows);
x /usr/include/glib-2.0/gobject/gsignal.h |
| |
421 | #define g_signal_connect(instance, detailed_signal, c_handler, data) \ |
422 | g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (GConnectFlags) 0) |
| |
x /usr/include/glib-2.0/gobject/gclosure.h |
| |
72 | #define G_CALLBACK(f) ((GCallback) (f)) |
| |
|
| 1278 | | | |
| 1279 | | | conversations->num_conversations=0; |
| 1280 | | | conversations->conversations=NULL; |
| 1281 | | | |
| 1282 | | | |
| 1283 | | | if(hide_ports){ |
| 1284 | | | gtk_clist_set_column_visibility(conversations->table, 1, FALSE); |
| 1285 | | | gtk_clist_set_column_visibility(conversations->table, 3, FALSE); |
| 1286 | | | } |
| 1287 | | | |
| 1288 | | | |
| 1289 | | | (conversations); |
| 1290 | | | |
| 1291 | | | |
| 1292 | | | error_string=register_tap_listener(tap_name, conversations, filter, reset_ct_table_data_cb, packet_func, draw_ct_table_data_cb); |
| 1293 | | | if(error_string){ |
| 1294 | | | simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str); |
| 1295 | | | g_string_free(error_string, TRUE); |
| 1296 | | | return FALSE; |
| 1297 | | | } |
| 1298 | | | |
| 1299 | | | return TRUE; |
| 1300 | | | } |
| |