Move merge.{h,c} into wiretap: these modules use wiretap to merge files.
authorJeff Morriss <jeff.morriss.ws@gmail.com>
Tue, 16 Jul 2013 02:35:33 +0000 (02:35 -0000)
committerJeff Morriss <jeff.morriss.ws@gmail.com>
Tue, 16 Jul 2013 02:35:33 +0000 (02:35 -0000)
svn path=/trunk/; revision=50656

13 files changed:
CMakeLists.txt
Makefile.common
file.c
mergecap.c
ui/gtk/capture_file_dlg.c
ui/gtk/main.c
ui/qt/QtShark.pro
ui/qt/main.cpp
ui/win32/file_dlg_win32.c
wiretap/CMakeLists.txt
wiretap/Makefile.common
wiretap/merge.c [moved from merge.c with 99% similarity]
wiretap/merge.h [moved from merge.h with 95% similarity]

index 06d5bb62905593244bf0935039755087dc994e10..29f65b6e2b076f43bfb840c0d57c383e37d578b9 100644 (file)
@@ -762,7 +762,6 @@ if( (BUILD_wireshark AND GTK_FOUND) OR (BUILD_qtshark AND QT_FOUND) )
                fileset.c
                filters.c
                iface_monitor.c
-               merge.c
                proto_hier_stats.c
                summary.c
                ws80211_utils.c
@@ -927,7 +926,6 @@ if(BUILD_mergecap)
        )
        set(mergecap_FILES
                mergecap.c
-               merge.c
                svnversion.h
                ${WTAP_PLUGIN_SOURCES}
        )
index dcd139d34af6adfa57ae496f3adc2f14b11580a1..b4dab9ae883c7bfa5acd7fe9ef95976eac3da07b 100644 (file)
@@ -97,7 +97,6 @@ WIRESHARK_COMMON_SRC =        \
        fileset.c       \
        filters.c       \
        iface_monitor.c \
-       merge.c         \
        proto_hier_stats.c      \
        summary.c       \
        ws80211_utils.c
@@ -114,7 +113,6 @@ WIRESHARK_COMMON_INCLUDES = \
        globals.h       \
        iface_monitor.h \
        log.h           \
-       merge.h         \
        proto_hier_stats.h      \
        stat_menu.h     \
        summary.h       \
@@ -145,8 +143,7 @@ text2pcap_INCLUDES = \
 
 # mergecap specifics
 mergecap_SOURCES = \
-       mergecap.c \
-       merge.c
+       mergecap.c
 
 # editcap specifics
 editcap_SOURCES = \
diff --git a/file.c b/file.c
index 6a0d2ba86de1972529e4d48027532f65071afe6f..dfb1d1b0ce441b51a8b302e387ffc07cc7dfa12b 100644 (file)
--- a/file.c
+++ b/file.c
 #include <fcntl.h>
 #endif
 
-#include <epan/epan.h>
-#include <epan/expert.h>
-#include <epan/filesystem.h>
+#include <wsutil/tempfile.h>
+#include <wsutil/file_util.h>
 
-#include "color.h"
-#include "color_filters.h"
-#include "cfile.h"
+#include <wiretap/merge.h>
+
+#include <epan/epan.h>
 #include <epan/column.h>
 #include <epan/packet.h>
 #include <epan/column-utils.h>
-#include "file.h"
-#include "fileset.h"
-#include "frame_tvbuff.h"
-#include "wsutil/tempfile.h"
-#include "merge.h"
-
+#include <epan/expert.h>
+#include <epan/filesystem.h>
 #include <epan/prefs.h>
 #include <epan/dfilter/dfilter.h>
 #include <epan/epan_dissect.h>
 #include <epan/dissectors/packet-ber.h>
 #include <epan/timestamp.h>
 #include <epan/dfilter/dfilter-macro.h>
-#include <wsutil/file_util.h>
 #include <epan/strutil.h>
 #include <epan/addr_resolv.h>
 
+#include "color.h"
+#include "color_filters.h"
+#include "cfile.h"
+#include "file.h"
+#include "fileset.h"
+#include "frame_tvbuff.h"
+
 #include "ui/alert_box.h"
 #include "ui/simple_dialog.h"
 #include "ui/main_statusbar.h"
index 35609ee07433b658c3d4036d883e5038a24c56b0..e8cae5d43fec1c81f11d0cd41f276fc336172d84 100644 (file)
 #include "wtap.h"
 
 #ifndef HAVE_GETOPT
