Commit 6b178bd4 authored by Gerald Combs's avatar Gerald Combs

Add 'extern "C"' wrappers and #include guards to various header files.

svn path=/trunk/; revision=40321
parent cb9725ce
......@@ -30,6 +30,10 @@
#include <epan/crypt/airpdcap_user.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Error values from "get_airpcap_interface_list()". */
#define CANT_GET_AIRPCAP_INTERFACE_LIST 0 /* error getting list */
#define NO_AIRPCAP_INTERFACES_FOUND 1 /* list is empty */
......@@ -551,4 +555,8 @@ get_compiled_airpcap_version(GString *str);
void
get_runtime_airpcap_version(GString *str);
#ifdef __cplusplus
}
#endif
#endif /* __AIRPCAP_LOADER_H__ */
......@@ -27,12 +27,12 @@
#ifdef HAVE_LIBPCAP
#include <pcap.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <pcap.h>
/*
* A snapshot length of 0 is useless - and libpcap/WinPcap don't guarantee
* that a snapshot length of 0 will work, and, on some platforms, it won't
......
......@@ -25,10 +25,18 @@
#ifndef CAPTURE_WPCAP_H
#define CAPTURE_WPCAP_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
extern gboolean has_wpcap;
void
load_wpcap(void);
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* CAPTURE_WPCAP_H */
......@@ -33,6 +33,10 @@
#include "capture_opts.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef enum {
capture_cb_capture_prepared,
capture_cb_capture_update_started,
......@@ -123,4 +127,8 @@ extern gboolean capture_stats(if_stat_cache_t *sc, char *ifname, struct pcap_sta
*/
void capture_stat_stop(if_stat_cache_t *sc);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* capture.h */
......@@ -25,6 +25,10 @@
#ifndef __CAPTURE_IFINFO_H__
#define __CAPTURE_IFINFO_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
* The list of interfaces returned by "get_interface_list()" is
* a list of these structures.
......@@ -93,4 +97,8 @@ void free_if_capabilities(if_capabilities_t *caps);
void add_interface_to_remote_list(if_info_t *if_info);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __CAPTURE_IFINFO_H__ */
......@@ -24,7 +24,7 @@
/** @file
*
*
* capture info functions
*
*/
......@@ -34,6 +34,10 @@
#include "capture_opts.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* open the info - init values (wtap, counts), create dialog */
extern void capture_info_open(capture_options *capture_opts);
......@@ -73,5 +77,8 @@ capture_info *cinfo);
extern void capture_info_ui_destroy(
capture_info *cinfo);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* capture_info.h */
......@@ -38,6 +38,10 @@
#include "capture_ifinfo.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* Current state of capture engine. XXX - differentiate states */
typedef enum {
CAPTURE_STOPPED, /**< stopped */
......@@ -190,4 +194,8 @@ capture_opts_trim_ring_num_files(capture_options *capture_opts);
extern gboolean
capture_opts_trim_iface(capture_options *capture_opts, const char *capture_device);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* capture_opts.h */
......@@ -27,6 +27,10 @@
#include "capture_opts.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/** @file
* GList of available capture interfaces.
*/
......@@ -99,4 +103,8 @@ char *build_capture_combo_name(GList *if_list, gchar *if_name);
*/
const char *get_iface_description_for_interface(capture_options *capture_opts, guint i);
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __CAPTURE_UI_UTILS_H__ */
......@@ -25,6 +25,9 @@
#ifndef CAPTURE_WPCAP_PACKET_H
#define CAPTURE_WPCAP_PACKET_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
extern void wpcap_packet_load(void);
......@@ -43,5 +46,8 @@ extern int wpcap_packet_request_uint(void *a, ULONG Oid, UINT *value);
extern int wpcap_packet_request_ulong(void *a, ULONG Oid, ULONG *value);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* CAPTURE_WPCAP_PACKET_H */
......@@ -27,6 +27,10 @@
#include "frame_data_sequence.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* Current state of file. */
typedef enum {
FILE_CLOSED, /* No file open */
......@@ -115,4 +119,8 @@ typedef struct _capture_file {
extern void cap_file_init(capture_file *cf);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* cfile.h */
......@@ -25,6 +25,10 @@
#ifndef __COLOR_H__
#define __COLOR_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
* Data structure holding RGB value for a color.
*
......@@ -52,4 +56,8 @@ typedef struct {
*/
gboolean initialize_color(color_t *color, guint16 red, guint16 green, guint16 blue);
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __COLOR_H__ */
......@@ -24,6 +24,10 @@
#ifndef __COLOR_FILTERS_H__
#define __COLOR_FILTERS_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define CONVERSATION_COLOR_PREFIX "___conversation_color_filter___"
/** @file
* Color filters.
......@@ -190,6 +194,8 @@ void color_filter_delete(color_filter_t *colorf);
*/
void color_filter_list_delete(GSList **cfl);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif
......@@ -23,6 +23,13 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef DISABLED_PROTOS_H
#define DISABLED_PROTOS_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
* Item in a list of disabled protocols.
*/
......@@ -59,3 +66,9 @@ void set_disabled_protos_list(void);
* and "*errno_return" is set to the error.
*/
void save_disabled_protos_list(char **pref_path_return, int *errno_return);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* DISABLED_PROTOS_H */
......@@ -24,11 +24,12 @@
#ifndef __BASE64_H__
#define __BASE64_H__
#include <epan/tvbuff.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <epan/tvbuff.h>
/* In-place decoding of a base64 string. */
size_t epan_base64_decode(char *s);
......
......@@ -24,6 +24,10 @@
#ifndef EPAN_H
#define EPAN_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <glib.h>
#include "frame_data.h"
#include "column_info.h"
......@@ -183,4 +187,8 @@ epan_get_compiled_version_info(GString *str);
void
epan_get_runtime_version_info(GString *str);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* EPAN_H */
......@@ -24,6 +24,10 @@
#ifndef EPAN_DISSECT_H
#define EPAN_DISSECT_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include "tvbuff.h"
#include "proto.h"
#include "packet_info.h"
......@@ -40,5 +44,8 @@ struct _epan_dissect_t {
packet_info pi;
};
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* EPAN_DISSECT_H */
......@@ -23,12 +23,16 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _EX_OPT_H
#define _EX_OPT_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* will be called by main each time a -X option is found */
extern gboolean ex_opt_add(const gchar* optarg);
......@@ -41,4 +45,8 @@ extern const gchar* ex_opt_get_nth(const gchar* key, guint index);
/* extracts the next value of a given key */
extern const gchar* ex_opt_get_next(const gchar* key);
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _EX_OPT_H */
......@@ -25,6 +25,10 @@
#ifndef __PREFS_H__
#define __PREFS_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <glib.h>
#include "color.h"
......@@ -462,4 +466,8 @@ extern gboolean prefs_is_capture_device_hidden(const char *name);
*/
extern gboolean prefs_capture_device_monitor_mode(const char *name);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* prefs.h */
......@@ -25,6 +25,10 @@
#ifndef __STRUTIL_H__
#define __STRUTIL_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* ... thus, config.h needs to be #included */
/** @file
......@@ -268,4 +272,8 @@ gchar* ws_strdup_unescape_char (const gchar *str, const gchar chr);
*/
gchar *string_replace(const gchar* str, const gchar *old_val, const gchar *new_val);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __STRUTIL_H__ */
......@@ -25,6 +25,10 @@
#ifndef __TIMESTAMP_H__
#define __TIMESTAMP_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
* Type of time-stamp shown in the summary display.
*/
......@@ -81,4 +85,8 @@ extern void timestamp_set_precision(int tsp);
extern ts_seconds_type timestamp_get_seconds_type(void);
extern void timestamp_set_seconds_type(ts_seconds_type);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* timestamp.h */
......@@ -40,6 +40,10 @@
#include <epan/guid-utils.h>
#include "exceptions.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/** @file
* "testy, virtual(-izable) buffer". They are testy in that they get mad when
* an attempt is made to access data beyond the bounds of their array. In that
......@@ -674,4 +678,8 @@ extern tvbuff_t* tvb_child_uncompress(tvbuff_t *parent, tvbuff_t *tvb, const int
/************** END OF ACCESSORS ****************/
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __TVBUFF_H__ */
......@@ -34,6 +34,9 @@
#include "cfile.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/** Return values from functions that only can succeed or fail. */
typedef enum {
......@@ -581,4 +584,8 @@ cf_merge_files(char **out_filename, int in_file_count,
void read_keytab_file(const char *);
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* file.h */
......@@ -23,6 +23,13 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef FILTERS_H
#define FILTERS_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
* Filter lists.
*/
......@@ -85,3 +92,8 @@ void save_filter_list(filter_list_type_t list_type, char **pref_path_return,
*/
void copy_filter_list(filter_list_type_t dest_type, filter_list_type_t src_type);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* FILTERS_H */
......@@ -25,13 +25,13 @@
#ifndef __GLOBALS_H__
#define __GLOBALS_H__
#include "file.h"
#include <epan/timestamp.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include "file.h"
#include <epan/timestamp.h>
extern capture_file cfile;
#ifdef __cplusplus
......
......@@ -26,6 +26,10 @@
#ifndef __RECENT_H__
#define __RECENT_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <glib.h>
/** @file
......@@ -87,7 +91,7 @@ typedef struct recent_settings_tag {
gboolean privs_warn_if_elevated;
gboolean privs_warn_if_no_npf;
GList *col_width_list; /* column widths */
gchar *gui_fileopen_remembered_dir; /* folder of last capture loaded in File Open dialog */
gchar *gui_fileopen_remembered_dir; /* folder of last capture loaded in File Open dialog */
} recent_settings_t;
/** Global recent settings. */
......@@ -146,20 +150,20 @@ extern void write_recent_geom(gpointer key, gpointer value, gpointer rf);
extern int recent_set_arg(char *prefarg);
/** Get the column width for the given column
*
*
* @param col column number
*/
extern gint recent_get_column_width(gint col);
/** Set the column width for the given column
*
*
* @param col column number
* @param width column width
*/
extern void recent_set_column_width(gint col, gint width);
/** Get the column xalign for the given column
*
*
* @param col column number
*/
extern gchar recent_get_column_xalign(gint col);
......@@ -171,4 +175,8 @@ extern gchar recent_get_column_xalign(gint col);
*/
extern void recent_set_column_xalign(gint col, gchar xalign);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* recent.h */
......@@ -24,6 +24,9 @@
#ifndef __MAIN_STATUSBAR_H__
#define __MAIN_STATUSBAR_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
void profile_bar_update(void);
void packets_bar_update(void);
......@@ -61,4 +64,8 @@ void statusbar_pop_filter_msg(void);
void statusbar_push_temporary_msg(const gchar *msg_format, ...)
G_GNUC_PRINTF(1, 2);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __MAIN_STATUSBAR_H__ */
......@@ -25,6 +25,10 @@
#ifndef __PROGRESS_DLG_H__
#define __PROGRESS_DLG_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/** @file
* Progress (modal) dialog box routines.
* @ingroup dialog_group
......@@ -56,7 +60,7 @@ progdlg_t *create_progress_dlg(const gchar *task_title, const gchar *item_title,
/**
* Create a progress dialog, but only if it's not likely to disappear
* immediately. This can be disconcerting for the user.
* immediately. This can be disconcerting for the user.
*
* @param task_title the task to do, e.g. "Loading"
* @param item_title the item to do, e.g. "capture.cap"
......@@ -91,4 +95,8 @@ void update_progress_dlg(progdlg_t *dlg, gfloat percentage, const gchar *status)
*/
void destroy_progress_dlg(progdlg_t *dlg);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __PROGRESS_DLG_H__ */
......@@ -25,6 +25,10 @@
#ifndef __REGISTER_H__
#define __REGISTER_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <glib.h>
typedef enum {
......@@ -48,4 +52,9 @@ extern void register_all_protocols(register_cb cb, gpointer client_data);
extern void register_all_protocol_handoffs(register_cb cb, gpointer client_data);
extern void register_all_tap_listeners(void);
extern gulong register_count(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __REGISTER_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment