Move u3.{h,c} and g711.{h,c} into wsutil.
authorJeff Morriss <jeff.morriss.ws@gmail.com>
Tue, 16 Jul 2013 02:04:55 +0000 (02:04 -0000)
committerJeff Morriss <jeff.morriss.ws@gmail.com>
Tue, 16 Jul 2013 02:04:55 +0000 (02:04 -0000)
Project g711.h against multiple inclusion and add C++ compatibility wrapper.

svn path=/trunk/; revision=50654

14 files changed:
CMakeLists.txt
Makefile.common
ui/gtk/iax2_analysis.c
ui/gtk/main.c
ui/gtk/main_menubar.c
ui/gtk/rtp_analysis.c
ui/qt/main.cpp
ui/recent.c
wsutil/CMakeLists.txt
wsutil/Makefile.common
wsutil/g711.c [moved from g711.c with 100% similarity]
wsutil/g711.h [moved from g711.h with 70% similarity]
wsutil/u3.c [moved from u3.c with 99% similarity]
wsutil/u3.h [moved from u3.h with 75% similarity]

index 5761253086a94b15b999246d3aa49ebb687968cc..06d5bb62905593244bf0935039755087dc994e10 100644 (file)
@@ -761,12 +761,10 @@ if( (BUILD_wireshark AND GTK_FOUND) OR (BUILD_qtshark AND QT_FOUND) )
                file.c
                fileset.c
                filters.c
-               g711.c
                iface_monitor.c
                merge.c
                proto_hier_stats.c
                summary.c
-               u3.c
                ws80211_utils.c
                ${SHARK_COMMON_CAPTURE_SRC}
                ${WIRESHARK_COMMON_SRC}
index 8ee66f40b8ffefeecaee035854d3aab6c0ebce0c..dcd139d34af6adfa57ae496f3adc2f14b11580a1 100644 (file)
@@ -96,12 +96,10 @@ WIRESHARK_COMMON_SRC =      \
        file.c          \
        fileset.c       \
        filters.c       \
-       g711.c          \
        iface_monitor.c \
        merge.c         \
        proto_hier_stats.c      \
        summary.c       \
-       u3.c            \
        ws80211_utils.c
 
 # corresponding headers
@@ -113,7 +111,6 @@ WIRESHARK_COMMON_INCLUDES = \
        capture_opts.h  \
        color_filters.h \
        filters.h       \
-       g711.h          \
        globals.h       \
        iface_monitor.h \
        log.h           \
@@ -122,7 +119,6 @@ WIRESHARK_COMMON_INCLUDES = \
        stat_menu.h     \
        summary.h       \
        sync_pipe.h     \
-       u3.h            \
        ws80211_utils.h
 
 # tshark specifics
index 142727c6b3aa6df201e19187a8b66a9ef286f6f6..fe8de8db34bb3db8edffefafe1ce927249c4e634 100644 (file)
 
 #include <gtk/gtk.h>
 
+#include <wsutil/file_util.h>
+#include <wsutil/g711.h>
+#include <wsutil/tempfile.h>
+
 #include <epan/epan_dissect.h>
 #include <epan/filesystem.h>
 #include <epan/pint.h>
 #include <epan/stat_cmd_args.h>
 #include <epan/strutil.h>
 
-#include "ui/util.h"
-#include "../g711.h"
 #include "../stat_menu.h"
-#include "wsutil/tempfile.h"
 
+#include "ui/util.h"
 #include "ui/alert_box.h"
 #include "ui/last_open_dir.h"
 #include "ui/progress_dlg.h"
 #include "ui/simple_dialog.h"
 #include "ui/utf8_entities.h"
 
-#include <wsutil/file_util.h>
-
 #include "ui/gtk/gtkglobals.h"
 #include "ui/gtk/dlg_utils.h"
 #include "ui/gtk/file_dlg.h"
@@ -85,7 +85,6 @@
 #include "ui/gtk/iax2_analysis.h"
 #include "ui/gtk/rtp_stream.h"
 #include "ui/gtk/rtp_stream_dlg.h"
