Move some code (including the optional objects) into libwsutil

svn path=/trunk/; revision=33012
This commit is contained in:
Jeff Morriss 2010-05-28 20:19:55 +00:00
parent 17807a6b21
commit 47e2d75820
43 changed files with 143 additions and 177 deletions

View 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}

View 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@ \

View 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)

View File

@ -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
@ -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 \

View File

@ -82,7 +82,7 @@
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#else
#include "wsgetopt.h"
#include "wsutil/wsgetopt.h"
#endif
#include "svnversion.h"

View File

@ -44,7 +44,7 @@
#endif
#ifdef NEED_INET_V6DEFS_H
# include "inet_v6defs.h"
# include "wsutil/inet_v6defs.h"
#endif
#include <glib.h>

View File

@ -33,7 +33,7 @@
#include <errno.h>
#ifdef NEED_STRERROR_H
#include "strerror.h"
#include "wsutil/strerror.h"
#endif
#include <glib.h>

View File

@ -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>

View File

@ -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"

View 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

View 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
@ -134,8 +129,7 @@ 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) \
@ -285,23 +279,6 @@ 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

View File

@ -90,11 +90,11 @@
#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)

View 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"

View 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>

View 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

View File

@ -289,7 +289,7 @@
#include <glib.h>
#include <math.h>
#ifdef NEED_STRERROR_H
#include "strerror.h"
#include "wsutil/strerror.h"
#endif
#include "isprint.h"

View File

@ -50,7 +50,7 @@
#endif
#ifdef NEED_INET_V6DEFS_H
# include "inet_v6defs.h"
# include "wsutil/inet_v6defs.h"
#endif
#include <glib.h>

View File

@ -121,7 +121,9 @@
#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"

View File

@ -59,7 +59,7 @@
#endif
#ifdef NEED_INET_V6DEFS_H
# include "inet_v6defs.h"
# include "wsutil/inet_v6defs.h"
#endif
#include <glib.h>

View File

@ -42,7 +42,7 @@
#include <ftypes-int.h>
#ifdef NEED_STRPTIME_H
#include "strptime.h"
#include "wsutil/strptime.h"
#endif
static gboolean

View File

@ -42,13 +42,13 @@
#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 */

View File

@ -30,7 +30,7 @@
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#else
#include "wsgetopt.h"
#include "wsutil/wsgetopt.h"
#endif
#include "svnversion.h"

View File

@ -30,7 +30,7 @@
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#else
#include "wsgetopt.h"
#include "wsutil/wsgetopt.h"
#endif
#ifdef HAVE_UNISTD_H

View File

@ -62,13 +62,13 @@
#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>

View File

@ -128,11 +128,11 @@
#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"

View File

@ -52,13 +52,13 @@
#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>

View 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

View File

@ -28,6 +28,16 @@ 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)/..
@ -36,16 +46,28 @@ libwsutil_la_SOURCES = \
$(LIBWSUTIL_SRC) \
$(LIBWSUTIL_INCLUDES)
libwsutil_la_LIBADD = @GLIB_LIBS@
libwsutil_la_LIBADD = \
@GLIB_LIBS@ \
$(wsutil_optional_objects)
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 \

View File

@ -29,6 +29,7 @@
# 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 \
@ -36,6 +37,7 @@ LIBWSUTIL_SRC = \
# Header files that are not generated from other files
LIBWSUTIL_INCLUDES = \
inet_aton.h \
mpeg-audio.h \
privileges.h \
str_util.h \

View 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

View 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

View 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