-#include "wsutil/wsgetopt.h"
+#include <wsutil/wsgetopt.h>
 #endif
 
-#include "wsutil/strnatcmp.h"
+#include <wsutil/strnatcmp.h>
+#include <wsutil/file_util.h>
 
-#define WS_BUILD_DLL
-#define RESET_SYMBOL_EXPORT /* wsutil/wsgetopt.h set export behavior above. */
-#undef WS_BUILD_DLL
-#define RESET_SYMBOL_EXPORT
+#include <wiretap/merge.h>
 
 #include "svnversion.h"
-#include "merge.h"
-#include "wsutil/file_util.h"
 
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
index 6d24dff82c7ce55458719422a04a748c133c6b91..0c97311512eb618f3acfa2e4d0847777a0c8888a 100644 (file)
 #include "globals.h"
 #include "color.h"
 #include "color_filters.h"
-#include "merge.h"
 
-#include "ui/util.h"
 #include <wsutil/file_util.h>
 
+#include <wiretap/merge.h>
+
+#include "ui/util.h"
 #include "ui/alert_box.h"
 #include "ui/file_dialog.h"
 #include "ui/recent.h"
index 8aa1c6792b2dab1cbcd5fdf601f7582cfca10ca3..ab137a2d974327ee8ff6fa858105795582dff507 100644 (file)
@@ -68,6 +68,8 @@
 #include <wsutil/privileges.h>
 #include <wsutil/file_util.h>
 
+#include <wiretap/merge.h>
+
 #include <epan/epan.h>
 #include <epan/filesystem.h>
 #include <epan/epan_dissect.h>
 #include "../clopts_common.h"
 #include "../cmdarg_err.h"
 #include "../version_info.h"
-#include "../merge.h"
 #include "../log.h"
 
 #include "gtk_iface_monitor.h"
index c590d0643fb89567ab1bb9bb4ecc466f8b1a1813..dad81c2af3851990de05d5c2d4bba918da2b7814 100644 (file)
@@ -177,7 +177,6 @@ SOURCES_WS_C = \
     ../../filters.c       \
     ../../frame_tvbuff.c   \
     ../../g711.c \
-    ../../merge.c \
     ../../proto_hier_stats.c      \
     ../../summary.c       \
     ../../sync_pipe_write.c       \
index ba271236a4d65709fead3cdf6a6519ee9674161b..9f497e9803e5c67af2b2b44dafc1160e19998851 100644 (file)
@@ -44,6 +44,8 @@
 #include <wsutil/u3.h>
 #include <wsutil/file_util.h>
 
+#include <wiretap/merge.h>
+
 #include <epan/epan.h>
 #include <epan/filesystem.h>
 #include <wsutil/privileges.h>
@@ -79,7 +81,6 @@
 #include "clopts_common.h"
 #include "cmdarg_err.h"
 #include "version_info.h"
-#include "merge.h"
 #include "log.h"
 
 #include "ui/alert_box.h"
index c9fa01b997dc5ef470f182b665d9f2a4da23fd41..955767f1565db4173c91291379c56ee30e5bc5bb 100644 (file)
 
 #include <gtk/gtk.h>
 
+#include "wsutil/file_util.h"
+#include "wsutil/unicode-utils.h"
+
+#include "wiretap/merge.h"
+
 #include "epan/filesystem.h"
 #include "epan/addr_resolv.h"
 #include "epan/prefs.h"
 #include "epan/print.h"
-#include "wsutil/file_util.h"
-#include "wsutil/unicode-utils.h"
 
 #include "color.h"
 #include "color_filters.h"
-#include "merge.h"
 
 #include "ui/alert_box.h"
 #include "ui/help_url.h"
