Move still *more* headers outside of extern "C".

If a header declares a function, or anything else requiring the extern
"C" decoration, have it wrap the declaration itself; don't rely on the
header itself being included inside extern "C".
This commit is contained in:
Guy Harris 2021-03-16 13:50:13 -07:00
parent 205e77d404
commit 2820156fbd
26 changed files with 91 additions and 93 deletions

View File

@ -11,10 +11,6 @@
#ifndef __CAPCHILD_CAPTURE_SESSION_H__
#define __CAPCHILD_CAPTURE_SESSION_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifndef _WIN32
#include <sys/types.h>
#include <stdint.h>
@ -24,6 +20,12 @@ extern "C" {
#include <wsutil/processes.h>
#include "cfile.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifdef HAVE_LIBPCAP
/* Current state of capture engine. XXX - differentiate states */
typedef enum {
@ -32,7 +34,6 @@ typedef enum {
CAPTURE_RUNNING /**< capture child signalled ok, capture is running now */
} capture_state;
#include "cfile.h"
struct _info_data;
/*

View File

@ -11,10 +11,6 @@
#ifndef __CAPTURE_PCAP_UTIL_H__
#define __CAPTURE_PCAP_UTIL_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifdef HAVE_LIBPCAP
#include "wspcap.h"
@ -30,6 +26,10 @@ extern "C" {
*/
#define MIN_PACKET_SIZE 1 /* minimum amount of packet data we can read */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
GList *get_interface_list(int *err, char **err_str);
#ifdef HAVE_PCAP_REMOTE
GList *get_remote_interface_list(const char *hostname, const char *port,

View File

@ -11,12 +11,12 @@
#ifndef __WS80211_UTILS_H__
#define __WS80211_UTILS_H__
#include "ws_attributes.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include "ws_attributes.h"
enum ws80211_channel_type {
WS80211_CHAN_NO_HT,
WS80211_CHAN_HT20,

View File

@ -122,10 +122,10 @@ extern gboolean krb_decrypt;
#endif /* HAVE_KERBEROS */
#include "packet-kerberos-exp.h"
#ifdef __cplusplus
}
#endif /* __cplusplus */
#include "packet-kerberos-exp.h"
#endif /* __PACKET_KERBEROS_H */

View File

@ -10,12 +10,12 @@
#ifndef __PACKET_A21_H__
#define __PACKET_A21_H__
#include "ws_symbol_export.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include "ws_symbol_export.h"
WS_DLL_PUBLIC
void dissect_a21_ie_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree, proto_tree *tree, gint offset, guint8 message_type);

View File

@ -10,15 +10,15 @@
#ifndef __PACKET_BLUETOOTH_H__
#define __PACKET_BLUETOOTH_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <epan/wmem/wmem.h>
#include "packet-usb.h"
#include "packet-ubertooth.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define PROTO_DATA_BLUETOOTH_SERVICE_UUID 0
#define BLUETOOTH_DATA_SRC 0

View File

@ -25,9 +25,6 @@
extern "C" {
#endif /* __cplusplus */
#include "config.h"
#define DCM_VR_AE 1 /* Application Entity */
#define DCM_VR_AS 2 /* Age String */
#define DCM_VR_AT 3 /* Attribute Tag */

View File

@ -10,14 +10,14 @@
#ifndef __PACKET_QUIC_H__
#define __PACKET_QUIC_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include "ws_symbol_export.h"
#include <wsutil/wsgcrypt.h> /* needed to define HAVE_LIBGCRYPT_AEAD */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* Metadata for a STREAM frame.
* https://tools.ietf.org/html/draft-ietf-quic-transport-23#section-19.8

View File

@ -11,13 +11,13 @@
#ifndef __PACKET_SCSI_H_
#define __PACKET_SCSI_H_
#include <epan/exceptions.h>
#include <epan/srt_table.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <epan/exceptions.h>
#include <epan/srt_table.h>
/* Structure containing itl nexus data :
* The itlq nexus is a structure containing data specific
* for a initiator target lun combination.

View File

@ -10,16 +10,16 @@
#ifndef __PACKET_TCP_H__
#define __PACKET_TCP_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include "ws_symbol_export.h"
#include <epan/conversation.h>
#include <epan/wmem/wmem.h>
#include <epan/wmem/wmem_interval_tree.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* TCP flags */
#define TH_FIN 0x0001
#define TH_SYN 0x0002

View File

@ -11,14 +11,14 @@
#ifndef __PACKET_UDP_H__
#define __PACKET_UDP_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include "ws_symbol_export.h"
#include <epan/conversation.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* UDP structs and definitions */
typedef struct _e_udphdr {
guint16 uh_sport;

View File

@ -14,12 +14,12 @@
#include <glib.h>
#include "wmem_user_cb.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include "wmem_user_cb.h"
WS_DLL_LOCAL
void
wmem_call_callbacks(wmem_allocator_t *allocator, wmem_cb_event_t event);

View File

@ -11,12 +11,12 @@
#ifndef __INIT_WSLUA_H__
#define __INIT_WSLUA_H__
#include "ws_symbol_export.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include "ws_symbol_export.h"
WS_DLL_PUBLIC int wslua_count_plugins(void);
WS_DLL_PUBLIC void wslua_reload_plugins (register_cb cb, gpointer client_data);

View File

@ -12,12 +12,12 @@
#ifndef __EXPORT_OBJECT_UI_H__
#define __EXPORT_OBJECT_UI_H__
#include <epan/export_object.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <epan/export_object.h>
/* Common between protocols */
void eo_save_entry(const gchar *save_as_filename, export_object_entry_t *entry);

View File

@ -13,12 +13,12 @@
#ifndef __IO_GRAPH_ITEM_H__
#define __IO_GRAPH_ITEM_H__
#include "cfile.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include "cfile.h"
typedef enum {
IOG_ITEM_UNIT_FIRST,
IOG_ITEM_UNIT_PACKETS = IOG_ITEM_UNIT_FIRST,

View File

@ -18,12 +18,12 @@
#ifndef __MCAST_STREAM_H__
#define __MCAST_STREAM_H__
#include <epan/tap.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <epan/tap.h>
#define MAX_SPEED 200000
/* typedefs for sliding window and buffer size */

View File

@ -16,15 +16,15 @@
#include <glib.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <epan/range.h>
#include <epan/frame_data.h>
#include "cfile.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
extern guint32 curr_selected_frame;
typedef enum {

View File

@ -10,6 +10,9 @@
#ifndef __UI_PROTO_HIER_STATS_H__
#define __UI_PROTO_HIER_STATS_H__
#include <epan/proto.h>
#include "cfile.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@ -18,9 +21,6 @@ extern "C" {
* Protocol Hierarchy Statistics
*/
#include <epan/proto.h>
#include "cfile.h"
typedef struct {
header_field_info *hfinfo;
guint num_pkts_total;

View File

@ -14,14 +14,14 @@
#include <glib.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <stdio.h>
#include "epan/timestamp.h"
#include "ui/ws_ui_util.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/** @file
* Recent user interface settings.
* @ingroup main_window_group

View File

@ -16,15 +16,6 @@
#include <glib.h>
/** @file
* "RTP Streams" dialog box common routines.
* @ingroup main_ui_group
*/
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include "tap-rtp-analysis.h"
#include <stdio.h>
@ -35,6 +26,15 @@ extern "C" {
#include "ui/rtp_stream_id.h"
/** @file
* "RTP Streams" dialog box common routines.
* @ingroup main_ui_group
*/
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/** Defines an rtp stream */
typedef struct _rtpstream_info {
rtpstream_id_t id;

View File

@ -19,12 +19,12 @@
* @ingroup main_ui_group
*/
#include <epan/address.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <epan/address.h>
/* forward */
struct _rtp_info;

View File

@ -11,15 +11,15 @@
#ifndef __TAP_RLC_GRAPH_H__
#define __TAP_RLC_GRAPH_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <epan/epan.h>
#include <epan/packet.h>
#include <cfile.h>
#include <epan/dissectors/packet-rlc-lte.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
struct rlc_segment {
struct rlc_segment *next;
guint32 num; /* framenum */

View File

@ -18,12 +18,12 @@
#ifndef __TAP_RTP_COMMON_H__
#define __TAP_RTP_COMMON_H__
#include "ui/rtp_stream.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include "ui/rtp_stream.h"
/* type of error when saving voice in a file didn't succeed */
typedef enum {
TAP_RTP_NO_ERROR,

View File

@ -11,20 +11,20 @@
#ifndef __TAP_SCTP_ANALYSIS_H__
#define __TAP_SCTP_ANALYSIS_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <epan/dissectors/packet-sctp.h>
#include <epan/address.h>
#ifndef _WIN32
#ifdef _WIN32
#include <winsock2.h>
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#else
#include <winsock2.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define CHUNK_TYPE_LENGTH 1
#define CHUNK_FLAGS_LENGTH 1
#define CHUNK_LENGTH_LENGTH 2

View File

@ -13,12 +13,12 @@
#include <glib.h>
#include <epan/tap.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <epan/tap.h>
extern tap_reg_t tap_reg_listener[];
extern const gulong tap_reg_listener_count;

View File

@ -24,15 +24,6 @@
#include <glib.h>
/** @file
* "VoIP Calls" dialog box common routines.
* @ingroup main_ui_group
*/
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <stdio.h>
#include "epan/address.h"
@ -42,6 +33,15 @@ extern "C" {
#include "epan/tap-voip.h"
#include "epan/sequence_analysis.h"
/** @file
* "VoIP Calls" dialog box common routines.
* @ingroup main_ui_group
*/
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/****************************************************************************/
extern const char *voip_call_state_name[8];