Move some code (including the optional objects) into libwsutil
authormorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 28 May 2010 20:19:55 +0000 (20:19 +0000)
committermorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 28 May 2010 20:19:55 +0000 (20:19 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33012 f5534014-38df-0310-8fa8-9805f1628bb7

43 files changed:
CMakeLists.txt
Makefile.am
Makefile.common
Makefile.nmake
capinfos.c
capture_ifinfo.c
dftest.c
dumpcap.c
editcap.c
epan/Makefile.am
epan/Makefile.nmake
epan/addr_resolv.c
epan/address_to_str.c
epan/dissectors/packet-dcom.c
epan/dissectors/packet-dtls.c
epan/dissectors/packet-giop.c
epan/dissectors/packet-sdp.c
epan/dissectors/packet-ssl.c
epan/dissectors/packet-tacacs.c
epan/ftypes/ftype-time.c
gtk/main.c
mergecap.c
randpkt.c
rawshark.c
text2pcap.c
tshark.c
wsutil/CMakeLists.txt
wsutil/Makefile.am
wsutil/Makefile.common
wsutil/Makefile.nmake
wsutil/inet_aton.c [moved from epan/inet_aton.c with 100% similarity]
wsutil/inet_aton.h [moved from epan/inet_aton.h with 100% similarity]
wsutil/inet_ntop.c [moved from inet_ntop.c with 100% similarity]
wsutil/inet_pton.c [moved from inet_pton.c with 100% similarity]
wsutil/inet_v6defs.h [moved from inet_v6defs.h with 100% similarity]
wsutil/libwsutil.def
wsutil/strerror.c [moved from strerror.c with 100% similarity]
wsutil/strerror.h [moved from strerror.h with 100% similarity]
wsutil/strncasecmp.c [moved from strncasecmp.c with 100% similarity]
wsutil/strptime.c [moved from strptime.c with 100% similarity]
wsutil/strptime.h [moved from strptime.h with 100% similarity]
wsutil/wsgetopt.c [moved from wsgetopt.c with 100% similarity]
wsutil/wsgetopt.h [moved from wsgetopt.h with 97% similarity]

index fc1c02e22374532a98eee46995f44b607fdbc39f..ad1c1c1984343a2329101f1f75c75c65a3f548a4 100644 (file)
@@ -576,16 +576,9 @@ set(INSTALL_FILES
 )
 
 set(LIBEPAN_LIBS
-#              @GETOPT_O@      # wsgetopt.c
-#              @INET_ATON_LO@  # epan/inet_aton.c
-#              @INET_NTOP_LO@  # inet_ntop.c
-#              @INET_PTON_LO@  # inet_pton.c
 #              @NSL_LIBS@      # -lnsl
 #              @SOCKET_LIBS@   # -lsocket
 #              @SSL_LIBS@      # -lcrypto
-#              @STRERROR_O@    # strerror.c
-#              @STRNCASECMP_O@ # strncasecmp.c
-#              @STRPTIME_O@    # strptime.c
                epan
 #              $(plugin_ldadd) # in case of static
                ${PCRE_LIBRARIES}
index d874e8ba5aa2cabc56c0bc45838135e4d066493a..597cb04ab59789a6a74b98b9fda6098170b7ae98 100644 (file)
@@ -295,17 +295,6 @@ endif              # HAVE_PLUGINS
 
 include Makefile.common
 
-# Optional objects that I know how to build. These will be
-# linked into the wireshark executable.
-# They will also be linked into the tshark executable; if this
-# list ever grows to include something that can't be linked with
-# tshark, or if tshark needs something that wireshark doesn't,
-# we should probably split this into stuff needed both
-# by wireshark and tshark and stuff needed only by one or the
-# other.
-wireshark_optional_objects = @GETOPT_O@ @STRERROR_O@ \
-       @STRNCASECMP_O@ @STRPTIME_O@
-
 if ENABLE_STATIC
 wireshark_LDFLAGS = -Wl,-static -all-static
 else
@@ -320,14 +309,11 @@ endif
 # @GTK_LIBS@ (as those are also needed for X applications, and GTK+
 # applications are X applications).
 wireshark_LDADD = \
-       $(wireshark_optional_objects)   \
        gtk/libui.a                     \
        codecs/libcodec.a               \
        wiretap/libwiretap.la           \
        epan/libwireshark.la            \
        wsutil/libwsutil.la             \
-       @INET_PTON_LO@                  \
-       @INET_NTOP_LO@                  \
        @SSL_LIBS@                      \
        $(plugin_ldadd)                 \
        @PCRE_LIBS@                     \
@@ -351,12 +337,9 @@ endif
 
 # Libraries and plugin flags with which to link tshark.
 tshark_LDADD = \
-       $(wireshark_optional_objects)   \
        wiretap/libwiretap.la           \
        epan/libwireshark.la            \
        wsutil/libwsutil.la             \
-       @INET_PTON_LO@                  \
-       @INET_NTOP_LO@                  \
        @SSL_LIBS@                      \
        $(plugin_ldadd)                 \
        @PCRE_LIBS@                     \
@@ -381,12 +364,9 @@ endif
 
 # Libraries and plugin flags with which to link rawshark.
 rawshark_LDADD = \
-       $(wireshark_optional_objects)   \
        wiretap/libwiretap.la           \
        epan/libwireshark.la            \
        wsutil/libwsutil.la             \
-       @INET_PTON_LO@                  \
-       @INET_NTOP_LO@                  \
        @SSL_LIBS@                      \
        $(plugin_ldadd)                 \
        @PCRE_LIBS@                     \
@@ -403,13 +383,8 @@ rawshark_LDADD = \
        @LIBSMI_LDFLAGS@
 rawshark_CFLAGS = $(AM_CLEAN_CFLAGS) $(py_dissectors_dir)
 
-# Optional objects that I know how to build, and that are needed by
-# text2pcap.
-text2pcap_optional_objects = @STRERROR_O@ @STRPTIME_O@
-
 # Libraries with which to link text2pcap.
 text2pcap_LDADD = \
-       $(text2pcap_optional_objects)   \
        wiretap/libwiretap.la           \
        wsutil/libwsutil.la             \
        @GLIB_LIBS@ -lm
@@ -455,7 +430,6 @@ randpkt_CFLAGS = $(AM_CLEAN_CFLAGS) $(py_dissectors_dir)
 
 # Libraries and plugin flags with which to link dftest.
 dftest_LDADD = \
-       $(wireshark_optional_objects)   \
        wiretap/libwiretap.la           \
        wsutil/libwsutil.la             \
        epan/libwireshark.la            \
@@ -478,7 +452,6 @@ dftest_CFLAGS = $(AM_CLEAN_CFLAGS) $(py_dissectors_dir)
 dumpcap_LDADD = \
        wiretap/libwiretap.la           \
        wsutil/libwsutil.la             \
-       @INET_NTOP_LO@                  \
        @GLIB_LIBS@                     \
        @PCAP_LIBS@                     \
        @SOCKET_LIBS@                   \
index e3d1a7e7dc36d735d725094822094af4e90adc12..bb4f4b6007d4fd8332e04c0af9d64c49cacbecef 100644 (file)
@@ -131,22 +131,6 @@ TSHARK_TAP_SRC =   \
        tap-stats_tree.c        \
        tap-wspstat.c
 
-# helpers already available on some platforms (and on others not)
-EXTRA_wireshark_SOURCES =      \
-       wsgetopt.c      \
-       inet_ntop.c     \
-       inet_pton.c     \
-       strerror.c      \
-       strncasecmp.c   \
-       strptime.c
-
-# corresponding headers
-EXTRA_wireshark_INCLUDES =     \
-       wsgetopt.h      \
-       inet_v6defs.h   \
-       strerror.h      \
-       strptime.h
-
 # wireshark specifics
 wireshark_SOURCES =    \
        $(WIRESHARK_COMMON_SRC) \
@@ -264,5 +248,4 @@ noinst_HEADERS =    \
        $(WIRESHARK_COMMON_INCLUDES) \
        $(SHARK_COMMON_CAPTURE_INCLUDES) \
        $(wireshark_INCLUDES) \
-       $(EXTRA_wireshark_INCLUDES) \
        $(dumpcap_INCLUDES)
index a91008b9af080a572972dbc17ac6973b5cbe022d..75298aa5d73ac25f1ed05573340aeaae57b7821b 100644 (file)
@@ -27,7 +27,7 @@ WIN_SETUP=tools/$(WIRESHARK_TARGET_PLATFORM)-setup.sh
 #     If $(CHECK_TAG) is null, but either config.nmake or Makefile.nmake
 #      are newer than the $(LIBS_CHECK) target, then a detailed verification
 #      as to the required library package files will be made.
-#    
+#
 LIBS_CHECK=_libs_check_
 !IF [$(SH) $(WIN_SETUP) --checktag "$(WIRESHARK_LIBS)"] != 0
 CHECK_TAG=_check_tag_
@@ -72,12 +72,6 @@ dftest_OBJECTS = $(dftest_SOURCES:.c=.obj)
 dumpcap_OBJECTS = $(dumpcap_SOURCES:.c=.obj)
 randpkt_OBJECTS = $(randpkt_SOURCES:.c=.obj)
 
-EXTRA_OBJECTS = \
-       wsgetopt.obj    \
-       inet_ntop.obj   \
-       inet_pton.obj   \
-       strptime.obj
-
 wireshark_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
        wsock32.lib user32.lib shell32.lib comctl32.lib \
        $(HHC_LIBS) \
@@ -252,28 +246,28 @@ $(RESOURCES): image
 
 wiretap\wiretap-$(WTAP_VERSION).lib: image $(ZLIB_DLL) wiretap
 
-wireshark.exe  : $(LIBS_CHECK) config.h $(wireshark_OBJECTS) wsgetopt.obj inet_ntop.obj inet_pton.obj codecs epan gtk image\wireshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib codecs\codecs.lib gtk\libui.lib plugins
+wireshark.exe  : $(LIBS_CHECK) config.h $(wireshark_OBJECTS) codecs epan gtk image\wireshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib codecs\codecs.lib gtk\libui.lib plugins
        @echo Linking $@
        $(LINK) @<<
-               /OUT:wireshark.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:windows $(wireshark_LIBS) wsgetopt.obj inet_ntop.obj inet_pton.obj $(GTK_LIBS) codecs\codecs.lib gtk\libui.lib $(wireshark_OBJECTS) image\wireshark.res
+               /OUT:wireshark.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:windows $(wireshark_LIBS) $(GTK_LIBS) codecs\codecs.lib gtk\libui.lib $(wireshark_OBJECTS) image\wireshark.res
 <<
 !IFDEF MANIFEST_INFO_REQUIRED
        mt.exe -nologo -manifest "wireshark.exe.manifest" -outputresource:wireshark.exe;1
 !ENDIF
 
-tshark.exe     : $(LIBS_CHECK) config.h $(tshark_OBJECTS) wsgetopt.obj inet_ntop.obj inet_pton.obj epan image\tshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib plugins
+tshark.exe     : $(LIBS_CHECK) config.h $(tshark_OBJECTS) epan image\tshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib plugins
        @echo Linking $@
        $(LINK) @<<
-               /OUT:tshark.exe $(conflags) $(conlibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console $(tshark_LIBS) $(tshark_OBJECTS) wsgetopt.obj inet_ntop.obj inet_pton.obj image\tshark.res
+               /OUT:tshark.exe $(conflags) $(conlibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console $(tshark_LIBS) $(tshark_OBJECTS) image\tshark.res
 <<
 !IFDEF MANIFEST_INFO_REQUIRED
        mt.exe -nologo -manifest "tshark.exe.manifest" -outputresource:tshark.exe;1
 !ENDIF
 
-rawshark.exe   : $(LIBS_CHECK) config.h $(rawshark_OBJECTS) wsgetopt.obj inet_ntop.obj epan image\rawshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib plugins
+rawshark.exe   : $(LIBS_CHECK) config.h $(rawshark_OBJECTS) epan image\rawshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib plugins
        @echo Linking $@
        $(LINK) @<<
-               /OUT:rawshark.exe $(conflags) $(conlibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console $(rawshark_LIBS) $(rawshark_OBJECTS) wsgetopt.obj inet_ntop.obj image\rawshark.res
+               /OUT:rawshark.exe $(conflags) $(conlibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console $(rawshark_LIBS) $(rawshark_OBJECTS) image\rawshark.res
 <<
 !IFDEF MANIFEST_INFO_REQUIRED
        mt.exe -nologo -manifest "rawshark.exe.manifest" -outputresource:rawshark.exe;1
@@ -282,10 +276,10 @@ rawshark.exe      : $(LIBS_CHECK) config.h $(rawshark_OBJECTS) wsgetopt.obj inet_ntop
 # XXX: This makefile does not properly handle doing a 'nmake ... capinfos.exe' directly since some of the .objs
 #      (e.g. epan\plugins.obj) must be built first using epan\Makefile.nmake (which happens for 'nmake ... all').
 # Linking with setargv.obj enables "wildcard expansion" of command-line arguments
-capinfos.exe   : $(LIBS_CHECK) config.h $(capinfos_OBJECTS) wsgetopt.obj wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\capinfos.res
+capinfos.exe   : $(LIBS_CHECK) config.h $(capinfos_OBJECTS) wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\capinfos.res
        @echo Linking $@
        $(LINK) @<<
-               /OUT:capinfos.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(capinfos_OBJECTS) wsgetopt.obj $(capinfos_LIBS) setargv.obj image\capinfos.res
+               /OUT:capinfos.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(capinfos_OBJECTS) $(capinfos_LIBS) setargv.obj image\capinfos.res
 <<
 !IFDEF MANIFEST_INFO_REQUIRED
        mt.exe -nologo -manifest "capinfos.exe.manifest" -outputresource:capinfos.exe;1
@@ -293,29 +287,29 @@ capinfos.exe      : $(LIBS_CHECK) config.h $(capinfos_OBJECTS) wsgetopt.obj wsutil\li
 
 # XXX: This makefile does not properly handle doing a 'nmake ... editcap.exe' directly since some of the .objs
 #      (e.g. epan\plugins.obj) must be built first using epan\Makefile.nmake (which happens for 'nmake ... all').
-editcap.exe    : $(LIBS_CHECK) config.h $(editcap_OBJECTS) wsgetopt.obj strptime.obj wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
+editcap.exe    : $(LIBS_CHECK) config.h $(editcap_OBJECTS) wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
        @echo Linking $@
        $(LINK) @<<
-               /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(editcap_OBJECTS) wsgetopt.obj strptime.obj $(editcap_LIBS) image\editcap.res
+               /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(editcap_OBJECTS) $(editcap_LIBS) image\editcap.res
 <<
 !IFDEF MANIFEST_INFO_REQUIRED
        mt.exe -nologo -manifest "editcap.exe.manifest" -outputresource:editcap.exe;1
 !ENDIF
 
 # Linking with setargv.obj enables "wildcard expansion" of command-line arguments
-mergecap.exe   : $(LIBS_CHECK)  config.h mergecap.obj merge.obj wsgetopt.obj wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
+mergecap.exe   : $(LIBS_CHECK)  config.h mergecap.obj merge.obj wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
        @echo Linking $@
        $(LINK) @<<
-               /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj merge.obj wsgetopt.obj $(mergecap_LIBS) setargv.obj image\mergecap.res
+               /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj merge.obj $(mergecap_LIBS) setargv.obj image\mergecap.res
 <<
 !IFDEF MANIFEST_INFO_REQUIRED
        mt.exe -nologo -manifest "mergecap.exe.manifest" -outputresource:mergecap.exe;1
 !ENDIF
 
-text2pcap.exe  : $(LIBS_CHECK) config.h text2pcap.obj text2pcap-scanner.obj wsgetopt.obj wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib strptime.obj image\text2pcap.res
+text2pcap.exe  : $(LIBS_CHECK) config.h text2pcap.obj text2pcap-scanner.obj wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\text2pcap.res
        @echo Linking $@
        $(LINK) @<<
-               /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj wsgetopt.obj $(text2pcap_LIBS) strptime.obj image\text2pcap.res
+               /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj $(text2pcap_LIBS) image\text2pcap.res
 <<
 !IFDEF MANIFEST_INFO_REQUIRED
        mt.exe -nologo -manifest "text2pcap.exe.manifest" -outputresource:text2pcap.exe;1
@@ -330,19 +324,19 @@ dftest.exe        : $(dftest_OBJECTS) epan
        mt.exe -nologo -manifest "dftest.exe.manifest" -outputresource:dftest.exe;1
 !ENDIF
 
-randpkt.exe    : $(randpkt_OBJECTS) wsgetopt.obj
+randpkt.exe    : $(randpkt_OBJECTS)
        @echo Linking $@
        $(LINK) @<<
-               /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS) wsgetopt.obj
+               /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS)
 <<
 !IFDEF MANIFEST_INFO_REQUIRED
        mt.exe -nologo -manifest "randpkt.exe.manifest" -outputresource:randpkt.exe;1
 !ENDIF
 
-dumpcap.exe    : $(LIBS_CHECK) config.h $(dumpcap_OBJECTS) wsgetopt.obj inet_ntop.obj wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\dumpcap.res
+dumpcap.exe    : $(LIBS_CHECK) config.h $(dumpcap_OBJECTS) wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\dumpcap.res
        @echo Linking $@
        $(LINK) @<<
-               /OUT:dumpcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dumpcap_LIBS) $(dumpcap_OBJECTS) wsgetopt.obj inet_ntop.obj image\dumpcap.res
+               /OUT:dumpcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dumpcap_LIBS) $(dumpcap_OBJECTS) image\dumpcap.res
 <<
 !IFDEF MANIFEST_INFO_REQUIRED
        mt.exe -nologo -manifest "dumpcap.exe.manifest" -outputresource:dumpcap.exe;1
@@ -428,7 +422,7 @@ text2pcap-scanner.obj : text2pcap-scanner.c
        $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $?
 
 #
-# The following targets will rebuild their respective objs 
+# The following targets will rebuild their respective objs
 # if and when svnversion.h should change.
 #
 
@@ -449,7 +443,7 @@ version_info.obj : $*.c svnversion.h
 
 clean-local: clean-deps
        rm -f $(wireshark_OBJECTS) $(tshark_OBJECTS) $(dumpcap_OBJECTS) $(rawshark_OBJECTS) \
-               $(EXTRA_OBJECTS) $(EXECUTABLES) *.pdb *.exe.manifest \
+               $(EXECUTABLES) *.pdb *.exe.manifest \
                capinfos.obj editcap.obj mergecap.obj text2pcap.obj \
                nio-ie5.obj update.obj \
                text2pcap-scanner.obj text2pcap-scanner.c rdps.obj \
@@ -687,7 +681,7 @@ doxygen-run:
 !ENDIF
 
 doxygen: doxygen.cfg doxygen-run
-       
+
 
 ################################################################################
 # Prepare build environment by downloading and installing required libraries
@@ -736,7 +730,7 @@ check_libs:
 #  If $(CHECK_TAG) is non-null then checktag failed; Exit with an error message. (See beginning of this Makefile).
 #  Otherwise do detailed library package files verification only if Makefile.nmake or config.make have been updated
 #  (or dummy file doesn't exist because of 'make clean' or whatever).
-#  Note that the creation/modification time of a file after an svn update of that file 
+#  Note that the creation/modification time of a file after an svn update of that file
 #   is the time of the update (not the time of the file in the repository).
 # touch is only called if libverify succeeds.
 $(LIBS_CHECK):  $(CHECK_TAG) config.nmake Makefile.nmake
@@ -972,9 +966,9 @@ install-generated-files:
        xcopy ".\wimaxasncp\*.*" $(INSTALL_DIR)\wimaxasncp /d
        if not exist $(INSTALL_DIR)\plugins mkdir $(INSTALL_DIR)\plugins
        if not exist $(INSTALL_DIR)\plugins\$(VERSION) mkdir $(INSTALL_DIR)\plugins\$(VERSION)
-       cd plugins 
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake install-plugins 
-       cd .. 
+       cd plugins
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake install-plugins
+       cd ..
 
 # "install-all" will copy all files needed to run Wireshark/Tshark
 # to the INSTALL_DIR, so you can run/debug Wireshark/Tshark from there.
index 4a9cf85ed08ddfbed72682d01caa7427b7c2adaf..7d3223098a56d8563a7af1227e21b1d228e4c850 100644 (file)
@@ -82,7 +82,7 @@
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
 #else
-#include "wsgetopt.h"
+#include "wsutil/wsgetopt.h"
 #endif
 
 #include "svnversion.h"
index a9648753bdf16343e782d0dccfe9c87f6f77aaf6..f4dffd4530fa4c52e074bba869a953fc3a103b7a 100644 (file)
@@ -44,7 +44,7 @@
 #endif
 
 #ifdef NEED_INET_V6DEFS_H
-# include "inet_v6defs.h"
+# include "wsutil/inet_v6defs.h"
 #endif
 
 #include <glib.h>
index 03e884b8a3a0852d378762f959ba8521b9a2104a..a9ed86458899105a3c45e2ed30ac5c68312a0516 100644 (file)
--- a/dftest.c
+++ b/dftest.c
@@ -33,7 +33,7 @@
 #include <errno.h>
 
 #ifdef NEED_STRERROR_H
-#include "strerror.h"
+#include "wsutil/strerror.h"
 #endif
 
 #include <glib.h>
index 3ba302e3447df46fa0051844d0961d64e3f73308..f01eca6960e0c70437cc4a19eb432d0b07f948b5 100644 (file)
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -62,7 +62,7 @@
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
 #else
-#include "wsgetopt.h"
+#include "wsutil/wsgetopt.h"
 #endif
 
 #ifdef HAVE_NETDB_H
@@ -95,7 +95,7 @@
 #endif
 
 #ifdef NEED_INET_V6DEFS_H
-# include "inet_v6defs.h"
+# include "wsutil/inet_v6defs.h"
 #endif
 
 #include <wsutil/privileges.h>
@@ -674,7 +674,7 @@ get_if_capabilities(const char *devname, gboolean monitor_mode
         g_free(caps);
         return NULL;
     }
-    status = pcap_can_set_rfmon(pch); 
+    status = pcap_can_set_rfmon(pch);
     if (status < 0) {
         /* Error. */
         if (status == PCAP_ERROR)
index 724f7abdd9f37903f26774fd096f7717a86c0971..3492fb75cca3744318153d2813efb94b3746fa22 100644 (file)
--- a/editcap.c
+++ b/editcap.c
@@ -45,7 +45,7 @@
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
 #else
-#include "wsgetopt.h"
+#include "wsutil/wsgetopt.h"
 #endif
 
 #ifdef _WIN32
@@ -56,7 +56,7 @@
 #endif
 
 #ifdef NEED_STRPTIME_H
-# include "strptime.h"
+# include "wsutil/strptime.h"
 #endif
 
 #include "epan/crypt/crypt-md5.h"
@@ -141,7 +141,7 @@ abs_time_to_str_with_sec_resolution(const struct wtap_nstime *abs_time)
 {
     struct tm *tmp;
     gchar *buf = g_malloc(16);
-    
+
 #ifdef _MSC_VER
     /* calling localtime() on MSVC 2005 with huge values causes it to crash */
     /* XXX - find the exact value that still does work */
@@ -166,7 +166,7 @@ abs_time_to_str_with_sec_resolution(const struct wtap_nstime *abs_time)
 }
 
 static gchar*
-fileset_get_filename_by_pattern(guint idx,    const struct wtap_nstime *time_val, 
+fileset_get_filename_by_pattern(guint idx,    const struct wtap_nstime *time_val,
                                     gchar *fprefix, gchar *fsuffix)
 {
     gchar filenum[5+1];
@@ -1003,7 +1003,7 @@ main(int argc, char *argv[])
         pdh = wtap_dump_open(filename, out_file_type,
             out_frame_type, wtap_snapshot_length(wth),
             FALSE /* compressed */, &err);
-        if (pdh == NULL) {  
+        if (pdh == NULL) {
           fprintf(stderr, "editcap: Can't open or create %s: %s\n", filename,
                   wtap_strerror(err));
           exit(2);
@@ -1045,7 +1045,7 @@ main(int argc, char *argv[])
       if (split_packet_count > 0) {
 
         /* time for the next file? */
-        if (written_count > 0 && 
+        if (written_count > 0 &&
             written_count % split_packet_count == 0) {
           if (!wtap_dump_close(pdh, &err)) {
             fprintf(stderr, "editcap: Error writing to %s: %s\n", filename,
@@ -1274,7 +1274,7 @@ main(int argc, char *argv[])
       pdh = wtap_dump_open(filename, out_file_type,
                           out_frame_type, wtap_snapshot_length(wth), FALSE /* compressed */, &err);
       if (pdh == NULL) {
-       fprintf(stderr, "editcap: Can't open or create %s: %s\n", filename, 
+       fprintf(stderr, "editcap: Can't open or create %s: %s\n", filename,
                wtap_strerror(err));
        exit(2);
       }
index c7aa198e923a17956ca81a60c2aa252cd1f8806b..3200047410549386a7c2f3a386d1c8cc3ee91fac 100644 (file)
@@ -87,10 +87,6 @@ libwireshark_asmopt_la_SOURCES = \
        asm_utils.h             \
        asm_utils_win32_x86.asm
 
-EXTRA_libwireshark_la_SOURCES =        \
-       inet_aton.c             \
-       inet_aton.h
-
 EXTRA_DIST = \
        diam_dict.l             \
        dtd_grammar.lemon       \
@@ -116,8 +112,6 @@ CLEANFILES = \
        libwireshark_generated.la       \
        libwireshark_asmopt.a           \
        libwireshark_asmopt.la          \
-       inet_ntop.c                     \
-       inet_pton.c                     \
        *~
 
 DISTCLEANFILES = \
@@ -189,12 +183,6 @@ tvbtest.o exntest.o: exceptions.h
 sminmpec.c: enterprise-numbers ../tools/make-sminmpec.pl
        $(PERL) $(srcdir)/../tools/make-sminmpec.pl $(srcdir)/enterprise-numbers sminmpec.c
 
-inet_ntop.c:
-       ln -s $(srcdir)/../inet_ntop.c .
-
-inet_pton.c:
-       ln -s $(srcdir)/../inet_pton.c .
-
 if HAVE_PLUGINS
 
 if ENABLE_STATIC
index 6db84ef56e099f175bd7acefdaccd131449a58a1..b0e2d43ed70f7795d794d2097f751d15a1d2939b 100644 (file)
@@ -56,11 +56,6 @@ libwireshark_LIBS = \
 LIBWIRESHARK_OBJECTS = $(LIBWIRESHARK_ALL_SRC:.c=.obj)
 
 EXTRA_OBJECTS = \
-#      strerror.obj    \
-       inet_aton.obj   \
-       inet_pton.obj   \
-       inet_ntop.obj   \
-       strptime.obj    \
 !IF defined(NASM) && "$(WIRESHARK_TARGET_PLATFORM)" == "win32"
        asm_utils_win32_x86.obj
 !ELSE
@@ -107,7 +102,7 @@ clean-local:
                libwireshark.lib libwireshark.dll *.manifest libwireshark.exp \
                *.pdb doxygen.cfg html/*.* \
                exntest.obj exntest.exe reassemble_test.obj reassemble_test.exe tvbtest.obj tvbtest.exe
-       if exist html rmdir html        
+       if exist html rmdir html
 
 clean:  clean-local
        cd crc
@@ -134,13 +129,12 @@ clean:  clean-local
 # the same for now.
 #
 distclean-local: clean-local
-       rm -f config.h register.c mkstemp.c strptime.c \
-               inet_ntop.c inet_pton.c \
+       rm -f config.h register.c mkstemp.c \
                $(LIBWIRESHARK_DISTCLEAN_GENERATED_SRC) \
                $(LIBWIRESHARK_DISTCLEAN_GENERATED_INCLUDES) \
                $(LIBWIRESHARK_NODISTCLEAN_GENERATED_SRC) \
                $(LIBWIRESHARK_NODISTCLEAN_GENERATED_INCLUDES) \
-               dtd_grammar.out sminmpec.c 
+               dtd_grammar.out sminmpec.c
 
 distclean: distclean-local
        cd crc
@@ -285,28 +279,11 @@ asm_utils_win32_x86.obj: asm_utils_win32_x86.asm
        $(NASM) -f $(WIRESHARK_TARGET_PLATFORM) -o $@ $?
 !ENDIF
 
-# (Windows only) Copy some sources from /trunk to /trunk/epan.
-# It is a cleaner to compile these sources separately with this makefile than
-# using the object code compiled by the makefile in /trunk for both dynamically
-# and statically linking
-
-strptime.c: ..\strptime.c
-       set copycmd=/y
-       xcopy ..\strptime.c . /d
-
-inet_ntop.c: ..\inet_ntop.c
-       set copycmd=/y
-       xcopy ..\inet_ntop.c . /d
-
-inet_pton.c: ..\inet_pton.c
-       set copycmd=/y
-       xcopy ..\inet_pton.c . /d
-
 sminmpec.c: enterprise-numbers ..\tools\make-sminmpec.pl
        $(PERL) ../tools/make-sminmpec.pl enterprise-numbers sminmpec.c
 
 RUNLEX=..\tools\runlex.sh
+
 diam_dict_lex.h: diam_dict.c
 diam_dict.obj : diam_dict.c
        $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $?
index 4a33c8dd25200cfd500ed48a10b1501e1193da7f..758f66a328a040daa6a301eea70f472812ee2d25 100644 (file)
 #endif
 
 #ifdef NEED_INET_ATON_H
-# include "inet_aton.h"
+# include "wsutil/inet_aton.h"
 #endif
 
 #ifdef NEED_INET_V6DEFS_H
-# include "inet_v6defs.h"
+# include "wsutil/inet_v6defs.h"
 #endif
 
 #if defined(_WIN32) && defined(INET6)
index a09a4ae11caba332125c78fa09f3b336616494a9..1c39a57d661d657114965650740f4b637fcb084e 100644 (file)
@@ -50,7 +50,7 @@
 #endif
 
 #ifdef NEED_INET_V6DEFS_H
-# include "inet_v6defs.h"
+# include "wsutil/inet_v6defs.h"
 #endif
 
 #include "to_str.h"
@@ -395,7 +395,7 @@ address_to_str_buf(const address *addr, gchar *buf, int buf_len)
   /* copy to output buffer */
   if (tempptr != temp) {
     size_t temp_len = (size_t) (tempptr - temp);
-    
+
     if (temp_len < (size_t) buf_len) {
       memcpy(buf, temp, temp_len);
       buf[temp_len] = '\0';
index 68672f4e0c4718567805a7f82d111a76cef471ac..c14f8e3670755658457777cee13d5bef57c54ffa 100644 (file)
@@ -90,7 +90,7 @@
 #include <epan/packet.h>
 #include <epan/emem.h>
 #include <epan/addr_resolv.h>
-#include <epan/inet_aton.h>
+#include <wsutil/inet_aton.h>
 #include <epan/expert.h>
 #include <epan/prefs.h>
 #include <ctype.h>
index 5cc1bd437ebf65684bb643e86abec4d76560de81..d4969b19e7925cb034f41de38cac9752f4d3af6f 100644 (file)
@@ -70,7 +70,9 @@
 #include <epan/emem.h>
 #include <epan/tap.h>
 #include <epan/reassemble.h>
-#include "inet_v6defs.h"
+#ifdef NEED_INET_V6DEFS_H
+#include "wsutil/inet_v6defs.h"
+#endif
 #include "packet-ssl-utils.h"
 
 /* we need to remember the top tree so that subdissectors we call are created
index 4858bd63e3cc6314b1563f99f21dca47e55b0c94..4beee5a6bee2359c5d4a3c42b8c665572bab281a 100644 (file)
 #include <glib.h>
 #include <math.h>
 #ifdef NEED_STRERROR_H
-#include "strerror.h"
+#include "wsutil/strerror.h"
 #endif
 
 #include "isprint.h"
index 877c867fc1ab391c45df5cfcedddb18d7e2e54a3..9e936f45689f2f3204c2e49c549ee87fe0f5f0f3 100644 (file)
@@ -50,7 +50,7 @@
 #endif
 
 #ifdef NEED_INET_V6DEFS_H
-# include "inet_v6defs.h"
+# include "wsutil/inet_v6defs.h"
 #endif
 
 #include <glib.h>
index 2b95d9ca46ae5e1cbcd0c805bdf8d636562cb282..25b2aaca354c2b9e674e0e72f68b6c230a55dd58 100644 (file)
 #include <epan/filesystem.h>
 #include <epan/report_err.h>
 #include <epan/expert.h>
-#include "inet_v6defs.h"
+#ifdef NEED_INET_V6DEFS_H
+#include "wsutil/inet_v6defs.h"
+#endif
 #include "packet-x509if.h"
 #include "packet-ssl.h"
 #include "packet-ssl-utils.h"
index be9103a66e339e3a8fb364363800a2a0b61a4ca8..898b63968a380bd789fd25122c3c53a3a56643a2 100644 (file)
@@ -59,7 +59,7 @@
 #endif
 
 #ifdef NEED_INET_V6DEFS_H
-# include "inet_v6defs.h"
+# include "wsutil/inet_v6defs.h"
 #endif
 
 #include <glib.h>
index fd81266722d12be4083b8e768acf90f2d51c1c44..b091c3bd2366962d1332d34c0c261b604c606625 100644 (file)
@@ -42,7 +42,7 @@
 #include <ftypes-int.h>
 
 #ifdef NEED_STRPTIME_H
-#include "strptime.h"
+#include "wsutil/strptime.h"
 #endif
 
 static gboolean
@@ -175,14 +175,14 @@ relative_val_from_unparsed(fvalue_t *fv, char *s, gboolean allow_partial_value _
 {
        char    *curptr, *endptr;
         gboolean negative = FALSE;
-        
+
        curptr = s;
 
         if(*curptr == '-') {
             negative = TRUE;
             curptr++;
         }
-        
+
        /*
         * If it doesn't begin with ".", it should contain a seconds
         * value.
@@ -313,7 +313,7 @@ value_get(fvalue_t *fv)
 {
        return &(fv->value.time);
 }
-   
+
 static int
 absolute_val_repr_len(fvalue_t *fv, ftrepr_t rtype _U_)
 {
@@ -331,7 +331,7 @@ absolute_val_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf)
            abs_time_to_str(&fv->value.time, ABSOLUTE_TIME_LOCAL,
                rtype == FTREPR_DISPLAY));
 }
-   
+
 static int
 relative_val_repr_len(fvalue_t *fv, ftrepr_t rtype _U_)
 {
index 45e36a8512e23df7b2e64e13be3780b754af0f4c..cbb5f2d98fc2c340d91bcd19b59cc60ca73be3f2 100644 (file)
 #endif
 
 #ifdef NEED_STRERROR_H
-#include "strerror.h"
+#include "wsutil/strerror.h"
 #endif
 
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
 #else
-#include "wsgetopt.h"
+#include "wsutil/wsgetopt.h"
 #endif
 
 #ifdef _WIN32 /* Needed for console I/O */
@@ -1774,7 +1774,7 @@ main_capture_callback(gint event, capture_options *capture_opts, gpointer user_d
 {
 #ifdef HAVE_GTKOSXAPPLICATION
     GtkOSXApplication *theApp;
-#endif 
+#endif
     switch(event) {
     case(capture_cb_capture_prepared):
         g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_DEBUG, "Callback: capture prepared");
@@ -2058,7 +2058,7 @@ main(int argc, char *argv[])
 #ifdef HAVE_GTKOSXAPPLICATION
   GtkOSXApplication   *theApp;
 #endif
-       
+
 #ifdef HAVE_LIBPCAP
 #if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
 #define OPTSTRING_B "B:"
@@ -3010,7 +3010,7 @@ main(int argc, char *argv[])
   gtk_osxapplication_set_dock_icon_pixbuf(theApp,gdk_pixbuf_new_from_xpm_data(wsicon64_xpm));
   gtk_osxapplication_ready(theApp);
 #endif
-       
+
   g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_INFO, "Wireshark is up and ready to go");
 
   /* we'll enter the GTK loop now and hand the control over to GTK ... */
@@ -3033,7 +3033,7 @@ main(int argc, char *argv[])
 #ifdef HAVE_GTKOSXAPPLICATION
   g_object_unref(theApp);
 #endif
-       
+
   /* Shutdown windows sockets */
   WSACleanup();
 
index bf58298ccaa10f059aac1ae2ef839c929105f65e..05bb517666d8090f66ad0d802e1e2bae64c13562 100644 (file)
@@ -30,7 +30,7 @@
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
 #else
-#include "wsgetopt.h"
+#include "wsutil/wsgetopt.h"
 #endif
 
 #include "svnversion.h"
index 4b6644fa68ef2a74c9ef050306b7a5d65008bbcf..941b267643d72935f24468d5dc8b8abe117cc12c 100644 (file)
--- a/randpkt.c
+++ b/randpkt.c
@@ -30,7 +30,7 @@
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
 #else
-#include "wsgetopt.h"
+#include "wsutil/wsgetopt.h"
 #endif
 
 #ifdef HAVE_UNISTD_H
index 23cff51cb566e7c913a38312654bc37552d4e8ba..6a7d89606c5476e3d7e1f4998f7c5954ebedc73f 100644 (file)
 #endif
 
 #ifdef NEED_STRERROR_H
-#include "strerror.h"
+#include "wsutil/strerror.h"
 #endif
 
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
 #else
-#include "wsgetopt.h"
+#include "wsutil/wsgetopt.h"
 #endif
 
 #include <glib.h>
index 825fa2a12b5225a224e9fbba710fbcf60be5ecd6..f75a9f48df727560a1fb358d4a3765d71b89cd8f 100644 (file)
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
 #else
-#include "wsgetopt.h"
+#include "wsutil/wsgetopt.h"
 #endif
 
 #ifdef NEED_STRPTIME_H
-# include "strptime.h"
+# include "wsutil/strptime.h"
 #endif
 
 #include "text2pcap.h"
@@ -1075,7 +1075,7 @@ usage (void)
             "  -u <srcp>,<destp>      prepend dummy UDP header with specified\n"
             "                         dest and source ports (in DECIMAL).\n"
             "                         Automatically prepends Ethernet & IP headers as well.\n"
-            "                         Example: -u 1000 69 to make the packets look like TFTP/UDP packets.\n" 
+            "                         Example: -u 1000 69 to make the packets look like TFTP/UDP packets.\n"
             "  -T <srcp>,<destp>      prepend dummy TCP header with specified\n"
             "                         dest and source ports (in DECIMAL).\n"
             "                         Automatically prepends Ethernet & IP headers as well.\n"
index 73c810a2cab02d5b797643467d215701c59c51be..f25305a6699d9af927cb01e6249335cd4cae787b 100644 (file)
--- a/tshark.c
+++ b/tshark.c
 #endif
 
 #ifdef NEED_STRERROR_H
-#include "strerror.h"
+#include "wsutil/strerror.h"
 #endif
 
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
 #else
-#include "wsgetopt.h"
+#include "wsutil/wsgetopt.h"
 #endif
 
 #include <glib.h>
index 96b96b70d56019d59698e89e52da242ebb612bf7..4bef18437d0d936c76d16db2e80df44f4b6e2459 100644 (file)
@@ -29,6 +29,13 @@ IF(WIN32)
 ENDIF(WIN32)
 
 set(WSUTIL_FILES
+#              @GETOPT_O@      # wsgetopt.c
+#              @INET_ATON_LO@  # inet_aton.c
+#              @INET_NTOP_LO@  # inet_ntop.c
+#              @INET_PTON_LO@  # inet_pton.c
+#              @STRERROR_O@    # strerror.c
+#              @STRNCASECMP_O@ # strncasecmp.c
+#              @STRPTIME_O@    # strptime.c
   mpeg-audio.c
   privileges.c
   str_util.c
index 461557d45cc0e6791f7d73c2eb29ec804cde1b2a..84a643b6cfd185488ae190ebbbe212f76347695c 100644 (file)
@@ -28,24 +28,46 @@ if HAVE_WARNINGS_AS_ERRORS
 AM_CFLAGS = -Werror
 endif
 
+# Optional objects that I know how to build. These will be
+# linked into libwsutil.
+wsutil_optional_objects =      \
+       @GETOPT_O@              \
+       @STRERROR_O@            \
+       @STRNCASECMP_O@         \
+       @STRPTIME_O@            \
+       @INET_PTON_LO@          \
+       @INET_NTOP_LO@
+
 lib_LTLIBRARIES = libwsutil.la
 
 INCLUDES = -I$(srcdir)/..
 
-libwsutil_la_SOURCES = \
+libwsutil_la_SOURCES =         \
        $(LIBWSUTIL_SRC)        \
        $(LIBWSUTIL_INCLUDES)
 
-libwsutil_la_LIBADD = @GLIB_LIBS@
+libwsutil_la_LIBADD =  \
+       @GLIB_LIBS@     \
+       $(wsutil_optional_objects)
 
-EXTRA_DIST = \
+EXTRA_DIST =           \
        Makefile.common \
        Makefile.nmake  \
        file_util.c     \
        file_util.h     \
+       inet_ntop.c     \
+       inet_pton.c     \
+       inet_v6defs.h   \
        libwsutil.def   \
+       strerror.c      \
+       strerror.h      \
+       strncasecmp.c   \
+       strptime.c      \
+       strptime.h      \
        unicode-utils.c \
-       unicode-utils.h
+       unicode-utils.h \
+       wsgetopt.c      \
+       wsgetopt.h
 
 CLEANFILES = \
        libwsutil.a     \
index 08ee5150267bc92d30a36c2cbe22b594ecb9b5ac..9e9c56e71679e5057772fadf3953932c3b14899f 100644 (file)
 # generated from YACC or Lex files (as Automake doesn't want them in
 # _SOURCES variables).
 LIBWSUTIL_SRC =        \
+       inet_aton.c     \
        mpeg-audio.c    \
        privileges.c    \
-       str_util.c              \
+       str_util.c      \
        type_util.c
 
 # Header files that are not generated from other files
 LIBWSUTIL_INCLUDES =   \
+       inet_aton.h     \
        mpeg-audio.h    \
        privileges.h    \
-       str_util.h              \
+       str_util.h      \
        type_util.h
index d12fe418634def781bc9ca430641d8208a605b3c..9f264b92920d3d7370ebb4c809a19121b748aed6 100644 (file)
@@ -22,8 +22,13 @@ CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
 # For use when making libwsutil.dll
 libwsutil_LIBS = $(GLIB_LIBS)
 
-OBJECTS = file_util.obj unicode-utils.obj $(LIBWSUTIL_SRC:.c=.obj)
-
+OBJECTS = file_util.obj                \
+       inet_ntop.obj           \
+       inet_pton.obj           \
+       $(LIBWSUTIL_SRC:.c=.obj) \
+       strptime.obj            \
+       unicode-utils.obj       \
+       wsgetopt.obj
 
 # For use when making libwsutil.dll
 libwsutil.lib: libwsutil.dll
similarity index 100%
rename from epan/inet_aton.c
rename to wsutil/inet_aton.c
similarity index 100%
rename from epan/inet_aton.h
rename to wsutil/inet_aton.h
similarity index 100%
rename from inet_ntop.c
rename to wsutil/inet_ntop.c
similarity index 100%
rename from inet_pton.c
rename to wsutil/inet_pton.c
similarity index 100%
rename from inet_v6defs.h
rename to wsutil/inet_v6defs.h
index db5d2ec4981b9deb3140138467bac4f614780ced..ad304e8ef768cfe793a47e5b804d4d42793fa8ad 100644 (file)
@@ -19,6 +19,15 @@ ws_stdio_rename
 ws_stdio_stat
 ws_stdio_unlink
 
+; inet_aton.c
+inet_aton
+
+; inet_ntop.c
+inet_ntop
+
+; inet_pton.c
+inet_pton
+
 ; mpeg-audio.c
 mpa_bitrate
 mpa_frequency
@@ -36,6 +45,9 @@ relinquish_special_privs_perm
 running_with_special_privs
 started_with_special_privs
 
+; strptime.c
+strptime
+
 ; str_util.c
 ascii_strdown_inplace
 ascii_strup_inplace
@@ -48,3 +60,9 @@ type_util_guint64_to_gdouble
 utf_16to8
 utf_8to16
 utf_8to16_snprintf
+
+; wsgetopt.c
+getopt
+optarg DATA
+optind DATA
+opterr DATA
similarity index 100%
rename from strerror.c
rename to wsutil/strerror.c
similarity index 100%
rename from strerror.h
rename to wsutil/strerror.h
similarity index 100%
rename from strncasecmp.c
rename to wsutil/strncasecmp.c
similarity index 100%
rename from strptime.c
rename to wsutil/strptime.c
similarity index 100%
rename from strptime.h
rename to wsutil/strptime.h
similarity index 100%
rename from wsgetopt.c
rename to wsutil/wsgetopt.c
similarity index 97%
rename from wsgetopt.h
rename to wsutil/wsgetopt.h
index e22c634bcc6041c7aa4558cb246cd28bade09503..8744bed10fa941cd1aef924e00895b7eac80df6c 100644 (file)
@@ -28,7 +28,7 @@ extern "C" {
    Also, when `ordering' is RETURN_IN_ORDER,
    each non-option ARGV-element is returned here.  */
 
-extern char *optarg;
+WS_VAR_IMPORT char *optarg;
 
 /* Index in ARGV of the next element to be scanned.
    This is used for communication to and from the caller
@@ -42,16 +42,16 @@ extern char *optarg;
    Otherwise, `optind' communicates from one call to the next
    how much of ARGV has been scanned so far.  */
 
-extern int optind;
+WS_VAR_IMPORT int optind;
 
 /* Callers store zero here to inhibit the error message `getopt' prints
    for unrecognized options.  */
 
-extern int opterr;
+WS_VAR_IMPORT int opterr;
 
 /* Set to an option character which was unrecognized.  */
 
-extern int optopt;
+WS_VAR_IMPORT int optopt;
 
 /* Describe the long-named options requested by the application.
    The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector