/* Create a new filter */
color_filter_t *
-color_filter_new(gchar *name, /* The name of the filter to create */
- gchar *filter_string, /* The string representing the filter */
+color_filter_new(const gchar *name, /* The name of the filter to create */
+ const gchar *filter_string, /* The string representing the filter */
color_t *bg_color, /* The background color */
color_t *fg_color) /* The foreground color */
{
* @param fg_color foreground color
* @return the new color filter
*/
-color_filter_t *color_filter_new(gchar *name, gchar *filter_string,
+color_filter_t *color_filter_new(const gchar *name, const gchar *filter_string,
color_t *bg_color, color_t *fg_color);
/** Remove the color filter.
* function on each entry.
*/
void
-dissector_table_foreach_handle(char *name,
+dissector_table_foreach_handle(const char *name,
DATFunc_handle func,
gpointer user_data)
{
gpointer user_data);
extern void dissector_all_tables_foreach_changed (DATFunc func,
gpointer user_data);
-extern void dissector_table_foreach_handle(char *name, DATFunc_handle func,
+extern void dissector_table_foreach_handle(const char *name, DATFunc_handle func,
gpointer user_data);
extern void dissector_all_tables_foreach_table (DATFunc_table func,
gpointer user_data);
GtkWidget *table;
const char *constpath;
char *path;
- gchar *titles[] = { "Name", "Folder", "Typical Files"};
+ const gchar *titles[] = { "Name", "Folder", "Typical Files"};
GtkWidget *scrolledwindow;
scrolledwindow = scrolled_window_new(NULL, NULL);
static void
ansi_a_stat_gtk_win_create(
ansi_a_stat_dlg_t *dlg_p,
- char *title)
+ const char *title)
{
#define INIT_TABLE_NUM_COLUMNS 3
- char *default_titles[] = { "IEI", "Message Name", "Count" };
+ const char *default_titles[] = { "IEI", "Message Name", "Count" };
int i;
column_arrows *col_arrows;
GtkWidget *column_lb;
typedef struct _my_columns_t {
guint32 value;
- gchar *strptr;
+ const gchar *strptr;
GtkJustification just;
} my_columns_t;
static void
ansi_map_stat_gtk_win_create(
ansi_map_stat_dlg_t *dlg_p,
- char *title)
+ const char *title)
{
int i;
column_arrows *col_arrows;
#define TIME_UNIT_HOUR 2
#define TIME_UNIT_DAY 3
#define MAX_TIME_UNITS 4
-static char *time_unit_name[MAX_TIME_UNITS] = {
+static const char *time_unit_name[MAX_TIME_UNITS] = {
"second(s)",
"minute(s)",
"hour(s)",
#define SIZE_UNIT_MEGABYTES 2
#define SIZE_UNIT_GIGABYTES 3
#define MAX_SIZE_UNITS 4
-static char *size_unit_name[MAX_SIZE_UNITS] = {
+static const char *size_unit_name[MAX_SIZE_UNITS] = {
"byte(s)",
"kilobyte(s)",
"megabyte(s)",
*cur_opts_fr, *ed_opts_fr, *main_vb,
*if_descr_lb, *if_hide_lb,
*bbox, *ok_bt, *cancel_bt;
- gchar *cur_titles[] = { "Device", "Description",
- "Comment", "Hide?" };
- int row = 0;
+ const gchar *cur_titles[] = { "Device", "Description", "Comment", "Hide?" };
+ int row = 0;
GtkWidget *caller = gtk_widget_get_toplevel(w);
#endif
static void color_destroy_cb(GtkButton *button, gpointer user_data);
static void destroy_edit_dialog_cb(gpointer filter_arg, gpointer dummy);
-static void create_new_color_filter(GtkButton *button, char *filter);
+static void create_new_color_filter(GtkButton *button, const char *filter);
static void color_new_cb(GtkButton *button, gpointer user_data);
static void color_props_cb(GtkButton *button, gpointer user_data);
static void color_delete_cb(GtkWidget *widget, gpointer user_data);
GtkTreeViewColumn *column;
GtkTreeSelection *selection;
#endif
- gchar *titles[] = { "Name", "String" };
+ const gchar *titles[] = { "Name", "String" };
row_selected = -1; /* no row selected */
/* Create a new filter in the list, and pop up an "Edit color filter"
dialog box to edit it. */
static void
-create_new_color_filter(GtkButton *button, char *filter)
+create_new_color_filter(GtkButton *button, const char *filter)
{
color_filter_t *colorf;
GtkStyle *style;
GList *clp = NULL;
fmt_data *cfmt;
gint i;
- gchar *column_titles[] = {"Title", "Format"};
+ const gchar *column_titles[] = {"Title", "Format"};
#if GTK_MAJOR_VERSION < 2
gchar *col_ent[2];
gint row;
static void
column_list_new_cb(GtkWidget *w _U_, gpointer data _U_) {
fmt_data *cfmt;
- gchar *title = "New Column";
+ const gchar *title = "New Column";
#if GTK_MAJOR_VERSION < 2
gchar *col_ent[2];
#else
static void
-eth_conversation_init(char *optarg)
+eth_conversation_init(const char *optarg)
{
- char *filter=NULL;
+ const char *filter=NULL;
if(!strncmp(optarg,"conv,eth,",9)){
filter=optarg+9;
static void
-fc_conversation_init(char *optarg)
+fc_conversation_init(const char *optarg)
{
- char *filter=NULL;
+ const char *filter=NULL;
if(!strncmp(optarg,"conv,fc,",8)){
filter=optarg+8;
static void
-fddi_conversation_init(char *optarg)
+fddi_conversation_init(const char *optarg)
{
- char *filter=NULL;
+ const char *filter=NULL;
if(!strncmp(optarg,"conv,fddi,",10)){
filter=optarg+10;
}
static void
-ip_conversation_init(char *optarg)
+ip_conversation_init(const char *optarg)
{
- char *filter=NULL;
+ const char *filter=NULL;
if(!strncmp(optarg,"conv,ip,",8)){
filter=optarg+8;
static void
-ipx_conversation_init(char *optarg)
+ipx_conversation_init(const char *optarg)
{
- char *filter=NULL;
+ const char *filter=NULL;
if(!strncmp(optarg,"conv,ipx,",9)){
filter=optarg+9;
}
static void
-jxta_conversation_init(char *optarg)
+jxta_conversation_init(const char *optarg)
{
- char *filter=NULL;
+ const char *filter=NULL;
if(!strncmp(optarg,"conv,jxta,",10)){
filter=optarg+10;
/* conversations_sctp.c
* conversations_sctp 2005 Oleg Terletsky <oleg.terletsky@comverse.com>
*
- * $Id:$
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
static void
-sctp_conversation_init(char *optarg)
+sctp_conversation_init(const char *optarg)
{
- char *filter=NULL;
+ const char *filter=NULL;
if(!strncmp(optarg,"conv,sctp,",10)){
filter=optarg+10;
of protocols, either ethernet, tokenring, fddi etc so we must be more
specific there thats why we need specific_addr_type
*/
-static char *
+static const char *
ct_get_filter_name(address *addr, int specific_addr_type, int port_type, int name_type)
{
switch(name_type){
static gboolean
-init_ct_table_page(conversations_table *conversations, GtkWidget *vbox, gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func)
+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)
{
int i;
column_arrows *col_arrows;
void
-init_conversation_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func)
+init_conversation_table(gboolean hide_ports, const char *table_name, const char *tap_name, const char *filter, tap_packet_cb packet_func)
{
conversations_table *conversations;
char title[256];
static conversations_table *
-init_ct_notebook_page_cb(gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func)
+init_ct_notebook_page_cb(gboolean hide_ports, const char *table_name, const char *tap_name, const char *filter, tap_packet_cb packet_func)
{
gboolean ret;
GtkWidget *page_vbox;
typedef struct {
gboolean hide_ports; /* hide TCP / UDP port columns */
- char *table_name; /* GUI output name */
- char *tap_name; /* internal name */
- char *filter; /* display filter string (unused) */
+ const char *table_name; /* GUI output name */
+ const char *tap_name; /* internal name */
+ const char *filter; /* display filter string (unused) */
tap_packet_cb packet_func; /* function to be called for new incoming packets */
} register_ct_t;
static GSList *registered_ct_tables = NULL;
void
-register_conversation_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func)
+register_conversation_table(gboolean hide_ports, const char *table_name, const char *tap_name, const char *filter, tap_packet_cb packet_func)
{
register_ct_t *table;
/* if this was a new conversation we have to create a clist row for it */
if(new_conversation){
- char *entries[NUM_COLS];
+ const char *entries[NUM_COLS];
char frames[16],bytes[16],txframes[16],txbytes[16],rxframes[16],rxbytes[16];
/* these values will be filled by call to draw_ct_table_addresses() below */
/** Conversation widget */
typedef struct _conversations_table {
- char *name; /**< the name of the table */
+ const char *name; /**< the name of the table */
GtkWidget *win; /**< GTK window */
GtkWidget *page_lb; /**< label */
GtkWidget *scrolled_window; /**< the scrolled window */
GtkCList *table; /**< the GTK table */
guint32 num_columns; /**< number of columns in the above table */
- char *default_titles[10]; /**< Column headers */
+ const char *default_titles[10]; /**< Column headers */
GtkWidget *menu; /**< context menu */
gboolean has_ports; /**< table has ports */
guint32 num_conversations; /**< number of conversations */
* @param filter the optional filter name or NULL
* @param packet_func the function to be called for each incoming packet
*/
-extern void register_conversation_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func);
+extern void register_conversation_table(gboolean hide_ports, const char *table_name, const char *tap_name, const char *filter, tap_packet_cb packet_func);
/** Init the conversation table for the single conversation window.
*
* @param filter the optional filter name or NULL
* @param packet_func the function to be called for each incoming packet
*/
-extern void init_conversation_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func);
+extern void init_conversation_table(gboolean hide_ports, const char *table_name, const char *tap_name, const char *filter, tap_packet_cb packet_func);
/** Callback for "Conversations" statistics item.
*
static void
-tcpip_conversation_init(char *optarg)
+tcpip_conversation_init(const char *optarg)
{
- char *filter=NULL;
+ const char *filter=NULL;
if(!strncmp(optarg,"conv,tcp,",9)){
filter=optarg+9;
static void
-tr_conversation_init(char *optarg)
+tr_conversation_init(const char *optarg)
{
- char *filter=NULL;
+ const char *filter=NULL;
if(!strncmp(optarg,"conv,tr,",8)){
filter=optarg+8;
static void
-udpip_conversation_init(char *optarg)
+udpip_conversation_init(const char *optarg)
{
- char *filter=NULL;
+ const char *filter=NULL;
if(!strncmp(optarg,"conv,udp,",9)){
filter=optarg+9;
static void
-wlan_conversation_init(char *optarg)
+wlan_conversation_init(const char *optarg)
{
- char *filter=NULL;
+ const char *filter=NULL;
if(!strncmp(optarg,"conv,wlan,",10)){
filter=optarg+10;
/* remove a binding (looking the same way as the given one) */
static void
decode_dcerpc_binding_reset(
-gchar *table_name _U_,
+const gchar *table_name _U_,
decode_dcerpc_bind_values_t *binding)
{
GSList *le;
/* a binding has changed (remove a previously existing one) */
static void
decode_dcerpc_binding_change(
-gchar *table_name,
+const gchar *table_name,
decode_dcerpc_bind_values_t *binding)
{
/* a binding has changed (add/replace/remove it) */
static void
-decode_change_one_dcerpc_binding(gchar *table_name, decode_dcerpc_bind_values_t *binding, GtkWidget *list)
+decode_change_one_dcerpc_binding(const gchar *table_name, decode_dcerpc_bind_values_t *binding, GtkWidget *list)
{
dcerpc_uuid_key *key;
gchar *abbrev;
decode_dcerpc(GtkWidget *notebook_pg)
{
GtkWidget *list;
- gchar *table_name;
+ const gchar *table_name;
decode_dcerpc_bind_values_t *binding;
/* add all interfaces to the list */
static GtkWidget *
-decode_add_dcerpc_menu (GtkWidget *page, gchar *table_name _U_)
+decode_add_dcerpc_menu (GtkWidget *page, const gchar *table_name _U_)
{
GtkWidget *scrolled_window;
GtkWidget *list;
* to store any information generated by this routine.
*/
extern void
-decode_add_to_list (gchar *table_name, const gchar *proto_name, gpointer value, gpointer user_data);
+decode_add_to_list (const gchar *table_name, const gchar *proto_name, gpointer value, gpointer user_data);
/*
* This routine starts the creation of a List on a notebook page. It
const gchar *initial_proto_name,
const gchar *current_proto_name)
{
- gchar *text[E_LIST_D_COLUMNS];
+ const gchar *text[E_LIST_D_COLUMNS];
#if GTK_MAJOR_VERSION < 2
GtkCList *clist;
gint row;
store = (GtkListStore *)list_data;
#endif
- text[E_LIST_D_TABLE] = (char *)table_name;
+ text[E_LIST_D_TABLE] = table_name;
text[E_LIST_D_SELECTOR] = selector_name;
- text[E_LIST_D_INITIAL] = (char *)initial_proto_name;
- text[E_LIST_D_CURRENT] = (char *)current_proto_name;
+ text[E_LIST_D_INITIAL] = initial_proto_name;
+ text[E_LIST_D_CURRENT] = current_proto_name;
#if GTK_MAJOR_VERSION < 2
row = gtk_clist_prepend(clist, text);
#else
decode_show_cb (GtkWidget * w _U_, gpointer data _U_)
{
GtkWidget *main_vb, *bbox, *ok_bt, *clear_bt, *help_bt, *scrolled_window;
- gchar *titles[E_LIST_D_COLUMNS] = {
+ const gchar *titles[E_LIST_D_COLUMNS] = {
"Table", "Value", "Initial", "Current"
};
gint column;
* to store any information generated by this routine.
*/
void
-decode_add_to_list (gchar *table_name, const gchar *proto_name, gpointer value, gpointer user_data)
+decode_add_to_list (const gchar *table_name, const gchar *proto_name, gpointer value, gpointer user_data)
{
- gchar *text[E_LIST_S_COLUMNS];
+ const gchar *text[E_LIST_S_COLUMNS];
#if GTK_MAJOR_VERSION < 2
GtkCList *list;
gint row;
if (hli.found) return;
#endif
- text[E_LIST_S_PROTO_NAME] = (char *)proto_name;
+ text[E_LIST_S_PROTO_NAME] = proto_name;
text[E_LIST_S_TABLE] = table_name;
#if GTK_MAJOR_VERSION < 2
row = gtk_clist_prepend(list, text);
void
decode_list_menu_finish(GtkWidget *list)
{
- gchar *text[E_LIST_S_COLUMNS];
+ const gchar *text[E_LIST_S_COLUMNS];
#if GTK_MAJOR_VERSION < 2
gint row;
#else
* scrolled window.
*/
static GtkWidget *
-decode_add_simple_menu (GtkWidget *page, gchar *table_name)
+decode_add_simple_menu (GtkWidget *page, const gchar *table_name)
{
GtkWidget *scrolled_window;
GtkWidget *list;
* routine.
*/
static GtkWidget *
-decode_add_simple_page (gchar *prompt, gchar *title, gchar *table_name,
+decode_add_simple_page (const gchar *prompt, const gchar *title, const gchar *table_name,
guint value)
{
GtkWidget *page, *label, *scrolled_window;
* this routine.
*/
static GtkWidget *
-decode_add_tcpudp_page (gchar *prompt, gchar *table_name)
+decode_add_tcpudp_page (const gchar *prompt, const gchar *table_name)
{
GtkWidget *page, *label, *scrolled_window, *optmenu;
static GtkWidget *
-decode_add_sctp_page (gchar *prompt, gchar *table_name)
+decode_add_sctp_page (const gchar *prompt, const gchar *table_name)
{
GtkWidget *page, *label, *scrolled_window, *radio, *vbox, *alignment, *sctpbox, *sctpmenu;
static void show_relations(GtkWidget *relation_list, ftenum_t ftype);
static gboolean relation_is_presence_test(const char *string);
-static void add_relation_list(GtkWidget *relation_list, char *relation, gboolean sensitive);
+static void add_relation_list(GtkWidget *relation_list, const char *relation, gboolean sensitive);
static void build_boolean_values(GtkWidget *value_list_scrolled_win,
GtkWidget *value_list,
const true_false_string *values);
}
static void
-add_relation_list(GtkWidget *relation_list, char *relation, gboolean sensitive)
+add_relation_list(GtkWidget *relation_list, const char *relation, gboolean sensitive)
{
#if GTK_MAJOR_VERSION < 2
GtkWidget *label, *item;
*/
if (values == NULL)
values = &true_false;
- add_value_list_item(value_list, values->true_string, (gpointer)values);
+ add_value_list_item(value_list, values->true_string, values);
add_value_list_item(value_list, values->false_string, NULL);
/*
*/
while (values->strptr != NULL) {
add_value_list_item(value_list, values->strptr,
- (gpointer)values);
+ values);
values++;
}
/* create a button for the button row (helper for dlg_button_row_new) */
static GtkWidget *
-dlg_button_new(GtkWidget *hbox, GtkWidget *button_hbox, gchar *stock_id)
+dlg_button_new(GtkWidget *hbox, GtkWidget *button_hbox, const gchar *stock_id)
{
GtkWidget *button;
* GTK2 (e.g. GNOME) "Apply" "Cancel" "OK"
*/
GtkWidget *
-dlg_button_row_new(gchar *stock_id_first, ...)
+dlg_button_row_new(const gchar *stock_id_first, ...)
{
gint buttons = 0;
va_list stock_id_list;
- gchar *stock_id = stock_id_first;
+ const gchar *stock_id = stock_id_first;
GtkWidget *hbox;
GtkWidget *button_hbox;
GtkWidget *help_hbox;
GtkWidget *button;
- gchar *ok = NULL;
- gchar *apply = NULL;
- gchar *save = NULL;
- gchar *dont_save = NULL;
- gchar *cancel = NULL;
- gchar *close = NULL;
- gchar *clear = NULL;
- gchar *start = NULL;
- gchar *stop = NULL;
- gchar *create_stat = NULL;
- gchar *help = NULL;
- gchar *print = NULL;
- gchar *find = NULL;
- gchar *jump = NULL;
- gchar *yes = NULL;
- gchar *no = NULL;
+ const gchar *ok = NULL;
+ const gchar *apply = NULL;
+ const gchar *save = NULL;
+ const gchar *dont_save = NULL;
+ const gchar *cancel = NULL;
+ const gchar *close = NULL;
+ const gchar *clear = NULL;
+ const gchar *start = NULL;
+ const gchar *stop = NULL;
+ const gchar *create_stat = NULL;
+ const gchar *help = NULL;
+ const gchar *print = NULL;
+ const gchar *find = NULL;
+ const gchar *jump = NULL;
+ const gchar *yes = NULL;
+ const gchar *no = NULL;
va_start(stock_id_list, stock_id_first);
* @return the new button row
* @todo move this to ui_util.h
*/
-extern GtkWidget *dlg_button_row_new(gchar *stock_id_first, ...);
+extern GtkWidget *dlg_button_row_new(const gchar *stock_id_first, ...);
/** Set the "activate" signal for a widget to call a routine to
* activate the "OK" button for a dialog box.
/* copied from summary_dlg.c */
static GtkWidget *
-add_string_to_table_sensitive(GtkWidget *list, guint *row, gchar *title, gchar *value, gboolean sensitive)
+add_string_to_table_sensitive(GtkWidget *list, guint *row, const gchar *title, const gchar *value, gboolean sensitive)
{
GtkWidget *label;
gchar *indent;
}
static GtkWidget *
-add_string_to_table(GtkWidget *list, guint *row, gchar *title, gchar *value)
+add_string_to_table(GtkWidget *list, guint *row, const gchar *title, const gchar *value)
{
return add_string_to_table_sensitive(list, row, title, value, TRUE);
}
char *pf_dir_path;
char *f_path;
int f_save_errno;
- char *filter_type;
+ const char *filter_type;
/* Create the directory that holds personal configuration files,
if necessary. */
* created.
*/
typedef struct {
- gchar *title; /**< title of dialog box */
+ const gchar *title; /**< title of dialog box */
gboolean wants_apply_button; /**< dialog should have an Apply button */
gboolean activate_on_ok; /**< if parent text widget should be
activated on "Ok" or "Apply" */
/* this function jumps to the next packet matching the filter */
void
-find_previous_next_frame_with_filter(char *filter, gboolean backwards)
+find_previous_next_frame_with_filter(const char *filter, gboolean backwards)
{
dfilter_t *sfcode;
gboolean sbackwards_saved;
* @param filter the filter string
* @param backwards TRUE, if searching should be done backwards
*/
-extern void find_previous_next_frame_with_filter(char *filter, gboolean backwards);
+extern void find_previous_next_frame_with_filter(const char *filter, gboolean backwards);
#endif /* find_dlg.h */
{
graph_analysis_item_t *gai;
/* copied from packet-tcp */
- gchar *fstr[] = {"FIN", "SYN", "RST", "PSH", "ACK", "URG", "ECN", "CWR" };
+ const gchar *fstr[] = {"FIN", "SYN", "RST", "PSH", "ACK", "URG", "ECN", "CWR" };
guint i, bpos;
guint fpos = 0;
gchar flags[64] = "<None>";
/* init function for tap */
static void
-flow_graph_init_tap(char *dummy _U_)
+flow_graph_init_tap(const char *dummy _U_)
{
/* initialize graph items store */
static void
gsm_a_stat_gtk_win_create(
gsm_a_stat_dlg_t *dlg_p,
- char *title)
+ const char *title)
{
#define INIT_TABLE_NUM_COLUMNS 3
- char *default_titles[] = { "IEI", "Message Name", "Count" };
+ const char *default_titles[] = { "IEI", "Message Name", "Count" };
int i;
column_arrows *col_arrows;
GtkWidget *column_lb;
GtkWidget *w _U_,
gpointer d _U_,
gsm_a_stat_dlg_t *dlg_dtap_p,
- char *title,
+ const char *title,
const value_string *dtap_msg_strings)
{
int i;
typedef struct _my_columns_t {
guint32 value;
- gchar *strptr;
+ const gchar *strptr;
GtkJustification just;
} my_columns_t;
static void
gsm_map_stat_gtk_win_create(
gsm_map_stat_dlg_t *dlg_p,
- char *title)
+ const char *title)
{
int i;
column_arrows *col_arrows;
/* init a main windowfor stats, set title and display used filter in window */
void
-init_main_stat_window(GtkWidget *window, GtkWidget *mainbox, char *title, char *filter)
+init_main_stat_window(GtkWidget *window, GtkWidget *mainbox, const char *title, const char *filter)
{
GtkWidget *main_label;
GtkWidget *filter_label;
/* create a table, using a scrollable gtkclist */
GtkCList *
-create_stat_table(GtkWidget *scrolled_window, GtkWidget *vbox, int columns, char *titles[])
+create_stat_table(GtkWidget *scrolled_window, GtkWidget *vbox, int columns, const char *titles[])
{
GtkCList *table;
int i;
* @param title the title for the window
* @param filter the filter string
*/
-extern void init_main_stat_window(GtkWidget *window, GtkWidget *mainbox, char *title, char *filter);
+extern void init_main_stat_window(GtkWidget *window, GtkWidget *mainbox, const char *title, const char *filter);
/** Create a stats table, using a scrollable gtkclist.
*
* @param columns number of columns
* @param titles
*/
-extern GtkCList *create_stat_table(GtkWidget *scrolled_window, GtkWidget *vbox, int columns, char *titles[]);
+extern GtkCList *create_stat_table(GtkWidget *scrolled_window, GtkWidget *vbox, int columns, const char *titles[]);
#endif
}
-static gchar *titles[]={"Message Type or Reason",
+static const gchar *titles[]={"Message Type or Reason",
"Count" };
static void
}
-static gchar *titles[]={"RAS-Type",
+static const gchar *titles[]={"RAS-Type",
"Measurements",
"Min RTT",
"Max RTT",
/*
* Open the help dialog and show a specific help page.
*/
-static void help_topic(gchar *topic) {
+static void help_topic(const gchar *topic) {
gchar *page_topic;
GtkWidget *help_nb;
GSList *help_page_ent;
static void
-gtk_eth_hostlist_init(char *optarg)
+gtk_eth_hostlist_init(const char *optarg)
{
char *filter=NULL;
of protocols, either ethernet, tokenring, fddi etc so we must be more
specific there thats why we need specific_addr_type
*/
-static char *
+static const char *
hostlist_get_filter_name(address *addr, int specific_addr_type, int port_type, int name_type)
{
switch(name_type){
static gboolean
-init_hostlist_table_page(hostlist_table *hosttable, GtkWidget *vbox, gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func)
+init_hostlist_table_page(hostlist_table *hosttable, GtkWidget *vbox, gboolean hide_ports, const char *table_name, const char *tap_name, const char *filter, tap_packet_cb packet_func)
{
int i;
column_arrows *col_arrows;
/* if this was a new talker we have to create a clist row for it */
if(new_talker){
- char *entries[NUM_COLS];
+ const char *entries[NUM_COLS];
char frames[16],bytes[16],txframes[16],txbytes[16],rxframes[16],rxbytes[16];
/* these values will be filled by call to draw_hostlist_table_addresses() below */
GtkWidget *scrolled_window; /**< the scrolled window */
GtkCList *table; /**< the GTK table */
guint32 num_columns; /**< number of columns in the above table */
- char *default_titles[8]; /**< Column headers */
+ const char *default_titles[8]; /**< Column headers */
GtkWidget *menu; /**< context menu */
gboolean has_ports; /**< table has ports */
guint32 num_hosts; /**< number of hosts (0 or 1) */
* @param filter the optional filter name or NULL
* @param packet_func the function to be called for each incoming packet
*/
-extern void init_hostlist_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func);
+extern void init_hostlist_table(gboolean hide_ports, const char *table_name, const char *tap_name, const char *filter, tap_packet_cb packet_func);
/** Callback for "Endpoints" statistics item.
*
"Hint 2: If you want to add a new protocol page, you should use the ProtocolTemplate,\n"
"which will save you a lot of editing and will give a consistent look over the pages.",
proto_abbrev, proto_abbrev);
- simple_dialog_set_cb(dialog, selected_ptree_info_answered_cb, (gpointer) proto_abbrev);
+ simple_dialog_set_cb(dialog, selected_ptree_info_answered_cb, proto_abbrev);
}
}
*/
void
register_tap_menu_item(
- char *name,
+ const char *name,
REGISTER_TAP_GROUP_E group,
GtkItemFactoryCallback callback,
gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *),
gpointer callback_data)
{
/*static const char toolspath[] = "/Statistics/";*/
- char *toolspath;
+ const char *toolspath;
char *p;
char *menupath;
size_t menupathlen;
}
static void
-set_menu_object_data_meat(GtkItemFactory *ifactory, gchar *path, gchar *key, gpointer data)
+set_menu_object_data_meat(GtkItemFactory *ifactory, const gchar *path, const gchar *key, gpointer data)
{
GtkWidget *menu = NULL;
}
void
-set_menu_object_data (gchar *path, gchar *key, gpointer data) {
+set_menu_object_data (const gchar *path, const gchar *key, gpointer data) {
GSList *menu_list = popup_menu_list;
gchar *shortpath = strrchr(path, '/');
* @param key the key to set
* @param data the data to set
*/
-extern void set_menu_object_data(gchar *path, gchar *key, gpointer data);
+extern void set_menu_object_data(const gchar *path, const gchar *key, gpointer data);
/** The popup menu handler.
*
win_style = gtk_widget_get_style(top_level);
ascend_pm = gdk_pixmap_create_from_xpm_d(top_level->window, &ascend_bm,
&win_style->bg[GTK_STATE_NORMAL],
- (gchar **)clist_ascend_xpm);
+ clist_ascend_xpm);
descend_pm = gdk_pixmap_create_from_xpm_d(top_level->window, &descend_bm,
&win_style->bg[GTK_STATE_NORMAL],
- (gchar **)clist_descend_xpm);
+ clist_descend_xpm);
col_arrows = (column_arrows *) g_malloc(sizeof(column_arrows) *
cfile.cinfo.num_cols);
{
gint row;
- row = eth_clist_append(ETH_CLIST(packet_list), (gchar **)text);
+ row = eth_clist_append(ETH_CLIST(packet_list), text);
eth_clist_set_row_data(ETH_CLIST(packet_list), row, data);
return row;
}
{
plugin *pt_plug;
GString *type;
- char *sep;
+ const char *sep;
pt_plug = plugin_list;
while (pt_plug)
{
GtkWidget *scrolledwindow;
GtkWidget *plugins_list;
- gchar *titles[] = {"Name", "Version", "Type"};
+ const gchar *titles[] = {"Name", "Version", "Type"};
scrolledwindow = scrolled_window_new(NULL, NULL);
*/
static GtkWidget *
-open_print_dialog(char *title, output_action_e action, print_args_t *args);
+open_print_dialog(const char *title, output_action_e action, print_args_t *args);
static void print_cmd_toggle_dest(GtkWidget *widget, gpointer data);
static void print_cmd_toggle_detail(GtkWidget *widget, gpointer data);
static void print_ok_cb(GtkWidget *ok_bt, gpointer parent_w);
/* Open the print dialog */
static GtkWidget *
-open_print_dialog(char *title, output_action_e action, print_args_t *args)
+open_print_dialog(const char *title, output_action_e action, print_args_t *args)
{
#if GTK_MAJOR_VERSION < 2
GtkAccelGroup *accel_group;
GtkWidget *main_vb, *bbox, *proto_list, *label, *proto_sw, *proto_frame,
*proto_vb, *button;
- gchar *titles[] = { "Status", "Protocol", "Description" };
+ const gchar *titles[] = { "Status", "Protocol", "Description" };
#if GTK_MAJOR_VERSION < 2
gint width;
#else
#else
GtkTextBuffer *buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(bv));
GtkTextIter iter;
- char *revstyle;
- gchar *convline;
+ const char *revstyle;
+ const gchar *convline;
gsize newsize;
GtkTextMark *mark = NULL;
#endif
gboolean is_leaf;
draw_info_t child_di;
double seconds;
- gchar *text[NUM_STAT_COLUMNS];
+ const gchar *text[NUM_STAT_COLUMNS];
#if GTK_MAJOR_VERSION < 2
GtkCTree *tree = di->tree;
GtkCTreeNode *parent = di->parent;
seconds = ps->last_time - ps->first_time;
- text[0] = (gchar *) stats->hfinfo->name;
+ text[0] = stats->hfinfo->name;
text[1] = g_strdup_printf("%6.2f%%",
PCT(stats->num_pkts_total, ps->tot_packets));
text[2] = g_strdup_printf("%u", stats->num_pkts_total);
recent_settings_t recent;
-static char *ts_type_text[] =
+static const char *ts_type_text[] =
{ "RELATIVE", "ABSOLUTE", "ABSOLUTE_WITH_DATE", "DELTA", NULL };
/* Takes an string and a pointer to an array of strings, and a default int value.
* default value that was passed as the third argument is returned.
*/
static int
-find_index_from_string_array(char *needle, char **haystack, int default_value)
+find_index_from_string_array(const char *needle, const char **haystack, int default_value)
{
int i = 0;
GtkWidget *bt_frame;
GtkWidget *bt_close;
- gchar *titles[NUM_COLS] = {"Framenumber","Chunk Types", "Info"};
+ const gchar *titles[NUM_COLS] = {"Framenumber","Chunk Types", "Info"};
column_arrows *col_arrows;
GtkStyle *win_style;
GtkWidget *column_lb;
typedef struct _sctp_error_info {
guint32 frame_number;
gchar chunk_info[200];
- gchar *info_text;
+ const gchar *info_text;
} sctp_error_info_t;
GdkPixmap *ascend_pm, *descend_pm;
GtkStyle *win_style;
GtkWidget *column_lb;
- char *default_titles[] = { "Index", "Procedure", "Calls", "Min SRT", "Max SRT", "Avg SRT" };
+ const char *default_titles[] = { "Index", "Procedure", "Calls", "Min SRT", "Max SRT", "Avg SRT" };
if(filter_string){
* @param callback_data data for callback function
*/
extern void register_tap_menu_item(
- char *name,
+ const char *name,
REGISTER_TAP_GROUP_E group,
GtkItemFactoryCallback callback,
gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *),
/* create a simple list widget */
GtkWidget *
-simple_list_new(gint cols, gchar **titles) {
+simple_list_new(gint cols, const gchar **titles) {
GtkWidget *plugins_list;
#if GTK_MAJOR_VERSION >= 2
int i;
* (Or ignore it if unspecified).
*/
gchar *
-create_user_window_title(gchar *caption)
+create_user_window_title(const gchar *caption)
{
/* fail-safe */
if (caption == NULL)
* @param titles the titles of all columns
* @return the new simple list widget
*/
-extern GtkWidget *simple_list_new(gint cols, gchar **titles);
+extern GtkWidget *simple_list_new(gint cols, const gchar **titles);
/** Append a row to the simple list.
*
* @param list the list from simple_list_new()
* @param caption string you want included in title (appended to user-defined string)
* @return a newly created title string including user-defined preference (if specified)
*/
-extern gchar *create_user_window_title(gchar *caption);
+extern gchar *create_user_window_title(const gchar *caption);
#endif /* __GTKGUIUI_UTIL_H__ */
#include "alert_box.h"
#include "simple_dialog.h"
-char *voip_call_state_name[7]={
+const char *voip_call_state_name[7]={
"CALL SETUP",
"RINGING",
"IN CALL",
};
/* defines whether we can consider the call active */
-char *voip_protocol_name[6]={
+const char *voip_protocol_name[6]={
"SIP",
"ISUP",
"H323",
};
typedef struct {
- gchar *frame_label;
- gchar *comment;
+ const gchar *frame_label;
+ const gchar *comment;
} graph_str;
#define H245_MAX 6
This function will look for a signal/event in the SignalReq/ObsEvent string
and return true if it is found
*/
-gboolean isSignal(gchar *signal, gchar *signalStr)
+gboolean isSignal(const gchar *signal, const gchar *signalStr)
{
gint i;
gchar **resultArray;
VOIP_UNKNOWN
} voip_call_state;
-extern char *voip_call_state_name[7];
+extern const char *voip_call_state_name[7];
typedef enum _voip_call_active_state {
VOIP_ACTIVE,
VOIP_AC_CAS
} voip_protocol;
-extern char *voip_protocol_name[6];
+extern const char *voip_protocol_name[6];
/* defines specific SIP data */
/* XPM */
-static char *dn_arrow[] = {
+static const char *dn_arrow[] = {
/* width height num_colors chars_per_pixel */
" 11 12 2 1",
/* colors */
/* XPM */
-static char * eexcl3d64_xpm[] = {
+static const char * eexcl3d64_xpm[] = {
"64 64 1305 2",
" c None",
". c #ACAFAC",
/* XPM */
-static char * eicon3d16_xpm[] = {
+static const char * eicon3d16_xpm[] = {
"16 16 195 2",
" c None",
". c #C6CAC6",
/* XPM */
-static char * eicon3d32_xpm[] = {
+static const char * eicon3d32_xpm[] = {
"32 32 599 2",
" c None",
". c #ACB0AC",
/* XPM */
-static char * eicon3d48_xpm[] = {
+static const char * eicon3d48_xpm[] = {
"48 48 1034 2",
" c None",
". c #B2B5B2",
/* XPM */
-static char *icon_ethereal_xpm[] = {
+static const char *icon_ethereal_xpm[] = {
/* width height num_colors chars_per_pixel */
" 66 63 10 1",
/* colors */
/* XPM */
-static char * icon_excl_xpm[] = {
+static const char * icon_excl_xpm[] = {
"64 64 21 1",
" c None",
". c #FFFFFF",
/* XPM */
-static char * stock_dialog_error_48_xpm[] = {
+static const char * stock_dialog_error_48_xpm[] = {
"48 48 474 2",
" c None",
". c #8B5447",
/* XPM */
-static char * stock_dialog_info_48_xpm[] = {
+static const char * stock_dialog_info_48_xpm[] = {
"48 48 590 2",
" c None",
". c #9A9AA0",
/* XPM */
-static char * stock_dialog_question_48_xpm[] = {
+static const char * stock_dialog_question_48_xpm[] = {
"48 48 481 2",
" c None",
". c #572B20",
/* XPM */
-static char * stock_dialog_warning_48_xpm[] = {
+static const char * stock_dialog_warning_48_xpm[] = {
"48 48 225 2",
" c None",
". c #000000",
/* XPM */
-static char * autoscroll_24_xpm[] = {
+static const char * autoscroll_24_xpm[] = {
"24 24 71 1",
" c None",
". c #000000",
/* XPM */
-static char * capture_filter_24_xpm[] = {
+static const char * capture_filter_24_xpm[] = {
"24 24 305 2",
" c None",
". c #000000",
/* XPM */
-static char * capture_interfaces_24_xpm[] = {
+static const char * capture_interfaces_24_xpm[] = {
"24 24 219 2",
" c None",
". c #000000",
/* XPM */
-static char * capture_options_24_xpm[] = {
+static const char * capture_options_24_xpm[] = {
"24 24 261 2",
" c None",
". c #000000",
/* XPM */
-static char * capture_restart_24_xpm[] = {
+static const char * capture_restart_24_xpm[] = {
"24 24 270 2",
" c None",
". c #000000",
/* XPM */
-static char * capture_start_24_xpm[] = {
+static const char * capture_start_24_xpm[] = {
"24 24 241 2",
" c None",
". c #000000",
/* XPM */
-static char * capture_stop_24_xpm[] = {
+static const char * capture_stop_24_xpm[] = {
"24 24 337 2",
" c None",
". c #000000",
/* XPM */
-static char * checkbox_16_xpm[] = {
+static const char * checkbox_16_xpm[] = {
"16 16 25 1",
" c None",
". c #9D9D9D",
/* XPM */
-static char * colorize_24_xpm[] = {
+static const char * colorize_24_xpm[] = {
"24 24 57 1",
" c None",
". c #000000",
/* XPM */
-static char * conversations_16_xpm[] = {
+static const char * conversations_16_xpm[] = {
"16 16 51 1",
" c None",
". c #191918",
/* XPM */
-static char * decode_as_16_xpm[] = {
+static const char * decode_as_16_xpm[] = {
"16 16 6 1",
" c None",
". c #000000",
/* XPM */
-static char * display_filter_24_xpm[] = {
+static const char * display_filter_24_xpm[] = {
"24 24 110 2",
" c None",
". c #000000",
/* XPM */
-static char * endpoints_16_xpm[] = {
+static const char * endpoints_16_xpm[] = {
"16 16 49 1",
" c None",
". c #79797C",
/* XPM */
-static char * file_set_list_16_xpm[] = {
+static const char * file_set_list_16_xpm[] = {
"16 16 37 1",
" c None",
". c #000000",
/* XPM */
-static char * file_set_next_16_xpm[] = {
+static const char * file_set_next_16_xpm[] = {
"16 16 42 1",
" c None",
". c #000000",
/* XPM */
-static char * file_set_previous_16_xpm[] = {
+static const char * file_set_previous_16_xpm[] = {
"16 16 42 1",
" c None",
". c #000000",
/* XPM */
-static char * graphs_16_xpm[] = {
+static const char * graphs_16_xpm[] = {
"16 16 4 1",
" c None",
". c #000000",
/* XPM */
-static char * internet_24_xpm[] = {
+static const char * internet_24_xpm[] = {
"24 24 310 2",
" c None",
". c #2D373E",
/* XPM */
-static char * resize_columns_24_xpm[] = {
+static const char * resize_columns_24_xpm[] = {
"24 24 24 1",
" c None",
". c #000000",
/* XPM */
-static char * stock_add_24_xpm[] = {
+static const char * stock_add_24_xpm[] = {
"24 24 24 1",
" c None",
". c #000000",
/* XPM */
-static char * stock_bottom_24_xpm[] = {
+static const char * stock_bottom_24_xpm[] = {
"24 24 49 1",
" c None",
". c #000000",
/* XPM */
-static char * stock_clear_24_xpm[] = {
+static const char * stock_clear_24_xpm[] = {
"24 24 56 1",
" c None",
". c #000000",
/* XPM */
-static char * stock_close_24_xpm[] = {
+static const char * stock_close_24_xpm[] = {
"24 24 2 1",
" c None",
". c #000000",
/* XPM */
-static char * stock_colorselector_24_xpm[] = {
+static const char * stock_colorselector_24_xpm[] = {
"24 24 223 2",
" c None",
". c #000000",
/* XPM */
-static char * stock_help_24_xpm[] = {
+static const char * stock_help_24_xpm[] = {
"24 24 244 2",
" c None",
". c #000000",
/* XPM */
-static char * stock_jump_to_24_xpm[] = {
+static const char * stock_jump_to_24_xpm[] = {
"24 24 144 2",
" c None",
". c #000000",
/* XPM */
-static char * stock_left_arrow_24_xpm[] = {
+static const char * stock_left_arrow_24_xpm[] = {
"24 24 43 1",
" c None",
". c #000000",
/* XPM */
-static char * stock_ok_20_xpm[] = {
+static const char * stock_ok_20_xpm[] = {
"20 20 47 1",
" c None",
". c #10120F",
/* XPM */
-static char * stock_open_24_xpm[] = {
+static const char * stock_open_24_xpm[] = {
"24 24 173 2",
" c None",
". c #000000",
/* XPM */
-static char * stock_preferences_24_xpm[] = {
+static const char * stock_preferences_24_xpm[] = {
"24 24 87 1",
" c None",
". c #000000",
/* XPM */
-static char * stock_print_24_xpm[] = {
+static const char * stock_print_24_xpm[] = {
"24 24 175 2",
" c None",
". c #000000",
/* XPM */
-static char * stock_properties_24_xpm[] = {
+static const char * stock_properties_24_xpm[] = {
"24 24 185 2",
" c None",
". c #000000",
/* XPM */
-static char * stock_refresh_24_xpm[] = {
+static const char * stock_refresh_24_xpm[] = {
"24 24 126 2",
" c None",
". c #000000",
/* XPM */
-static char * stock_right_arrow_24_xpm[] = {
+static const char * stock_right_arrow_24_xpm[] = {
"24 24 41 1",
" c None",
". c #000000",
/* XPM */
-static char * stock_save_24_xpm[] = {
+static const char * stock_save_24_xpm[] = {
"24 24 220 2",
" c None",
". c #000000",
/* XPM */
-static char * stock_save_as_24_xpm[] = {
+static const char * stock_save_as_24_xpm[] = {
"24 24 262 2",
" c None",
". c #000000",
/* XPM */
-static char * stock_search_24_xpm[] = {
+static const char * stock_search_24_xpm[] = {
"24 24 207 2",
" c None",
". c #000000",
/* XPM */
-static char * stock_stop_24_xpm[] = {
+static const char * stock_stop_24_xpm[] = {
"24 24 258 2",
" c None",
". c #010000",
/* XPM */
-static char * stock_top_24_xpm[] = {
+static const char * stock_top_24_xpm[] = {
"24 24 51 1",
" c None",
". c #000000",
/* XPM */
-static char * stock_zoom_1_24_xpm[] = {
+static const char * stock_zoom_1_24_xpm[] = {
"24 24 136 2",
" c None",
". c #343434",
/* XPM */
-static char * stock_zoom_in_24_xpm[] = {
+static const char * stock_zoom_in_24_xpm[] = {
"24 24 132 2",
" c None",
". c #343434",
/* XPM */
-static char * stock_zoom_out_24_xpm[] = {
+static const char * stock_zoom_out_24_xpm[] = {
"24 24 131 2",
" c None",
". c #343434",
/* XPM */
-static char * telephony_16_xpm[] = {
+static const char * telephony_16_xpm[] = {
"16 16 87 1",
" c None",
". c #000000",
/* XPM */
-static char * time_24_xpm[] = {
+static const char * time_24_xpm[] = {
"24 24 92 2",
" c None",
". c #000000",
/* XPM */
-static char * web_support_24_xpm[] = {
+static const char * web_support_24_xpm[] = {
"24 24 383 2",
" c None",
". c #010101",
/* XPM */
-static char * wiki_24_xpm[] = {
+static const char * wiki_24_xpm[] = {
"24 24 305 2",
" c None",
". c #2D373E",
/* XPM */
-static char *up_arrow[] = {
+static const char *up_arrow[] = {
/* width height num_colors chars_per_pixel */
" 11 12 2 1",
/* colors */
/* ip host stats_tree -- basic test */
static int st_node_ip = -1;
-static gchar* st_str_ip = "IP address";
+static const gchar* st_str_ip = "IP address";
static void ip_hosts_stats_tree_init(stats_tree* st) {
st_node_ip = stats_tree_create_node(st, st_str_ip, 0, TRUE);
/* packet type stats_tree -- test pivot node */
static int st_node_ptype = -1;
-static gchar* st_str_ptype = "Port Type";
+static const gchar* st_str_ptype = "Port Type";
static void ptype_stats_tree_init(stats_tree* st) {
st_node_ptype = stats_tree_create_pivot(st, st_str_ptype, 0);
/* packet length stats_tree -- test range node */
static int st_node_plen = -1;
-static gchar* st_str_plen = "Packet Length";
+static const gchar* st_str_plen = "Packet Length";
static void plen_stats_tree_init(stats_tree* st) {
st_node_plen = stats_tree_create_range_node(st, st_str_plen, 0, "0-19","20-39","40-79","80-159","160-319","320-639","640-1279","1280-",NULL);
*/
static int st_node_dsts = -1;
-static gchar* st_str_dsts = "Destinations";
+static const gchar* st_str_dsts = "Destinations";
static void dsts_stats_tree_init(stats_tree* st) {
st_node_dsts = stats_tree_create_node(st, st_str_dsts, 0, TRUE);
*/
typedef struct _tap_dfilter_dlg {
- char *win_title; /* title */
- char *init_string; /* the string to call the tap without a filter via "-z" option */
+ const char *win_title; /* title */
+ const char *init_string; /* the string to call the tap without a filter via "-z" option */
void (* tap_init_cb)(char *); /* callback to init function of the tap */
- gint index; /* initiate this value always with "-1" */
+ gint index; /* initiate this value always with "-1" */
} tap_dfilter_dlg;
/* This will update the titles of the dialog windows when we load a new capture file. */