index 1ddbcfdbf16f076a60442e78b6b3ee5fb45d4af4..4dcacdbd4625282c3d665b2d5f2bbbd9184d018f 100644 (file)
@@ -50,6 +50,7 @@ set(WIRETAP_FILES
        k12.c
        lanalyzer.c
        libpcap.c
+       merge.c
        mpeg.c
        mime_file.c
        mp2t.c
index 8726adbb2efc02b4f4dd82afb9c5350b61bfd27f..eb54501c618c01a59f642f5d740a9d95cc0173d1 100644 (file)
@@ -57,6 +57,7 @@ NONGENERATED_C_FILES = \
        k12.c                   \
        lanalyzer.c             \
        libpcap.c               \
+       merge.c                 \
        mpeg.c                  \
        mp2t.c                  \
        netmon.c                \
@@ -113,6 +114,7 @@ NONGENERATED_HEADER_FILES = \
        lanalyzer.h             \
        libpcap.h               \
        mpeg.h                  \
+       mpeg.h                  \
        mp2t.h                  \
        netmon.h                \
        netscreen.h             \
similarity index 99%
rename from merge.c
rename to wiretap/merge.c
index f68c4758c862eedf1a0980375d89ac0c28e0dd65..264f66c3ed4912fb7b5d209c941dbbdd1960e993 100644 (file)
--- a/merge.c
@@ -42,7 +42,6 @@
 #endif
 
 #include <string.h>
-#include "wtap.h"
 #include "merge.h"
 
 /*
similarity index 95%
rename from merge.h
rename to wiretap/merge.h
index a9a36f2c9308d416ae2b550dd6e9d6397e32ee25..12be91bc1299b6bce95181f6b672bcf4d38fb6a2 100644 (file)
--- a/merge.h
@@ -25,6 +25,8 @@
 #ifndef __MERGE_H__
 #define __MERGE_H__
 
+#include "wiretap/wtap.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
@@ -46,12 +48,12 @@ typedef struct merge_in_file_s {
   in_file_state_e state;
   guint32         packet_num;    /* current packet number */
   gint64          size;                      /* file size */
-  guint32         interface_id;   /* identifier of the interface. 
+  guint32         interface_id;   /* identifier of the interface.
                                                                   * Used for fake interfaces when writing WTAP_ENCAP_PER_PACKET */
 } merge_in_file_t;
 
 /** Open a number of input files to merge.
- * 
+ *
  * @param in_file_count number of entries in in_file_names and in_files
  * @param in_file_names filenames of the input files
  * @param in_files input file array to be filled (>= sizeof(merge_in_file_t) * in_file_count)
@@ -60,40 +62,40 @@ typedef struct merge_in_file_s {
  * @param err_fileno file on which open failed, if failed
  * @return TRUE if all files could be opened, FALSE otherwise
  */
-extern gboolean
+WS_DLL_PUBLIC gboolean
 merge_open_in_files(int in_file_count, char *const *in_file_names,
                     merge_in_file_t **in_files, int *err, gchar **err_info,
                     int *err_fileno);
 
 /** Close the input files again.
- * 
+ *
  * @param in_file_count number of entries in in_files
  * @param in_files input file array to be closed
  */
-extern void
+WS_DLL_PUBLIC void
 merge_close_in_files(int in_file_count, merge_in_file_t in_files[]);
 
 /** Try to get the frame type from the input files.
- * 
+ *
  * @param in_file_count number of entries in in_files
  * @param in_files input file array
  * @return the frame type
  */
-extern int
+WS_DLL_PUBLIC int
 merge_select_frame_type(int in_file_count, merge_in_file_t in_files[]);
 
 /** Try to get the snapshot length from the input files.
- * 
+ *
  * @param in_file_count number of entries in in_files
  * @param in_files input file array
  * @return the snapshot length
  */
-extern int
+WS_DLL_PUBLIC int
 merge_max_snapshot_length(int in_file_count, merge_in_file_t in_files[]);
 
 /** Read the next packet, in chronological order, from the set of files to
  * be merged.
- * 
+ *
  * @param in_file_count number of entries in in_files
  * @param in_files input file array
  * @param err wiretap error, if failed
@@ -101,14 +103,14 @@ merge_max_snapshot_length(int in_file_count, merge_in_file_t in_files[]);
  * @return pointer to merge_in_file_t for file from which that packet
  * came, or NULL on error or EOF
  */
-extern merge_in_file_t *
+WS_DLL_PUBLIC merge_in_file_t *
 merge_read_packet(int in_file_count, merge_in_file_t in_files[], int *err,
                   gchar **err_info);
 
 
 /** Read the next packet, in file sequence order, from the set of files
  * to be merged.
- * 
+ *
  * @param in_file_count number of entries in in_files
  * @param in_files input file array
  * @param err wiretap error, if failed
@@ -116,7 +118,7 @@ merge_read_packet(int in_file_count, merge_in_file_t in_files[], int *err,
  * @return pointer to merge_in_file_t for file from which that packet
  * came, or NULL on error or EOF
  */
-extern merge_in_file_t *
+WS_DLL_PUBLIC merge_in_file_t *
 merge_append_read_packet(int in_file_count, merge_in_file_t in_files[],
                          int *err, gchar **err_info);