Add 'extern "C"' wrappers and #include guards to various header files.
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 29 Dec 2011 00:08:47 +0000 (00:08 +0000)
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 29 Dec 2011 00:08:47 +0000 (00:08 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40321 f5534014-38df-0310-8fa8-9805f1628bb7

28 files changed:
airpcap_loader.h
capture-pcap-util.h
capture-wpcap.h
capture.h
capture_ifinfo.h
capture_info.h
capture_opts.h
capture_ui_utils.h
capture_wpcap_packet.h
cfile.h
color.h
color_filters.h
disabled_protos.h
epan/base64.h
epan/epan.h
epan/epan_dissect.h
epan/ex-opt.h
epan/prefs.h
epan/strutil.h
epan/timestamp.h
epan/tvbuff.h
file.h
filters.h
globals.h
gtk/recent.h
main_statusbar.h
progress_dlg.h
register.h

index 765fde330ef485c7815749b00eab353b5db9c808..823b658d2491432d0afd95495561d2be06659fdc 100644 (file)
 
 #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__ */
index fa16c5c74e98db7e06d4952409c845017a58290a..781979e05edf052c82f7a892eb200d079906c650 100644 (file)
 
 #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
index c3b45ea2309a885a0bc926cda8f7c3eb3dc071c6..cfe23828d787189c168c578963eeab24c2846b2a 100644 (file)
 #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 */
index a09829d58ee37e258cebc782fe08085fa20a7762..d4cc76986b63eede2a5c57bc7398780dbc76f0a6 100644 (file)
--- a/capture.h
+++ b/capture.h
 
 #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 */
index ea18085bb71c5d3aa0e69ef7fbd5fa925443bb24..e96dfb6cfb4bdabbcc6cc4321196fb95aeeffa21 100644 (file)
 #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__ */
index 29df7901789534228186e1337c222dd6f8093e97..0fd08cdd7b302227f7ddc8bc3fded30c1a02561c 100644 (file)
@@ -24,7 +24,7 @@
 
 
 /** @file
- *  
+ *
  * capture info functions
  *
  */
 
 #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 */
index 7778bf49af921f97c230964a2896e2b673e78a68..baa40099a704a07f06405065f5436a59d82d8f60 100644 (file)
 
 #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 */
index a7531b5b60772785f186ee28fbba0a75fc7c5df1..f2c6f4c117a1f2c007dc34873339244c83ed398e 100644 (file)
 
 #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__ */
index 4aeb756c96ef3e499cfa7a3299944b6482ee26a2..044547bfe2838b1cbd1ea1db7906f88ea25e191d 100644 (file)
@@ -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 */
diff --git a/cfile.h b/cfile.h
index 163f4ca426d6376a51faab0e2f1ba865642689d5..730da187c78064797a9dccebbbac4264b81ba7e7 100644 (file)
--- a/cfile.h
+++ b/cfile.h
 
 #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 */
diff --git a/color.h b/color.h
index 622b6ab7f1a28d42b11bf8cdf7dbf7107891d63b..7a55cf66edf53faf0a10dd381e127d813913c74f 100644 (file)
--- a/color.h
+++ b/color.h
 #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__ */
index 5de7c23cf073de8eaf8fec0cf65d91eeb9726e52..5d5c1ad1cff213523f913389ffc76a340e940368 100644 (file)
 #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
index 6bee1e6f7176853a7b95656a0f04f1e970bcc5a0..3314cceb298c330ac977d0883f14d0ba1eb5f5d1 100644 (file)
  * 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 */
index ef68eb4f630a323c2b7df31e9d137c7412b49a77..8b18616efbb6121492a867a192af821d9eafc182 100644 (file)
 #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);
 
index 0b98c584b4efe3979dcd594ca6438f81c22e6b3f..834e990df3d880a0bd57ac842ad3eb573da8b89b 100644 (file)
 #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 */
index 5b0f2d9345621122594bc8610183c50ec097a897..96ea52324fb8e9f0775517d0c0cd31766df5f9d0 100644 (file)
 #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 */
index 0cfbc3aa1f571c7a115a329c1d840eef11b97cef..2001b2829d20aca842f1b310a8ae25cab589599c 100644 (file)
  *
  * 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 */
index cec0a4af46054878c2f98080d8768a80b098695f..eae802e3d79846720c45ef1a77b16322e6dc2c72 100644 (file)
 #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 */
index 38da893a25bce0b9efa86b51a0ad963ef3e7559b..8c1dbcbc903b5cb0153ea30de1f5e887b4f7e4fd 100644 (file)
 #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__ */
index 9282ac5216f86f6fe803101a57219c4953eca0e5..da41c947a235b6d1957fe3b20119a3cccb6e1dea 100644 (file)
 #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 */
index 61b7b12c30013592f724cf28b40d553652a95815..3f9124e5a3b9c489cb30b4d6f5d26e51663d0bd3 100644 (file)
 #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__ */
diff --git a/file.h b/file.h
index 842e48608aea9c5bcdebfa918bb87178b55e1fc8..facf0f1d40d76796108c9f959c836a9317769722 100644 (file)
--- a/file.h
+++ b/file.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 */
index 78a59a483fe71742e3d6126f062449058db70aab..bfb3f93c2b832adf6327f3a255f9eada95e55067 100644 (file)
--- a/filters.h
+++ b/filters.h
  * 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 */
index 7e3e526ecd9c91f693056725507c29174eedce4e..5c1e0675cba224caeabf8c115798cdae0397b1d3 100644 (file)
--- a/globals.h
+++ b/globals.h
 #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
index 788a6ac8da7bd2d4228e320b011ed58e82cba4dd..d582573bbfb9881c24271580e87782c4d4fceced 100644 (file)
 #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 */
index a15aa4e158dffd4dfaa304faff97dd8b2c9a877d..9647a2ed62dff60b8f4bbe5a5dd0a6d037e0a3f3 100644 (file)
@@ -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__ */
index 0f404c71d702be819158aeb819f47b7044bb61e8..638c8a3cca5959626393b60de4de4ae28ce5bb77 100644 (file)
 #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__ */
index 91fd0f1ffc201984fba36f59d8977fdf8b82bb34..25ba0a657cd1aed95cd464490ac0fa05eed57db7 100644 (file)
 #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__ */