-
 #include "ui/gtk/old-gtk-compat.h"
 #include "ui/gtk/gui_utils.h"
 
index 812777b490b0106ad9d837fbd2de04c7612fae19..8aa1c6792b2dab1cbcd5fdf601f7582cfca10ca3 100644 (file)
 #endif /* HAVE_LIBPORTAUDIO */
 
 #include <wsutil/crash_info.h>
+#include <wsutil/u3.h>
+#include <wsutil/privileges.h>
+#include <wsutil/file_util.h>
 
 #include <epan/epan.h>
 #include <epan/filesystem.h>
-#include <wsutil/privileges.h>
 #include <epan/epan_dissect.h>
 #include <epan/timestamp.h>
 #include <epan/plugins.h>
 #include "../version_info.h"
 #include "../merge.h"
 #include "../log.h"
-#include "../u3.h"
 
 #include "gtk_iface_monitor.h"
 
 #include "ui/iface_lists.h"
 #endif
 
-#include <wsutil/file_util.h>
-
 #ifdef HAVE_LIBPCAP
 #include "capture_ui_utils.h"
 #include "capture-pcap-util.h"
index e9b9081753236ee59950cb4caa5a118e64952a78..ea32ecd57807ca1b2b4587b0830a144ea8c3e38b 100644 (file)
@@ -28,6 +28,8 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <wsutil/u3.h>
+
 #include <epan/packet.h>
 #include <epan/addr_resolv.h>
 #include <epan/prefs.h>
@@ -49,7 +51,6 @@
 #include "globals.h"
 #include "color_filters.h"
 #include "stat_menu.h"
-#include "u3.h"
 
 #include "ui/iface_lists.h"
 #include "ui/main_statusbar.h"
index 647775e6d4cf696e14cc47650a76783bd6eb7a7b..b3d9778b7361236812627c030463fecdc7821189 100644 (file)
 
 #include <gtk/gtk.h>
 
+#include <wsutil/file_util.h>
+#include <wsutil/tempfile.h>
+#include <wsutil/g711.h>
+
 #include <epan/epan_dissect.h>
 #include <epan/filesystem.h>
 #include <epan/pint.h>
 #include <epan/stat_cmd_args.h>
 #include <epan/strutil.h>
 
-#include "ui/util.h"
-#include "../g711.h"
 #include "../stat_menu.h"
-#include "wsutil/tempfile.h"
 
+#include "ui/util.h"
 #include "ui/alert_box.h"
 #include "ui/last_open_dir.h"
 #include "ui/progress_dlg.h"
 #include "ui/simple_dialog.h"
 #include "ui/utf8_entities.h"
 
-#include <wsutil/file_util.h>
 
 #include "ui/gtk/gtkglobals.h"
 #include "ui/gtk/dlg_utils.h"
index 5570e5965d8304ece7c288eb1e941142accaa8d7..ba271236a4d65709fead3cdf6a6519ee9674161b 100644 (file)
@@ -41,6 +41,8 @@
 #endif /* HAVE_LIBPORTAUDIO */
 
 #include <wsutil/crash_info.h>
+#include <wsutil/u3.h>
+#include <wsutil/file_util.h>
 
 #include <epan/epan.h>
 #include <epan/filesystem.h>
@@ -79,8 +81,6 @@
 #include "version_info.h"
 #include "merge.h"
 #include "log.h"
-#include "u3.h"
-#include <wsutil/file_util.h>
 
 #include "ui/alert_box.h"
 #include "ui/capture_globals.h"
index db1881e58505f3cc9be59066836e3e63669d08f2..c739397144313e6c754690d8955f1b748bab5c66 100644 (file)
@@ -44,8 +44,7 @@
 #include "ui/simple_dialog.h"
 #include "ui/ui_util.h"
 
-#include "u3.h"
-
+#include <wsutil/u3.h>
 #include <wsutil/file_util.h>
 #include <wsutil/str_util.h>
 
