diff options
Diffstat (limited to 'ui/cli/tap-funnel.c')
-rw-r--r-- | ui/cli/tap-funnel.c | 77 |
1 files changed, 45 insertions, 32 deletions
diff --git a/ui/cli/tap-funnel.c b/ui/cli/tap-funnel.c index 16e0cac09f..bf13223d5b 100644 --- a/ui/cli/tap-funnel.c +++ b/ui/cli/tap-funnel.c @@ -37,44 +37,44 @@ void register_tap_listener_gtkfunnel(void); struct _funnel_text_window_t { - gchar* title; - GString* text; + gchar *title; + GString *text; }; -static GPtrArray* text_windows = NULL; +static GPtrArray *text_windows = NULL; -static funnel_text_window_t* new_text_window(const gchar* title) { - funnel_text_window_t* tw = g_new(funnel_text_window_t,1); +static funnel_text_window_t *new_text_window(const gchar *title) { + funnel_text_window_t *tw = g_new(funnel_text_window_t, 1); tw->title = g_strdup(title); tw->text = g_string_new(""); if (!text_windows) text_windows = g_ptr_array_new(); - g_ptr_array_add(text_windows,tw); + g_ptr_array_add(text_windows, tw); return tw; } -static void text_window_clear(funnel_text_window_t* tw) { - g_string_free(tw->text,TRUE); +static void text_window_clear(funnel_text_window_t *tw) { + g_string_free(tw->text, TRUE); tw->text = g_string_new(""); } -static void text_window_append(funnel_text_window_t* tw, const char *text ) { - g_string_append(tw->text,text); +static void text_window_append(funnel_text_window_t *tw, const char *text ) { + g_string_append(tw->text, text); } -static void text_window_set_text(funnel_text_window_t* tw, const char* text) { - g_string_free(tw->text,TRUE); +static void text_window_set_text(funnel_text_window_t *tw, const char *text) { + g_string_free(tw->text, TRUE); tw->text = g_string_new(text); } -static void text_window_prepend(funnel_text_window_t* tw, const char *text) { - g_string_prepend(tw->text,text); +static void text_window_prepend(funnel_text_window_t *tw, const char *text) { + g_string_prepend(tw->text, text); } -static const gchar* text_window_get_text(funnel_text_window_t* tw) { +static const gchar *text_window_get_text(funnel_text_window_t *tw) { return tw->text->str; } @@ -83,7 +83,7 @@ static void funnel_logger(const gchar *log_domain _U_, GLogLevelFlags log_level _U_, const gchar *message, gpointer user_data _U_) { - fputs(message,stderr); + fputs(message, stderr); } @@ -129,32 +129,32 @@ void funnel_dump_all_text_windows(void) { if (!text_windows) return; for ( i = 0 ; i < text_windows->len; i++) { - funnel_text_window_t* tw = (funnel_text_window_t*)g_ptr_array_index(text_windows,i); + funnel_text_window_t *tw = (funnel_text_window_t *)g_ptr_array_index(text_windows, i); printf("\n========================== %s " - "==========================\n%s\n",tw->title,tw->text->str); + "==========================\n%s\n", tw->title, tw->text->str); - g_ptr_array_remove_index(text_windows,i); + g_ptr_array_remove_index(text_windows, i); g_free(tw->title); - g_string_free(tw->text,TRUE); + g_string_free(tw->text, TRUE); g_free(tw); } } #if 0 -GHashTable* menus = NULL; +GHashTable *menus = NULL; typedef struct _menu_cb_t { void (*callback)(gpointer); - void* callback_data; + void *callback_data; } menu_cb_t; -static void init_funnel_cmd(const char *opt_arg, void* data ) { - gchar** args = g_strsplit(opt_arg,",",0); - gchar** arg; - menu_cb_t* mcb = data; +static void init_funnel_cmd(const char *opt_arg, void *data ) { + gchar **args = g_strsplit(opt_arg, ",", 0); + gchar **arg; + menu_cb_t *mcb = data; - for(arg = args; *arg ; arg++) { + for (arg = args; *arg ; arg++) { g_strstrip(*arg); } @@ -169,17 +169,17 @@ static void register_menu_cb(const char *name, void (*callback)(gpointer), gpointer callback_data, gboolean retap _U_) { - menu_cb_t* mcb = g_malloc(sizeof(menu_cb_t)); + menu_cb_t *mcb = g_malloc(sizeof(menu_cb_t)); mcb->callback = callback; mcb->callback_data = callback_data; if (!menus) - menus = g_hash_table_new(g_str_hash,g_str_equal); + menus = g_hash_table_new(g_str_hash, g_str_equal); - g_hash_table_insert(menus,g_strdup(name),mcb); + g_hash_table_insert(menus, g_strdup(name), mcb); - register_stat_cmd_arg(name,init_funnel_cmd,mcb); + register_stat_cmd_arg(name, init_funnel_cmd, mcb); } void initialize_funnel_ops(void) { @@ -191,7 +191,20 @@ void register_tap_listener_gtkfunnel(void) { #if 0 - /* #if 0 at least since Revision Rev 17396 */ + /* #if 0 at least since Revision Rev 17396 */ funnel_register_all_menus(register_menu_cb); #endif } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil + * End: + * + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: + */ |