Delete extra_split if we're not using it. This keeps its handle from
[metze/wireshark/wip.git] / ui / preference_utils.h
1 /* preference_utils.h
2  * Routines for handling preferences
3  *
4  * $Id$
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  */
24
25 #ifndef __PREFRENCE_UTILS_H__
26 #define __PREFRENCE_UTILS_H__
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31
32 /** @file
33  * Preference utility routines.
34  *  @ingroup prefs_group
35  */
36
37 /** "Stash" a preference.
38  * Copy a preference to its stashed value. Can be called from prefs_pref_foreach().
39  *
40  * @param pref A preference.
41  * @param unused unused
42  */
43 extern guint pref_stash(pref_t *pref, gpointer unused _U_);
44
45 /** "Untash" a preference.
46  * Set a preference to its stashed value. Can be called from prefs_pref_foreach().
47  *
48  * @param pref A preference.
49  * @param changed_p A pointer to a gboolean. Set to TRUE if the preference differs
50  * from its stashed value.
51  *
52  * @return Always returns 0.
53  */
54 extern guint pref_unstash(pref_t *pref, gpointer changed_p);
55
56 /** Clean up a stashed preference.
57  * Can be called from prefs_pref_foreach().
58  *
59  * @param pref A preference.
60  * @param unused unused
61  *
62  * @return Always returns 0.
63  */
64 extern guint pref_clean_stash(pref_t *pref, gpointer unused _U_);
65
66 /** Set a stashed preference to its default value.
67  *
68  *@param pref A preference.
69  */
70 extern void reset_stashed_pref(pref_t *pref);
71
72
73 /** If autoscroll in live captures is active or not
74  */
75 extern gboolean auto_scroll_live;
76
77 /** Fill in capture options with values from the preferences
78  */
79 extern void prefs_to_capture_opts(void);
80
81 /** Save all preferences
82  */
83 extern void prefs_main_write(void);
84
85 /** Add a custom column.
86  *
87  * @param fmt column format
88  * @param title column title
89  * @param custom_field column custom field
90  */
91 void column_prefs_add_custom(gint fmt, const gchar *title,
92                              const gchar *custom_field,
93                              gint custom_occurrence);
94
95 /** Remove a column.
96  *
97  * @param col_link Column list entry
98  */
99 void column_prefs_remove_link(GList* col_link);
100
101 /** Remove a column.
102  *
103  * @param col Column number
104  */
105 void column_prefs_remove_nth(gint col);
106
107
108 #ifdef __cplusplus
109 }
110 #endif /* __cplusplus */
111
112 #endif /* __PREFRENCE_UTILS_H__ */