index 086410143590e254dc1d96f41db62fd79f247763..85fe2a96f594005f2bd0d5d0e0c4d73926b526c6 100644 (file)
@@ -46,6 +46,7 @@ set(WSUTIL_FILES
   crc8.c
   crc11.c
   crcdrm.c
+  g711.c
   mpeg-audio.c
   nstime.c
   privileges.c
@@ -54,6 +55,7 @@ set(WSUTIL_FILES
   report_err.c
   tempfile.c
   type_util.c
+  u3.c
   ${WSUTIL_PLATFORM_FILES}
 )
 
index dd15f9fb5158ed263952ee2152b6daef752b79b5..8e2903bef5b6a094a35de62b0b6c6ba4699d22a7 100644 (file)
@@ -40,6 +40,7 @@ LIBWSUTIL_SRC =       \
        crc16-plain.c   \
        crc32.c         \
        crcdrm.c        \
+       g711.c          \
        mpeg-audio.c    \
        nstime.c        \
        privileges.c    \
@@ -47,7 +48,8 @@ LIBWSUTIL_SRC =       \
        str_util.c      \
        report_err.c    \
        tempfile.c      \
-       type_util.c
+       type_util.c     \
+       u3.c
 
 # Header files that are not generated from other files
 LIBWSUTIL_INCLUDES =   \
@@ -61,6 +63,7 @@ LIBWSUTIL_INCLUDES =  \
        crc16-plain.h   \
        crc32.h         \
        crcdrm.h        \
+       g711.h          \
        mpeg-audio.h    \
        nstime.h        \
        privileges.h    \
@@ -68,4 +71,5 @@ LIBWSUTIL_INCLUDES =  \
        str_util.h      \
        report_err.h    \
        tempfile.h      \
-       type_util.h
+       type_util.h     \
+       u3.h
similarity index 100%
rename from g711.c
rename to wsutil/g711.c
similarity index 70%
rename from g711.h
rename to wsutil/g711.h
index 2df327e894ca3c09d03c00d2caab8b6898f39bd1..8dc7d206eff684b5d97172963734c8b512277fd4 100644 (file)
--- a/g711.h
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-unsigned char linear2alaw( int );
-int alaw2linear( unsigned char );
-unsigned char linear2ulaw( int );
-int ulaw2linear( unsigned char );
+#ifndef __G711_H__
+#define __G711_H__
+
+#include "ws_symbol_export.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+WS_DLL_PUBLIC unsigned char linear2alaw( int );
+WS_DLL_PUBLIC int alaw2linear( unsigned char );
+WS_DLL_PUBLIC unsigned char linear2ulaw( int );
+WS_DLL_PUBLIC int ulaw2linear( unsigned char );
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __G711_H__ */
similarity index 99%
rename from u3.c
rename to wsutil/u3.c
index 25e16fe8a00b0897621b55dd53a16fca8a405b30..217d9f3bace47166114707f0eecb9c3067f58578 100644 (file)
--- a/u3.c
@@ -46,8 +46,6 @@
 
 #include <wsutil/file_util.h>
 
-#include <epan/filesystem.h>
-
 #include "u3.h"
 
 
similarity index 75%
rename from u3.h
rename to wsutil/u3.h
index a083e60bf64d6f86e16c6db4f3d73db6d16360bc..fac385aebedd768d34644be2952851f2aac7415e 100644 (file)
--- a/u3.h
 #ifndef __U3_H__
 #define __U3_H__
 
+#include "ws_symbol_export.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
 
-gboolean u3_active(void);
+WS_DLL_PUBLIC gboolean u3_active(void);
 
-void u3_runtime_info(GString *str);
+WS_DLL_PUBLIC void u3_runtime_info(GString *str);
 
-void u3_register_pid(void);
-void u3_deregister_pid(void);
+WS_DLL_PUBLIC void u3_register_pid(void);
+WS_DLL_PUBLIC void u3_deregister_pid(void);
 
-const char * u3_expand_device_path(const char *path);
-const char * u3_contract_device_path(char *path);
+WS_DLL_PUBLIC const char *u3_expand_device_path(const char *path);
+WS_DLL_PUBLIC const char *u3_contract_device_path(char *path);
 
 #ifdef __cplusplus
 }