diff --git a/pvpgn/BUGS b/BUGS
similarity index 100%
rename from pvpgn/BUGS
rename to BUGS
diff --git a/pvpgn/CMakeLists.txt b/CMakeLists.txt
similarity index 100%
rename from pvpgn/CMakeLists.txt
rename to CMakeLists.txt
diff --git a/d2pack109/COPYING b/COPYING
similarity index 100%
rename from d2pack109/COPYING
rename to COPYING
diff --git a/pvpgn/CREDITS b/CREDITS
similarity index 100%
rename from pvpgn/CREDITS
rename to CREDITS
diff --git a/pvpgn/ConfigureChecks.cmake b/ConfigureChecks.cmake
similarity index 100%
rename from pvpgn/ConfigureChecks.cmake
rename to ConfigureChecks.cmake
diff --git a/pvpgn/IGNOREME b/IGNOREME
similarity index 100%
rename from pvpgn/IGNOREME
rename to IGNOREME
diff --git a/pvpgn/NEWS b/NEWS
similarity index 100%
rename from pvpgn/NEWS
rename to NEWS
diff --git a/pvpgn/README.ALPHA b/README.ALPHA
similarity index 100%
rename from pvpgn/README.ALPHA
rename to README.ALPHA
diff --git a/pvpgn/README.DEV b/README.DEV
similarity index 100%
rename from pvpgn/README.DEV
rename to README.DEV
diff --git a/pvpgn/README.cmake b/README.cmake
similarity index 100%
rename from pvpgn/README.cmake
rename to README.cmake
diff --git a/README.md b/README.md
index 1bb012e..e84fd4b 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,6 @@ New commands
* `/save` immediately save changes of accounts and clans from the cache to a storage (useful for testing) [commit](https://github.com/HarpyWar/pvpgn/commit/be8d65d16f910b2090b0db9e7eb2c043b816dae7)
-
Minor changes
--
* add original MOTD files with UTF-8 encoding
@@ -26,7 +25,8 @@ Minor changes
* add ODBC support for CMake
* add latest versioncheck.conf
* skip_versioncheck, allow_bad_version are enabled by default in bnetd.conf - for easy start
-
+* source code is formatted for better reading
+* unused files are removed, only pvpgn source here
Build source code
--
diff --git a/pvpgn/TODO b/TODO
similarity index 100%
rename from pvpgn/TODO
rename to TODO
diff --git a/pvpgn/UPDATE b/UPDATE
similarity index 100%
rename from pvpgn/UPDATE
rename to UPDATE
diff --git a/pvpgn/cmake/Modules/CheckIncludeFilesCXX.cmake b/cmake/Modules/CheckIncludeFilesCXX.cmake
similarity index 100%
rename from pvpgn/cmake/Modules/CheckIncludeFilesCXX.cmake
rename to cmake/Modules/CheckIncludeFilesCXX.cmake
diff --git a/pvpgn/cmake/Modules/CheckMkdirArgs.cmake b/cmake/Modules/CheckMkdirArgs.cmake
similarity index 100%
rename from pvpgn/cmake/Modules/CheckMkdirArgs.cmake
rename to cmake/Modules/CheckMkdirArgs.cmake
diff --git a/pvpgn/cmake/Modules/CheckTypeSizeCXX.cmake b/cmake/Modules/CheckTypeSizeCXX.cmake
similarity index 100%
rename from pvpgn/cmake/Modules/CheckTypeSizeCXX.cmake
rename to cmake/Modules/CheckTypeSizeCXX.cmake
diff --git a/pvpgn/cmake/Modules/CheckTypeSizeCXX.cxx.in b/cmake/Modules/CheckTypeSizeCXX.cxx.in
similarity index 100%
rename from pvpgn/cmake/Modules/CheckTypeSizeCXX.cxx.in
rename to cmake/Modules/CheckTypeSizeCXX.cxx.in
diff --git a/pvpgn/cmake/Modules/DefineInstallationPaths.cmake b/cmake/Modules/DefineInstallationPaths.cmake
similarity index 100%
rename from pvpgn/cmake/Modules/DefineInstallationPaths.cmake
rename to cmake/Modules/DefineInstallationPaths.cmake
diff --git a/pvpgn/cmake/Modules/FindMySQL.cmake b/cmake/Modules/FindMySQL.cmake
similarity index 100%
rename from pvpgn/cmake/Modules/FindMySQL.cmake
rename to cmake/Modules/FindMySQL.cmake
diff --git a/pvpgn/cmake/Modules/FindODBC.cmake b/cmake/Modules/FindODBC.cmake
similarity index 100%
rename from pvpgn/cmake/Modules/FindODBC.cmake
rename to cmake/Modules/FindODBC.cmake
diff --git a/pvpgn/cmake/Modules/FindPostgreSQL.cmake b/cmake/Modules/FindPostgreSQL.cmake
similarity index 100%
rename from pvpgn/cmake/Modules/FindPostgreSQL.cmake
rename to cmake/Modules/FindPostgreSQL.cmake
diff --git a/pvpgn/cmake/Modules/FindSQLite3.cmake b/cmake/Modules/FindSQLite3.cmake
similarity index 100%
rename from pvpgn/cmake/Modules/FindSQLite3.cmake
rename to cmake/Modules/FindSQLite3.cmake
diff --git a/pvpgn/cmake/Modules/FindZLIB.cmake b/cmake/Modules/FindZLIB.cmake
similarity index 100%
rename from pvpgn/cmake/Modules/FindZLIB.cmake
rename to cmake/Modules/FindZLIB.cmake
diff --git a/pvpgn/conf/CMakeLists.txt b/conf/CMakeLists.txt
similarity index 100%
rename from pvpgn/conf/CMakeLists.txt
rename to conf/CMakeLists.txt
diff --git a/pvpgn/conf/Makefile.am b/conf/Makefile.am
similarity index 100%
rename from pvpgn/conf/Makefile.am
rename to conf/Makefile.am
diff --git a/pvpgn/conf/ad.conf.in b/conf/ad.conf.in
similarity index 100%
rename from pvpgn/conf/ad.conf.in
rename to conf/ad.conf.in
diff --git a/pvpgn/conf/address_translation.conf.in b/conf/address_translation.conf.in
similarity index 100%
rename from pvpgn/conf/address_translation.conf.in
rename to conf/address_translation.conf.in
diff --git a/pvpgn/conf/anongame_infos.conf.in b/conf/anongame_infos.conf.in
similarity index 100%
rename from pvpgn/conf/anongame_infos.conf.in
rename to conf/anongame_infos.conf.in
diff --git a/pvpgn/conf/autoupdate.conf.in b/conf/autoupdate.conf.in
similarity index 98%
rename from pvpgn/conf/autoupdate.conf.in
rename to conf/autoupdate.conf.in
index 26953ac..a4fb468 100644
--- a/pvpgn/conf/autoupdate.conf.in
+++ b/conf/autoupdate.conf.in
@@ -1,518 +1,518 @@
-##############################################################################
-# autoupdate.conf - Auto Update Configuration #
-#----------------------------------------------------------------------------#
-# #
-# This is a list of client tags and their equivalent autoupdate files and #
-# version information. #
-# #
-# This file will be ignored for certain clients if skip_versioncheck is #
-# enabled in the bnetd.conf file. #
-# #
-# Only the first matching line is used. If no lines match then no upgrade #
-# will be attempted and the client will remain at its current version. #
-# #
-# Note: if you want to use the autoupdate wildcard entries, you'll also need #
-# to uncomment the corresponding wildcard entries in versioncheck.conf. #
-# #
-# Do not include "/" in any of the filenames. #
-# #
-# The versiontag is used to identify a particular version as specified in #
-# the versioncheck configuration file. #
-# #
-# It works like this: versioncheck identifies a version by reported version #
-# number, checksum, clienttag, etc. The autoupdate then uses the arch tag, #
-# client tag and version tag to find the needed update file. #
-# #
-##############################################################################
-# Battle.net related informations #
-#----------------------------------------------------------------------------#
-# War3 and War3x clients have different mpq files for the different game #
-# languages. This is accounted for by the server, and the client will get #
-# the correct file. Only one entry is needed per arch, client, and version #
-# tag. #
-# #
-# Example: With the following line: #
-# #
-# IX86 W3XP W3XP_107A W3XP_IX86_1xx_111A.mpq #
-# #
-# war3x english clients will receive the file "W3XP_IX86_1xx_111A_enUS.mpq" #
-# where russian clients will receive the file "W3XP_IX86_1xx_111A_ruRU.mpq" #
-# and german clients will receive the file "W3XP_IX86_1xx_111A_deDE.mpq" #
-# Make sure all the required mpq files are in the files directory or #
-# autoupdate will not work. #
-# #
-# The avaliable language files are: #
-# #
-# enUS csCZ deDE esES frFR itIT jaJA koKR plPL ruRU zhCN zhTW #
-# #
-# The format of this file is as follows: #
-# #
-# archtag clienttag versiontag -----update file----- #
-# #
-##############################################################################
-# Westwood Online related informations #
-#----------------------------------------------------------------------------#
-# For WOL autoupdate is used standart FTP protocol which is not included in #
-# PvPGN. The default WOL autoupdate entryes are writed according to #
-# westwood's autoupdate FTP server settings (username, password, filepath). #
-# #
-# WOLv2 using diferent rtp files for the diferent SKUs. This is accounted #
-# for by the server, and the client will get the correct file. Only one #
-# entry is needed per arch, client, and version tag. #
-# #
-# Example: With the following line: #
-# IX86 TSUN 65536 131075_65536.rtp tibsun #
-# #
-# TibSun clients with SKU 4608 will receive the file "131075_65536_4608.rtp" #
-# TibSun clients with SKU 4610 will receive the file "131075_65536_4610.rtp" #
-# #
-# The avaliable clients, theirs tags and SKUs are: #
-# #
-# Client name CTag SKUs #
-# --------------------------------------------------- #
-# Renegade RNGD 3072 3074 3075 3078 3081 3082 #
-# Dune 2000 DN2K 3584 3586 3587 3589 3591 #
-# Nox NOXX 4096 4098 4099 4101 4102 4105 #
-# Tiberian Sun TSUN 4608 4610 4611 4615 #
-# Red Alert 1v3 RALT 5376 5378 5379 #
-# Lands of Lore 3 LOR3 6400 6401 6402 6403 6405 #
-# Tiberian Sun XP TSXP 7168 7170 7171 7175 7424 7426 7427 7431 #
-# Emperor: BFD EBFD 7936 7938 7939 7945 7946 #
-# Red Alert 2 RAL2 8448 8450 8451 8457 8458 8960 8962 8963 8969 8970 #
-# Nox Quest NOXQ 9472 9474 9475 9477 9478 9481 #
-# Yuri's Revenge YURI 10496 10498 10499 10505 10506 #
-# Renegade Server RFDS 12288 #
-# WOL API WWOL 32512 #
-# #
-# Note: WOL update entry must including file path according to FTP server. #
-# All WOL entries using archtag IX86. #
-# #
-# The format of this file is as follows: #
-# #
-# archtag clienttag versiontag -----update file----- file path #
-# #
-##############################################################################
-
-##### Intel (IX86) ###########################################################
-
-# =============== WarCraft III - FT (Expansion) ===============
-#IX86 W3XP W3XP_107A W3XP_IX86_1xx_122a_2.mpq
-#IX86 W3XP W3XP_110A W3XP_IX86_1xx_122a_2.mpq
-#IX86 W3XP W3XP_111A W3XP_IX86_1xx_122a_2.mpq
-#IX86 W3XP W3XP_112A W3XP_IX86_1xx_122a_2.mpq
-#IX86 W3XP W3XP_113A W3XP_IX86_1xx_122a_2.mpq
-#IX86 W3XP W3XP_113B W3XP_IX86_1xx_122a_2.mpq
-#IX86 W3XP W3XP_114A W3XP_IX86_1xx_122a_2.mpq
-#IX86 W3XP W3XP_114B W3XP_IX86_1xx_122a_2.mpq
-#IX86 W3XP W3XP_115A W3XP_IX86_1xx_122a_2.mpq
-#IX86 W3XP W3XP_116A W3XP_IX86_1xx_122a_2.mpq
-#IX86 W3XP W3XP_117A W3XP_IX86_1xx_122a_2.mpq
-#IX86 W3XP W3XP_118A W3XP_IX86_1xx_122a_2.mpq
-#IX86 W3XP W3XP_119A W3XP_IX86_1xx_122a_2.mpq
-#IX86 W3XP W3XP_119B W3XP_IX86_1xx_122a_2.mpq
-#IX86 W3XP W3XP_120A W3XP_IX86_1xx_122a_2.mpq
-#IX86 W3XP W3XP_120B W3XP_IX86_1xx_122a_2.mpq
-#IX86 W3XP W3XP_120C W3XP_IX86_1xx_122a_2.mpq
-#IX86 W3XP W3XP_120D W3XP_IX86_1xx_122a_2.mpq
-#IX86 W3XP W3XP_120E W3XP_IX86_1xx_122a_2.mpq
-#IX86 W3XP W3XP_121A W3XP_IX86_1xx_122a_2.mpq
-
-# Incremental update from version 1.21b
-#IX86 W3XP W3XP_121B W3XP_IX86_121B_122a_2.mpq
-
-# The next one is a WarCraft III - FT wildcard entry.
-#IX86 W3XP W3XP_1xx W3XP_IX86_1xx_122a_2.mpq
-
-# ==================== WarCraft III - RoC =====================
-#IX86 WAR3 WAR3_107A WAR3_IX86_1xx_122a_2.mpq
-#IX86 WAR3 WAR3_110A WAR3_IX86_1xx_122a_2.mpq
-#IX86 WAR3 WAR3_111A WAR3_IX86_1xx_122a_2.mpq
-#IX86 WAR3 WAR3_112A WAR3_IX86_1xx_122a_2.mpq
-#IX86 WAR3 WAR3_113A WAR3_IX86_1xx_122a_2.mpq
-#IX86 WAR3 WAR3_113B WAR3_IX86_1xx_122a_2.mpq
-#IX86 WAR3 WAR3_114A WAR3_IX86_1xx_122a_2.mpq
-#IX86 WAR3 WAR3_114B WAR3_IX86_1xx_122a_2.mpq
-#IX86 WAR3 WAR3_115A WAR3_IX86_1xx_122a_2.mpq
-#IX86 WAR3 WAR3_116A WAR3_IX86_1xx_122a_2.mpq
-#IX86 WAR3 WAR3_117A WAR3_IX86_1xx_122a_2.mpq
-#IX86 WAR3 WAR3_118A WAR3_IX86_1xx_122a_2.mpq
-#IX86 WAR3 WAR3_119A WAR3_IX86_1xx_122a_2.mpq
-#IX86 WAR3 WAR3_119B WAR3_IX86_1xx_122a_2.mpq
-#IX86 WAR3 WAR3_120A WAR3_IX86_1xx_122a_2.mpq
-#IX86 WAR3 WAR3_120B WAR3_IX86_1xx_122a_2.mpq
-#IX86 WAR3 WAR3_120C WAR3_IX86_1xx_122a_2.mpq
-#IX86 WAR3 WAR3_120D WAR3_IX86_1xx_122a_2.mpq
-#IX86 WAR3 WAR3_120E WAR3_IX86_1xx_122a_2.mpq
-#IX86 WAR3 WAR3_121A WAR3_IX86_1xx_122a_2.mpq
-
-# Incremental update from version 1.21b
-#IX86 WAR3 WAR3_121B WAR3_IX86_121B_122a_2.mpq
-
-# The next one is a WarCraft III - RoC wildcard entry.
-#IX86 WAR3 WAR3_1xx WAR3_IX86_1xx_122a_2.mpq
-
-# ===================== Diablo II Expansion (LoD) ===========================
-# Note: the following assumes that you want to upgrade all Diablo II clients
-# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you
-# will need to modify these entries accordingly.
-
-#IX86 D2XP D2XP_107 D2XP_IX86_1xx_112A.mpq
-#IX86 D2XP D2XP_108 D2XP_IX86_1xx_112A.mpq
-#IX86 D2XP D2XP_109 D2XP_IX86_1xx_112A.mpq
-#IX86 D2XP D2XP_109B D2XP_IX86_1xx_112A.mpq
-#IX86 D2XP D2XP_109C D2XP_IX86_1xx_112A.mpq
-#IX86 D2XP D2XP_109D D2XP_IX86_1xx_112A.mpq
-#IX86 D2XP D2XP_110 D2XP_IX86_1xx_112A.mpq
-#IX86 D2XP D2XP_111 D2XP_IX86_1xx_112A.mpq
-
-# Incremental update from version 1.11a --> 1.11b
-#IX86 D2XP D2XP_111B D2XP_IX86_111B_112A.mpq
-
-# The next one is a Diablo II LoD wildcard entry.
-#IX86 D2XP D2XP_1xx D2XP_IX86_1xx_112A.mpq
-
-# ========================== Diablo II (DV) =================================
-# Note: the following assumes that you want to upgrade all Diablo II clients
-# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you
-# will need to modify these entries accordingly.
-
-#IX86 D2DV D2DV_100 D2DV_IX86_1xx_112A.mpq
-#IX86 D2DV D2DV_101 D2DV_IX86_1xx_112A.mpq
-#IX86 D2DV D2DV_103 D2DV_IX86_1xx_112A.mpq
-#IX86 D2DV D2DV_104B D2DV_IX86_1xx_112A.mpq
-#IX86 D2DV D2DV_104C D2DV_IX86_1xx_112A.mpq
-#IX86 D2DV D2DV_105 D2DV_IX86_1xx_112A.mpq
-#IX86 D2DV D2DV_105B D2DV_IX86_1xx_112A.mpq
-#IX86 D2DV D2DV_106 D2DV_IX86_1xx_112A.mpq
-#IX86 D2DV D2DV_106B D2DV_IX86_1xx_112A.mpq
-#IX86 D2DV D2DV_108 D2DV_IX86_1xx_112A.mpq
-#IX86 D2DV D2DV_109 D2DV_IX86_1xx_112A.mpq
-#IX86 D2DV D2DV_109B D2DV_IX86_1xx_112A.mpq
-#IX86 D2DV D2DV_109C D2DV_IX86_1xx_112A.mpq
-#IX86 D2DV D2DV_109D D2DV_IX86_1xx_112A.mpq
-#IX86 D2DV D2DV_110 D2DV_IX86_1xx_112A.mpq
-#IX86 D2DV D2DV_111 D2DV_IX86_1xx_112A.mpq
-
-# Incremental update from version 1.11a --> 1.11b
-#IX86 D2DV D2DV_111B D2DV_IX86_111B_112A.mpq
-
-# The next one is a Diablo II wildcard entry.
-#IX86 D2DV D2DV_1xx D2DV_IX86_1xx_112A.mpq
-
-# ================ StarCraft Expansion (Brood War) ==========================
-#IX86 SEXP SEXP_104 SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_104_STAR SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_105 SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_105_STAR SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_106 SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_106_STAR SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_107 SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_107_STAR SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_108 SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_108_STAR SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_108B SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_108B_STAR SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_109 SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_109_STAR SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_110 SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_110_STAR SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_111 SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_111_STAR SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_111B SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_111B_STAR SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_112 SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_112_STAR SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_112B SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_112B_STAR SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_113 SEXP_IX86_1xx_1161.mpq
-# unfortunately we don't have a SEXP_113_STAR in versioncheck.conf
-#IX86 SEXP SEXP_113B SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_113B_STAR SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_113C SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_113C_STAR SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_113D SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_113D_STAR SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_113E SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_113E SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_114 SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_114 SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_115 SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_115 SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_1151 SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_1151 SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_1152 SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_1152 SEXP_IX86_1xx_1161.mpq
-#IX86 SEXP SEXP_1153 SEXP_IX86_1xx_1161.mpq
-#IX86 STAR SEXP_1153 SEXP_IX86_1xx_1161.mpq
-
-# Incremental update from version 1.15.3
-#IX86 SEXP SEXP_116 SEXP_IX86_116_1161.mpq
-#IX86 STAR SEXP_116 SEXP_IX86_116_1161.mpq
-
-# The next one is a Brood War wildcard entry.
-#IX86 SEXP SEXP_1xx SEXP_IX86_1xx_1161.mpq
-
-# ========================= StarCraft (original) ============================
-#IX86 STAR STAR_100 STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_101 STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_102 STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_103 STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_104 STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_105 STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_106 STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_107 STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_108 STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_108B STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_109 STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_109B STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_110 STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_111 STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_111B STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_112 STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_112B STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_113 STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_113B STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_113C STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_113D STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_113E STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_114 STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_115 STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_1151 STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_1152 STAR_IX86_1xx_1161.mpq
-#IX86 STAR STAR_1153 SEXP_IX86_1xx_1161.mpq
-
-# Incremental update from version 1.15.3
-#IX86 STAR STAR_116 SEXP_IX86_116_1161.mpq
-
-# The next one is a Starcraft wildcard entry.
-#IX86 STAR STAR_1xx STAR_IX86_1xx_1161.mpq
-
-# ========================= Diablo (original) ==============================
-# note: Blizzard doesn't update client from 109 to 109b.
-#IX86 DRTL DRTL_108 DRTL_IX86_108_109.mpq
-
-# The next one is a Diablo wildcard entry.
-#IX86 DRTL DRTL_1xx DRTL_IX86_100_109.mpq
-
-# ========================= Warcraft II BNE ===============================
-#IX86 W2BN W2BN_200 W2BN_IX86_200_202.mpq
-#IX86 W2BN W2BN_201 W2BN_IX86_201_202.mpq
-
-##### Mac OS X (XMAC) ########################################################
-
-# ===================== Diablo II Expansion (LoD) ===========================
-# Note: the following assumes that you want to upgrade all Diablo II clients
-# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you
-# will need to modify these entries accordingly.
-
-#XMAC D2XP D2XP_109D D2XP_XMAC_1xx_111B.mpq
-#XMAC D2XP D2XP_110 D2XP_XMAC_1xx_111B.mpq
-
-# Incremental update from version 1.11a --> 1.11b
-#XMAC D2XP D2XP_111 D2XP_XMAC_111A_111B.mpq
-
-# The next one is a Diablo II LoD wildcard entry.
-#XMAC D2XP D2XP_1xx D2XP_XMAC_1xx_111B.mpq
-
-# ========================== Diablo II (DV) =================================
-# Note: the following assumes that you want to upgrade all Diablo II clients
-# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you
-# will need to modify these entries accordingly.
-
-#XMAC D2DV D2DV_109D D2DV_XMAC_1xx_111B.mpq
-#XMAC D2DV D2DV_110 D2DV_XMAC_1xx_111B.mpq
-
-# Incremental update from version 1.11a --> 1.11b
-#XMAC D2DV D2DV_111 D2DV_XMAC_111A_111B.mpq
-
-# The next one is a Diablo II LoD wildcard entry.
-#XMAC D2DV D2DV_1xx D2DV_XMAC_1xx_111B.mpq
-
-# ================ StarCraft Expansion (Brood War) ==========================
-
-#XMAC SEXP SEXP_109B SEXP_XMAC_1xx_113E.mpq
-#XMAC SEXP SEXP_110 SEXP_XMAC_1xx_113E.mpq
-#XMAC STAR SEXP_110_STAR SEXP_XMAC_1xx_113E.mpq
-#XMAC SEXP SEXP_111 SEXP_XMAC_1xx_113E.mpq
-#XMAC STAR SEXP_111_STAR SEXP_XMAC_1xx_113E.mpq
-#XMAC SEXP SEXP_111B SEXP_XMAC_1xx_113E.mpq
-#XMAC STAR SEXP_111B_STAR SEXP_XMAC_1xx_113E.mpq
-#XMAC SEXP SEXP_112 SEXP_XMAC_1xx_113E.mpq
-#XMAC STAR SEXP_112_STAR SEXP_XMAC_1xx_113E.mpq
-#XMAC SEXP SEXP_113 SEXP_XMAC_1xx_113E.mpq
-#XMAC STAR SEXP_113_STAR SEXP_XMAC_1xx_113E.mpq
-#XMAC SEXP SEXP_113C SEXP_XMAC_1xx_113E.mpq
-#XMAC STAR SEXP_113C_STAR SEXP_XMAC_1xx_113E.mpq
-# Unfortunately versioncheck.conf does not contain entries for 1.13{a|b|d}
-
-# The next one is a Brood War wildcard entry.
-#XMAC SEXP SEXP_1xx SEXP_XMAC_1xx_113E.mpq
-
-# ========================= StarCraft (original) ============================
-
-#XMAC STAR STAR_109B STAR_XMAC_1xx_113E.mpq
-#XMAC STAR STAR_110 STAR_XMAC_1xx_113E.mpq
-#XMAC STAR STAR_111 STAR_XMAC_1xx_113E.mpq
-#XMAC STAR STAR_111B STAR_XMAC_1xx_113E.mpq
-#XMAC STAR STAR_112 STAR_XMAC_1xx_113E.mpq
-# Unfortunately versioncheck.conf does not contain entries for 1.13{a-d}
-
-# The next one is a Starcraft wildcard entry.
-#XMAC STAR STAR_1xx STAR_XMAC_1xx_113E.mpq
-
-##### Mac OS Classic (PMAC) ##################################################
-
-# ===================== Diablo II Expansion (LoD) ===========================
-# Note: the following assumes that you want to upgrade all Diablo II clients
-# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you
-# will need to modify these entries accordingly.
-
-#PMAC D2XP D2XP_1xx D2XP_PMAC_1xx_111B.mpq
-
-# ========================== Diablo II (DV) =================================
-# Note: the following assumes that you want to upgrade all Diablo II clients
-# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you
-# will need to modify these entries accordingly.
-
-#PMAC D2DV D2DV_109D D2DV_PMAC_1xx_111B.mpq
-#PMAC D2DV D2DV_1xx D2DV_PMAC_1xx_111B.mpq
-
-# ================ StarCraft Expansion (Brood War) ==========================
-
-#PMAC SEXP SEXP_109B SEXP_PMAC_1xx_113E.mpq
-#PMAC SEXP SEXP_110 SEXP_PMAC_1xx_113E.mpq
-#PMAC STAR SEXP_110_STAR SEXP_PMAC_1xx_113E.mpq
-#PMAC SEXP SEXP_111 SEXP_PMAC_1xx_113E.mpq
-#PMAC STAR SEXP_111_STAR SEXP_PMAC_1xx_113E.mpq
-#PMAC SEXP SEXP_111B SEXP_PMAC_1xx_113E.mpq
-#PMAC STAR SEXP_111B_STAR SEXP_PMAC_1xx_113E.mpq
-#PMAC SEXP SEXP_112 SEXP_PMAC_1xx_113E.mpq
-#PMAC STAR SEXP_112_STAR SEXP_PMAC_1xx_113E.mpq
-
-# The next one is a Brood War wildcard entry.
-#PMAC SEXP SEXP_1xx SEXP_PMAC_1xx_113E.mpq
-
-# ========================= StarCraft (original) ============================
-
-#PMAC STAR STAR_109B STAR_PMAC_1xx_113E.mpq
-#PMAC STAR STAR_110 STAR_PMAC_1xx_113E.mpq
-#PMAC STAR STAR_111 STAR_PMAC_1xx_113E.mpq
-#PMAC STAR STAR_111B STAR_PMAC_1xx_113E.mpq
-#PMAC STAR STAR_112 STAR_PMAC_1xx_113E.mpq
-
-# The next one is a Brood War wildcard entry.
-#PMAC STAR STAR_1xx STAR_PMAC_1xx_113E.mpq
-
-##### Westwood Online update entries #########################################
-
-# ========================== Westwood Online API ============================
-
-#IX86 WWOL 65536 65551_65536.rtp wolapi
-#IX86 WWOL 65537 65551_65537.rtp wolapi
-#IX86 WWOL 65538 65551_65538.rtp wolapi
-#IX86 WWOL 65539 65551_65539.rtp wolapi
-#IX86 WWOL 65540 65551_65540.rtp wolapi
-#IX86 WWOL 65541 65551_65541.rtp wolapi
-#IX86 WWOL 65542 65551_65542.rtp wolapi
-#IX86 WWOL 65543 65551_65543.rtp wolapi
-#IX86 WWOL 65544 65551_65544.rtp wolapi
-#IX86 WWOL 65545 65551_65545.rtp wolapi
-#IX86 WWOL 65546 65551_65546.rtp wolapi
-#IX86 WWOL 65547 65551_65547.rtp wolapi
-#IX86 WWOL 65548 65551_65548.rtp wolapi
-#IX86 WWOL 65549 65551_65549.rtp wolapi
-#IX86 WWOL 65550 65551_65550.rtp wolapi
-#IX86 WWOL 65555 65556_65555.rtp wolapi
-
-# =============================== Renegade ==================================
-
-#IX86 RNGD 65538 65573_65538.rtp renegade
-#IX86 RNGD 65550 65573_65538.rtp renegade
-#IX86 RNGD 65551 65573_65538.rtp renegade
-#IX86 RNGD 65566 65573_65538.rtp renegade
-#IX86 RNGD 65567 65573_65538.rtp renegade
-#IX86 RNGD 65568 65573_65538.rtp renegade
-#IX86 RNGD 65570 65573_65570.rtp renegade
-#IX86 RNGD 65571 65573_65571.rtp renegade
-#IX86 RNGD 65572 65573_65572.rtp renegade
-
-# ==================== Renegade Free Dedicated Server =======================
-
-#IX86 RFDS 65538 65572_65538.rtp renegade
-#IX86 RFDS 65550 65572_65550.rtp renegade
-#IX86 RFDS 65551 65572_65551.rtp renegade
-#IX86 RFDS 65553 65572_65553.rtp renegade
-#IX86 RFDS 65554 65572_65554.rtp renegade
-#IX86 RFDS 65566 65572_65566.rtp renegade
-#IX86 RFDS 65568 65572_65568.rtp renegade
-#IX86 RFDS 65570 65572_65570.rtp renegade
-#IX86 RFDS 65571 65572_65571.rtp renegade
-#IX86 RFDS 65572 65573_65572.rtp renegade
-
-# ============================= Tiberian Sun ================================
-
-#IX86 TSUN 65536 131075_65536.rtp tibsun
-#IX86 TSUN 65541 131075_65536.rtp tibsun
-#IX86 TSUN 65542 131075_65536.rtp tibsun
-#IX86 TSUN 65543 131075_65536.rtp tibsun
-#IX86 TSUN 65544 131075_65536.rtp tibsun
-#IX86 TSUN 65545 131075_65536.rtp tibsun
-#IX86 TSUN 65546 131075_65536.rtp tibsun
-#IX86 TSUN 65547 131075_65536.rtp tibsun
-#IX86 TSUN 65548 131075_65548.rtp tibsun
-#IX86 TSUN 131072 131075_65548.rtp tibsun
-#IX86 TSUN 131074 131075_131074.rtp tibsun
-
-# ======================= Tiberian Sun: FireStorm ===========================
-
-#IX86 TSXP 131072 131074_131072.rtp tibsun
-#IX86 TSXP 131074 131075_131074.rtp tibsun
-
-# =============================== Dune 2000 =================================
-
-#IX86 DN2K 65536 65542.rtp dune2k/1.006/1.000
-#IX86 DN2K 65537 65542_65537.rtp dune2k/1.006/1.001
-
-# ================================== NOX ====================================
-
-#IX86 NOXX 65536 65538_65536.rtp nox
-#IX86 NOXX 65537 65538_65537.rtp nox
-
-# =============================== NOX: Quest ================================
-
-#IX86 NOXQ 65536 65538_65536.rtp nox
-#IX86 NOXQ 65537 65538_65537.rtp nox
-#IX86 NOXQ 65538 65540_65538.rtp nox
-#IX86 NOXQ 65539 65540_65539.rtp nox
-
-# ======================= Emperor: Battle for Dune ==========================
-
-#IX86 EBFD 1 65545_1.rtp emperor
-#IX86 EBFD 65536 65545_65536.rtp emperor
-#IX86 EBFD 65537 65545_65537.rtp emperor
-#IX86 EBFD 65538 65545_65538.rtp emperor
-#IX86 EBFD 65539 65545_65539.rtp emperor
-#IX86 EBFD 65540 65545_65540.rtp emperor
-#IX86 EBFD 65541 65545_65541.rtp emperor
-#IX86 EBFD 65542 65545_65542.rtp emperor
-#IX86 EBFD 65543 65545_65543.rtp emperor
-#IX86 EBFD 65544 65545_65544.rtp emperor
-
-# ============================= Red Alert 2 =================================
-
-#IX86 RAL2 65536 65542_65536.rtp ra2
-#IX86 RAL2 65537 65542_65537.rtp ra2
-#IX86 RAL2 65538 65542_65538.rtp ra2
-#IX86 RAL2 65539 65542_65539.rtp ra2
-#IX86 RAL2 65540 65542_65540.rtp ra2
-#IX86 RAL2 65541 65542_65541.rtp ra2
-
-# ============================= Yuri's Revenge ==============================
-
-#IX86 YURI 65536 65537_65536.rtp yuri
-
-# ============================= Lands of Lore 3 =============================
-
-#IX86 LOR3 65536 65539_65536.rtp lore3/1.003
-#IX86 LOR3 65537 65539_65537.rtp lore3/1.003
-#IX86 LOR3 65538 65539_65538.rtp lore3/1.003
+##############################################################################
+# autoupdate.conf - Auto Update Configuration #
+#----------------------------------------------------------------------------#
+# #
+# This is a list of client tags and their equivalent autoupdate files and #
+# version information. #
+# #
+# This file will be ignored for certain clients if skip_versioncheck is #
+# enabled in the bnetd.conf file. #
+# #
+# Only the first matching line is used. If no lines match then no upgrade #
+# will be attempted and the client will remain at its current version. #
+# #
+# Note: if you want to use the autoupdate wildcard entries, you'll also need #
+# to uncomment the corresponding wildcard entries in versioncheck.conf. #
+# #
+# Do not include "/" in any of the filenames. #
+# #
+# The versiontag is used to identify a particular version as specified in #
+# the versioncheck configuration file. #
+# #
+# It works like this: versioncheck identifies a version by reported version #
+# number, checksum, clienttag, etc. The autoupdate then uses the arch tag, #
+# client tag and version tag to find the needed update file. #
+# #
+##############################################################################
+# Battle.net related informations #
+#----------------------------------------------------------------------------#
+# War3 and War3x clients have different mpq files for the different game #
+# languages. This is accounted for by the server, and the client will get #
+# the correct file. Only one entry is needed per arch, client, and version #
+# tag. #
+# #
+# Example: With the following line: #
+# #
+# IX86 W3XP W3XP_107A W3XP_IX86_1xx_111A.mpq #
+# #
+# war3x english clients will receive the file "W3XP_IX86_1xx_111A_enUS.mpq" #
+# where russian clients will receive the file "W3XP_IX86_1xx_111A_ruRU.mpq" #
+# and german clients will receive the file "W3XP_IX86_1xx_111A_deDE.mpq" #
+# Make sure all the required mpq files are in the files directory or #
+# autoupdate will not work. #
+# #
+# The avaliable language files are: #
+# #
+# enUS csCZ deDE esES frFR itIT jaJA koKR plPL ruRU zhCN zhTW #
+# #
+# The format of this file is as follows: #
+# #
+# archtag clienttag versiontag -----update file----- #
+# #
+##############################################################################
+# Westwood Online related informations #
+#----------------------------------------------------------------------------#
+# For WOL autoupdate is used standart FTP protocol which is not included in #
+# PvPGN. The default WOL autoupdate entryes are writed according to #
+# westwood's autoupdate FTP server settings (username, password, filepath). #
+# #
+# WOLv2 using diferent rtp files for the diferent SKUs. This is accounted #
+# for by the server, and the client will get the correct file. Only one #
+# entry is needed per arch, client, and version tag. #
+# #
+# Example: With the following line: #
+# IX86 TSUN 65536 131075_65536.rtp tibsun #
+# #
+# TibSun clients with SKU 4608 will receive the file "131075_65536_4608.rtp" #
+# TibSun clients with SKU 4610 will receive the file "131075_65536_4610.rtp" #
+# #
+# The avaliable clients, theirs tags and SKUs are: #
+# #
+# Client name CTag SKUs #
+# --------------------------------------------------- #
+# Renegade RNGD 3072 3074 3075 3078 3081 3082 #
+# Dune 2000 DN2K 3584 3586 3587 3589 3591 #
+# Nox NOXX 4096 4098 4099 4101 4102 4105 #
+# Tiberian Sun TSUN 4608 4610 4611 4615 #
+# Red Alert 1v3 RALT 5376 5378 5379 #
+# Lands of Lore 3 LOR3 6400 6401 6402 6403 6405 #
+# Tiberian Sun XP TSXP 7168 7170 7171 7175 7424 7426 7427 7431 #
+# Emperor: BFD EBFD 7936 7938 7939 7945 7946 #
+# Red Alert 2 RAL2 8448 8450 8451 8457 8458 8960 8962 8963 8969 8970 #
+# Nox Quest NOXQ 9472 9474 9475 9477 9478 9481 #
+# Yuri's Revenge YURI 10496 10498 10499 10505 10506 #
+# Renegade Server RFDS 12288 #
+# WOL API WWOL 32512 #
+# #
+# Note: WOL update entry must including file path according to FTP server. #
+# All WOL entries using archtag IX86. #
+# #
+# The format of this file is as follows: #
+# #
+# archtag clienttag versiontag -----update file----- file path #
+# #
+##############################################################################
+
+##### Intel (IX86) ###########################################################
+
+# =============== WarCraft III - FT (Expansion) ===============
+#IX86 W3XP W3XP_107A W3XP_IX86_1xx_122a_2.mpq
+#IX86 W3XP W3XP_110A W3XP_IX86_1xx_122a_2.mpq
+#IX86 W3XP W3XP_111A W3XP_IX86_1xx_122a_2.mpq
+#IX86 W3XP W3XP_112A W3XP_IX86_1xx_122a_2.mpq
+#IX86 W3XP W3XP_113A W3XP_IX86_1xx_122a_2.mpq
+#IX86 W3XP W3XP_113B W3XP_IX86_1xx_122a_2.mpq
+#IX86 W3XP W3XP_114A W3XP_IX86_1xx_122a_2.mpq
+#IX86 W3XP W3XP_114B W3XP_IX86_1xx_122a_2.mpq
+#IX86 W3XP W3XP_115A W3XP_IX86_1xx_122a_2.mpq
+#IX86 W3XP W3XP_116A W3XP_IX86_1xx_122a_2.mpq
+#IX86 W3XP W3XP_117A W3XP_IX86_1xx_122a_2.mpq
+#IX86 W3XP W3XP_118A W3XP_IX86_1xx_122a_2.mpq
+#IX86 W3XP W3XP_119A W3XP_IX86_1xx_122a_2.mpq
+#IX86 W3XP W3XP_119B W3XP_IX86_1xx_122a_2.mpq
+#IX86 W3XP W3XP_120A W3XP_IX86_1xx_122a_2.mpq
+#IX86 W3XP W3XP_120B W3XP_IX86_1xx_122a_2.mpq
+#IX86 W3XP W3XP_120C W3XP_IX86_1xx_122a_2.mpq
+#IX86 W3XP W3XP_120D W3XP_IX86_1xx_122a_2.mpq
+#IX86 W3XP W3XP_120E W3XP_IX86_1xx_122a_2.mpq
+#IX86 W3XP W3XP_121A W3XP_IX86_1xx_122a_2.mpq
+
+# Incremental update from version 1.21b
+#IX86 W3XP W3XP_121B W3XP_IX86_121B_122a_2.mpq
+
+# The next one is a WarCraft III - FT wildcard entry.
+#IX86 W3XP W3XP_1xx W3XP_IX86_1xx_122a_2.mpq
+
+# ==================== WarCraft III - RoC =====================
+#IX86 WAR3 WAR3_107A WAR3_IX86_1xx_122a_2.mpq
+#IX86 WAR3 WAR3_110A WAR3_IX86_1xx_122a_2.mpq
+#IX86 WAR3 WAR3_111A WAR3_IX86_1xx_122a_2.mpq
+#IX86 WAR3 WAR3_112A WAR3_IX86_1xx_122a_2.mpq
+#IX86 WAR3 WAR3_113A WAR3_IX86_1xx_122a_2.mpq
+#IX86 WAR3 WAR3_113B WAR3_IX86_1xx_122a_2.mpq
+#IX86 WAR3 WAR3_114A WAR3_IX86_1xx_122a_2.mpq
+#IX86 WAR3 WAR3_114B WAR3_IX86_1xx_122a_2.mpq
+#IX86 WAR3 WAR3_115A WAR3_IX86_1xx_122a_2.mpq
+#IX86 WAR3 WAR3_116A WAR3_IX86_1xx_122a_2.mpq
+#IX86 WAR3 WAR3_117A WAR3_IX86_1xx_122a_2.mpq
+#IX86 WAR3 WAR3_118A WAR3_IX86_1xx_122a_2.mpq
+#IX86 WAR3 WAR3_119A WAR3_IX86_1xx_122a_2.mpq
+#IX86 WAR3 WAR3_119B WAR3_IX86_1xx_122a_2.mpq
+#IX86 WAR3 WAR3_120A WAR3_IX86_1xx_122a_2.mpq
+#IX86 WAR3 WAR3_120B WAR3_IX86_1xx_122a_2.mpq
+#IX86 WAR3 WAR3_120C WAR3_IX86_1xx_122a_2.mpq
+#IX86 WAR3 WAR3_120D WAR3_IX86_1xx_122a_2.mpq
+#IX86 WAR3 WAR3_120E WAR3_IX86_1xx_122a_2.mpq
+#IX86 WAR3 WAR3_121A WAR3_IX86_1xx_122a_2.mpq
+
+# Incremental update from version 1.21b
+#IX86 WAR3 WAR3_121B WAR3_IX86_121B_122a_2.mpq
+
+# The next one is a WarCraft III - RoC wildcard entry.
+#IX86 WAR3 WAR3_1xx WAR3_IX86_1xx_122a_2.mpq
+
+# ===================== Diablo II Expansion (LoD) ===========================
+# Note: the following assumes that you want to upgrade all Diablo II clients
+# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you
+# will need to modify these entries accordingly.
+
+#IX86 D2XP D2XP_107 D2XP_IX86_1xx_112A.mpq
+#IX86 D2XP D2XP_108 D2XP_IX86_1xx_112A.mpq
+#IX86 D2XP D2XP_109 D2XP_IX86_1xx_112A.mpq
+#IX86 D2XP D2XP_109B D2XP_IX86_1xx_112A.mpq
+#IX86 D2XP D2XP_109C D2XP_IX86_1xx_112A.mpq
+#IX86 D2XP D2XP_109D D2XP_IX86_1xx_112A.mpq
+#IX86 D2XP D2XP_110 D2XP_IX86_1xx_112A.mpq
+#IX86 D2XP D2XP_111 D2XP_IX86_1xx_112A.mpq
+
+# Incremental update from version 1.11a --> 1.11b
+#IX86 D2XP D2XP_111B D2XP_IX86_111B_112A.mpq
+
+# The next one is a Diablo II LoD wildcard entry.
+#IX86 D2XP D2XP_1xx D2XP_IX86_1xx_112A.mpq
+
+# ========================== Diablo II (DV) =================================
+# Note: the following assumes that you want to upgrade all Diablo II clients
+# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you
+# will need to modify these entries accordingly.
+
+#IX86 D2DV D2DV_100 D2DV_IX86_1xx_112A.mpq
+#IX86 D2DV D2DV_101 D2DV_IX86_1xx_112A.mpq
+#IX86 D2DV D2DV_103 D2DV_IX86_1xx_112A.mpq
+#IX86 D2DV D2DV_104B D2DV_IX86_1xx_112A.mpq
+#IX86 D2DV D2DV_104C D2DV_IX86_1xx_112A.mpq
+#IX86 D2DV D2DV_105 D2DV_IX86_1xx_112A.mpq
+#IX86 D2DV D2DV_105B D2DV_IX86_1xx_112A.mpq
+#IX86 D2DV D2DV_106 D2DV_IX86_1xx_112A.mpq
+#IX86 D2DV D2DV_106B D2DV_IX86_1xx_112A.mpq
+#IX86 D2DV D2DV_108 D2DV_IX86_1xx_112A.mpq
+#IX86 D2DV D2DV_109 D2DV_IX86_1xx_112A.mpq
+#IX86 D2DV D2DV_109B D2DV_IX86_1xx_112A.mpq
+#IX86 D2DV D2DV_109C D2DV_IX86_1xx_112A.mpq
+#IX86 D2DV D2DV_109D D2DV_IX86_1xx_112A.mpq
+#IX86 D2DV D2DV_110 D2DV_IX86_1xx_112A.mpq
+#IX86 D2DV D2DV_111 D2DV_IX86_1xx_112A.mpq
+
+# Incremental update from version 1.11a --> 1.11b
+#IX86 D2DV D2DV_111B D2DV_IX86_111B_112A.mpq
+
+# The next one is a Diablo II wildcard entry.
+#IX86 D2DV D2DV_1xx D2DV_IX86_1xx_112A.mpq
+
+# ================ StarCraft Expansion (Brood War) ==========================
+#IX86 SEXP SEXP_104 SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_104_STAR SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_105 SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_105_STAR SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_106 SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_106_STAR SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_107 SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_107_STAR SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_108 SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_108_STAR SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_108B SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_108B_STAR SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_109 SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_109_STAR SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_110 SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_110_STAR SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_111 SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_111_STAR SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_111B SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_111B_STAR SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_112 SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_112_STAR SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_112B SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_112B_STAR SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_113 SEXP_IX86_1xx_1161.mpq
+# unfortunately we don't have a SEXP_113_STAR in versioncheck.conf
+#IX86 SEXP SEXP_113B SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_113B_STAR SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_113C SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_113C_STAR SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_113D SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_113D_STAR SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_113E SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_113E SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_114 SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_114 SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_115 SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_115 SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_1151 SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_1151 SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_1152 SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_1152 SEXP_IX86_1xx_1161.mpq
+#IX86 SEXP SEXP_1153 SEXP_IX86_1xx_1161.mpq
+#IX86 STAR SEXP_1153 SEXP_IX86_1xx_1161.mpq
+
+# Incremental update from version 1.15.3
+#IX86 SEXP SEXP_116 SEXP_IX86_116_1161.mpq
+#IX86 STAR SEXP_116 SEXP_IX86_116_1161.mpq
+
+# The next one is a Brood War wildcard entry.
+#IX86 SEXP SEXP_1xx SEXP_IX86_1xx_1161.mpq
+
+# ========================= StarCraft (original) ============================
+#IX86 STAR STAR_100 STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_101 STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_102 STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_103 STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_104 STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_105 STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_106 STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_107 STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_108 STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_108B STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_109 STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_109B STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_110 STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_111 STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_111B STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_112 STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_112B STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_113 STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_113B STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_113C STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_113D STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_113E STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_114 STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_115 STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_1151 STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_1152 STAR_IX86_1xx_1161.mpq
+#IX86 STAR STAR_1153 SEXP_IX86_1xx_1161.mpq
+
+# Incremental update from version 1.15.3
+#IX86 STAR STAR_116 SEXP_IX86_116_1161.mpq
+
+# The next one is a Starcraft wildcard entry.
+#IX86 STAR STAR_1xx STAR_IX86_1xx_1161.mpq
+
+# ========================= Diablo (original) ==============================
+# note: Blizzard doesn't update client from 109 to 109b.
+#IX86 DRTL DRTL_108 DRTL_IX86_108_109.mpq
+
+# The next one is a Diablo wildcard entry.
+#IX86 DRTL DRTL_1xx DRTL_IX86_100_109.mpq
+
+# ========================= Warcraft II BNE ===============================
+#IX86 W2BN W2BN_200 W2BN_IX86_200_202.mpq
+#IX86 W2BN W2BN_201 W2BN_IX86_201_202.mpq
+
+##### Mac OS X (XMAC) ########################################################
+
+# ===================== Diablo II Expansion (LoD) ===========================
+# Note: the following assumes that you want to upgrade all Diablo II clients
+# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you
+# will need to modify these entries accordingly.
+
+#XMAC D2XP D2XP_109D D2XP_XMAC_1xx_111B.mpq
+#XMAC D2XP D2XP_110 D2XP_XMAC_1xx_111B.mpq
+
+# Incremental update from version 1.11a --> 1.11b
+#XMAC D2XP D2XP_111 D2XP_XMAC_111A_111B.mpq
+
+# The next one is a Diablo II LoD wildcard entry.
+#XMAC D2XP D2XP_1xx D2XP_XMAC_1xx_111B.mpq
+
+# ========================== Diablo II (DV) =================================
+# Note: the following assumes that you want to upgrade all Diablo II clients
+# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you
+# will need to modify these entries accordingly.
+
+#XMAC D2DV D2DV_109D D2DV_XMAC_1xx_111B.mpq
+#XMAC D2DV D2DV_110 D2DV_XMAC_1xx_111B.mpq
+
+# Incremental update from version 1.11a --> 1.11b
+#XMAC D2DV D2DV_111 D2DV_XMAC_111A_111B.mpq
+
+# The next one is a Diablo II LoD wildcard entry.
+#XMAC D2DV D2DV_1xx D2DV_XMAC_1xx_111B.mpq
+
+# ================ StarCraft Expansion (Brood War) ==========================
+
+#XMAC SEXP SEXP_109B SEXP_XMAC_1xx_113E.mpq
+#XMAC SEXP SEXP_110 SEXP_XMAC_1xx_113E.mpq
+#XMAC STAR SEXP_110_STAR SEXP_XMAC_1xx_113E.mpq
+#XMAC SEXP SEXP_111 SEXP_XMAC_1xx_113E.mpq
+#XMAC STAR SEXP_111_STAR SEXP_XMAC_1xx_113E.mpq
+#XMAC SEXP SEXP_111B SEXP_XMAC_1xx_113E.mpq
+#XMAC STAR SEXP_111B_STAR SEXP_XMAC_1xx_113E.mpq
+#XMAC SEXP SEXP_112 SEXP_XMAC_1xx_113E.mpq
+#XMAC STAR SEXP_112_STAR SEXP_XMAC_1xx_113E.mpq
+#XMAC SEXP SEXP_113 SEXP_XMAC_1xx_113E.mpq
+#XMAC STAR SEXP_113_STAR SEXP_XMAC_1xx_113E.mpq
+#XMAC SEXP SEXP_113C SEXP_XMAC_1xx_113E.mpq
+#XMAC STAR SEXP_113C_STAR SEXP_XMAC_1xx_113E.mpq
+# Unfortunately versioncheck.conf does not contain entries for 1.13{a|b|d}
+
+# The next one is a Brood War wildcard entry.
+#XMAC SEXP SEXP_1xx SEXP_XMAC_1xx_113E.mpq
+
+# ========================= StarCraft (original) ============================
+
+#XMAC STAR STAR_109B STAR_XMAC_1xx_113E.mpq
+#XMAC STAR STAR_110 STAR_XMAC_1xx_113E.mpq
+#XMAC STAR STAR_111 STAR_XMAC_1xx_113E.mpq
+#XMAC STAR STAR_111B STAR_XMAC_1xx_113E.mpq
+#XMAC STAR STAR_112 STAR_XMAC_1xx_113E.mpq
+# Unfortunately versioncheck.conf does not contain entries for 1.13{a-d}
+
+# The next one is a Starcraft wildcard entry.
+#XMAC STAR STAR_1xx STAR_XMAC_1xx_113E.mpq
+
+##### Mac OS Classic (PMAC) ##################################################
+
+# ===================== Diablo II Expansion (LoD) ===========================
+# Note: the following assumes that you want to upgrade all Diablo II clients
+# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you
+# will need to modify these entries accordingly.
+
+#PMAC D2XP D2XP_1xx D2XP_PMAC_1xx_111B.mpq
+
+# ========================== Diablo II (DV) =================================
+# Note: the following assumes that you want to upgrade all Diablo II clients
+# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you
+# will need to modify these entries accordingly.
+
+#PMAC D2DV D2DV_109D D2DV_PMAC_1xx_111B.mpq
+#PMAC D2DV D2DV_1xx D2DV_PMAC_1xx_111B.mpq
+
+# ================ StarCraft Expansion (Brood War) ==========================
+
+#PMAC SEXP SEXP_109B SEXP_PMAC_1xx_113E.mpq
+#PMAC SEXP SEXP_110 SEXP_PMAC_1xx_113E.mpq
+#PMAC STAR SEXP_110_STAR SEXP_PMAC_1xx_113E.mpq
+#PMAC SEXP SEXP_111 SEXP_PMAC_1xx_113E.mpq
+#PMAC STAR SEXP_111_STAR SEXP_PMAC_1xx_113E.mpq
+#PMAC SEXP SEXP_111B SEXP_PMAC_1xx_113E.mpq
+#PMAC STAR SEXP_111B_STAR SEXP_PMAC_1xx_113E.mpq
+#PMAC SEXP SEXP_112 SEXP_PMAC_1xx_113E.mpq
+#PMAC STAR SEXP_112_STAR SEXP_PMAC_1xx_113E.mpq
+
+# The next one is a Brood War wildcard entry.
+#PMAC SEXP SEXP_1xx SEXP_PMAC_1xx_113E.mpq
+
+# ========================= StarCraft (original) ============================
+
+#PMAC STAR STAR_109B STAR_PMAC_1xx_113E.mpq
+#PMAC STAR STAR_110 STAR_PMAC_1xx_113E.mpq
+#PMAC STAR STAR_111 STAR_PMAC_1xx_113E.mpq
+#PMAC STAR STAR_111B STAR_PMAC_1xx_113E.mpq
+#PMAC STAR STAR_112 STAR_PMAC_1xx_113E.mpq
+
+# The next one is a Brood War wildcard entry.
+#PMAC STAR STAR_1xx STAR_PMAC_1xx_113E.mpq
+
+##### Westwood Online update entries #########################################
+
+# ========================== Westwood Online API ============================
+
+#IX86 WWOL 65536 65551_65536.rtp wolapi
+#IX86 WWOL 65537 65551_65537.rtp wolapi
+#IX86 WWOL 65538 65551_65538.rtp wolapi
+#IX86 WWOL 65539 65551_65539.rtp wolapi
+#IX86 WWOL 65540 65551_65540.rtp wolapi
+#IX86 WWOL 65541 65551_65541.rtp wolapi
+#IX86 WWOL 65542 65551_65542.rtp wolapi
+#IX86 WWOL 65543 65551_65543.rtp wolapi
+#IX86 WWOL 65544 65551_65544.rtp wolapi
+#IX86 WWOL 65545 65551_65545.rtp wolapi
+#IX86 WWOL 65546 65551_65546.rtp wolapi
+#IX86 WWOL 65547 65551_65547.rtp wolapi
+#IX86 WWOL 65548 65551_65548.rtp wolapi
+#IX86 WWOL 65549 65551_65549.rtp wolapi
+#IX86 WWOL 65550 65551_65550.rtp wolapi
+#IX86 WWOL 65555 65556_65555.rtp wolapi
+
+# =============================== Renegade ==================================
+
+#IX86 RNGD 65538 65573_65538.rtp renegade
+#IX86 RNGD 65550 65573_65538.rtp renegade
+#IX86 RNGD 65551 65573_65538.rtp renegade
+#IX86 RNGD 65566 65573_65538.rtp renegade
+#IX86 RNGD 65567 65573_65538.rtp renegade
+#IX86 RNGD 65568 65573_65538.rtp renegade
+#IX86 RNGD 65570 65573_65570.rtp renegade
+#IX86 RNGD 65571 65573_65571.rtp renegade
+#IX86 RNGD 65572 65573_65572.rtp renegade
+
+# ==================== Renegade Free Dedicated Server =======================
+
+#IX86 RFDS 65538 65572_65538.rtp renegade
+#IX86 RFDS 65550 65572_65550.rtp renegade
+#IX86 RFDS 65551 65572_65551.rtp renegade
+#IX86 RFDS 65553 65572_65553.rtp renegade
+#IX86 RFDS 65554 65572_65554.rtp renegade
+#IX86 RFDS 65566 65572_65566.rtp renegade
+#IX86 RFDS 65568 65572_65568.rtp renegade
+#IX86 RFDS 65570 65572_65570.rtp renegade
+#IX86 RFDS 65571 65572_65571.rtp renegade
+#IX86 RFDS 65572 65573_65572.rtp renegade
+
+# ============================= Tiberian Sun ================================
+
+#IX86 TSUN 65536 131075_65536.rtp tibsun
+#IX86 TSUN 65541 131075_65536.rtp tibsun
+#IX86 TSUN 65542 131075_65536.rtp tibsun
+#IX86 TSUN 65543 131075_65536.rtp tibsun
+#IX86 TSUN 65544 131075_65536.rtp tibsun
+#IX86 TSUN 65545 131075_65536.rtp tibsun
+#IX86 TSUN 65546 131075_65536.rtp tibsun
+#IX86 TSUN 65547 131075_65536.rtp tibsun
+#IX86 TSUN 65548 131075_65548.rtp tibsun
+#IX86 TSUN 131072 131075_65548.rtp tibsun
+#IX86 TSUN 131074 131075_131074.rtp tibsun
+
+# ======================= Tiberian Sun: FireStorm ===========================
+
+#IX86 TSXP 131072 131074_131072.rtp tibsun
+#IX86 TSXP 131074 131075_131074.rtp tibsun
+
+# =============================== Dune 2000 =================================
+
+#IX86 DN2K 65536 65542.rtp dune2k/1.006/1.000
+#IX86 DN2K 65537 65542_65537.rtp dune2k/1.006/1.001
+
+# ================================== NOX ====================================
+
+#IX86 NOXX 65536 65538_65536.rtp nox
+#IX86 NOXX 65537 65538_65537.rtp nox
+
+# =============================== NOX: Quest ================================
+
+#IX86 NOXQ 65536 65538_65536.rtp nox
+#IX86 NOXQ 65537 65538_65537.rtp nox
+#IX86 NOXQ 65538 65540_65538.rtp nox
+#IX86 NOXQ 65539 65540_65539.rtp nox
+
+# ======================= Emperor: Battle for Dune ==========================
+
+#IX86 EBFD 1 65545_1.rtp emperor
+#IX86 EBFD 65536 65545_65536.rtp emperor
+#IX86 EBFD 65537 65545_65537.rtp emperor
+#IX86 EBFD 65538 65545_65538.rtp emperor
+#IX86 EBFD 65539 65545_65539.rtp emperor
+#IX86 EBFD 65540 65545_65540.rtp emperor
+#IX86 EBFD 65541 65545_65541.rtp emperor
+#IX86 EBFD 65542 65545_65542.rtp emperor
+#IX86 EBFD 65543 65545_65543.rtp emperor
+#IX86 EBFD 65544 65545_65544.rtp emperor
+
+# ============================= Red Alert 2 =================================
+
+#IX86 RAL2 65536 65542_65536.rtp ra2
+#IX86 RAL2 65537 65542_65537.rtp ra2
+#IX86 RAL2 65538 65542_65538.rtp ra2
+#IX86 RAL2 65539 65542_65539.rtp ra2
+#IX86 RAL2 65540 65542_65540.rtp ra2
+#IX86 RAL2 65541 65542_65541.rtp ra2
+
+# ============================= Yuri's Revenge ==============================
+
+#IX86 YURI 65536 65537_65536.rtp yuri
+
+# ============================= Lands of Lore 3 =============================
+
+#IX86 LOR3 65536 65539_65536.rtp lore3/1.003
+#IX86 LOR3 65537 65539_65537.rtp lore3/1.003
+#IX86 LOR3 65538 65539_65538.rtp lore3/1.003
diff --git a/pvpgn/conf/bnalias.conf.in b/conf/bnalias.conf.in
similarity index 100%
rename from pvpgn/conf/bnalias.conf.in
rename to conf/bnalias.conf.in
diff --git a/pvpgn/conf/bnban.conf.in b/conf/bnban.conf.in
similarity index 100%
rename from pvpgn/conf/bnban.conf.in
rename to conf/bnban.conf.in
diff --git a/pvpgn/conf/bnetd.conf.in b/conf/bnetd.conf.in
similarity index 100%
rename from pvpgn/conf/bnetd.conf.in
rename to conf/bnetd.conf.in
diff --git a/pvpgn/conf/bnetd.conf.win32 b/conf/bnetd.conf.win32
similarity index 100%
rename from pvpgn/conf/bnetd.conf.win32
rename to conf/bnetd.conf.win32
diff --git a/pvpgn/conf/bnetd_default_user.cdb b/conf/bnetd_default_user.cdb
similarity index 100%
rename from pvpgn/conf/bnetd_default_user.cdb
rename to conf/bnetd_default_user.cdb
diff --git a/pvpgn/conf/bnetd_default_user.plain.in b/conf/bnetd_default_user.plain.in
similarity index 100%
rename from pvpgn/conf/bnetd_default_user.plain.in
rename to conf/bnetd_default_user.plain.in
diff --git a/pvpgn/conf/bnhelp.conf.in b/conf/bnhelp.conf.in
similarity index 100%
rename from pvpgn/conf/bnhelp.conf.in
rename to conf/bnhelp.conf.in
diff --git a/pvpgn/conf/bnissue.txt.in b/conf/bnissue.txt.in
similarity index 100%
rename from pvpgn/conf/bnissue.txt.in
rename to conf/bnissue.txt.in
diff --git a/pvpgn/conf/bnmaps.conf.in b/conf/bnmaps.conf.in
similarity index 100%
rename from pvpgn/conf/bnmaps.conf.in
rename to conf/bnmaps.conf.in
diff --git a/pvpgn/conf/bnmotd-bgBG.txt.in b/conf/bnmotd-bgBG.txt.in
similarity index 100%
rename from pvpgn/conf/bnmotd-bgBG.txt.in
rename to conf/bnmotd-bgBG.txt.in
diff --git a/pvpgn/conf/bnmotd-csCZ.txt.in b/conf/bnmotd-csCZ.txt.in
similarity index 100%
rename from pvpgn/conf/bnmotd-csCZ.txt.in
rename to conf/bnmotd-csCZ.txt.in
diff --git a/pvpgn/conf/bnmotd-deDE.txt.in b/conf/bnmotd-deDE.txt.in
similarity index 100%
rename from pvpgn/conf/bnmotd-deDE.txt.in
rename to conf/bnmotd-deDE.txt.in
diff --git a/pvpgn/conf/bnmotd-enUS.txt.in b/conf/bnmotd-enUS.txt.in
similarity index 100%
rename from pvpgn/conf/bnmotd-enUS.txt.in
rename to conf/bnmotd-enUS.txt.in
diff --git a/pvpgn/conf/bnmotd-esES.txt.in b/conf/bnmotd-esES.txt.in
similarity index 100%
rename from pvpgn/conf/bnmotd-esES.txt.in
rename to conf/bnmotd-esES.txt.in
diff --git a/pvpgn/conf/bnmotd-frFR.txt.in b/conf/bnmotd-frFR.txt.in
similarity index 100%
rename from pvpgn/conf/bnmotd-frFR.txt.in
rename to conf/bnmotd-frFR.txt.in
diff --git a/pvpgn/conf/bnmotd-jpJA.txt.in b/conf/bnmotd-jpJA.txt.in
similarity index 100%
rename from pvpgn/conf/bnmotd-jpJA.txt.in
rename to conf/bnmotd-jpJA.txt.in
diff --git a/pvpgn/conf/bnmotd-koKR.txt.in b/conf/bnmotd-koKR.txt.in
similarity index 100%
rename from pvpgn/conf/bnmotd-koKR.txt.in
rename to conf/bnmotd-koKR.txt.in
diff --git a/pvpgn/conf/bnmotd-nlNL.txt.in b/conf/bnmotd-nlNL.txt.in
similarity index 100%
rename from pvpgn/conf/bnmotd-nlNL.txt.in
rename to conf/bnmotd-nlNL.txt.in
diff --git a/pvpgn/conf/bnmotd-plPL.txt.in b/conf/bnmotd-plPL.txt.in
similarity index 100%
rename from pvpgn/conf/bnmotd-plPL.txt.in
rename to conf/bnmotd-plPL.txt.in
diff --git a/pvpgn/conf/bnmotd-ptBR.txt.in b/conf/bnmotd-ptBR.txt.in
similarity index 100%
rename from pvpgn/conf/bnmotd-ptBR.txt.in
rename to conf/bnmotd-ptBR.txt.in
diff --git a/pvpgn/conf/bnmotd-ruRU.txt.in b/conf/bnmotd-ruRU.txt.in
similarity index 100%
rename from pvpgn/conf/bnmotd-ruRU.txt.in
rename to conf/bnmotd-ruRU.txt.in
diff --git a/pvpgn/conf/bnmotd-svSE.txt.in b/conf/bnmotd-svSE.txt.in
similarity index 100%
rename from pvpgn/conf/bnmotd-svSE.txt.in
rename to conf/bnmotd-svSE.txt.in
diff --git a/pvpgn/conf/bnmotd-zhCN.txt.in b/conf/bnmotd-zhCN.txt.in
similarity index 100%
rename from pvpgn/conf/bnmotd-zhCN.txt.in
rename to conf/bnmotd-zhCN.txt.in
diff --git a/pvpgn/conf/bnmotd-zhTW.txt.in b/conf/bnmotd-zhTW.txt.in
similarity index 100%
rename from pvpgn/conf/bnmotd-zhTW.txt.in
rename to conf/bnmotd-zhTW.txt.in
diff --git a/pvpgn/conf/bnxpcalc.conf.in b/conf/bnxpcalc.conf.in
similarity index 100%
rename from pvpgn/conf/bnxpcalc.conf.in
rename to conf/bnxpcalc.conf.in
diff --git a/pvpgn/conf/bnxplevel.conf.in b/conf/bnxplevel.conf.in
similarity index 100%
rename from pvpgn/conf/bnxplevel.conf.in
rename to conf/bnxplevel.conf.in
diff --git a/pvpgn/conf/channel.conf.in b/conf/channel.conf.in
similarity index 100%
rename from pvpgn/conf/channel.conf.in
rename to conf/channel.conf.in
diff --git a/pvpgn/conf/command_groups.conf.in b/conf/command_groups.conf.in
similarity index 100%
rename from pvpgn/conf/command_groups.conf.in
rename to conf/command_groups.conf.in
diff --git a/pvpgn/conf/d2cs.conf.in b/conf/d2cs.conf.in
similarity index 100%
rename from pvpgn/conf/d2cs.conf.in
rename to conf/d2cs.conf.in
diff --git a/pvpgn/conf/d2cs.conf.win32 b/conf/d2cs.conf.win32
similarity index 100%
rename from pvpgn/conf/d2cs.conf.win32
rename to conf/d2cs.conf.win32
diff --git a/pvpgn/conf/d2dbs.conf.in b/conf/d2dbs.conf.in
similarity index 100%
rename from pvpgn/conf/d2dbs.conf.in
rename to conf/d2dbs.conf.in
diff --git a/pvpgn/conf/d2dbs.conf.win32 b/conf/d2dbs.conf.win32
similarity index 100%
rename from pvpgn/conf/d2dbs.conf.win32
rename to conf/d2dbs.conf.win32
diff --git a/pvpgn/conf/d2server.ini b/conf/d2server.ini
similarity index 100%
rename from pvpgn/conf/d2server.ini
rename to conf/d2server.ini
diff --git a/pvpgn/conf/news.txt.in b/conf/news.txt.in
similarity index 100%
rename from pvpgn/conf/news.txt.in
rename to conf/news.txt.in
diff --git a/pvpgn/conf/realm.conf.in b/conf/realm.conf.in
similarity index 100%
rename from pvpgn/conf/realm.conf.in
rename to conf/realm.conf.in
diff --git a/pvpgn/conf/sql_DB_layout.conf.in b/conf/sql_DB_layout.conf.in
similarity index 100%
rename from pvpgn/conf/sql_DB_layout.conf.in
rename to conf/sql_DB_layout.conf.in
diff --git a/pvpgn/conf/sql_DB_layout2.conf.in b/conf/sql_DB_layout2.conf.in
similarity index 100%
rename from pvpgn/conf/sql_DB_layout2.conf.in
rename to conf/sql_DB_layout2.conf.in
diff --git a/pvpgn/conf/supportfile.conf.in b/conf/supportfile.conf.in
similarity index 100%
rename from pvpgn/conf/supportfile.conf.in
rename to conf/supportfile.conf.in
diff --git a/pvpgn/conf/topics.conf.in b/conf/topics.conf.in
similarity index 100%
rename from pvpgn/conf/topics.conf.in
rename to conf/topics.conf.in
diff --git a/pvpgn/conf/tournament.conf.in b/conf/tournament.conf.in
similarity index 100%
rename from pvpgn/conf/tournament.conf.in
rename to conf/tournament.conf.in
diff --git a/pvpgn/conf/versioncheck.conf.in b/conf/versioncheck.conf.in
similarity index 100%
rename from pvpgn/conf/versioncheck.conf.in
rename to conf/versioncheck.conf.in
diff --git a/pvpgn/config.h.cmake b/config.h.cmake
similarity index 100%
rename from pvpgn/config.h.cmake
rename to config.h.cmake
diff --git a/pvpgn/conversion-changelog b/conversion-changelog
similarity index 100%
rename from pvpgn/conversion-changelog
rename to conversion-changelog
diff --git a/d2pack109/CREDITS b/d2pack109/CREDITS
deleted file mode 100644
index bbbaeb9..0000000
--- a/d2pack109/CREDITS
+++ /dev/null
@@ -1,245 +0,0 @@
-PvPGN CREDITS (also please see the original BNETD credits bellow):
---------------------------------------------------------------------
-
-CREDITS
- This file contains the names of people who have contributed to the
- development of the PvPGN BNETD mod in some way. This file is not
- complete and we would like to thank everyone who helped us in any way.
-
-PROGRAMMING CONTRIBUTORS
- Zzzoom (servers@3dgames.com.ar)
- For persistent SQL connections patch, password brute force attacks
- protection and various bug reports.
-
- Lots of other people who do not whish to be mentioned here.
-
-BINARY PACKAGES:
-- Birzan George Cristian (Debian packages)
-- Dorin Lazar (RPMs)
-- Mihai Maties (RPMs & src.rpm snapshot script)
-- Radu Radoveneanu (Slackware packages)
-
-ORIGINAL BNETD CREDITS:
--------------------------------
-
-CREDITS
-
- This file contains the names of people who have contributed to the
- development of the BNETD server in some way. This project has made an
- enormous amount of progress since the development has become public,
- and this is one place where members of the community can be thanked.
-
-
-PROGRAMMING CONTRIBUTORS
-
- The following people have contributed code, code ideas, bug fixes, and
- debugging work:
-
- Mark Baysinger (mbaysing@ucsd.edu)
- For the original idea, original implementation, documentation of the
- protocol, starhack.ml.org, the tracking server, etc.
-
- Ross Combs (rocombs@cs.nmsu.edu)
- Various cleanups, release coordination, / commands, config files, etc.
-
- Rob Crittenden (rcrit@greyoak.com)
- For many bug fixes, protocol work, file downloads, man pages, user
- icons, better channel handling, autoconf, ladder, etc. as well as
- working on the FAQ and user support.
-
- Descolada (dyn1-tnt9-237.chicago.il.ameritech.net)
- For the hashing algorithm complete with a sample C implementation.
-
- Gediminas (gediminas_lt@mailexcite.com)
- For work on the client command "readline" code, the initial help
- system, and a better /conn command.
-
- Oleg Drokin (green@ccssu.crimea.ua)
- For patches to fix bnchat and bnstat.
-
- Damien Clermonte (clermond@esiee.fr)
- For portability (to cygnus B20.1 on win32) work, testing, and helpful
- observations, and the TCP keepalive patch.
-
- Denis Moreaux (vapula@endor.be)
- For working out the correct ladder equations.
-
- Philippe Dubois (pdubois@matrox.com)
- For working on the Win32 port, UDP stuff, auto-update, and the
- bnettime code.
-
- Typhoon [Marco Ziech] (mmz@gmx.net)
- For lots of good work on the BNI utilities, BITS (server inter-
- connectivity) support, and his bnetmasq.sh script. He also
- answers a lot of user questions and put together most of the
- web site.
-
- Dizzy (dizzy@roedu.net)
- For help with NAT issues, a much improved help system, channel
- flooding prevention, new /-commands, a mail system, and more.
-
- Razvan Jianu (roger@hell.gameover.ro)
- For many useful coredumps :) Also for the /addacct command.
-
- Qlex (qlex@eoliss.com)
- For kick starting the Diablo II stuff, testing thousands quick
- changes, moral support, and digging up all the information.
-
- Kenshin (kenshin_@hotmail.com)
- For helping Qlex with the character stuff, fixing some major
- bugs in the Diablo II code, and starting work on saving
- characters.
-
- Hakan Tandogan (hakan@gurkensalat.com)
- For always making RPMs for bnetd and the tracker and some patches to
- correct startup/shutdown issues. Also for continuing Diablo II work.
-
- Jung-woo Sohn (logout@aeroguy.snu.ac.kr)
- For /watch feedback, dobae flooding disconnect, better disconnect
- game result handling, and generally for lots of good ideas. And
- also for spotting the failed account creation crashing bug.
-
- YobGuls (yobguls@yobguls.2ndmail.com)
- Actually contributed to the DSBot code, but see next entry.
-
- Eurijk! (wc2@zefga.net)
- For pointing out how the new cdkey hashing works and also how
- version checking is performed. This was some really ugly but
- important stuff! He figured this out working on DSBot but
- kindly explained it to us and showed us example code. He's
- also working on the Prolix bot project and has provided lots
- of useful bug reports and other commentary.
-
- Fred Wittekind (rom@twister.dyndns.org)
- For autoupdate version range support. For pointing out all the
- update MPQ files we didn't know about. Also for the message
- force-command patch.
-
- Mathieu Legare (Mathieu_Legare@uqtr.uquebec.ca)
- For picking up bnetdStats and making it report all kinds of
- statistics.
-
- Onlyer (onlyer@users.sourceforge.net)
- For new commands, Diablo II protocol work, Diablo II closed server
- work, FSGS account conversion, etc.
-
- faster (lqx@cic.tsinghua.edu.cn)
- For Diablo II closed communication (S2S) and for finding that
- check_alloc bug.
-
- sousou (liupeng.cs@263.net)
- For Diablo II closed database server and ladder.
-
- esper (esperpale@263.net)
- Diablo II closed server gui and ladder.
-
- sherpya (sherpya@netfarm.it)
- For lots of help with adbanners, the d2close merge, reporting
- bugs (like the 100% poll() CPU usage bug), and lots of good
- suggestions. Also for work on channel list reloads.
-
- Yoss (bartek@milc.com.pl)
- For helpful suggestions for the mail code and for patching
- the emote flooding hole. Also for the /admin command and for
- the patch to fix the "operator can ban admins" bug. A big
- thanks for much improved kill and ban commands and the new
- dynamic ipban with better address matching and timeouts.
-
- Roland Stahn (blue@cs.tu-berlin.de)
- For all the work tracking down the versioncheck information
- for revision of the STAR and SEXP clients. For information about
- Blizzard's numbering scheme. For helpful packet information.
- Also for the bug reports and simple patches which probably should
- have been fixed a long time ago but he was the only person with
- enough patience to figure out what was happening. Specifically,
- the "all countries in one channel" feature, the empty game pass
- bug, the multiple game with same name bug, and the memory
- corruption after autoupdates. For updated version information.
- For diagnosing the autoupdate crash (bug in server.c handling
- closed sockets).
-
- KWS (vizi@csucs.net)
- For the nice bug reports on gameinfo parsing on game join, win32
- socket and file portability problems. Also for patches to update
- versioncheck info, implement IP storage, the patch for better
- eventlogs, and Makefile improvements.
-
- Jack (jack@takeovertheworld.org)
- For Diablo II open game difficulty patch.
-
- forester (laterk@inbox.lv)
- Working on the Win32 port, bnetd GUI for Win32, small patches.
-
-TESTING AND DEBUGGING CONTRIBUTORS
-
- The following people have sent in ideas, bug reports, and minor
- patches.
-
- 187 (187@infoceptor.com)
- For bug reports and the idea for the /news command.
-
- Shin DongJun (djshin@oslab.snu.ac.kr)
- For some bug reports and patches.
-
- Jeffery Jones (jeffery_jones@mtlusa.com)
- For the game address translation idea.
-
- Maxim Tereshenkov (max@ostin.ru)
- For the stack trace which found the 8-bit account.c bug.
-
- Yanoch (yanoch@loginnovation.com)
- For suggesting the /kill improvement.
-
- stacker (stacker@mail.ee.ntou.edu.tw)
- For lots of bug reports and also the sbnetd front end.
-
- Mike Hindman (mhindman@bnetd.nmsu.edu)
- David Fitzpatrick (dfitzpat@bnetd.nmsu.edu)
- For lots of ideas and all the help with Diablo.
-
- Homer (homer@ogn.de)
- For the helpful info on game info strings and ladder maps.
-
- Alvin Sim (elflord@faerie.cx)
- For lots of testing and figuring out that Diablo II open gameplay was
- actually not too hard to implement.
-
- AsmodeusB
- For finding annoying the gameinfo bug in connection.c :)
-
- forester (http://forester.yo.lv)
- For pointing out what gameresult 5 means.
-
- jerome (imeepmeep@mac.com)
- For the MacOS X package.
-
- acbcdde (acbcdde@hotmail.com)
- For Win32 Makefile and config.h fixes.
-
- mojohead ( Andrey Ilyin )
- For d2dbs/d2ladder.c fixes.
-
-
-OTHER CONTRIBUTORS
-
- The following people have contributed their time, talent, and other
- resources to the project:
-
- Josh (josh@bnetd.org)
- For a wonderful web site, quick mirroring of new releases, testing,
- organization, documentation, and user support.
-
- Tim Jung (tjung@igateway.net)
- For kindly hosting our mailing lists, domain, web pages, etc. as well
- as regular feedback and testing.
-
- Allan Clark (allanc@sco.com)
- For putting together some nice RPMs.
-
-
-NOTE
-
- This list is not complete. I have lost track of the names of some
- people who have contributed, and likely forgotten about others. If you
- think you should be listed here but aren't, please contact the
- bnetd-dev mailing list and we will take care of it right away.
diff --git a/d2pack109/README b/d2pack109/README
deleted file mode 100644
index 8b77ba5..0000000
--- a/d2pack109/README
+++ /dev/null
@@ -1,44 +0,0 @@
- Readme for Player vs. Player Gaming Network
- ---------------------------------------------
- D2Pack 1.09
- -------------
-
- PvPGN is a BNETD mod which aims to provide support for all Blizzard
-clients (thus it supports all BNETD supported clients plus the most recent
-ones).
- This release only includes d2cs/d2dbs as needed to host a Diablo II 1.09
-closed realm. It only supports d2gs 1.09d. This package NEEDS a "bnetd" server
-configured to work (for example use a "bnetd" from a PvPGN release).
-
-The list of supported clients and their minimum verion required is:
-- Diablo 2 v1.09
-- Diablo 2 LOD v1.09
-------------
-
- The documentation is located in the docs directory. Please read docs/INDEX
-for a list of files and what they contain.
- If you are updating from a previous PvPGN version check the file UPDATE
-first.
-
-
------
-
-We're always looking for good coders (C coders) or
-anyone who can contribute to our project in any way.
-
-Project homepages/distribution sites:
-- project home and main distribution site: http://pvpgn.berlios.de
-- alternate project home: http://www.pvpgn.org
-- alternate distribution site: http://www.pvpgn.de
-
-Support channels:
-
-1. BugTracker (preffered support method):
-http://developer.berlios.de/bugs/?group_id=2291
-
-2. Mailing List: pvpgn-users@lists.berlios.de ( to subscribe go here
-https://lists.berlios.de/mailman/listinfo/pvpgn-users )
-
-3. Forums: http://forums.pvpgn.org
-
-4. IRC live support: #pvpgn on irc.pvpgn.org
diff --git a/d2pack109/Win32-Projects/Makefile.mingw b/d2pack109/Win32-Projects/Makefile.mingw
deleted file mode 100644
index a626bc8..0000000
--- a/d2pack109/Win32-Projects/Makefile.mingw
+++ /dev/null
@@ -1,493 +0,0 @@
-# Project: d2pack109 Package
-# Makefile: MinGW (http://www.mingw.org)
-#
-# Copyright (C) 2005 CreepLord (creeplord@pvpgn.org)
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-
-#####################################################################
-
-ifndef DEST
-DEST = ./win32-builds
-endif
-
-VERSION = 0.7
-RELEASE = CVS
-PACKAGE = $(DEST)/D2Pack109-$(VERSION)-$(RELEASE)-Win32$(TYPE).zip
-
-ifndef prefix
- prefix = ./d2pack109
- installdir = $(prefix)-$(VERSION)
-else
- installdir = $(prefix)
-endif
-
-confdir = $(installdir)/conf
-docsdir = $(installdir)/docs
-filesdir = $(installdir)/files
-sharedir = $(installdir)/var
-bakdir = $(sharedir)/bak
-bakcharsavedir = $(sharedir)/bak/charsave
-bakcharinfodir = $(sharedir)/bak/charinfo
-charsavedir = $(sharedir)/charinfo
-charinfodir = $(sharedir)/charsave
-laddersdir = $(sharedir)/ladders
-reportsdir = $(sharedir)/reports
-
-#####################################################################
-
-TOP_DIR = ./..
-
-SRC_CONFDIR = $(TOP_DIR)/conf
-SRC_DOCSDIR = $(TOP_DIR)/docs
-SRC_FILESDIR = $(TOP_DIR)/files
-SRC_SBINDIR = $(TOP_DIR)/sbin
-SRC_SRCDIR = $(TOP_DIR)/src
-SRC_COMMONDIR = $(SRC_SRCDIR)/common
-SRC_COMPATDIR = $(SRC_SRCDIR)/compat
-SRC_D2CSDIR = $(SRC_SRCDIR)/d2cs
-SRC_D2DBSDIR = $(SRC_SRCDIR)/d2dbs
-SRC_WIN32DIR = $(SRC_SRCDIR)/win32
-
-#####################################################################
-
-CC = gcc
-INSTALL = install
-INSTALL_DIR = install -d
-RMF = rm -f
-STRIP = strip
-WINDRES = windres
-ZIP = zip -rm9q
-ECHO = echo
-
-ifdef CROSS_BUILD
-PCC = /usr/bin/gcc
-ENV =
-WFLAGS = -W -Wall -Wno-unused
-#WFLAGS =
-UNIX2DOS = ./u2d
-else
-PCC = $(CC)
-ENV = -e
-WFLAGS =
-UNIX2DOS = u2d.exe
-endif
-
-#####################################################################
-
-CFLAGS = $(WFLAGS) -I$(SRC_SRCDIR) -I$(SRC_SRCDIR)/include
-LDFLAGS = -lws2_32 -L$(SRC_SRCDIR)/lib
-
-ifdef WITH_MYSQL
-CFLAGS += -DWITH_SQL_MYSQL
-LDFLAGS += -lmysql
-endif
-
-ifdef WITH_PGSQL
-CFLAGS += -DWITH_SQL_PGSQL
-LDFLAGS += -lpq
-endif
-
-ifdef WITH_SQLITE3
-CFLAGS += -DWITH_SQL_SQLITE3 -DHAVE_SQLITE3_H
-LDFLAGS += -lsqlite3
-endif
-
-ifdef WITH_ODBC
-CFLAGS += -DWITH_SQL_ODBC
-LDFLAGS += -lodbc32
-endif
-
-ifdef WITH_GUI
-CFLAGS += -DWIN32_GUI
-LDFLAGS += -mwindows
-endif
-
-#####################################################################
-# EXECUTABLES
-#####################################################################
-
-ifdef WITH_GUI
- d2cs_SBIN = $(SRC_SBINDIR)/d2cs109.exe
- d2dbs_SBIN = $(SRC_SBINDIR)/d2dbs109.exe
-else
- d2cs_SBIN = $(SRC_SBINDIR)/d2cs109Console.exe
- d2dbs_SBIN = $(SRC_SBINDIR)/d2dbs109Console.exe
-endif
-
-#####################################################################
-# RESOURCES
-#####################################################################
-
-ifdef WITH_GUI
-d2cs_RES = $(SRC_WIN32DIR)/d2cs_resource.res
-d2dbs_RES = $(SRC_WIN32DIR)/d2dbs_resource.res
-else
-d2cs_RES = $(SRC_WIN32DIR)/console_resource.res
-d2dbs_RES = $(SRC_WIN32DIR)/console_resource.res
-endif
-
-#####################################################################
-# SOURCE
-#####################################################################
-
-d2cs_SOURCE = \
- $(SRC_D2CSDIR)/main.c \
- $(SRC_D2CSDIR)/d2gs.c \
- $(SRC_D2CSDIR)/handle_d2gs.c \
- $(SRC_D2CSDIR)/serverqueue.c \
- $(SRC_D2CSDIR)/connection.c \
- $(SRC_D2CSDIR)/game.c \
- $(SRC_D2CSDIR)/server.c \
- $(SRC_D2CSDIR)/handle_init.c \
- $(SRC_D2CSDIR)/handle_d2cs.c \
- $(SRC_D2CSDIR)/d2charfile.c \
- $(SRC_D2CSDIR)/d2charlist.c \
- $(SRC_D2CSDIR)/xstring.c \
- $(SRC_D2CSDIR)/gamequeue.c \
- $(SRC_D2CSDIR)/prefs.c \
- $(SRC_D2CSDIR)/conf.c \
- $(SRC_D2CSDIR)/cmdline_parse.c \
- $(SRC_D2CSDIR)/bnetd.c \
- $(SRC_D2CSDIR)/handle_bnetd.c \
- $(SRC_D2CSDIR)/s2s.c \
- $(SRC_D2CSDIR)/net.c \
- $(SRC_D2CSDIR)/d2ladder.c \
- $(SRC_D2CSDIR)/handle_signal.c \
- $(SRC_COMMONDIR)/eventlog.c \
- $(SRC_COMMONDIR)/hashtable.c \
- $(SRC_COMMONDIR)/hexdump.c \
- $(SRC_COMMONDIR)/list.c \
- $(SRC_COMMONDIR)/packet.c \
- $(SRC_COMMONDIR)/bn_type.c \
- $(SRC_COMMONDIR)/addr.c \
- $(SRC_COMMONDIR)/util.c \
- $(SRC_COMMONDIR)/queue.c \
- $(SRC_COMMONDIR)/network.c \
- $(SRC_COMMONDIR)/fdwatch.c\
- $(SRC_COMMONDIR)/fdwatch_select.c\
- $(SRC_COMMONDIR)/fdwatch_poll.c\
- $(SRC_COMMONDIR)/fdwatch_kqueue.c\
- $(SRC_COMMONDIR)/fdwatch_epoll.c\
- $(SRC_COMMONDIR)/trans.c \
- $(SRC_COMMONDIR)/xalloc.c \
- $(SRC_COMMONDIR)/rlimit.c \
- $(SRC_COMMONDIR)/tag.c \
- $(SRC_COMPATDIR)/inet_aton.c \
- $(SRC_COMPATDIR)/inet_ntoa.c \
- $(SRC_COMPATDIR)/strdup.c \
- $(SRC_COMPATDIR)/strerror.c \
- $(SRC_COMPATDIR)/strtoul.c \
- $(SRC_COMPATDIR)/strftime.c \
- $(SRC_COMPATDIR)/strcasecmp.c \
- $(SRC_COMPATDIR)/strncasecmp.c \
- $(SRC_COMPATDIR)/strsep.c \
- $(SRC_COMPATDIR)/psock.c \
- $(SRC_COMPATDIR)/uname.c \
- $(SRC_COMPATDIR)/gettimeofday.c \
- $(SRC_COMPATDIR)/difftime.c \
- $(SRC_COMPATDIR)/pdir.c \
- $(SRC_COMPATDIR)/memset.c \
- $(SRC_COMPATDIR)/memcpy.c \
- $(SRC_COMPATDIR)/memmove.c \
- $(SRC_WIN32DIR)/service.c \
- $(SRC_WIN32DIR)/d2cs_winmain.c
-
-d2dbs_SOURCE = \
- $(SRC_D2DBSDIR)/main.c \
- $(SRC_D2DBSDIR)/charlock.c \
- $(SRC_D2DBSDIR)/d2ladder.c \
- $(SRC_D2DBSDIR)/dbserver.c \
- $(SRC_D2DBSDIR)/dbspacket.c \
- $(SRC_D2DBSDIR)/prefs.c \
- $(SRC_D2DBSDIR)/handle_signal.c \
- $(SRC_D2DBSDIR)/dbsdupecheck.c \
- $(SRC_D2DBSDIR)/cmdline_parse.c \
- $(SRC_D2CSDIR)/conf.c \
- $(SRC_D2CSDIR)/xstring.c \
- $(SRC_COMMONDIR)/eventlog.c \
- $(SRC_COMMONDIR)/list.c \
- $(SRC_COMMONDIR)/bn_type.c \
- $(SRC_COMMONDIR)/util.c \
- $(SRC_COMMONDIR)/addr.c \
- $(SRC_COMMONDIR)/xalloc.c \
- $(SRC_COMMONDIR)/fdwatch.c \
- $(SRC_COMMONDIR)/fdwatch_select.c \
- $(SRC_COMMONDIR)/fdwatch_poll.c \
- $(SRC_COMMONDIR)/fdwatch_epoll.c \
- $(SRC_COMMONDIR)/fdwatch_kqueue.c \
- $(SRC_COMMONDIR)/tag.c \
- $(SRC_COMMONDIR)/rlimit.c \
- $(SRC_COMPATDIR)/inet_aton.c \
- $(SRC_COMPATDIR)/psock.c \
- $(SRC_COMPATDIR)/strerror.c \
- $(SRC_COMPATDIR)/strsep.c \
- $(SRC_WIN32DIR)/service.c \
- $(SRC_WIN32DIR)/d2dbs_winmain.c
-
-#####################################################################
-# OBJECTS
-#####################################################################
-
-d2cs_OBJECTS = $(d2cs_SOURCE:.c=.o)
-d2dbs_OBJECTS = $(d2dbs_SOURCE:.c=.o)
-
-d2server_OBJECTS = $(d2cs_OBJECTS) $(d2dbs_OBJECTS)
-
-#####################################################################
-# Targets
-#####################################################################
-
-.PHONY: all
-all:
- @$(ECHO) ===============================================================================
- @$(ECHO) = =
- @$(ECHO) = Targets: =
- @$(ECHO) = =
- @$(ECHO) = make_mingw gui Build GUI Programs =
-# @$(ECHO) = make_mingw gui-mysql Build GUI Programs with mySQL Support =
-# @$(ECHO) = make_mingw gui-pgsql Build GUI Programs with pgSQL Support =
-# @$(ECHO) = make_mingw gui-sqlite3 Build GUI Programs with SQLite3 Support =
-# @$(ECHO) = make_mingw gui-odbc Build GUI Programs with ODBC Support =
-# @$(ECHO) = =
- @$(ECHO) = make_mingw console Build Console Programs =
-# @$(ECHO) = make_mingw console-mysql Build Console Programs with mySQL Support =
-# @$(ECHO) = make_mingw console-pgsql Build Console Programs with pgSQL Support =
-# @$(ECHO) = make_mingw console-sqlite3 Build Console Programs with SQLite3 Support =
-# @$(ECHO) = make_mingw console-odbc Build Console Programs with ODBC Support =
- @$(ECHO) = =
- @$(ECHO) = make_mingw clean Remove All Objects, Resources, Executables =
- @$(ECHO) = =
- @$(ECHO) = make_mingw install [InstallPath] Installs the D2Pack109 Package =
- @$(ECHO) = =
- @$(ECHO) ===============================================================================
- @pause
-
-#####################################################################
-# COMPILING TARGETS
-#####################################################################
-
-.PHONY: gui
-gui: clean
- @$(MAKE) -s -fMakefile.mingw servers $(ENV) WITH_GUI=1
-
-.PHONY: gui-mysql
-gui-mysql: clean
- @$(MAKE) -s -fMakefile.mingw servers $(ENV) WITH_GUI=1 $(ENV) WITH_MYSQL=1
-
-.PHONY: gui-pgsql
-gui-pgsql: clean
- @$(MAKE) -s -fMakefile.mingw servers $(ENV) WITH_GUI=1 $(ENV) WITH_PGSQL=1
-
-.PHONY: gui-sqlite3
-gui-sqlite3: clean
- @$(MAKE) -s -fMakefile.mingw servers $(ENV) WITH_GUI=1 $(ENV) WITH_SQLITE3=1
-
-.PHONY: gui-odbc
-gui-odbc: clean
- @$(MAKE) -s -fMakefile.mingw servers $(ENV) WITH_GUI=1 $(ENV) WITH_ODBC=1
-
-.PHONY: console
-console: clean servers
-
-.PHONY: console-mysql
-console-mysql: clean
- @$(MAKE) -s -fMakefile.mingw servers $(ENV) WITH_MYSQL=1
-
-.PHONY: console-pgsql
-console-pgsql: clean
- @$(MAKE) -s -fMakefile.mingw servers $(ENV) WITH_PGSQL=1
-
-.PHONY: console-sqlite3
-console-sqlite3: clean
- @$(MAKE) -s -fMakefile.mingw servers $(ENV) WITH_SQLITE3=1
-
-.PHONY: console-odbc
-console-odbc: clean
- @$(MAKE) -s -fMakefile.mingw servers $(ENV) WITH_ODBC=1
-
-#####################################################################
-
-.PHONY: servers
-servers: $(d2cs_SBIN) $(d2dbs_SBIN)
-
-#####################################################################
-# CLEANING
-#####################################################################
-
-.PHONY: clean
-clean: clean-obj clean-res clean-exe
-
-.PHONY: clean-obj
-clean-obj:
- @$(ECHO) Removing Objects
- @-$(RMF) $(SRC_COMMONDIR)/*.o
- @-$(RMF) $(SRC_COMPATDIR)/*.o
- @-$(RMF) $(SRC_D2CSDIR)/*.o
- @-$(RMF) $(SRC_D2DBSDIR)/*.o
- @-$(RMF) $(SRC_WIN32DIR)/*.o
-
-.PHONY: clean-res
-clean-res:
- @$(ECHO) Removing Resourses
- @-$(RMF) $(SRC_WIN32DIR)/*.res
-
-.PHONY: clean-exe
-clean-exe:
- @$(ECHO) Removing Executables
- @-$(RMF) $(SRC_SBINDIR)/*.exe
-
-#####################################################################
-# PACKAGING
-#####################################################################
-
-.PHONY: gui-package
-gui-package:
- @$(MAKE) -s -fMakefile.mingw gui
- @$(MAKE) -s -fMakefile.mingw package $(ENV) TYPE=-GUI $(ENV)
-
-.PHONY: console-package
-console-package:
- @$(MAKE) -s -fMakefile.mingw console
- @$(MAKE) -s -fMakefile.mingw package $(ENV) TYPE=-Console $(ENV) NAME_TYPE=Console
-
-.PHONY: releases
-releases: console-package gui-package
-
-.PHONY: package
-package: $(DEST) install
- @$(ECHO) Making PvPGN$(TYPE) Package
- @$(ECHO) @echo off > $(installdir)/install.bat
- @$(ECHO) d2cs109$(NAME_TYPE).exe -s install >> $(installdir)/install.bat
- @$(ECHO) d2dbs109$(NAME_TYPE).exe -s install >> $(installdir)/install.bat
- @$(ECHO) @echo off > $(installdir)/uninstall.bat
- @$(ECHO) d2cs109$(NAME_TYPE).exe -s uninstall >> $(installdir)/uninstall.bat
- @$(ECHO) d2dbs109$(NAME_TYPE).exe -s uninstall >> $(installdir)/uninstall.bat
- @-$(RMF) $(PACKAGE)
- @$(ZIP) $(PACKAGE) $(installdir)
-
-#####################################################################
-# INSTALLING
-#####################################################################
-
-.PHONY: install
-install: install-dirs install-confs install-docs install-files install-exes install-misc install-u2d
-
-.PHONY: install-dirs
-install-dirs:
- @$(ECHO) Creating Directorys
- @-$(INSTALL_DIR) $(installdir)
- @-$(INSTALL_DIR) $(confdir)
- @-$(INSTALL_DIR) $(docsdir)
- @-$(INSTALL_DIR) $(filesdir)
- @-$(INSTALL_DIR) $(sharedir)
- @-$(INSTALL_DIR) $(bakdir)
- @-$(INSTALL_DIR) $(bakcharsavedir)
- @-$(INSTALL_DIR) $(bakcharinfodir)
- @-$(INSTALL_DIR) $(charsavedir)
- @-$(INSTALL_DIR) $(charinfodir)
- @-$(INSTALL_DIR) $(laddersdir)
-
-.PHONY: install-confs
-install-confs:
- @$(ECHO) Installing Configuration Files
- @-$(INSTALL) $(SRC_CONFDIR)/d2cs.conf.win32 $(confdir)/d2cs.conf
- @-$(INSTALL) $(SRC_CONFDIR)/d2dbs.conf.win32 $(confdir)/d2dbs.conf
- @-$(INSTALL) $(SRC_CONFDIR)/address_translation.conf $(confdir)
-
-.PHONY: install-docs
-install-docs:
- @$(ECHO) Installing Docs
- @-$(INSTALL) $(SRC_DOCSDIR)/Service.Win32.txt $(docsdir)
- @-$(INSTALL) $(SRC_DOCSDIR)/INSTALL.unix $(docsdir)/INSTALL.unix.txt
-
-.PHONY: install-files
-install-files:
- @$(ECHO) Installing Server Files
- @-$(INSTALL) $(SRC_FILESDIR)/newbie.save $(filesdir)
-
-.PHONY: install-exes
-install-exes:
- @$(ECHO) Installing Executables
- @-$(INSTALL) $(SRC_SBINDIR)/*.exe $(installdir)
-# @-$(INSTALL) $(SRC_SBINDIR)/*.dll $(installdir)
-
-.PHONY: install-misc
-install-misc:
- @$(ECHO) Installing Misc Files
- @-$(INSTALL) $(TOP_DIR)/COPYING $(installdir)/COPYING.txt
- @-$(INSTALL) $(TOP_DIR)/CREDITS $(installdir)/CREDITS.txt
- @-$(INSTALL) $(TOP_DIR)/README $(installdir)/README.txt
-
-.PHONY: install-u2d
-install-u2d:
- @$(ECHO) Converting Unix Style Text Files to Dos Format
- @$(PCC) $(SRC_WIN32DIR)/u2d.c -o $(UNIX2DOS)
- @-$(UNIX2DOS) $(confdir)/*.conf
- @-$(UNIX2DOS) $(docsdir)/*.txt
- @-$(UNIX2DOS) $(installdir)/*.txt
- @-$(RMF) $(UNIX2DOS)
-
-#####################################################################
-# DIRECTORYS
-#####################################################################
-
-$(SRC_SBINDIR):
- $(INSTALL_DIR) $(SRC_SBINDIR)
-
-$(DEST):
- $(INSTALL_DIR) $(DEST)
-
-#####################################################################
-# HEADER
-#####################################################################
-
-.PHONY: SHOWHEADER
-SHOWHEADER:
- @$(ECHO) ============================================================
- @$(ECHO) CFLAGS..= $(CFLAGS)
- @$(ECHO) LDFLAGS.= $(LDFLAGS)
- @$(ECHO) ============================================================
-
-#####################################################################
-# SERVER BINS
-#####################################################################
-
-$(d2cs_SBIN): SHOWHEADER $(d2cs_OBJECTS) $(d2cs_RES) $(SRC_SBINDIR)
- @$(ECHO) Linking $@
- @$(CC) $(d2cs_OBJECTS) $(d2cs_RES) $(LDFLAGS) -o $@
- @$(STRIP) $@
-
-$(d2dbs_SBIN): SHOWHEADER $(d2dbs_OBJECTS) $(d2dbs_RES) $(SRC_SBINDIR)
- @$(ECHO) Linking $@
- @$(CC) $(d2dbs_OBJECTS) $(d2dbs_RES) $(LDFLAGS) -o $@
- @$(STRIP) $@
-
-#####################################################################
-# Object Files
-#####################################################################
-
-%.o: %.c
- @$(ECHO) Compiling $*.c
- @$(CC) $(CFLAGS) -c $< -o $@
-
-#####################################################################
-# Resource Files
-#####################################################################
-
-%.res: %.rc
- @$(ECHO) Compiling $*.rc
- @$(WINDRES) -i $< -o $@ -O coff --include-dir $(SRC_SRCDIR)
diff --git a/d2pack109/Win32-Projects/make_mingw.bat b/d2pack109/Win32-Projects/make_mingw.bat
deleted file mode 100644
index 9d2b171..0000000
--- a/d2pack109/Win32-Projects/make_mingw.bat
+++ /dev/null
@@ -1,24 +0,0 @@
-@echo off
-path = C:\MinGW\bin
-
-if %1X == installX goto install
-
-mingw32-make -fMakefile.mingw %1
-goto end
-
-:install
-if %2X == X goto error
-
-mingw32-make -fMakefile.mingw %1 -e prefix=%2
-goto end
-
-:error
-echo:
-echo You didn't supply the Install Path!
-echo:
-echo example: make_mingw install C:\d2pack109
-echo:
-pause
-goto end
-
-:end
diff --git a/d2pack109/Win32-Projects/make_mingw.sh b/d2pack109/Win32-Projects/make_mingw.sh
deleted file mode 100755
index b08b309..0000000
--- a/d2pack109/Win32-Projects/make_mingw.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-PREFIX=/usr/local/cross-tools
-TARGET=i386-mingw32msvc
-export PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH"
-export CROSS_BUILD=1
-export DEST="./win32-builds"
-exec make -fMakefile.mingw $*
diff --git a/d2pack109/conf/address_translation.conf b/d2pack109/conf/address_translation.conf
deleted file mode 100644
index 50cbfea..0000000
--- a/d2pack109/conf/address_translation.conf
+++ /dev/null
@@ -1,94 +0,0 @@
-########################################################################################################
-#------------------------------------------------------------------------------------------------------#
-# Address Translation table #
-#------------------------------------------------------------------------------------------------------#
-# #
-# This is a list of ip:port addresses that get translated #
-# #
-# The entries are broken into four parts: #
-# #
-# * the IP address w/port to be translated #
-# * the output IP address w/port #
-# * comma delimited list of networks to be excluded from translation #
-# * comma delimited list of networks to be included in translation #
-# #
-# Each line must contain all four parts or the entire entry will be rejected #
-# There are no default ports, make sure input and output includes the port number #
-# #
-# The entries are searched in the order listed in this file #
-# Exclude networks are searched before include networks #
-# Only the first matching line is used #
-# Lines begining with '#' are ignored #
-# #
-# If no match is found, the input ip will be returned. #
-# #
-# NONE = There are no neworks to exclude/include (just a place holder, no entries will be added) #
-# ANY = All networks will be excluded/included (same as 0.0.0.0/0) #
-# #
-########################################################################################################
-
-########################################################################################################
-# w3route server ip (removed from w3trans.conf) (Port 6200) #
-# #
-# Set input address the same as the w3routeaddr setting in the bnetd.conf #
-# Set output address to the address to be sent to war3 clients #
-# Set exclude to the range of clients you want to recieve the input address #
-# instead of the output address #
-# Set include to the range of clients you want to recieve the output address #
-# #
-# input (ip:port) output (ip:port) exclude (ip/netmask) include (ip/netmask) #
-#--------------------- ---------------------- ---------------------------- -------------------------#
-
-#0.0.0.0:6200 192.168.1.100:6200 NONE 192.168.1.0/24
-#0.0.0.0:6200 internetip:6200 NONE ANY
-
-
-
-########################################################################################################
-# Game Translations for clients (removed from gametrans.conf) (client data ports) #
-# #
-# Set input address to the client to be translated #
-# Set output address to the address to be sent to the other clients #
-# Set exclude to the range of clients you want to recieve the input address #
-# instead of the output address #
-# Set include to the range of clients you want to recieve the output address #
-# #
-# input (ip:port) output (ip:port) exclude (ip/netmask) include (ip/netmask) #
-#--------------------- ---------------------- ---------------------------- -------------------------#
-
-#192.168.1.1:6119 internetip:6119 192.168.1.0/24,10.0.0.0/8 ANY
-#192.168.1.2:6118 internetip:6118 192.168.1.0/24 ANY
-
-
-
-########################################################################################################
-# Diablo II Charactar Server (d2cs) - (removed from realm.conf) (Port 6113) #
-# #
-# Set input address to the ip of d2cs (same as the ip in the realm.conf) #
-# Set output address to the address to be sent to the clients #
-# Set exclude to the range of clients you want to recieve the input address #
-# instead of the output address #
-# Set include to the range of client you want to recieve the output address #
-# #
-# input (ip:port) output (ip:port) exclude (ip/netmask) include (ip/netmask) #
-#--------------------- ---------------------- ---------------------------- -------------------------#
-
-#192.168.1.100:6113 internetip:6113 192.168.1.0/24 ANY
-
-
-
-########################################################################################################
-# Diablo II Game Server (d2gs) - (removed from d2gstrans.conf) (Port 4000) #
-# #
-# Set input address to the ip of d2gs (same as the gameservlist in d2cs.conf) #
-# Set output address to the address to be sent to the clients #
-# Set exclude to the range of clients you want to recieve the input address #
-# instead of the output address #
-# Set include to the range of client you want to recieve the output address #
-# #
-# input (ip:port) output (ip:port) exclude (ip/netmask) include (ip/netmask) #
-#--------------------- ---------------------- ---------------------------- -------------------------#
-
-#192.168.1.100:4000 internetip:4000 192.168.1.0/24 ANY
-
-
diff --git a/d2pack109/conf/d2cs.conf.in b/d2pack109/conf/d2cs.conf.in
deleted file mode 100644
index 844c563..0000000
--- a/d2pack109/conf/d2cs.conf.in
+++ /dev/null
@@ -1,201 +0,0 @@
-#################################################################################
-# d2cs.conf - Configuration file for the diablo2 game control server #
-#-------------------------------------------------------------------------------#
-# #
-# This file is an example configuration and may require modification to #
-# suit your needs or your site. Blank lines and lines starting with a "#" #
-# are ignored. Use quotes around values that contain spaces. #
-# #
-#################################################################################
-
-
-#################################################################################
-# Server Major Settings #
-#-------------------------------------------------------------------------------#
-# #
-# Your realm server name #
-realmname = D2CS
-
-# This is a comma delimited list of hostnames that the server should
-# listen on. It might be useful to make an internal-only server on a
-# gateway machine for example. If the list is not set or if it has a
-# entry with no host component, the server will bind to that port on all
-# interfaces.
-# d2cs default listening port is 6113
-servaddrs = 0.0.0.0:6113
-
-# This is a comma delimited list of game servers
-#gameservlist = your.gameserver,another.gameserver
-
-# This is bnetd server address with port
-# bnetd default listening port is 6112
-#bnetdaddr = xxx.xxx.xxx.xxx:6112
-
-# Set this to the maximum number of concurrent connections allowed on
-# this server.
-max_connections = 1000
-
-# This sets the realm to Classic or LOD or Both
-# Classic = 0
-# LOD = 1
-# Both = 2 (default)
-lod_realm = 2
-
-# This sets whether you can convert a clasic char to
-# an expansion char.
-# Allow Convert = 1
-# Don't allow Convert = 0
-allow_convert = 0
-
-# here u can enter the symbols allowed in accountnames (additional to
-# alphanumerical symbals which are always accepted). please note that
-# it is absolutly mandatory that u set up the same symbols here as in
-# bnetd.conf or else u wont be able to play D2 with some characters
-# (those whose symbols are allowed in bnetd.conf but not here)
-# same warnings as in bnetd.conf apply here - be warned - and just
-# change something if you know what you are doing
-#default setting is "-_[]"
-account_allowed_symbols = "-_[]"
-
-# #
-#################################################################################
-
-#################################################################################
-# Message logs #
-#-------------------------------------------------------------------------------#
-# Multiple log levels can be defined by connecting them with a comma (,)
-# Available loglevels are:
-# none
-# trace
-# debug
-# info
-# warn
-# error
-# fatal
-#loglevels = fatal,error,warn,info
-loglevels = fatal,error,warn,info,debug,trace
-
-# #
-#################################################################################
-
-#################################################################################
-# File and Path section #
-# Use absolute paths in these lines to avoid problems! #
-#-------------------------------------------------------------------------------#
-# #
-logfile = /usr/local/var/d2cs.log
-charsavedir = /usr/local/var/charsave
-charinfodir = /usr/local/var/charinfo
-bak_charsavedir = /usr/local/var/bak/charsave
-bak_charinfodir = /usr/local/var/bak/charinfo
-ladderdir = /usr/local/var/ladders
-newbiefile = /usr/local/var/files/newbie.save
-transfile = /usr/local/etc/address_translation.conf
-# #
-#################################################################################
-
-#################################################################################
-# Misc #
-#-------------------------------------------------------------------------------#
-# #
-# Message Of The Day, support hexcode
-motd = "Tips: How to use color in your profile(Right click on your portrait to open pr ofile editing). Use \\\\xffc as Prefix (\\\\xff means ascii code 0xff,but you should use copy/paste trick to in put it, c means character 'c'. Color also works in game chat,but have input limit). Then append the Color chara cter list below: \\xffc0White '0' \\xffc1Red '1' \\xffc2Green '2' \\xffc3Blue '3' \\xffc4Gold '4' \\xffc5Gray '5' Black '6' \\xffc7DarkYellow '7' \\xffc8Orange '8' \\xffc9Yellow '9' \\xffc:DarkGreen ':' \\xffc;Purple ';' \\xffc/src) and run configure. You will need to provide configure with
-your custom options, ex.
-
-./configure --prefix=
-
-It will configure the source distribution to compile and install in the
-location.
-
-Check using ./configure --help for all available options.
-
-3. Compile and install PvPGN using
-
-$ make
-$ make install
-
-WARNING !! make install it will also overwrite the configuration files. Make a
-backup of them before doing "make install" (read more about this in the UPDATE
-file).
-
-Now you just need to edit the config files and adjust them acording to your
-system. Have fun!
-
-4. (only for binary PvPGN distributions)
-Depending on the type of package you have obtained (ex RPM, deb, tgz) you will
-have to install the package using the right package tool.
-
-Examples:
-
-$ rpm -ivh pvpgn-.rpm
-
-or
-
-$ installpkg pvpgn-.tgz
-
-or
-
-$ dpkg -i pvpgn-.deb
-
-After you install the binary package you will need to adjust PvPGN configuration
-files (usually installed in /etc/pvpgn dir). Have fun!
diff --git a/d2pack109/docs/Service.Win32.txt b/d2pack109/docs/Service.Win32.txt
deleted file mode 100644
index cbb0a14..0000000
--- a/d2pack109/docs/Service.Win32.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-To Install:
-run the install.bat in the main dir
-
-To Uninstall:
-run the uninstall.bat in the main dir
\ No newline at end of file
diff --git a/d2pack109/src/Makefile.in b/d2pack109/src/Makefile.in
deleted file mode 100644
index d83fddb..0000000
--- a/d2pack109/src/Makefile.in
+++ /dev/null
@@ -1,348 +0,0 @@
-#
-# Copyright (C) 1999 Rob Crittenden (rcrit@greyoak.com)
-# Copyright (C) 1999,2000 Ross Combs (rocombs@cs.nmsu.edu)
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-mandir = @mandir@
-confdir = @sysconfdir@
-sharedir = @localstatedir@
-filesdir = @localstatedir@/files
-charinfodir = @localstatedir@/charinfo
-charsavedir = @localstatedir@/charsave
-ladderdir = @localstatedir@/ladders
-statusdir = @localstatedir@/status
-bak_charsavedir = @localstatedir@/bak/charsave
-bak_charinfodir = @localstatedir@/bak/charinfo
-
-SRC_SRCDIR = @srcdir@
-SRC_SBINDIR = @srcdir@/../sbin
-SRC_MANDIR = @srcdir@/../man
-SRC_CONFDIR = @srcdir@/../conf
-SRC_SHAREDIR = @srcdir@/../files
-SRC_SCRIPTDIR = @srcdir@/../scripts
-
-SRC_ACDIR = ${SRC_SRCDIR}/autoconf
-SRC_D2CSDIR = ${SRC_SRCDIR}/d2cs
-SRC_D2DBSDIR = ${SRC_SRCDIR}/d2dbs
-SRC_COMMONDIR = ${SRC_SRCDIR}/common
-SRC_COMPATDIR = ${SRC_SRCDIR}/compat
-
-RMF = rm -f
-
-RMDIR = rmdir
-
-ECHO = echo
-
-SED = sed
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_DIRS = @INSTALL@ -d -m 755
-
-# CC set by configure
-# CFLAGS set by configure
-CPPFLAGS = @DEFS@ @DEFINES@ -DD2CS_DEFAULT_CONF_FILE=\"${confdir}/d2cs.conf\" -DD2DBS_DEFAULT_CONF_FILE=\"${confdir}/d2dbs.conf\" -I"${SRC_SRCDIR}" @CPPFLAGS@
-COMPILE = @CC@ @CFLAGS@ ${CPPFLAGS} -fno-strict-aliasing -c
-#PREPROCESS = @CPP@ ${CPPFLAGS}
-LINK = @CC@ @CFLAGS@ @LDFLAGS@
-LINK_LIBS = @LIBS@
-
-PARTS = common compat d2cs d2dbs
-
-d2cs_SBIN = ${SRC_SBINDIR}/d2cs
-d2cs_CONFS = d2cs.conf address_translation.conf
-d2cs_OBJECTS = ${SRC_D2CSDIR}/main.o \
-${SRC_D2CSDIR}/d2gs.o \
-${SRC_D2CSDIR}/handle_d2gs.o \
-${SRC_D2CSDIR}/serverqueue.o \
-${SRC_D2CSDIR}/connection.o \
-${SRC_D2CSDIR}/game.o \
-${SRC_D2CSDIR}/server.o \
-${SRC_D2CSDIR}/handle_init.o \
-${SRC_D2CSDIR}/handle_d2cs.o \
-${SRC_D2CSDIR}/d2charfile.o \
-${SRC_D2CSDIR}/d2charlist.o \
-${SRC_D2CSDIR}/xstring.o \
-${SRC_D2CSDIR}/gamequeue.o \
-${SRC_D2CSDIR}/conf.o \
-${SRC_D2CSDIR}/prefs.o \
-${SRC_D2CSDIR}/cmdline_parse.o \
-${SRC_D2CSDIR}/bnetd.o \
-${SRC_D2CSDIR}/handle_bnetd.o \
-${SRC_D2CSDIR}/s2s.o \
-${SRC_D2CSDIR}/net.o \
-${SRC_D2CSDIR}/d2ladder.o \
-${SRC_D2CSDIR}/handle_signal.o \
-${SRC_COMMONDIR}/hashtable.o \
-${SRC_COMMONDIR}/hexdump.o \
-${SRC_COMMONDIR}/eventlog.o \
-${SRC_COMMONDIR}/list.o \
-${SRC_COMMONDIR}/packet.o \
-${SRC_COMMONDIR}/bn_type.o \
-${SRC_COMMONDIR}/addr.o \
-${SRC_COMMONDIR}/util.o \
-${SRC_COMMONDIR}/queue.o \
-${SRC_COMMONDIR}/network.o \
-${SRC_COMMONDIR}/fdwatch.o \
-${SRC_COMMONDIR}/fdwatch_select.o \
-${SRC_COMMONDIR}/fdwatch_poll.o \
-${SRC_COMMONDIR}/fdwatch_epoll.o \
-${SRC_COMMONDIR}/fdwatch_kqueue.o \
-${SRC_COMMONDIR}/rlimit.o \
-${SRC_COMMONDIR}/trans.o \
-${SRC_COMMONDIR}/tag.o \
-${SRC_COMMONDIR}/xalloc.o \
-${SRC_COMPATDIR}/inet_aton.o \
-${SRC_COMPATDIR}/inet_ntoa.o \
-${SRC_COMPATDIR}/strdup.o \
-${SRC_COMPATDIR}/strerror.o \
-${SRC_COMPATDIR}/strtoul.o \
-${SRC_COMPATDIR}/strftime.o \
-${SRC_COMPATDIR}/strcasecmp.o \
-${SRC_COMPATDIR}/strncasecmp.o \
-${SRC_COMPATDIR}/strsep.o \
-${SRC_COMPATDIR}/psock.o \
-${SRC_COMPATDIR}/uname.o \
-${SRC_COMPATDIR}/gettimeofday.o \
-${SRC_COMPATDIR}/difftime.o \
-${SRC_COMPATDIR}/pdir.o \
-${SRC_COMPATDIR}/memset.o \
-${SRC_COMPATDIR}/memcpy.o \
-${SRC_COMPATDIR}/memmove.o
-
-d2dbs_SBIN = ${SRC_SBINDIR}/d2dbs
-d2dbs_CONFS = d2dbs.conf
-d2dbs_OBJECTS = ${SRC_D2DBSDIR}/main.o \
-${SRC_D2DBSDIR}/charlock.o \
-${SRC_D2DBSDIR}/d2ladder.o \
-${SRC_D2DBSDIR}/dbserver.o \
-${SRC_D2DBSDIR}/dbspacket.o \
-${SRC_D2DBSDIR}/cmdline_parse.o \
-${SRC_D2DBSDIR}/prefs.o \
-${SRC_D2DBSDIR}/handle_signal.o \
-${SRC_D2DBSDIR}/dbsdupecheck.o \
-${SRC_D2CSDIR}/conf.o \
-${SRC_D2CSDIR}/xstring.o \
-${SRC_COMMONDIR}/list.o \
-${SRC_COMMONDIR}/eventlog.o \
-${SRC_COMMONDIR}/bn_type.o \
-${SRC_COMMONDIR}/util.o \
-${SRC_COMMONDIR}/addr.o \
-${SRC_COMMONDIR}/fdwatch.o \
-${SRC_COMMONDIR}/fdwatch_select.o \
-${SRC_COMMONDIR}/fdwatch_poll.o \
-${SRC_COMMONDIR}/fdwatch_epoll.o \
-${SRC_COMMONDIR}/fdwatch_kqueue.o \
-${SRC_COMMONDIR}/rlimit.o \
-${SRC_COMMONDIR}/tag.o \
-${SRC_COMMONDIR}/xalloc.o \
-${SRC_COMPATDIR}/psock.o \
-${SRC_COMPATDIR}/strerror.o \
-${SRC_COMPATDIR}/strsep.o
-
-OBJECTS = ${d2cs_OBJECTS} ${d2dbs_OBJECTS}
-SBINS = ${d2cs_SBIN} ${d2dbs_SBIN}
-
-CONFS = ${d2cs_CONFS} ${d2dbs_CONFS}
-
-SHARES = newbie.save
-
-OTHERRM = ${SRC_ACDIR}/ansi2knr ${SRC_ACDIR}/ansi2knr.o @ANSI2KNR_TMP@
-DIRS = ${SRC_SBINDIR}
-
-.PHONY: all
-all: .dep @ANSI2KNR_DEP@ config ${SBINS} ${SRC_CONFDIR}/d2cs.conf ${SRC_CONFDIR}/d2dbs.conf
-
-.PHONY: clean
-clean:
- -${RMF} core
- -${RMF} ${OBJECTS}
- -${RMF} ${SBINS}
- -${RMF} ${OTHERRM}
-
-.PHONY: distclean
-distclean: clean
- -${RMF} ${SRC_CONFDIR}/d2cs.conf
- -${RMF} ${SRC_CONFDIR}/d2dbs.conf
- -${RMF} ${SRC_SRCDIR}/config.cache ${SRC_SRCDIR}/config.log
- -${RMF} ${SRC_SRCDIR}/config.status
- -${RMF} ${SRC_SRCDIR}/Makefile ${SRC_SRCDIR}/config.h
- -${RMDIR} ${DIRS}
-
-.PHONY: cvsclean
-cvsclean: distclean
- -${RMF} ${SRC_SRCDIR}/configure ${SRC_SRCDIR}/config.h.in
-
-.PHONY: clean-compile
-clean-compile: clean all
-
-.PHONY: config
-config: .dep ${SRC_SRCDIR}/Makefile ${SRC_SRCDIR}/config.h
-
-${SRC_SRCDIR}/configure: ${SRC_SRCDIR}/configure.in
- @${ECHO} "The configure script is out of date; rebuilding..."
- cd ${SRC_SRCDIR} && autoconf
- @${ECHO} >> ${SRC_SRCDIR}/config.h.in
- @${ECHO} >> $@
-
-${SRC_SRCDIR}/config.h.in: ${SRC_SRCDIR}/configure.in
- @${ECHO} "The config.h.in header is out of date; rebuilding..."
- cd ${SRC_SRCDIR} && autoheader
- @${ECHO} >> $@
- @${ECHO} >> ${SRC_SRCDIR}/configure
-
-${SRC_SRCDIR}/config.status: ${SRC_SRCDIR}/configure
- @${ECHO} "The config.status script is out of date; rechecking..."
- ${SRC_SRCDIR}/config.status --recheck
- @${ECHO} >> $@
-
-${SRC_SRCDIR}/config.h: ${SRC_SRCDIR}/config.h.in ${SRC_SRCDIR}/config.status
- @${ECHO} "The config.h header is out of date; rewriting..."
- ${SRC_SRCDIR}/config.status
- @${ECHO} >> ${SRC_SRCDIR}/Makefile
- @${ECHO} >> $@
-
-${SRC_SRCDIR}/Makefile: ${SRC_SRCDIR}/Makefile.in ${SRC_SRCDIR}/config.status
- @${ECHO} "The Makefile is out of date; rewriting..."
- ${SRC_SRCDIR}/config.status
- @${ECHO} >> ${SRC_SRCDIR}/config.h
- @${ECHO} >> $@
-
-${SRC_SBINDIR}:
- ${INSTALL_DIRS} $@
-
-.PHONY: install
-install: .dep install-sbin install-conf install-share
-
-.PHONY: install-sbin
-install-sbin: ${SBINS}
- ${INSTALL_DIRS} ${DESTDIR}/${sbindir}
- @list='${SBINS}'; for p in $$list; do \
- if test -f $$p; then \
- ${ECHO} " ${INSTALL_PROGRAM} $$p ${DESTDIR}/${sbindir}"; \
- ${INSTALL_PROGRAM} $$p ${DESTDIR}/${sbindir}; \
- else :; fi; \
- done
-
-.PHONY: install-conf
-install-conf: ${SRC_CONFDIR}/d2cs.conf ${SRC_CONFDIR}/d2dbs.conf
- ${INSTALL_DIRS} ${DESTDIR}/${confdir}
- @list='${CONFS}'; for p in $$list; do \
- if test -f ${SRC_CONFDIR}/$$p; then \
- ${ECHO} " ${INSTALL_DATA} ${SRC_CONFDIR}/$$p ${DESTDIR}/${confdir}"; \
- ${INSTALL_DATA} ${SRC_CONFDIR}/$$p ${DESTDIR}/${confdir}; \
- else :; fi; \
- done
-
-.PHONY: install-share
-install-share:
- ${INSTALL_DIRS} ${DESTDIR}/${sharedir} ${DESTDIR}/${filesdir} \
- ${DESTDIR}/${charinfodir} ${DESTDIR}/${charsavedir} ${DESTDIR}/${bak_charsavedir} \
- ${DESTDIR}/${bak_charinfodir} ${DESTDIR}/${ladderdir} ${DESTDIR}/${statusdir}
- @list='${SHARES}'; for p in $$list; do \
- if test -f ${SRC_SHAREDIR}/$$p; then \
- ${ECHO} " ${INSTALL_DATA} ${SRC_SHAREDIR}/$$p ${DESTDIR}/${filesdir}"; \
- ${INSTALL_DATA} ${SRC_SHAREDIR}/$$p ${DESTDIR}/${filesdir}; \
- else :; fi; \
- done
-
-.PHONY: uninstall
-uninstall: uninstall-sbin uninstall-conf uninstall-share
-
-.PHONY: uninstall-sbin
-uninstall-sbin:
- @list='${SBINS}'; for p in $$list; do \
- ${ECHO} " ${RMF} ${sbindir}/$$p"; \
- ${RMF} ${sbindir}/$$p; \
- done
-
-.PHONY: uninstall-conf
-uninstall-conf:
- @list='${CONFS}'; for p in $$list; do \
- ${ECHO} " ${RMF} ${confdir}/$$p"; \
- ${RMF} ${confdir}/$$p; \
- done
-
-.PHONY: uninstall-share
-uninstall-share:
- @list='${SHARES}'; for p in $$list; do \
- ${ECHO} " ${RMF} ${sharedir}/$$p"; \
- ${RMF} ${sharedir}/$$p; \
- done
-
-${SRC_CONFDIR}/d2cs.conf: ${SRC_CONFDIR}/d2cs.conf.in ${SRC_SRCDIR}/config.status
- @${RMF} $@
- ${SED} -e "s@/usr/local/var/@${sharedir}/@g" -e "s@/usr/local/etc/@${confdir}/@g" ${SRC_CONFDIR}/d2cs.conf.in > $@
-
-${SRC_CONFDIR}/d2dbs.conf: ${SRC_CONFDIR}/d2dbs.conf.in ${SRC_SRCDIR}/config.status
- @${RMF} $@
- ${SED} -e "s@/usr/local/var/@${sharedir}/@g" -e "s@/usr/local/etc/@${confdir}/@g" ${SRC_CONFDIR}/d2dbs.conf.in > $@
-
-${SRC_ACDIR}/ansi2knr: ${SRC_ACDIR}/ansi2knr.o
- @${RMF} $@
- ${LINK} ${SRC_ACDIR}/ansi2knr.o ${LINK_LIBS} -o $@
-
-${SRC_ACDIR}/ansi2knr.o: ${SRC_ACDIR}/ansi2knr.c
- @${RMF} $@
- ${COMPILE} ${SRC_ACDIR}/ansi2knr.c -o $@
-
-SHOWHEADER:
- @echo
- @echo "Using compile command: ${COMPILE}"
- @echo
-
-.c.o: SHOWHEADER
- @${RMF} $@
- @echo "Compiling $*.c"
- @@COMPILEANSI1@
- @@COMPILEANSI2@
- @@COMPILEANSI3@
-
-.dep:
- ${MAKE} dep
-
-dep:
- @${RMF} .dep
- @for a in ${PARTS}; do \
- echo Dependency check: $$a; \
- ${COMPILE} -MM `ls $$a/*.c` | sed -e "s@\(.*\)\.o:\(.*\)@$$a\/\1\.o:\2@g" 1>>.dep; \
- done
-
-${d2cs_SBIN}: SHOWHEADER ${d2cs_OBJECTS}
- @${INSTALL_DIRS} ${SRC_SBINDIR}
- @${RMF} $@
- ${LINK} ${d2cs_OBJECTS} ${LINK_LIBS} -o $@
-
-${d2dbs_SBIN}: SHOWHEADER ${d2dbs_OBJECTS}
- @${INSTALL_DIRS} ${SRC_SBINDIR}
- @${RMF} $@
- ${LINK} ${d2dbs_OBJECTS} ${LINK_LIBS} -o $@
-
-ifneq ($(wildcard .dep),)
-include .dep
-endif
-
-# Tell versions (3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/d2pack109/src/autoconf/ansi2knr.c b/d2pack109/src/autoconf/ansi2knr.c
deleted file mode 100644
index 1ef66bf..0000000
--- a/d2pack109/src/autoconf/ansi2knr.c
+++ /dev/null
@@ -1,637 +0,0 @@
-/* Copyright (C) 1989, 1997, 1998 Aladdin Enterprises. All rights reserved. */
-
-/*$Id: ansi2knr.c,v 1.1.1.1 2004/03/11 18:57:30 dizzy Exp $*/
-/* Convert ANSI C function definitions to K&R ("traditional C") syntax */
-
-/*
-ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY. No author or distributor accepts responsibility to anyone for the
-consequences of using it or for whether it serves any particular purpose or
-works at all, unless he says so in writing. Refer to the GNU General Public
-License (the "GPL") for full details.
-
-Everyone is granted permission to copy, modify and redistribute ansi2knr,
-but only under the conditions described in the GPL. A copy of this license
-is supposed to have been given to you along with ansi2knr so you can know
-your rights and responsibilities. It should be in a file named COPYLEFT,
-or, if there is no file named COPYLEFT, a file named COPYING. Among other
-things, the copyright notice and this notice must be preserved on all
-copies.
-
-We explicitly state here what we believe is already implied by the GPL: if
-the ansi2knr program is distributed as a separate set of sources and a
-separate executable file which are aggregated on a storage medium together
-with another program, this in itself does not bring the other program under
-the GPL, nor does the mere fact that such a program or the procedures for
-constructing it invoke the ansi2knr executable bring any other part of the
-program under the GPL.
-*/
-
-/*
- * Usage:
- ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]
- * --filename provides the file name for the #line directive in the output,
- * overriding input_file (if present).
- * If no input_file is supplied, input is read from stdin.
- * If no output_file is supplied, output goes to stdout.
- * There are no error messages.
- *
- * ansi2knr recognizes function definitions by seeing one or more
- * identifiers at the left margin, possibly including function pointer
- * types, eventually followed by a left parenthesis with a right
- * parenthesis after that and with a left brace as the first token on
- * the next line. ansi2knr will recognize a multi-line header provided
- * that no intervening line ends with a left or right brace or a
- * semicolon. These algorithms ignore whitespace and comments.
- * The following constructs will confuse it:
- * - Any other construct that starts at the left margin and
- * follows the above syntax (such as a macro or function call).
- * - Some macros that tinker with the syntax of the function header.
- */
-
-/*
- * The original and principal author of ansi2knr is L. Peter Deutsch
- * . Other authors are noted in the change history
- * that follows (in reverse chronological order):
- rac 2000-08-02 modified to not force the return values to be
- on the preceding line, to transform prototypes, to
- remove the "void" single parameter restriction, and to
- handle function pointers with ANSI style parameters.
- lpd 1998-11-09 added further hack to recognize identifier(void)
- as being a procedure
- lpd 1998-10-23 added hack to recognize lines consisting of
- identifier1(identifier2) as *not* being procedures
- lpd 1997-12-08 made input_file optional; only closes input and/or
- output file if not stdin or stdout respectively; prints
- usage message on stderr rather than stdout; adds
- --filename switch (changes suggested by
- )
- lpd 1996-01-21 added code to cope with not HAVE_CONFIG_H and with
- compilers that don't understand void, as suggested by
- Tom Lane
- lpd 1996-01-15 changed to require that the first non-comment token
- on the line following a function header be a left brace,
- to reduce sensitivity to macros, as suggested by Tom Lane
-
- lpd 1995-06-22 removed #ifndefs whose sole purpose was to define
- undefined preprocessor symbols as 0; changed all #ifdefs
- for configuration symbols to #ifs
- lpd 1995-04-05 changed copyright notice to make it clear that
- including ansi2knr in a program does not bring the entire
- program under the GPL
- lpd 1994-12-18 added conditionals for systems where ctype macros
- don't handle 8-bit characters properly, suggested by
- Francois Pinard ;
- removed --varargs switch (this is now the default)
- lpd 1994-10-10 removed CONFIG_BROKETS conditional
- lpd 1994-07-16 added some conditionals to help GNU `configure',
- suggested by Francois Pinard ;
- properly erase prototype args in function parameters,
- contributed by Jim Avera ;
- correct error in writeblanks (it shouldn't erase EOLs)
- lpd 1989-xx-xx original version
- */
-
-/* Most of the conditionals here are to make ansi2knr work with */
-/* or without the GNU configure machinery. */
-
-#if HAVE_CONFIG_H
-# include
-#endif
-
-#include
-#include
-
-#if HAVE_CONFIG_H
-
-/*
- For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h).
- This will define HAVE_CONFIG_H and so, activate the following lines.
- */
-
-# if STDC_HEADERS || HAVE_STRING_H
-# include
-# else
-# include
-# endif
-
-#else /* not HAVE_CONFIG_H */
-
-/* Otherwise do it the hard way */
-
-# ifdef BSD
-# include
-# else
-# ifdef VMS
- extern int strlen(), strncmp();
-# else
-# include
-# endif
-# endif
-
-#endif /* not HAVE_CONFIG_H */
-
-#if STDC_HEADERS
-# include
-#else
-/*
- malloc and free should be declared in stdlib.h,
- but if you've got a K&R compiler, they probably aren't.
- */
-# ifdef MSDOS
-# include
-# else
-# ifdef VMS
- extern char *malloc();
- extern void free();
-# else
- extern char *malloc();
- extern int free();
-# endif
-# endif
-
-#endif
-
-/*
- * The ctype macros don't always handle 8-bit characters correctly.
- * Compensate for this here.
- */
-#ifdef isascii
-# undef HAVE_ISASCII /* just in case */
-# define HAVE_ISASCII 1
-#else
-#endif
-#if STDC_HEADERS || !HAVE_ISASCII
-# define is_ascii(c) 1
-#else
-# define is_ascii(c) isascii(c)
-#endif
-
-#define is_space(c) (is_ascii(c) && isspace(c))
-#define is_alpha(c) (is_ascii(c) && isalpha(c))
-#define is_alnum(c) (is_ascii(c) && isalnum(c))
-
-/* Scanning macros */
-#define isidchar(ch) (is_alnum(ch) || (ch) == '_')
-#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_')
-
-/* Forward references */
-static char *skipspace();
-static int writeblanks();
-static int test1();
-static int convert1();
-
-static char *startfn;
-static char *endfn;
-
-/* The main program */
-int
-main(argc, argv)
- int argc;
- char *argv[];
-{ FILE *in = stdin;
- FILE *out = stdout;
- char *filename = 0;
-#define bufsize 5000 /* arbitrary size */
- char *buf;
- char *line;
- char *more;
- char *usage =
- "Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]\n";
- /*
- * In previous versions, ansi2knr recognized a --varargs switch.
- * If this switch was supplied, ansi2knr would attempt to convert
- * a ... argument to va_alist and va_dcl; if this switch was not
- * supplied, ansi2knr would simply drop any such arguments.
- * Now, ansi2knr always does this conversion, and we only
- * check for this switch for backward compatibility.
- */
- int convert_varargs = 1;
-
- while ( argc > 1 && argv[1][0] == '-' ) {
- if ( !strcmp(argv[1], "--varargs") ) {
- convert_varargs = 1;
- argc--;
- argv++;
- continue;
- }
- if ( !strcmp(argv[1], "--filename") && argc > 2 ) {
- filename = argv[2];
- argc -= 2;
- argv += 2;
- continue;
- }
- fprintf(stderr, "Unrecognized switch: %s\n", argv[1]);
- fprintf(stderr, usage);
- exit(1);
- }
- switch ( argc )
- {
- default:
- fprintf(stderr, usage);
- exit(0);
- case 3:
- out = fopen(argv[2], "w");
- if ( out == NULL ) {
- fprintf(stderr, "Cannot open output file %s\n", argv[2]);
- exit(1);
- }
- /* falls through */
- case 2:
- in = fopen(argv[1], "r");
- if ( in == NULL ) {
- fprintf(stderr, "Cannot open input file %s\n", argv[1]);
- exit(1);
- }
- if ( filename == 0 )
- filename = argv[1];
- /* falls through */
- case 1:
- break;
- }
- if ( filename )
- fprintf(out, "#line 1 \"%s\"\n", filename);
- buf = malloc(bufsize);
- line = buf;
- while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL )
- {
-test: line += strlen(line);
- switch ( test1(buf) )
- {
- case 3: /* a function pointer */
- case 2: /* a function prototype */
- convert1(buf, out, 1, convert_varargs);
- break;
- case 1: /* a function */
- /* Check for a { at the start of the next line. */
- more = ++line;
-f: if ( line >= buf + (bufsize - 1) ) /* overflow check */
- goto wl;
- if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL )
- goto wl;
- switch ( *skipspace(more, 1) )
- {
- case '{':
- /* Definitely a function */
- convert1(buf, out, 0, convert_varargs);
- fputs(more, out);
- break;
- case 0:
- /* The next line was blank or a comment: */
- /* keep scanning for a non-comment. */
- line += strlen(line);
- goto f;
- default:
- /* buf isn't a function header, but */
- /* more might be. */
- fputs(buf, out);
- strcpy(buf, more);
- line = buf;
- goto test;
- }
- break;
- case -1: /* maybe the start of a function */
- if ( line != buf + (bufsize - 1) ) /* overflow check */
- continue;
- /* falls through */
- default: /* not a function */
-wl: fputs(buf, out);
- break;
- }
- line = buf;
- }
- if ( line != buf )
- fputs(buf, out);
- free(buf);
- if ( out != stdout )
- fclose(out);
- if ( in != stdin )
- fclose(in);
- return 0;
-}
-
-
-/* Skip over space and comments, in either direction. */
-static char *
-skipspace(p, dir)
- char *p;
- int dir; /* 1 for forward, -1 for backward */
-{ if (*p=='\0') return p;
- for ( ; ; )
- { while ( is_space(*p) )
- p += dir;
- if ( !(*p == '/' && p[dir] == '*') )
- break;
- p += dir; p += dir;
- while ( !(*p == '*' && p[dir] == '/') )
- { if ( *p == 0 )
- return p; /* multi-line comment?? */
- p += dir;
- }
- p += dir; p += dir;
- }
- return p;
-}
-
-/*
- * Write blanks over part of a string.
- * Don't overwrite end-of-line characters.
- */
-static int
-writeblanks(start, end)
- char *start;
- char *end;
-{ char *p;
- for ( p = start; p < end; p++ )
- if ( *p != '\r' && *p != '\n' )
- *p = ' ';
- return 0;
-}
-
-/*
- * Test whether the string in buf is a function definition.
- * The string may contain and/or end with a newline.
- * Return as follows:
- * 0 - definitely not a function definition;
- * 1 - definitely a function definition;
- * 2 - definitely a function prototype;
- * 3 - definitely a function pointer;
- * -1 - may be the beginning of a function definition,
- * append another line and look again.
- */
-static int
-test1(buf)
- char *buf;
-{ char *p;
- char *bend;
- int contin;
-
- if ( !isalpha(*buf) )
- return 0; /* no name at left margin */
- bend = skipspace(buf + strlen(buf) - 1, -1);
- switch ( *bend )
- {
- case ';': contin = 2; break;
- case ')': contin = 1; break;
- case '{':
- case '}':
- return 0; /* not a function */
- default: contin = -1;
- }
-
- /* find start and end of function name */
- startfn=buf;
- while (*startfn!='\0' && *startfn!='(')
- {
- startfn++;
- startfn = skipspace(startfn, 1);
- }
- if (*startfn=='\0')
- return 0; /* not a function */
- startfn--;
- p = startfn;
- startfn = skipspace(startfn,-1);
- endfn = startfn+1;
- while (isidchar(*startfn)) startfn--;
- startfn++;
- if (startfn>=endfn)
- return 0;
-
- p = skipspace(endfn, 1);
-#if 0
-/* v v */
-/* typedef __ssize_t __io_read_ */
-fprintf(stderr,"found %s\n",buf);
-fprintf(stderr,"func=");
-{ int i; for (i=0; i 0) {
- int level = 0;
-
- for (p = endfn; *p; p = skipspace(p + 1, 1))
- level += (*p == '(' ? 1 : *p == ')' ? -1 : 0);
- if (level > 0)
- contin = -1;
- }
- return contin;
-}
-
-/* Convert a recognized function definition or header to K&R syntax. */
-static int
-convert1(buf, out, header, convert_varargs)
- char *buf;
- FILE *out;
- int header; /* Boolean */
- int convert_varargs; /* Boolean */
-{
- char *p;
- /*
- * The breaks table contains pointers to the beginning and end
- * of each argument.
- */
- char **breaks;
- unsigned num_breaks = 2; /* for testing */
- char **btop;
- char **bp;
- char **ap;
- char *vararg = 0;
-
- for (p=buf; p= btop )
- { /* Filled up break table. */
- /* Allocate a bigger one and start over. */
- free((char *)breaks);
- num_breaks <<= 1;
- goto top;
- }
- *bp++ = p;
- /* Find the end of the argument */
- for ( ; end == NULL; p++ )
- { switch(*p)
- {
- case ',':
- if ( !level ) end = p;
- break;
- case '(':
- if ( !level ) lp = p;
- level++;
- break;
- case ')':
- if ( --level < 0 ) end = p;
- else rp = p;
- break;
- case '/':
- p = skipspace(p, 1) - 1;
- break;
- default:
- ;
- }
- }
- /* Erase any embedded function pointer parameters. */
- if ( lp )
- writeblanks(lp + 1, rp);
- p--; /* back up over terminator */
- /* Find the name being declared. */
- /* This is complicated because of procedure and */
- /* array modifiers. */
- for ( ; ; )
- { p = skipspace(p - 1, -1);
- switch ( *p )
- {
- case ']': /* skip array dimension(s) */
- case ')': /* skip procedure args OR name */
- { int level = 1;
- while ( level )
- switch ( *--p )
- {
- case ']': case ')': level++; break;
- case '[': case '(': level--; break;
- case '/': p = skipspace(p, -1) + 1; break;
- default: ;
- }
- }
- if ( *p == '(' && *skipspace(p + 1, 1) == '*' )
- { /* We found the name of the function pointer */
- while ( !isidfirstchar(*p) )
- p = skipspace(p, 1) + 1;
- goto found;
- }
- break;
- default:
- goto found;
- }
- }
-found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' )
- { if ( convert_varargs )
- { *bp++ = "va_alist";
- vararg = p-2;
- }
- else
- { p++;
- if ( bp == breaks + 1 ) /* sole argument */
- writeblanks(breaks[0], p);
- else
- writeblanks(bp[-1] - 1, p);
- bp--;
- }
- }
- else
- { while ( isidchar(*p) ) p--;
- *bp++ = p+1;
- }
- p = end;
- }
- while ( *p++ == ',' );
- *bp = p;
- /* Make a special check for 'void' arglist */
- if ( bp == breaks+2 )
- { p = skipspace(breaks[0], 1);
- if ( !strncmp(p, "void", 4) )
- { p = skipspace(p+4, 1);
- if ( p == breaks[2] - 1 )
- { bp = breaks; /* yup, pretend arglist is empty */
- writeblanks(breaks[0], p + 1);
- }
- }
- }
- /* Put out the function name and left parenthesis. */
- for (p=startfn; p != endfn; p++) putc(*p, out);
- /* Put out the declaration. */
- if ( header )
- { fputs(");", out);
- for ( p = breaks[0]; *p; p++ )
- if ( *p == '\r' || *p == '\n' )
- putc(*p, out);
- }
- else
- { for ( ap = breaks+1; ap < bp; ap += 2 )
- { p = *ap;
- while ( isidchar(*p) )
- putc(*p, out), p++;
- if ( ap < bp - 1 )
- fputs(", ", out);
- }
- fputs(") ", out);
- /* Put out the argument declarations */
- for ( ap = breaks+2; ap <= bp; ap += 2 )
- (*ap)[-1] = ';';
- if ( vararg != 0 )
- { *vararg = 0;
- fputs(breaks[0], out); /* any prior args */
- fputs("va_dcl", out); /* the final arg */
- fputs(bp[0], out);
- }
- else
- fputs(breaks[0], out);
- }
- free((char *)breaks);
- return 0;
-}
diff --git a/d2pack109/src/autoconf/ccstdc.m4 b/d2pack109/src/autoconf/ccstdc.m4
deleted file mode 100644
index dfe01fb..0000000
--- a/d2pack109/src/autoconf/ccstdc.m4
+++ /dev/null
@@ -1,91 +0,0 @@
-## ----------------------------------------- ##
-## ANSIfy the C compiler whenever possible. ##
-## From Franc,ois Pinard ##
-## ----------------------------------------- ##
-
-# serial 1
-
-# @defmac AC_PROG_CC_STDC
-# @maindex PROG_CC_STDC
-# @ovindex CC
-# If the C compiler in not in ANSI C mode by default, try to add an option
-# to output variable @code{CC} to make it so. This macro tries various
-# options that select ANSI C on some system or another. It considers the
-# compiler to be in ANSI C mode if it handles function prototypes correctly.
-#
-# If you use this macro, you should check after calling it whether the C
-# compiler has been set to accept ANSI C; if not, the shell variable
-# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
-# code in ANSI C, you can make an un-ANSIfied copy of it by using the
-# program @code{ansi2knr}, which comes with Ghostscript.
-# @end defmac
-
-AC_DEFUN(AM_PROG_CC_STDC,
-[AC_REQUIRE([AC_PROG_CC])
-AC_BEFORE([$0], [AC_C_INLINE])
-AC_BEFORE([$0], [AC_C_CONST])
-dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
-dnl a magic option to avoid problems with ANSI preprocessor commands
-dnl like #elif.
-dnl FIXME: can't do this because then AC_AIX won't work due to a
-dnl circular dependency.
-dnl AC_BEFORE([$0], [AC_PROG_CPP])
-AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
-AC_CACHE_VAL(am_cv_prog_cc_stdc,
-[am_cv_prog_cc_stdc=no
-ac_save_CC="$CC"
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX -Aa -D_HPUX_SOURCE
-# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- AC_TRY_COMPILE(
-[#include
-#include
-#include
-#include
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-], [
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
-],
-[am_cv_prog_cc_stdc="$ac_arg"; break])
-done
-CC="$ac_save_CC"
-])
-if test -z "$am_cv_prog_cc_stdc"; then
- AC_MSG_RESULT([none needed])
-else
- AC_MSG_RESULT($am_cv_prog_cc_stdc)
-fi
-case "x$am_cv_prog_cc_stdc" in
- x|xno) ;;
- *) CC="$CC $am_cv_prog_cc_stdc" ;;
-esac
-])
diff --git a/d2pack109/src/autoconf/config.guess b/d2pack109/src/autoconf/config.guess
deleted file mode 100644
index d56c46d..0000000
--- a/d2pack109/src/autoconf/config.guess
+++ /dev/null
@@ -1,1410 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-
-timestamp='2003-08-18'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Originally written by Per Bothner .
-# Please send patches to . Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to ."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
- --version | -v )
- echo "$version" ; exit 0 ;;
- --help | --h* | -h )
- echo "$usage"; exit 0 ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
- arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # The OS release
- # Debian GNU/NetBSD machines have a different userland, and
- # thus, need a distinct triplet. However, they do not need
- # kernel version information, so it can be replaced with a
- # suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
- Debian*)
- release='-gnu'
- ;;
- *)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- ;;
- esac
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit 0 ;;
- amiga:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- arc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- hp300:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- macppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvmeppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- pmax:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sgi:OpenBSD:*:*)
- echo mipseb-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- wgrisc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- *:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- alpha:OSF1:*:*)
- if test $UNAME_RELEASE = "V4.0"; then
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- fi
- # According to Compaq, /usr/sbin/psrinfo has been available on
- # OSF/1 and Tru64 systems produced since 1995. I hope that
- # covers most systems running today. This code pipes the CPU
- # types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
- "EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
- "EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
- "LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
- "EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
- "EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
- "EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
- "EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
- "EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
- "EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
- "EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
- "EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
- "EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
- esac
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit 0 ;;
- Alpha*:OpenVMS:*:*)
- echo alpha-hp-vms
- exit 0 ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit 0 ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit 0 ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit 0;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit 0 ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit 0 ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit 0 ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit 0;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit 0;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit 0 ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit 0 ;;
- DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit 0 ;;
- DRS?6000:UNIX_SV:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7 && exit 0 ;;
- esac ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- i86pc:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit 0 ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit 0 ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit 0 ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit 0 ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit 0 ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit 0 ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit 0 ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit 0 ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit 0 ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit 0 ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c \
- && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && exit 0
- echo mips-mips-riscos${UNAME_RELEASE}
- exit 0 ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit 0 ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit 0 ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit 0 ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit 0 ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit 0 ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit 0 ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit 0 ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
- then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
- then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else
- echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit 0 ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit 0 ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit 0 ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit 0 ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit 0 ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit 0 ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit 0 ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit 0 ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
- echo rs6000-ibm-aix3.2.5
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit 0 ;;
- *:AIX:*:[45])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit 0 ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit 0 ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit 0 ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit 0 ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit 0 ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit 0 ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit 0 ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit 0 ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
- fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-
- #define _HPUX_SOURCE
- #include
- #include
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
- test -z "$HP_ARCH" && HP_ARCH=hppa
- fi ;;
- esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
- then
- # avoid double evaluation of $set_cc_for_build
- test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
- then
- HP_ARCH="hppa2.0w"
- else
- HP_ARCH="hppa64"
- fi
- fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit 0 ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit 0 ;;
- 3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
- echo unknown-hitachi-hiuxwe2
- exit 0 ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit 0 ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit 0 ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit 0 ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit 0 ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit 0 ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit 0 ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit 0 ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit 0 ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit 0 ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit 0 ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit 0 ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- *:UNICOS/mp:*:*)
- echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit 0 ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
- # Determine whether the default compiler uses glibc.
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include
- #if __GLIBC__ >= 2
- LIBC=gnu
- #else
- LIBC=
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- # GNU/FreeBSD systems have a "k" prefix to indicate we are using
- # FreeBSD's kernel, but not the complete OS.
- case ${LIBC} in gnu) kernel_only='k' ;; esac
- echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
- exit 0 ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit 0 ;;
- i*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit 0 ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit 0 ;;
- x86:Interix*:[34]*)
- echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
- exit 0 ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit 0 ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit 0 ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit 0 ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit 0 ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- *:GNU:*:*)
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit 0 ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit 0 ;;
- arm*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- cris:Linux:*:*)
- echo cris-axis-linux-gnu
- exit 0 ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- mips:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips
- #undef mipsel
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mipsel
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips
- #else
- CPU=
- #endif
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
- ;;
- mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips64
- #undef mips64el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
- #else
- CPU=
- #endif
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
- ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit 0 ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
- exit 0 ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit 0 ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
- esac
- exit 0 ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
- exit 0 ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
- exit 0 ;;
- sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
- exit 0 ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit 0 ;;
- coff-i386)
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit 0 ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit 0 ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #ifdef __INTEL_COMPILER
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
- ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit 0 ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit 0 ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit 0 ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit 0 ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit 0 ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit 0 ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit 0 ;;
- i*86:*:5:[78]*)
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit 0 ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
- (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit 0 ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
- exit 0 ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit 0 ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit 0 ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit 0 ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit 0 ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit 0 ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit 0 ;;
- M68*:*:R3V[567]*:*)
- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4.3${OS_REL} && exit 0
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4 && exit 0 ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit 0 ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit 0 ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit 0 ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit 0 ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit 0 ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says
- echo i586-unisys-sysv4
- exit 0 ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes .
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit 0 ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit 0 ;;
- *:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit 0 ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit 0 ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit 0 ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit 0 ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit 0 ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit 0 ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit 0 ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
- *:Darwin:*:*)
- case `uname -p` in
- *86) UNAME_PROCESSOR=i686 ;;
- powerpc) UNAME_PROCESSOR=powerpc ;;
- esac
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit 0 ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
- UNAME_PROCESSOR=i386
- UNAME_MACHINE=pc
- fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit 0 ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit 0 ;;
- NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit 0 ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit 0 ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit 0 ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit 0 ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = "386"; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit 0 ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit 0 ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit 0 ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit 0 ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit 0 ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit 0 ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit 0 ;;
- SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit 0 ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <
-# include
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit 0 ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- c34*)
- echo c34-convex-bsd
- exit 0 ;;
- c38*)
- echo c38-convex-bsd
- exit 0 ;;
- c4*)
- echo c4-convex-bsd
- exit 0 ;;
- esac
-fi
-
-cat >&2 < in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/d2pack109/src/autoconf/config.sub b/d2pack109/src/autoconf/config.sub
deleted file mode 100644
index 6890099..0000000
--- a/d2pack109/src/autoconf/config.sub
+++ /dev/null
@@ -1,1508 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-
-timestamp='2003-08-18'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Please send patches to . Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to ."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
- --version | -v )
- echo "$version" ; exit 0 ;;
- --help | --h* | -h )
- echo "$usage"; exit 0 ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit 0;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis)
- os=
- basic_machine=$1
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
- | c4x | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | m32r | m68000 | m68k | m88k | mcore \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64vr | mips64vrel \
- | mips64orion | mips64orionel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | msp430 \
- | ns16k | ns32k \
- | openrisc | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
- | pyramid \
- | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
- | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
- | v850 | v850e \
- | we32k \
- | x86 | xscale | xstormy16 | xtensa \
- | z8k)
- basic_machine=$basic_machine-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12)
- # Motorola 68HC11/12.
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* \
- | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | m32r-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | mcore-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipstx39-* | mipstx39el-* \
- | msp430-* \
- | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
- | pyramid-* \
- | romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
- | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tron-* \
- | v850-* | v850e-* | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
- | xtensa-* \
- | ymp-* \
- | z8k-*)
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- mingw32)
- basic_machine=i386-pc
- os=-mingw32
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- mmix*)
- basic_machine=mmix-knuth
- os=-mmixware
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- nv1)
- basic_machine=nv1-cray
- os=-unicosmp
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- or32 | or32-*)
- basic_machine=or32-unknown
- os=-coff
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc) basic_machine=powerpc-unknown
- ;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
- ;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparc | sparcv9 | sparcv9b)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -aros*)
- os=-aros
- ;;
- -kaos*)
- os=-kaos
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-ibm)
- os=-aix
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
-exit 0
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/d2pack109/src/autoconf/termios.m4 b/d2pack109/src/autoconf/termios.m4
deleted file mode 100644
index 1eb31d1..0000000
--- a/d2pack109/src/autoconf/termios.m4
+++ /dev/null
@@ -1,14 +0,0 @@
-dnl From Jim Meyering.
-
-# serial 1
-
-AC_DEFUN(AM_SYS_POSIX_TERMIOS,
-[AC_CACHE_CHECK([POSIX termios], am_cv_sys_posix_termios,
- [AC_TRY_LINK([#include
-#include
-#include ],
- [/* SunOS 4.0.3 has termios.h but not the library calls. */
- tcgetattr(0, 0);],
- am_cv_sys_posix_termios=yes,
- am_cv_sys_posix_termios=no)])
-])
diff --git a/d2pack109/src/autoconf/winsz.m4 b/d2pack109/src/autoconf/winsz.m4
deleted file mode 100644
index fa81c9d..0000000
--- a/d2pack109/src/autoconf/winsz.m4
+++ /dev/null
@@ -1,36 +0,0 @@
-dnl From Jim Meyering.
-
-# serial 1
-
-AC_DEFUN(AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL,
-[AC_REQUIRE([AM_SYS_POSIX_TERMIOS])
- AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
- am_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
- [am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
-
- gwinsz_in_termios_h=no
- if test $am_cv_sys_posix_termios = yes; then
- AC_EGREP_CPP([yes],
- [#include
-# include
-# ifdef TIOCGWINSZ
- yes
-# endif
- ], gwinsz_in_termios_h=yes)
- fi
-
- if test $gwinsz_in_termios_h = no; then
- AC_EGREP_CPP([yes],
- [#include
-# include
-# ifdef TIOCGWINSZ
- yes
-# endif
- ], am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
- fi
- ])
- if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
- AC_DEFINE(GWINSZ_IN_SYS_IOCTL,1,
- [Define if TIOCGWINSZ requires sys/ioctl.h])
- fi
-])
diff --git a/d2pack109/src/autogen.sh b/d2pack109/src/autogen.sh
deleted file mode 100755
index 7fe1d2d..0000000
--- a/d2pack109/src/autogen.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-autoconf
-autoheader
diff --git a/d2pack109/src/common/addr.c b/d2pack109/src/common/addr.c
deleted file mode 100644
index b906f3a..0000000
--- a/d2pack109/src/common/addr.c
+++ /dev/null
@@ -1,626 +0,0 @@
-/*
- * Copyright (C) 1999,2000,2001 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#define ADDR_INTERNAL_ACCESS
-#include "common/setup_before.h"
-#ifdef HAVE_STDDEF_H
-# include
-#else
-# ifndef NULL
-# define NULL ((void *)0)
-# endif
-#endif
-#ifdef STDC_HEADERS
-# include
-#else
-# ifdef HAVE_MALLOC_H
-# include
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# include
-#else
-# ifdef HAVE_STRINGS_H
-# include
-# endif
-#endif
-#ifdef HAVE_MEMORY_H
-# include
-#endif
-#include "compat/memset.h"
-#include "compat/memcpy.h"
-#include "compat/strrchr.h"
-#include "compat/strdup.h"
-#ifdef HAVE_SYS_TYPES_H
-# include
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-# include
-#endif
-#include "compat/socket.h"
-#ifdef HAVE_SYS_PARAM_H
-# include
-#endif
-#ifdef HAVE_NETINET_IN_H
-# include
-#endif
-#include "compat/netinet_in.h"
-#ifdef HAVE_ARPA_INET_H
-# include
-#endif
-#include "compat/inet_aton.h"
-#include "compat/inet_ntoa.h"
-#ifdef HAVE_NETDB_H
-# include
-#endif
-#ifdef HAVE_ASSERT_H
-# include
-#endif
-#include "compat/psock.h"
-#include "common/eventlog.h"
-#include "common/list.h"
-#include "common/util.h"
-#include "common/xalloc.h"
-#include "common/addr.h"
-#include "common/setup_after.h"
-
-
-static char const * netaddr_num_to_addr_str(unsigned int netipaddr, unsigned int netmask);
-
-
-#define HACK_SIZE 4
-
-/* both arguments are in host byte order */
-extern char const * addr_num_to_addr_str(unsigned int ipaddr, unsigned short port)
-{
- static unsigned int curr=0;
- static char temp[HACK_SIZE][64];
- struct sockaddr_in tsa;
-
- curr = (curr+1)%HACK_SIZE;
-
- memset(&tsa,0,sizeof(tsa));
- tsa.sin_family = PSOCK_AF_INET;
- tsa.sin_port = htons((unsigned short)0);
- tsa.sin_addr.s_addr = htonl(ipaddr);
- sprintf(temp[curr],"%.32s:%hu",inet_ntoa(tsa.sin_addr),port);
-
- return temp[curr];
-}
-
-
-/* ipaddr is in host byte order */
-extern char const * addr_num_to_ip_str(unsigned int ipaddr)
-{
- static unsigned int curr=0;
- static char temp[HACK_SIZE][64];
- struct sockaddr_in tsa;
-
- curr = (curr+1)%HACK_SIZE;
-
- memset(&tsa,0,sizeof(tsa));
- tsa.sin_family = PSOCK_AF_INET;
- tsa.sin_port = htons((unsigned short)0);
- tsa.sin_addr.s_addr = htonl(ipaddr);
- sprintf(temp[curr],"%.32s",inet_ntoa(tsa.sin_addr));
-
- return temp[curr];
-}
-
-
-static char const * netaddr_num_to_addr_str(unsigned int netipaddr, unsigned int netmask)
-{
- static unsigned int curr=0;
- static char temp[HACK_SIZE][64];
- struct sockaddr_in tsa;
-
- curr = (curr+1)%HACK_SIZE;
-
- memset(&tsa,0,sizeof(tsa));
- tsa.sin_family = PSOCK_AF_INET;
- tsa.sin_port = htons((unsigned short)0);
- tsa.sin_addr.s_addr = htonl(netipaddr);
- sprintf(temp[curr],"%.32s/0x%08x",inet_ntoa(tsa.sin_addr),netmask);
-
- return temp[curr];
-}
-
-
-
-extern char const * host_lookup(char const * hoststr, unsigned int * ipaddr)
-{
- struct sockaddr_in tsa;
-#ifdef HAVE_GETHOSTBYNAME
- struct hostent * hp;
-#endif
-
- if (!hoststr)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL hoststr");
- return NULL;
- }
- if (!ipaddr)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL ipaddr");
- return NULL;
- }
-
- memset(&tsa,0,sizeof(tsa));
- tsa.sin_family = PSOCK_AF_INET;
- tsa.sin_port = htons(0);
-
-#ifdef HAVE_GETHOSTBYNAME
-#ifdef WIN32
- psock_init();
-#endif
- hp = gethostbyname(hoststr);
- if (!hp || !hp->h_addr_list)
-#endif
- {
- if (inet_aton(hoststr,&tsa.sin_addr))
- {
- *ipaddr = ntohl(tsa.sin_addr.s_addr);
- return hoststr; /* We could call gethostbyaddr() on tsa to try and get the
- official hostname but most systems would have already found
- it when sending a dotted-quad to gethostbyname(). This is
- good enough when that fails. */
- }
- eventlog(eventlog_level_error,__FUNCTION__,"could not lookup host \"%s\"",hoststr);
- return NULL;
- }
-
-#ifdef HAVE_GETHOSTBYNAME
- memcpy(&tsa.sin_addr,(void *)hp->h_addr_list[0],sizeof(struct in_addr)); /* avoid warning */
- *ipaddr = ntohl(tsa.sin_addr.s_addr);
- if (hp->h_name)
- return hp->h_name;
- return hoststr;
-#endif
-}
-
-
-extern t_addr * addr_create_num(unsigned int ipaddr, unsigned short port)
-{
- t_addr * temp;
-
- temp = xmalloc(sizeof(t_addr));
- temp->str = xstrdup(addr_num_to_addr_str(ipaddr,port));
- temp->str = NULL;
- temp->ip = ipaddr;
- temp->port = port;
- temp->data.p = NULL;
-
- return temp;
-}
-
-
-extern t_addr * addr_create_str(char const * str, unsigned int defipaddr, unsigned short defport)
-{
- char * tstr;
- t_addr * temp;
- unsigned int ipaddr;
- unsigned short port;
- char const * hoststr;
- char * portstr;
- char const * hostname;
-
- if (!str)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL str");
- return NULL;
- }
-
- tstr = xstrdup(str);
-
- if ((portstr = strrchr(tstr,':')))
- {
- char * protstr;
-
- *portstr = '\0';
- portstr++;
-
- if ((protstr = strrchr(portstr,'/')))
- {
- *protstr = '\0';
- protstr++;
- }
-
- if (portstr[0]!='\0')
- {
- if (str_to_ushort(portstr,&port)<0)
- {
-#ifdef HAVE_GETSERVBYNAME
- struct servent * sp;
-
- if (!(sp = getservbyname(portstr,protstr?protstr:"tcp")))
-#endif
- {
- eventlog(eventlog_level_error,__FUNCTION__,"could not convert \"%s\" to a port number",portstr);
- xfree(tstr);
- return NULL;
- }
-#ifdef HAVE_GETSERVBYNAME
- port = ntohs(sp->s_port);
-#endif
- }
- }
- else
- port = defport;
- }
- else
- port = defport;
-
- if (tstr[0]!='\0')
- hoststr = tstr;
- else
- {
- struct sockaddr_in tsa;
-
- tsa.sin_addr.s_addr = htonl(defipaddr);
- hoststr = inet_ntoa(tsa.sin_addr);
- }
-
- if (!(hostname = host_lookup(hoststr,&ipaddr)))
- {
- eventlog(eventlog_level_error,__FUNCTION__,"could not lookup host \"%s\"",hoststr);
- xfree(tstr);
- return NULL;
- }
-
- temp = xmalloc(sizeof(t_addr));
- temp->str = xstrdup(hostname);
- xfree(tstr);
-
- temp->ip = ipaddr;
- temp->port = port;
- temp->data.p = NULL;
-
- return temp;
-}
-
-
-extern int addr_destroy(t_addr const * addr)
-{
- if (!addr)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL addr");
- return -1;
- }
-
- if (addr->str)
- xfree((void *)addr->str); /* avoid warning */
- xfree((void *)addr); /* avoid warning */
-
- return 0;
-}
-
-
-/* hostname or IP */
-extern char * addr_get_host_str(t_addr const * addr, char * str, unsigned int len)
-{
- if (!addr)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL addr");
- return NULL;
- }
- if (!str)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL str");
- return NULL;
- }
- if (len<2)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"str too short");
- return NULL;
- }
-
- if (!addr->str)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"addr has NULL str");
- return NULL;
- }
-
- strncpy(str,addr->str,len-1);
- str[len-1] = '\0';
-
- return str;
-}
-
-
-/* IP:port */
-extern char * addr_get_addr_str(t_addr const * addr, char * str, unsigned int len)
-{
- if (!addr)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL addr");
- return NULL;
- }
- if (!str)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL str");
- return NULL;
- }
- if (len<2)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"str too short");
- return NULL;
- }
-
- strncpy(str,addr_num_to_addr_str(addr->ip,addr->port),len-1);
- str[len-1] = '\0';
-
- return str;
-}
-
-
-extern unsigned int addr_get_ip(t_addr const * addr)
-{
- if (!addr)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL addr");
- return 0;
- }
-
- return addr->ip;
-}
-
-
-extern unsigned short addr_get_port(t_addr const * addr)
-{
- if (!addr)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL addr");
- return 0;
- }
-
- return addr->port;
-}
-
-
-extern int addr_set_data(t_addr * addr, t_addr_data data)
-{
- if (!addr)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL addr");
- return -1;
- }
-
- addr->data = data;
- return 0;
-}
-
-
-extern t_addr_data addr_get_data(t_addr const * addr)
-{
- t_addr_data tdata;
-
- if (!addr)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL addr");
- tdata.p = NULL;
- return tdata;
- }
-
- return addr->data;
-}
-
-
-extern t_netaddr * netaddr_create_str(char const * netstr)
-{
- t_netaddr * netaddr;
- char * temp;
- char const * netipstr;
- char const * netmaskstr;
- unsigned int netip;
- unsigned int netmask;
-
- if (!netstr)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"unable to allocate memory for netaddr");
- return NULL;
- }
-
- temp = xstrdup(netstr);
- if (!(netipstr = strtok(temp,"/")))
- {
- xfree(temp);
- return NULL;
- }
- if (!(netmaskstr = strtok(NULL,"/")))
- {
- xfree(temp);
- return NULL;
- }
-
- netaddr = xmalloc(sizeof(t_netaddr));
-
- /* FIXME: call getnetbyname() first, then host_lookup() */
- if (!host_lookup(netipstr,&netip))
- {
- eventlog(eventlog_level_error,__FUNCTION__,"could not lookup net");
- xfree(netaddr);
- xfree(temp);
- return NULL;
- }
- netaddr->ip = netip;
-
- if (str_to_uint(netmaskstr,&netmask)<0)
- {
- struct sockaddr_in tsa;
-
- if (inet_aton(netmaskstr,&tsa.sin_addr))
- netmask = ntohl(tsa.sin_addr.s_addr);
- else
- {
- eventlog(eventlog_level_error,__FUNCTION__,"could not convert mask");
- xfree(netaddr);
- xfree(temp);
- return NULL;
- }
- }
- else
- {
- if (netmask>32)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"network bits must be less than or equal to 32 (%u)",netmask);
- xfree(netaddr);
- xfree(temp);
- return NULL;
- }
- /* for example, 8 -> 11111111000000000000000000000000 */
- if (netmask!=0)
- netmask = ~((1<<(32-netmask))-1);
- }
- netaddr->mask = netmask;
-
- xfree(temp); // [zap-zero] 20020731 - (hopefully) fixed memory leak
-
- return netaddr;
-}
-
-
-extern int netaddr_destroy(t_netaddr const * netaddr)
-{
- if (!netaddr)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL netaddr");
- return -1;
- }
-
- xfree((void *)netaddr); /* avoid warning */
-
- return 0;
-}
-
-
-extern char * netaddr_get_addr_str(t_netaddr const * netaddr, char * str, unsigned int len)
-{
- if (!netaddr)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL netaddr");
- return NULL;
- }
- if (!str)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL str");
- return NULL;
- }
- if (len<2)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"str too short");
- return NULL;
- }
-
- strncpy(str,netaddr_num_to_addr_str(netaddr->ip,netaddr->mask),len-1); /* FIXME: format nicely with x.x.x.x/bitcount */
- str[len-1] = '\0';
-
- return str;
-}
-
-
-extern int netaddr_contains_addr_num(t_netaddr const * netaddr, unsigned int ipaddr)
-{
- if (!netaddr)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL netaddr");
- return -1;
- }
-
- return (ipaddr&netaddr->mask)==netaddr->ip;
-}
-
-
-extern int addrlist_append(t_addrlist * addrlist, char const * str, unsigned int defipaddr, unsigned short defport)
-{
- t_addr * addr;
- char * tstr;
- char * tok;
-
- assert(addrlist != NULL);
-
- if (!str)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL str");
- return -1;
- }
-
- tstr = xstrdup(str);
- for (tok=strtok(tstr,","); tok; tok=strtok(NULL,",")) /* strtok modifies the string it is passed */
- {
- if (!(addr = addr_create_str(tok,defipaddr,defport)))
- {
- eventlog(eventlog_level_error,__FUNCTION__,"could not create addr");
- xfree(tstr);
- return -1;
- }
- list_append_data(addrlist,addr);
- }
-
- xfree(tstr);
-
- return 0;
-}
-
-extern t_addrlist * addrlist_create(char const * str, unsigned int defipaddr, unsigned short defport)
-{
- t_addrlist * addrlist;
-
- if (!str)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL str");
- return NULL;
- }
-
- addrlist = list_create();
-
- if (addrlist_append(addrlist,str,defipaddr,defport)<0) {
- eventlog(eventlog_level_error,__FUNCTION__,"could not append to newly created addrlist");
- list_destroy(addrlist);
- return NULL;
- }
-
- return addrlist;
-}
-
-extern int addrlist_destroy(t_addrlist * addrlist)
-{
- t_elem * curr;
- t_addr * addr;
-
- if (!addrlist)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL addrlist");
- return -1;
- }
-
- LIST_TRAVERSE(addrlist,curr)
- {
- if (!(addr = elem_get_data(curr)))
- eventlog(eventlog_level_error,__FUNCTION__,"found NULL addr in list");
- else
- addr_destroy(addr);
- list_remove_elem(addrlist,&curr);
- }
-
- return list_destroy(addrlist);
-}
-
-
-extern int addrlist_get_length(t_addrlist const * addrlist)
-{
- return list_get_length(addrlist);
-}
diff --git a/d2pack109/src/common/addr.h b/d2pack109/src/common/addr.h
deleted file mode 100644
index da5f69e..0000000
--- a/d2pack109/src/common/addr.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 1999,2000,2001 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef INCLUDED_ADDR_TYPES
-#define INCLUDED_ADDR_TYPES
-
-#ifdef JUST_NEED_TYPES
-# include "common/list.h"
-#else
-# define JUST_NEED_TYPES
-# include "common/list.h"
-# undef JUST_NEED_TYPES
-#endif
-
-typedef union
-{
- unsigned long n;
- int i;
- void * p;
-} t_addr_data;
-
-typedef struct addr_struct
-#ifdef ADDR_INTERNAL_ACCESS
-{
- char const * str; /* hostname or ip */
- unsigned int ip;
- unsigned int port;
- t_addr_data data; /* data argument */
-}
-#endif
-t_addr;
-
-typedef struct netaddr_struct
-#ifdef ADDR_INTERNAL_ACCESS
-{
- unsigned int ip;
- unsigned int mask;
-}
-#endif
-t_netaddr;
-
-typedef t_list t_addrlist;
-
-#endif
-
-
-/*****/
-#ifndef JUST_NEED_TYPES
-#ifndef INCLUDED_ADDR_PROTOS
-#define INCLUDED_ADDR_PROTOS
-
-/* ipaddr and port are in host byte order */
-extern char const * addr_num_to_addr_str(unsigned int ipaddr, unsigned short port);
-/* ipaddr is in host byte order */
-extern char const * addr_num_to_ip_str(unsigned int ipaddr);
-
-extern char const * host_lookup(char const * hoststr, unsigned int * ipaddr);
-
-/* ipaddr and port are in host byte order */
-extern t_addr * addr_create_num(unsigned int ipaddr, unsigned short port) ;
-
-/* defipaddr and defport are in host byte order */
-extern t_addr * addr_create_str(char const * str, unsigned int defipaddr, unsigned short defport) ;
-
-extern int addr_destroy(t_addr const * addr);
-extern char * addr_get_host_str(t_addr const * addr, char * str, unsigned int len);
-extern char * addr_get_addr_str(t_addr const * addr, char * str, unsigned int len);
-/* returned in host byte order */
-extern unsigned int addr_get_ip(t_addr const * addr);
-/* returned in host byte order */
-extern unsigned short addr_get_port(t_addr const * addr);
-extern int addr_set_data(t_addr * addr, t_addr_data data);
-extern t_addr_data addr_get_data(t_addr const * addr);
-extern t_netaddr * netaddr_create_str(char const * str) ;
-extern int netaddr_destroy(t_netaddr const * netaddr);
-extern char * netaddr_get_addr_str(t_netaddr const * netaddr, char * str, unsigned int len);
-extern int netaddr_contains_addr_num(t_netaddr const * netaddr, unsigned int ipaddr);
-
-/* defipaddr and defport are in host byte order */
-extern int addrlist_append(t_addrlist * addrlist, char const * str, unsigned int defipaddr, unsigned short defport);
-extern t_addrlist * addrlist_create(char const * str, unsigned int defipaddr, unsigned short defport) ;
-extern int addrlist_destroy(t_addrlist * addrlist);
-extern int addrlist_get_length(t_addrlist const * addrlist);
-
-#endif
-#endif
diff --git a/d2pack109/src/common/bn_type.c b/d2pack109/src/common/bn_type.c
deleted file mode 100644
index 59fab41..0000000
--- a/d2pack109/src/common/bn_type.c
+++ /dev/null
@@ -1,665 +0,0 @@
-/*
- * Copyright (C) 1998,1999,2001 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#include "common/setup_before.h"
-#ifdef HAVE_STRING_H
-# include
-#endif
-#ifdef HAVE_MEMORY_H
-# include
-#endif
-#include "compat/memcpy.h"
-#include "common/eventlog.h"
-#include "common/bn_type.h"
-#include "common/setup_after.h"
-
-
-/************************************************************/
-
-
-extern int bn_byte_tag_get(bn_byte const * src, char * dst, unsigned int len)
-{
- unsigned int i;
-
- if (!dst)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL dst");
- return -1;
- }
- if (!src)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL src");
- return -1;
- }
- if (len<1)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got zero len");
- return -1;
- }
-
- for (i=0; i> 8) );
- return 0;
-}
-
-
-extern int bn_short_nset(bn_short * dst, t_uint16 src)
-{
- if (!dst)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL dst");
- return -1;
- }
-
- (*dst)[0] = (unsigned char)((src>> 8) );
- (*dst)[1] = (unsigned char)((src )&0xff);
- return 0;
-}
-
-
-extern int bn_int_set(bn_int * dst, t_uint32 src)
-{
- if (!dst)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL dst");
- return -1;
- }
-
- (*dst)[0] = (unsigned char)((src )&0xff);
- (*dst)[1] = (unsigned char)((src>> 8)&0xff);
- (*dst)[2] = (unsigned char)((src>>16)&0xff);
- (*dst)[3] = (unsigned char)((src>>24) );
- return 0;
-}
-
-
-extern int bn_int_nset(bn_int * dst, t_uint32 src)
-{
- if (!dst)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL dst");
- return -1;
- }
-
- (*dst)[0] = (unsigned char)((src>>24) );
- (*dst)[1] = (unsigned char)((src>>16)&0xff);
- (*dst)[2] = (unsigned char)((src>> 8)&0xff);
- (*dst)[3] = (unsigned char)((src )&0xff);
- return 0;
-}
-
-
-#ifdef HAVE_T_LONG
-extern int bn_long_set(bn_long * dst, t_uint64 src)
-{
- if (!dst)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL dst");
- return -1;
- }
-
- (*dst)[0] = (unsigned char)((src )&0xff);
- (*dst)[1] = (unsigned char)((src>> 8)&0xff);
- (*dst)[2] = (unsigned char)((src>>16)&0xff);
- (*dst)[3] = (unsigned char)((src>>24)&0xff);
- (*dst)[4] = (unsigned char)((src>>32)&0xff);
- (*dst)[5] = (unsigned char)((src>>40)&0xff);
- (*dst)[6] = (unsigned char)((src>>48)&0xff);
- (*dst)[7] = (unsigned char)((src>>56) );
- return 0;
-}
-
-
-extern int bn_long_nset(bn_long * dst, t_uint64 src)
-{
- if (!dst)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL dst");
- return -1;
- }
-
- (*dst)[0] = (unsigned char)((src>>56) );
- (*dst)[1] = (unsigned char)((src>>48)&0xff);
- (*dst)[2] = (unsigned char)((src>>40)&0xff);
- (*dst)[3] = (unsigned char)((src>>32)&0xff);
- (*dst)[4] = (unsigned char)((src>>24)&0xff);
- (*dst)[5] = (unsigned char)((src>>16)&0xff);
- (*dst)[6] = (unsigned char)((src>> 8)&0xff);
- (*dst)[7] = (unsigned char)((src )&0xff);
- return 0;
-}
-#endif
-
-
-extern int bn_long_set_a_b(bn_long * dst, t_uint32 srca, t_uint32 srcb)
-{
- if (!dst)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL dst");
- return -1;
- }
-
- (*dst)[0] = (unsigned char)((srcb )&0xff);
- (*dst)[1] = (unsigned char)((srcb>> 8)&0xff);
- (*dst)[2] = (unsigned char)((srcb>>16)&0xff);
- (*dst)[3] = (unsigned char)((srcb>>24)&0xff);
- (*dst)[4] = (unsigned char)((srca )&0xff);
- (*dst)[5] = (unsigned char)((srca>> 8)&0xff);
- (*dst)[6] = (unsigned char)((srca>>16)&0xff);
- (*dst)[7] = (unsigned char)((srca>>24) );
- return 0;
-}
-
-
-extern int bn_long_nset_a_b(bn_long * dst, t_uint32 srca, t_uint32 srcb)
-{
- if (!dst)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL dst");
- return -1;
- }
-
- (*dst)[0] = (unsigned char)((srca>>24) );
- (*dst)[1] = (unsigned char)((srca>>16)&0xff);
- (*dst)[2] = (unsigned char)((srca>> 8)&0xff);
- (*dst)[3] = (unsigned char)((srca )&0xff);
- (*dst)[4] = (unsigned char)((srcb>>24)&0xff);
- (*dst)[5] = (unsigned char)((srcb>>16)&0xff);
- (*dst)[6] = (unsigned char)((srcb>> 8)&0xff);
- (*dst)[7] = (unsigned char)((srcb )&0xff);
- return 0;
-}
-
-
-/************************************************************/
-
-
-extern int bn_raw_set(void * dst, void const * src, unsigned int len)
-{
- if (!dst)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL dst");
- return -1;
- }
- if (!src)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL src");
- return -1;
- }
-
- memcpy(dst,src,len);
- return 0;
-}
-
-
-/************************************************************/
-
-
-extern int bn_byte_tag_eq(bn_byte const src, char const * tag)
-{
- bn_byte temp;
-
- if (!src)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL src");
- return -1;
- }
- if (!tag)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL tag");
- return -1;
- }
-
- if (bn_byte_tag_set(&temp,tag)<0)
- return -1;
- if (bn_byte_get(src)==bn_byte_get(temp))
- return 0;
-
- return -1;
-}
-
-
-extern int bn_short_tag_eq(bn_short const src, char const * tag)
-{
- bn_short temp;
-
- if (!src)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL src");
- return -1;
- }
- if (!tag)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL tag");
- return -1;
- }
-
- if (bn_short_tag_set(&temp,tag)<0)
- return -1;
- if (bn_short_get(src)==bn_short_get(temp))
- return 0;
-
- return -1;
-}
-
-
-extern int bn_int_tag_eq(bn_int const src, char const * tag)
-{
- bn_int temp;
-
- if (!src)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL src");
- return -1;
- }
- if (!tag)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL tag");
- return -1;
- }
-
- if (bn_int_tag_set(&temp,tag)<0)
- return -1;
- if (bn_int_get(src)==bn_int_get(temp))
- return 0;
-
- return -1;
-}
-
-
-extern int bn_long_tag_eq(bn_long const src, char const * tag)
-{
- bn_long temp;
-
- if (!src)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL src");
- return -1;
- }
- if (!tag)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL tag");
- return -1;
- }
-
- if (bn_long_tag_set(&temp,tag)<0)
- return -1;
- if (bn_long_get_a(src)==bn_long_get_a(temp) &&
- bn_long_get_b(src)==bn_long_get_b(temp))
- return 0;
-
- return -1;
-}
-
-
-/************************************************************/
-
-
-extern int uint32_to_int(t_uint32 num)
-{
- if (num<(1UL<<30))
- return (int)num;
- return (-(int)((~(num))+1));
-}
diff --git a/d2pack109/src/common/bn_type.h b/d2pack109/src/common/bn_type.h
deleted file mode 100644
index c706dca..0000000
--- a/d2pack109/src/common/bn_type.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 1998,1999 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef INCLUDED_BN_TYPE_TYPES
-#define INCLUDED_BN_TYPE_TYPES
-
-#ifdef JUST_NEED_TYPES
-# include "compat/uint.h"
-#else
-# define JUST_NEED_TYPES
-# include "compat/uint.h"
-# undef JUST_NEED_TYPES
-#endif
-
-typedef t_uint8 bn_basic;
-typedef bn_basic bn_byte[1];
-typedef bn_basic bn_short[2];
-typedef bn_basic bn_int[4];
-typedef bn_basic bn_long[8];
-
-#endif
-
-
-/*****/
-#ifndef JUST_NEED_TYPES
-#ifndef INCLUDED_BN_TYPE_PROTOS
-#define INCLUDED_BN_TYPE_PROTOS
-
-#define JUST_NEED_TYPES
-# include "compat/uint.h"
-#undef JUST_NEED_TYPES
-
-extern int bn_byte_tag_get(bn_byte const * src, char * dst, unsigned int len);
-extern int bn_short_tag_get(bn_short const * src, char * dst, unsigned int len);
-extern int bn_int_tag_get(bn_int const * src, char * dst, unsigned int len);
-extern int bn_long_tag_get(bn_long const * src, char * dst, unsigned int len);
-
-extern int bn_byte_tag_set(bn_byte * dst, char const * tag);
-extern int bn_short_tag_set(bn_short * dst, char const * tag);
-extern int bn_int_tag_set(bn_int * dst, char const * tag);
-extern int bn_long_tag_set(bn_long * dst, char const * tag);
-
-extern t_uint8 bn_byte_get(bn_byte const src) ;
-extern t_uint16 bn_short_get(bn_short const src) ;
-extern t_uint16 bn_short_nget(bn_short const src) ;
-extern t_uint32 bn_int_get(bn_int const src) ;
-extern t_uint32 bn_int_nget(bn_int const src) ;
-#ifdef HAVE_T_UINT64
-extern t_uint64 bn_long_get(bn_long const src) ;
-#endif
-extern t_uint32 bn_long_get_a(bn_long const src) ;
-extern t_uint32 bn_long_get_b(bn_long const src) ;
-
-extern int bn_byte_set(bn_byte * dst, t_uint8 src);
-extern int bn_short_set(bn_short * dst, t_uint16 src);
-extern int bn_short_nset(bn_short * dst, t_uint16 src);
-extern int bn_int_set(bn_int * dst, t_uint32 src);
-extern int bn_int_nset(bn_int * dst, t_uint32 src);
-#ifdef HAVE_T_UINT64
-extern int bn_long_set(bn_long * dst, t_uint64 src);
-extern int bn_long_nset(bn_long * dst, t_uint64 src);
-#endif
-extern int bn_long_set_a_b(bn_long * dst, t_uint32 srca, t_uint32 srcb);
-extern int bn_long_nset_a_b(bn_long * dst, t_uint32 srca, t_uint32 srcb);
-
-extern int bn_raw_set(void * dst, void const * src, unsigned int len);
-
-extern int bn_byte_tag_eq(bn_byte const src, char const * tag) ;
-extern int bn_short_tag_eq(bn_short const src, char const * tag) ;
-extern int bn_int_tag_eq(bn_int const src, char const * tag) ;
-extern int bn_long_tag_eq(bn_long const src, char const * tag) ;
-
-extern int uint32_to_int(t_uint32 num);
-
-#endif
-#endif
diff --git a/d2pack109/src/common/d2game_protocol.h b/d2pack109/src/common/d2game_protocol.h
deleted file mode 100644
index 7092f08..0000000
--- a/d2pack109/src/common/d2game_protocol.h
+++ /dev/null
@@ -1,551 +0,0 @@
-/*
- * Copyright (C) 2000 Otto Chan (kenshin_@hotmail.com)
- * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu)
- * Copyright (C) 2000 Onlyer (onlyer@263.net)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef INCLUDED_D2GAME_PROTOCOL_TYPES
-#define INCLUDED_D2GAME_PROTOCOL_TYPES
-
-#ifdef JUST_NEED_TYPES
-# include "bn_type.h"
-#else
-# define JUST_NEED_TYPES
-# include "bn_type.h"
-# undef JUST_NEED_TYPES
-#endif
-
-
-/*
- * The protocol for communicating between a Diablo II client
- * and game server.
- * FIXME: put the #define's into the PROTO section
- */
-
-
-/******************************************************/
-typedef struct
-{
-#ifdef NOTONLYER
- bn_short magic;
- bn_short size;
- bn_byte type;
-/* FIXME: the two sets of packets don't jive... did the beta have a different
- game protocol or am I just confused (could easily be the later). */
-#else
- bn_byte type;
-#endif
-} t_d2game_header;
-/******************************************************/
-
-
-/******************************************************/
-typedef struct
-{
- t_d2game_header h;
-} t_d2game_generic;
-/******************************************************/
-
-
-/******************************************************/
-/*
-D2 00 05 00 00
-*/
-#define SERVER_00 0x00 /* beta-only? */
-typedef struct
-{
- t_d2game_header h;
- bn_byte unknown1; /* data request #? */
-} PACKED_ATTR() t_server_00_req;
-#define SERVER_00 0x00
-/******************************************************/
-
-
-/******************************************************/
-/*
-D2 00 20 00 01 E2 5E 13 BE 4C 02 04 CA 00 00 00 .........L......
-6C 69 6C 6A 6F 65 00 00 64 25 42 00 1C E9 50 00 liljoe..d.B...P.
-*/
-#define CLIENT_01 0x01 /* beta-only? */
-typedef struct /* game select? */
-{
- t_d2game_header h;
- bn_byte unknown1; /* data reply #? */
- bn_int gameid1; /* same as in auth 04 reply */
- bn_short gameid2; /* same as in auth 04 reply */
- bn_byte unknown2[5];
- /* character name */
- /* 00 64 25 42 00 1C E9 50 00 unknown... string or numeric? */
-} PACKED_ATTR() t_client_01;
-/******************************************************/
-
-
-/******************************************************/
-/*
-0030 22 38 32 5D 00 00 97 20 20 20 20 20 "82]........
-*/
-#define D2GAME_SERVER_WELCOME 0x97
-typedef struct
-{
- t_d2game_header h;
-} t_d2game_server_welcome;
-
-
-/*
-0000: 60 00 27 04 18 79 27 04 A8 00 00 00 07 02 00 00 `.'..y'.........
-0010: B0 01 01 00 00 6F 6E 6C 79 65 72 00 B8 6A F7 BF .....onlyer..j..
-0020: 00 00 00 00 34 00 00 04 00 00 00 00 00 ....4........
-
-0000: 60 00 27 04 18 79 27 04 30 0D 00 00 07 02 00 00 `.'..y'.0.......
-0010: B0 01 04 00 01 41 4C 42 45 52 54 00 B8 6A F7 BF .....ALBERT..j..
-0020: 00 00 00 00 34 00 00 04 00 00 00 00 00 ....4........
-
-0000: 60 00 27 04 18 79 27 04 A0 0A 00 00 07 02 00 00 `.'..y'.........
-0010: B0 01 04 00 02 41 4C 42 45 52 54 00 B8 6A F7 BF .....ALBERT..j..
-0020: 00 00 00 00 34 00 00 04 00 00 00 00 00 ....4........
-
-0000: 60 00 AB 04 18 79 AB 04 DE 00 9F 00 0C 02 00 00 `....y..........
-0010: 60 01 04 00 00 62 62 62 00 71 DF 77 A6 C0 E6 77 `....bbb.q.w...w
-0020: A6 C0 E6 77 34 05 00 04 00 00 00 00 00 ...w4........
-
-*/
-
-
-#define D2GAME_CLIENT_CREATEGAMEREQ 0x60
-
-typedef bn_basic bn_charname[16];
-
-typedef struct
-{
- t_d2game_header h;
- char gamename[16];
- bn_byte servertype; /* servertype=0, data not send to client and have no host */
- /* creator changed to newbie data saved in server machine*/
- /* servertype=1, data send to client and have host */
- /* servertype=2, data send to client and have no host */
- /* servertype=3, client all newbie,seems to be wrong */
- /* data is saved in server machine */
- /* client is loaded from server machine */
- bn_byte class;
- bn_byte template; /* character template */
- /* affect the reply in 0x01 */
- /* should less than the lines of excel/CharTemplate.txt */
- bn_byte difficulty;
- bn_charname charname;
- bn_short arena;
- bn_int gameflag;
- bn_byte unknownb2; /* unused */
- bn_byte unknownb3; /* unused */
-} t_d2game_client_creategamereq;
-
-
-typedef struct
-{
- bn_byte flag1; /* "test gameflag,06" should not be zero,or will be bad gameflag */
- /* flag1 should be set with bit 0x04 or will fail or crash */
- /* bit 0x10,0x20,0x08 is ignored in reply */
-
- bn_byte flag2; /* hardcore and softcore */
- /* 0x0 means softcore,0x1 template mode,0x8 means hardcore */
- /* bit 0x02,0x04,0xF0 is ignored in reply */
- /* have sth to do with char template */
- /* opengame */
-
- bn_byte flag3; /* guild data (not in reply) */
- /* 0x01 means have guild */
- /* others bits seems all unused */
-
- bn_byte flag4; /* seems to be unused */
-
-} t_d2game_gameflag;
-
-
-
-/*
-0030 22 37 86 D7 00 00 61 65 00 00 00 00 00 01 03 00 "7....ae........
-0040 00 00 6F 6E 6C 79 65 72 2D 63 6E 61 61 00 24 E0 ..onlyer-cnaa.$.
-0050 7B 05 {.
-*/
-
-#define D2GAME_CLIENT_JOINGAMEREQ 0x61
-typedef struct
-{
- t_d2game_header h;
- bn_int token;
- bn_short gameid;
- bn_byte charclass; /* 00=Amazon 01=Sor 02=Nec 03=Pal 04=Bar */
- bn_int version;
- bn_charname charname;
- /* 16 bytes playe name (including 0x0 ending) */
-} t_d2game_client_joingamereq;
-
-
-/*
-0030 22 1C C9 65 00 00 20 20 20 20 20 20 "..e........
-*/
-
-#define D2GAME_SERVER_NOOP 0x20
-typedef struct
-{
- t_d2game_header h;
- /* 5 \x20 noop */
-} t_d2game_server_noop;
-
-
-
-/*
-0030 22 37 17 07 00 00 66 91 4B A1 00 00 00 00 00 "7....f.K......
-*/
-#define D2GAME_CLIENT_UNKNOWN_66 0x66 /* echo message? */
-typedef struct
-{
- t_d2game_header h;
- bn_int unknown1;
- bn_int unknown2;
-} t_d2game_client_unknown_66;
-
-/*
-0000: 8F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-0020: 00 .
-*/
-
-#define D2GAME_SERVER_UNKNOWN_8F 0x8f /* echo reply? */
-typedef struct
-{
- t_d2game_header h;
- bn_int unknown1;
- bn_int unknown2;
- bn_int unknown3;
- bn_int unknown4;
- bn_int unknown5;
- bn_int unknown6;
- bn_int unknown7; /* all here for open char is zero */
-} t_d2game_server_unknown_8f;
-
-
-
-/*
-0030 22 1C C4 53 00 00 01 00 04 00 00 00 00 02 "..S..........
-*/
-#define D2GAME_SERVER_JOINOK 0x01
-/* this message will appear after
- * 1. CLIENT_CREATEGAEM valid
- * 2. CLIENT_JOINGAME valid
- */
-typedef struct
-{
- t_d2game_header h;
- bn_byte difficulty;
- bn_short gameflag;
- bn_byte template;
- bn_short unknown1;
- bn_short unknown2;
-} t_d2game_server_joinok;
-
-
-/*
-0030 22 2F 65 38 00 00 64 "/e8..d
-*/
-
-#define D2GAME_CLIENT_JOINACTREQ 0x64
-typedef struct
-{
- t_d2game_header h;
- /* none */
-} t_d2game_client_joinactreq;
-
-
-#define D2GAME_SERVER_UNKNOWN_59 0x59
-typedef struct
-{
- t_d2game_header h;
-} t_d2game_server_unknown_59;
-
-
-/*
-0030 22 0E 0C 01 00 00 65 82 82 00 00 00 55 AA 55 AA ".....e.....U.U.
-0040 47 00 00 00 6F 6E 6C 79 65 72 2D 63 6E 61 00 00 G...onlyer-cna..
-0050 00 00 00 00 01 00 00 00 DD 00 10 00 82 00 01 00 ................
-0060 01 00 01 01 01 01 01 FF FF FF 01 01 FF FF FF FF ................
-0070 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
-0080 FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-0090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-00A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-00B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FC ...............
-*/
-
-
-#define D2GAME_CLIENT_PLAYERSAVE 0x65
-typedef struct
-{
- t_d2game_header h;
- bn_byte size;
- bn_int total_size;
- /* player save file */
- /* an append */
-} t_d2game_client_playersave;
-
-
-#define D2GAME_SERVER_ERROR 0x9c
-typedef struct
-{
- t_d2game_header h;
- bn_int errorno;
-} t_d2game_server_error;
-
-#define D2GAME_SERVER_ERROR_UNKNOWN_FAILURE 0 /* error biger than 22 is also unknown */
-#define D2GAME_SERVER_ERROR_CHAR_VER 1
-#define D2GAME_SERVER_ERROR_QUEST_DATA 2
-#define D2GAME_SERVER_ERROR_WP_DATA 3
-#define D2GAME_SERVER_ERROR_STAT_DATA 4
-#define D2GAME_SERVER_ERROR_SKILL_DATA 5
-#define D2GAME_SERVER_ERROR_UNABLE_ENTER 6
-#define D2GAME_SERVER_ERROR_INVENTORY_DATA 7
-#define D2GAME_SERVER_ERROR_DEAD_BODY 8
-#define D2GAME_SERVER_ERROR_HEADER 9
-#define D2GAME_SERVER_ERROR_HIREABLES 10
-#define D2GAME_SERVER_ERROR_INTRO_DATA 11
-#define D2GAME_SERVER_ERROR_ITEM 12
-#define D2GAME_SERVER_ERROR_DEAD_BODY_ITEM 13
-#define D2GAME_SERVER_ERROR_GENERIC_BAD_FILE 14
-#define D2GAME_SERVER_ERROR_GAME_FULL 15
-#define D2GAME_SERVER_ERROR_GAME_VER 16
-#define D2GAME_SERVER_ERROR_NIGHTMARE 17
-#define D2GAME_SERVER_ERROR_HELL 18
-#define D2GAME_SERVER_ERROR_NORMAL_HARDCORE 19
-#define D2GAME_SERVER_ERROR_HARDCORE_NORMAL 20
-#define D2GAME_SERVER_ERROR_DEAD_HARDCORE 21
-/*
-0000: 15 01 00 69 20 77 69 6C 6C 20 67 6F 00 00 00 ...i will go...
-
-0000: 15 01 00 74 68 61 6E 6B 73 20 66 6F 72 20 79 6F ...thanks for yo
-0010: 75 72 20 68 65 6C 70 00 00 00 ur help...
-
-0000: 15 01 00 73 65 65 20 75 00 00 00 ...see u...
-
-
-*/
-
-#define D2GAME_CLIENT_CHAT_MESSAGE 0x15
-typedef struct
-{
- t_d2game_header h;
- bn_short unknown1;
- /* chat message */
-} t_d2game_client_chat_message;
-
-
-/*
-0000: 26 01 00 02 00 00 00 00 00 01 6F 6E 6C 79 65 72 &.........onlyer
-0010: 2D 63 6E 61 61 00 69 20 77 69 6C 6C 20 67 6F 00 -cnaa.i will go.
-
-0000: 26 01 00 02 00 00 00 00 00 01 6F 6E 6C 79 65 72 &.........onlyer
-0010: 2D 63 6E 61 61 00 74 68 61 6E 6B 73 20 66 6F 72 -cnaa.thanks for
-0020: 20 79 6F 75 72 20 68 65 6C 70 00 your help.
-
-0000: 26 01 00 02 00 00 00 00 00 01 6F 6E 6C 79 65 72 &.........onlyer
-0010: 2D 63 6E 61 61 00 73 65 65 20 75 00 -cnaa.see u.
-
-0000: 26 01 00 02 00 00 00 00 00 17 63 63 00 62 79 65 &.........cc.bye
-0010: 00 67 49 00 00 00 01 86 17 32 12 01 00 07 00 05 .gI......2......
-
-*/
-
-#define D2GAME_SERVER_CHAT_MESSAGE 0x26
-typedef struct
-{
- t_d2game_header h;
- bn_short unknown1;
- bn_int unknown2;
- bn_short unknown3;
- bn_byte unknown4; /* id or token? a fixed number for each char*/
- /* player name */
- /* message */
-} t_d2game_server_chat_message;
-
-#define D2GAME_SERVER_CHAT_MESSAGE_UNKNOWN1 0x0001
-#define D2GAME_SERVER_CHAT_MESSAGE_UNKNOWN2 0x00000002
-#define D2GAME_SERVER_CHAT_MESSAGE_UNKNOWN3 0x0000
-#define D2GAME_SERVER_CHAT_MESSAGE_UNKNOWN4 0x01
-
-
-/*
-0000: 62 b
-*/
-
-#define D2GAME_CLIENT_QUITGAME 0x62
-typedef struct
-{
- t_d2game_header h;
-} t_d2game_client_quitgame;
-
-
-/*
-0000: 9B FF 01 4E 03 00 00 55 AA 55 AA 47 00 00 00 6F ...N...U.U.G...o
-0010: 6E 6C 79 65 72 2D 63 6E 61 61 00 00 00 00 00 00 nlyer-cnaa......
-0020: 00 00 00 DD 00 10 00 82 00 01 00 01 00 FF FF FF ................
-0030: FF FF 53 FF FF FF FF FF FF FF FF FF FF FF FF FF ..S.............
-0040: FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 FF ................
-0050: 00 FF 00 FF 00 FF 00 FF 00 FF 00 FF 00 00 24 00 ..............$.
-0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-0080: 00 00 00 00 00 5E 17 41 5F 57 6F 6F 21 06 00 00 .....^.A_Woo!...
-0090: 00 2A 01 01 00 00 00 00 00 00 00 00 00 00 00 00 .*..............
-00A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-00B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-00C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-00D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-00E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-00F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-0100: 00 00 00 00 00 00 ......
-
-
-
-
-*/
-
-#define D2GAME_SERVER_PLAYERSAVE 0x9b
-typedef struct
-{
- t_d2game_header h;
- bn_byte size;
- bn_byte start;
- bn_int total_size;
- /* player save file */
-} t_d2game_server_playersave;
-
-
-/*
-0000: 98 05 06
-*/
-
-#define D2GAME_SERVER_CLOSEGAME 0x98
-typedef struct
-{
- t_d2game_header h;
- bn_short unknown1;
-} t_d2game_server_closegame;
-
-/*
-0000: 5A 02 04 00 00 00 00 03 61 72 63 68 5F 6E 61 67 Z.......arch_nag
-0010: 61 00 00 00 B0 FD B6 08 00 FF FF FF 78 07 39 04 a...........x.9.
-0020: D5 16 2D 04 01 FD B6 08 ..-.....
-*/
-
-#define D2GAME_SERVER_JOINGAME_MESSAGE 0x5a
-typedef struct
-{
- t_d2game_header h;
- bn_byte unknown1;
- bn_byte unknown2;
- bn_int unknown3;
- bn_byte unknown4;
- /* char name */
-} t_d2game_joingame_message;
-
-
-
-#define D2GAME_CLIENT_DIE 0x41
-typedef struct
-{
- t_d2game_header h;
-} t_d2game_client_die;
-
-
-/*
-0000: 02 73 00 00 00 4E 00 8B 0F 7B 14 00 00 .s...N...{...
-
-#define D2GAME_SERVER_UNKNOWN_2 0x2
-
-*/
-
-/*
-0000: 67 06 00 00 00 01 B2 0F 6B 14 01 00 07 00 05 g.......k......
-
-0000: 67 06 00 00 00 01 B2 0F 71 14 01 00 07 00 05 g.......q......
-
-0000: 67 0A 00 00 00 01 72 0F 63 14 01 00 07 00 05 g.....r.c......
-
-
-#define D2GAME_SERVER_UNKNOWN_67 0x67
-
-*/
-
-
-/*
-0000: 6D 0A 00 00 00 76 0F 64 14 80 m....v.d..
-
-0000: 6D 0A 00 00 00 72 0F 63 14 80 m....r.c..
-
-0000: 6D 06 00 00 00 B2 0F 71 14 80 8A 01 0B 00 00 00 m......q........
-
-0000: 6D 06 00 00 00 B2 0F 6B 14 80 m......k..
-
-
-
-#define D2GAME_SERVER_UNKNOWN_6D 0x6d
-
-*/
-
-/*
-0000: 8A 01 0B 00 00 00 6D 0B 00 00 00 9B 0F 70 14 80 ......m......p..
-0010: 2C 01 0B 00 00 00 11 00 ,.......
-
-0000: 8A 01 0B 00 00 00 ......
-
-
-#define D2GAME_SERVER_UNKNOWN_8A 0x8a
-
-*/
-
-
-/*
-0000: 96 59 80 CC 07 36 8A 4C 36 .Y...6.L6
-
-#define D2GAME_SERVER_UNKNOWN_96 0x96
-
-*/
-
-/*
-0000: 24 62 00 00 00 $b...
-
-#define D2GAME_CLIENT_UNKNOWN_24 0x24
-
-*/
-
-
-/*
-CLIENT:
-
-0000: 2F 01 00 00 00 49 00 00 00 /....I...
-
-0000: 31 49 00 00 00 00 00 00 00 1I.......
-
-0000: 30 01 00 00 00 49 00 00 00 0....I...
-
-0000: 03 8C 17 2E 12 .....
-
-0000: 03 87 17 27 12 ...'. command ?
-
-
-
-SERVER:
-
-
-*/
-
-#endif
diff --git a/d2pack109/src/common/elist.h b/d2pack109/src/common/elist.h
deleted file mode 100644
index 7bf296c..0000000
--- a/d2pack109/src/common/elist.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2004 Dizzy (dizzy@roedu.net)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef INCLUDED_ELIST_TYPES
-#define INCLUDED_ELIST_TYPES
-
-typedef struct elist_struct {
- struct elist_struct *next, *prev;
-} t_elist;
-
-#endif /* INCLUDED_ELIST_TYPES */
-
-#ifndef INCLUDED_ELIST_PROTOS
-#define INCLUDED_ELIST_PROTOS
-
-#ifdef HAVE_STDDEF_H
-# include
-#endif
-
-/* access to it's members */
-#define elist_next(ptr) ((ptr)->next)
-#define elist_prev(ptr) ((ptr)->prev)
-
-#define __elist_init(elist,val) { (elist)->next = (elist)->prev = (val); }
-#define elist_init(elist) __elist_init(elist,elist)
-#define DECLARE_ELIST_INIT(var) \
- t_elist var = { &var, &var };
-
-/* link an new node just after "where" */
-static inline void elist_add(t_elist *where, t_elist *what)
-{
- what->next = where->next;
- where->next->prev = what;
- what->prev = where;
- where->next = what;
-}
-
-/* link a new node just before "where" (usefull in creating queues) */
-static inline void elist_add_tail(t_elist *where, t_elist *what)
-{
- what->prev = where->prev;
- where->prev->next = what;
- what->next = where;
- where->prev = what;
-}
-
-/* unlink "what" from it's list */
-static inline void elist_del(t_elist *what)
-{
- what->next->prev = what->prev;
- what->prev->next = what->next;
-}
-
-/* finds out the container address by computing it from the list node
- * address substracting the offset inside the container of the list node
- * member */
-#define elist_entry(ptr,type,member) ((type*)(((char*)ptr)-offsetof(type,member)))
-
-/* DONT remove while traversing with this ! */
-#define elist_for_each(pos,head) \
- for (pos = (head)->next; pos != (head); pos = pos->next)
-
-#define elist_for_each_rev(pos,head) \
- for (pos = (head)->prev; pos != (head); pos = pos->prev)
-
-/* safe for removals while traversing */
-#define elist_for_each_safe(pos,head,save) \
- for (pos = (head)->next, save = pos->next; pos != (head); \
- pos = save, save = pos->next)
-
-#define elist_for_each_safe_rev(pos,head,save) \
- for (pos = (head)->prev, save = pos->prev; pos != (head); \
- pos = save, save = pos->prev)
-
-#define elist_empty(ptr) ((ptr)->next == (ptr))
-
-#endif /* INCLUDED_ELIST_PROTOS */
diff --git a/d2pack109/src/common/eventlog.c b/d2pack109/src/common/eventlog.c
deleted file mode 100644
index 24b21eb..0000000
--- a/d2pack109/src/common/eventlog.c
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * Copyright (C) 1999 Rob Crittenden (rcrit@greyoak.com)
- * Copyright (C) 1999,2000 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#include "common/setup_before.h"
-#include
-#ifdef HAVE_STDDEF_H
-# include
-#else
-# ifndef NULL
-# define NULL ((void *)0)
-# endif
-#endif
-#include
-#include "compat/strerror.h"
-#ifdef HAVE_STRING_H
-# include
-#else
-# ifdef HAVE_STRINGS_H
-# include
-# endif
-#endif
-#include "compat/strcasecmp.h"
-#ifdef HAVE_STDARG_H
-# include
-#else
-# ifdef HAVE_VARARGS_H
-# include
-# endif
-#endif
-#ifdef TIME_WITH_SYS_TIME
-# include
-# include
-#else
-# ifdef HAVE_SYS_TIME_H
-# include
-# else
-# include
-# endif
-#endif
-#include "compat/strftime.h"
-#ifdef HAVE_UNISTD_H
-# include
-#endif
-#include "common/eventlog.h"
-#include "common/setup_after.h"
-
-#ifdef WIN32_GUI
-# include "win32/winmain.h"
-#endif
-
-static FILE * eventstrm=NULL;
-static t_eventlog_level currlevel=eventlog_level_debug|
- eventlog_level_info|
- eventlog_level_warn|
- eventlog_level_error|
- eventlog_level_fatal;
-/* FIXME: maybe this should be default for win32 */
-static int eventlog_debugmode=0;
-
-extern void eventlog_set_debugmode(int debugmode)
-{
- eventlog_debugmode = debugmode;
-}
-
-extern void eventlog_set(FILE * fp)
-{
- eventstrm = fp;
-}
-
-extern FILE * eventlog_get(void)
-{
- return eventstrm;
-}
-
-extern int eventlog_close(void)
-{
- fclose(eventstrm);
- return 0;
-}
-
-extern int eventlog_open(char const * filename)
-{
- FILE * temp;
-
- if (!filename)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL filename");
- return -1;
- }
-
- if (!(temp = fopen(filename,"a")))
- {
- eventlog(eventlog_level_error,__FUNCTION__,"could not open file \"%s\" for appending (fopen: %s)",filename,strerror(errno));
- return -1;
- }
-
- if (eventstrm && eventstrm!=stderr) /* close old one */
- if (fclose(eventstrm)<0)
- {
- eventstrm = temp;
- eventlog(eventlog_level_error,__FUNCTION__,"could not close previous logfile after writing (fclose: %s)",strerror(errno));
- return 0;
- }
- eventstrm = temp;
-
- return 0;
-}
-
-
-extern void eventlog_clear_level(void)
-{
- currlevel = eventlog_level_none;
-}
-
-
-extern int eventlog_add_level(char const * levelname)
-{
- if (!levelname)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL levelname");
- return -1;
- }
-
- if (strcasecmp(levelname,"trace")==0)
- {
- currlevel |= eventlog_level_trace;
- return 0;
- }
- if (strcasecmp(levelname,"debug")==0)
- {
- currlevel |= eventlog_level_debug;
- return 0;
- }
- if (strcasecmp(levelname,"info")==0)
- {
- currlevel |= eventlog_level_info;
- return 0;
- }
- if (strcasecmp(levelname,"warn")==0)
- {
- currlevel |= eventlog_level_warn;
- return 0;
- }
- if (strcasecmp(levelname,"error")==0)
- {
- currlevel |= eventlog_level_error;
- return 0;
- }
- if (strcasecmp(levelname,"fatal")==0)
- {
- currlevel |= eventlog_level_fatal;
- return 0;
- }
-
- eventlog(eventlog_level_error,__FUNCTION__,"got bad levelname \"%s\"",levelname);
- return -1;
-}
-
-
-extern int eventlog_del_level(char const * levelname)
-{
- if (!levelname)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL levelname");
- return -1;
- }
-
- if (strcasecmp(levelname,"trace")==0)
- {
- currlevel &= ~eventlog_level_trace;
- return 0;
- }
- if (strcasecmp(levelname,"debug")==0)
- {
- currlevel &= ~eventlog_level_debug;
- return 0;
- }
- if (strcasecmp(levelname,"info")==0)
- {
- currlevel &= ~eventlog_level_info;
- return 0;
- }
- if (strcasecmp(levelname,"warn")==0)
- {
- currlevel &= ~eventlog_level_warn;
- return 0;
- }
- if (strcasecmp(levelname,"error")==0)
- {
- currlevel &= ~eventlog_level_error;
- return 0;
- }
- if (strcasecmp(levelname,"fatal")==0)
- {
- currlevel &= ~eventlog_level_fatal;
- return 0;
- }
-
-
- eventlog(eventlog_level_error,__FUNCTION__,"got bad levelname \"%s\"",levelname);
- return -1;
-}
-
-extern char const * eventlog_get_levelname_str(t_eventlog_level level)
-{
- switch (level)
- {
- case eventlog_level_trace:
- return "trace";
- case eventlog_level_debug:
- return "debug";
- case eventlog_level_info:
- return "info ";
- case eventlog_level_warn:
- return "warn ";
- case eventlog_level_error:
- return "error";
- case eventlog_level_fatal:
- return "fatal";
- default:
- return "unknown";
- }
-}
-
-
-#ifdef DEBUGMODSTRINGS
-extern void eventlog_real(t_eventlog_level level, char const * module, char const * fmt, ...)
-#else
-extern void eventlog(t_eventlog_level level, char const * module, char const * fmt, ...)
-#endif
-{
- va_list args;
- char time_string[EVENT_TIME_MAXLEN];
- struct tm * tmnow;
- time_t now;
-
- if (!(level&currlevel))
- return;
- if (!eventstrm)
- return;
-
- /* get the time before parsing args */
- time(&now);
- if (!(tmnow = localtime(&now)))
- strcpy(time_string,"?");
- else
- strftime(time_string,EVENT_TIME_MAXLEN,EVENT_TIME_FORMAT,tmnow);
-
- if (!module)
- {
- fprintf(eventstrm,"%s [error] eventlog: got NULL module\n",time_string);
-#ifdef WIN32_GUI
- gui_lprintf(eventlog_level_error,"%s [error] eventlog: got NULL module\n",time_string);
-#endif
- fflush(eventstrm);
- return;
- }
-
- if (!fmt)
- {
- fprintf(eventstrm,"%s [error] eventlog: got NULL fmt\n",time_string);
-#ifdef WIN32_GUI
- gui_lprintf(eventlog_level_error,"%s [error] eventlog: got NULL fmt\n",time_string);
-#endif
- fflush(eventstrm);
- return;
- }
-
- fprintf(eventstrm,"%s [%s] %s: ",time_string,eventlog_get_levelname_str(level),module);
-#ifdef WIN32_GUI
- gui_lprintf(level,"%s [%s] %s: ",time_string,eventlog_get_levelname_str(level),module);
-#endif
-
- va_start(args,fmt);
-
-#ifdef HAVE_VPRINTF
- vfprintf(eventstrm,fmt,args);
-#ifdef WIN32_GUI
- gui_lvprintf(level,fmt,args);
-#endif
-#else
-# if HAVE__DOPRNT
- _doprnt(fmt,args,eventstrm);
-# else
- fprintf(eventstrm,"sorry, vfprintf() and _doprnt() are not available on this system");
-# endif
-#endif
- va_end(args);
- fprintf(eventstrm,"\n");
-#ifdef WIN32_GUI
- gui_lprintf(level,"\n");
-#endif
-
- if (eventlog_debugmode) {
- printf("%s [%s] %s: ",time_string,eventlog_get_levelname_str(level),module);
- va_start(args,fmt);
-#ifdef HAVE_VPRINTF
- vprintf(fmt,args);
-#else
-# if HAVE__DOPRNT
- _doprnt(fmt,args,stdout);
-# else
- printf("sorry, vfprintf() and _doprnt() are not available on this system");
-# endif
-#endif
- va_end(args);
- printf("\n");
- fflush(stdout);
- }
- fflush(eventstrm);
-}
-
-
-extern void eventlog_step(char const * filename, t_eventlog_level level, char const * module, char const * fmt, ...)
-{
- va_list args;
- char time_string[EVENT_TIME_MAXLEN];
- struct tm * tmnow;
- time_t now;
- FILE * fp;
-
- if (!(level&currlevel))
- return;
- if (!eventstrm)
- return;
-
- if (!(fp = fopen(filename, "a")))
- return;
-
- /* get the time before parsing args */
- time(&now);
- if (!(tmnow = localtime(&now)))
- strcpy(time_string,"?");
- else
- strftime(time_string,EVENT_TIME_MAXLEN,EVENT_TIME_FORMAT,tmnow);
-
- if (!module)
- {
- fprintf(fp,"%s [error] eventlog_step: got NULL module\n",time_string);
- fclose(fp);
- return;
- }
- if (!fmt)
- {
- fprintf(fp,"%s [error] eventlog_step: got NULL fmt\n",time_string);
- fclose(fp);
- return;
- }
-
- fprintf(fp,"%s [%s] %s: ",time_string,eventlog_get_levelname_str(level),module);
- va_start(args,fmt);
-#ifdef HAVE_VPRINTF
- vfprintf(fp,fmt,args);
-#else
-# if HAVE__DOPRNT
- _doprnt(fmt,args,fp);
-# else
- fprintf(fp,"sorry, vfprintf() and _doprnt() are not available on this system");
-# endif
-#endif
- va_end(args);
- fprintf(fp,"\n");
- fclose(fp);
-}
diff --git a/d2pack109/src/common/eventlog.h b/d2pack109/src/common/eventlog.h
deleted file mode 100644
index eadca0d..0000000
--- a/d2pack109/src/common/eventlog.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 1998 Mark Baysinger (mbaysing@ucsd.edu)
- * Copyright (C) 1998,1999,2000 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef INCLUDED_EVENTLOG_TYPES
-#define INCLUDED_EVENTLOG_TYPES
-
-typedef enum
-{
- eventlog_level_none = 0,
- eventlog_level_trace= 1,
- eventlog_level_debug= 2,
- eventlog_level_info = 4,
- eventlog_level_warn = 8,
- eventlog_level_error=16,
- eventlog_level_fatal=32
-} t_eventlog_level;
-
-#endif
-
-
-/*****/
-#ifndef JUST_NEED_TYPES
-#ifndef INCLUDED_EVENTLOG_PROTOS
-#define INCLUDED_EVENTLOG_PROTOS
-
-#define JUST_NEED_TYPES
-#include
-#undef JUST_NEED_TYPES
-
-extern void eventlog_set_debugmode(int debugmode);
-extern void eventlog_set(FILE * fp);
-extern FILE * eventlog_get(void);
-extern int eventlog_open(char const * filename);
-extern int eventlog_close(void);
-extern void eventlog_clear_level(void);
-extern int eventlog_add_level(char const * levelname);
-extern int eventlog_del_level(char const * levelname);
-extern char const * eventlog_get_levelname_str(t_eventlog_level level);
-#ifdef DEBUGMODSTRINGS
-
-extern void eventlog_real(t_eventlog_level level, char const * module, char const * fmt, ...) PRINTF_ATTR(3,4);
-# if __STDC_VERSION__+1 >= 199901L
-# define eventlog(l,m,f,args...) eventlog_real(l,"@(" __FILE__ ":" m "@@" __func__ ")@",f,##args)
-# else
-# if defined(__GNUC__) && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ > 2)
-# define eventlog(l,m,f,args...) eventlog_real(l,"@(" __FILE__ ":" m "@@" __PRETTY_FUNCTION__ ")@",f,##args)
-# else
-# error "No function macro available, either don't define DEBUGMODSTRINGS or don't use -pedantic"
-# endif
-# endif
-
-#else
-
-extern void eventlog(t_eventlog_level level, char const * module, char const * fmt, ...);
-extern void eventlog_step(char const * filename, t_eventlog_level level, char const * module, char const * fmt, ...);
-
-#endif
-
-#endif
-#endif
diff --git a/d2pack109/src/common/fdwatch.c b/d2pack109/src/common/fdwatch.c
deleted file mode 100644
index 2dd7a99..0000000
--- a/d2pack109/src/common/fdwatch.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Abstraction API/layer for the various ways PvPGN can inspect sockets state
- * 2003 (C) dizzy@roedu.net
- *
- * Code is based on the ideas found in thttpd project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include "common/setup_before.h"
-#ifdef HAVE_STRING_H
-# include
-#else
-# ifdef HAVE_STRINGS_H
-# include
-# endif
-#endif
-#ifdef STDC_HEADERS
-# include
-#else
-# ifdef HAVE_MALLOC_H
-# include
-# endif
-#endif
-#include "common/eventlog.h"
-#define FDWATCH_BACKEND
-#include "fdwatch.h"
-#ifdef HAVE_SELECT
-#include "fdwatch_select.h"
-#endif
-#ifdef HAVE_POLL
-#include "fdwatch_poll.h"
-#endif
-#ifdef HAVE_KQUEUE
-#include "fdwatch_kqueue.h"
-#endif
-#ifdef HAVE_EPOLL
-#include "fdwatch_epoll.h"
-#endif
-#include "common/rlimit.h"
-#include "common/xalloc.h"
-#include "common/setup_after.h"
-
-int fdw_maxcons;
-t_fdwatch_fd *fdw_fds = NULL;
-
-static t_fdw_backend * fdw = NULL;
-static DECLARE_ELIST_INIT(freelist);
-static DECLARE_ELIST_INIT(uselist);
-
-extern int fdwatch_init(int maxcons)
-{
- int i, maxsys;
-
- maxsys = get_socket_limit();
- if (maxsys > 0) maxcons = (maxcons < maxsys) ? maxcons : maxsys;
- if (maxcons < 32) {
- eventlog(eventlog_level_fatal, __FUNCTION__, "too few sockets available (%d)",maxcons);
- return -1;
- }
- fdw_maxcons = maxcons;
-
- fdw_fds = xmalloc(sizeof(t_fdwatch_fd) * fdw_maxcons);
- memset(fdw_fds, 0, sizeof(t_fdwatch_fd) * fdw_maxcons);
- /* add all slots to the freelist */
- for(i = 0; i < fdw_maxcons; i++)
- elist_add_tail(&freelist,&(fdw_fds[i].freelist));
-
-#ifdef HAVE_EPOLL
- fdw = &fdw_epoll;
- if (!fdw->init(fdw_maxcons)) goto ok;
-#endif
-#ifdef HAVE_KQUEUE
- fdw = &fdw_kqueue;
- if (!fdw->init(fdw_maxcons)) goto ok;
-#endif
-#ifdef HAVE_POLL
- fdw = &fdw_poll;
- if (!fdw->init(fdw_maxcons)) goto ok;
- goto ok;
-#endif
-#ifdef HAVE_SELECT
- fdw = &fdw_select;
- if (!fdw->init(fdw_maxcons)) goto ok;
-#endif
-
- eventlog(eventlog_level_fatal, __FUNCTION__, "Found no working fdwatch layer");
- fdw = NULL;
- fdwatch_close();
- return -1;
-
-ok:
- return 0;
-}
-
-extern int fdwatch_close(void)
-{
- if (fdw) { fdw->close(); fdw = NULL; }
- if (fdw_fds) { xfree((void*)fdw_fds); fdw_fds = NULL; }
- elist_init(&freelist);
- elist_init(&uselist);
-
- return 0;
-}
-
-extern int fdwatch_add_fd(int fd, t_fdwatch_type rw, fdwatch_handler h, void *data)
-{
- t_fdwatch_fd *cfd;
-
- if (elist_empty(&freelist)) return -1; /* max sockets reached */
-
- cfd = elist_entry(elist_next(&freelist),t_fdwatch_fd,freelist);
- fdw_fd(cfd) = fd;
-
- if (fdw->add_fd(fdw_idx(cfd), rw)) return -1;
-
- /* add it to used sockets list, remove it from free list */
- elist_add_tail(&uselist,&cfd->uselist);
- elist_del(&cfd->freelist);
-
- fdw_rw(cfd) = rw;
- fdw_data(cfd) = data;
- fdw_hnd(cfd) = h;
-
- return fdw_idx(cfd);
-}
-
-extern int fdwatch_update_fd(int idx, t_fdwatch_type rw)
-{
- if (idx<0 || idx>=fdw_maxcons) {
- eventlog(eventlog_level_error,__FUNCTION__,"out of bounds idx [%d] (max: %d)",idx, fdw_maxcons);
- return -1;
- }
- /* do not allow completly reset the access because then backend codes
- * can get confused */
- if (!rw) {
- eventlog(eventlog_level_error,__FUNCTION__,"tried to reset rw, not allowed");
- return -1;
- }
-
- if (!fdw_rw(fdw_fds + idx)) {
- eventlog(eventlog_level_error,__FUNCTION__,"found reseted rw");
- return -1;
- }
-
- if (fdw->add_fd(idx, rw)) return -1;
- fdw_rw(&fdw_fds[idx]) = rw;
-
- return 0;
-}
-
-extern int fdwatch_del_fd(int idx)
-{
- t_fdwatch_fd *cfd;
-
- if (idx<0 || idx>=fdw_maxcons) {
- eventlog(eventlog_level_error,__FUNCTION__,"out of bounds idx [%d] (max: %d)",idx, fdw_maxcons);
- return -1;
- }
-
- cfd = fdw_fds + idx;
- if (!fdw_rw(cfd)) {
- eventlog(eventlog_level_error,__FUNCTION__,"found reseted rw");
- return -1;
- }
-
- fdw->del_fd(idx);
-
- /* remove it from uselist, add it to freelist */
- elist_del(&cfd->uselist);
- elist_add_tail(&freelist,&cfd->freelist);
-
- fdw_fd(cfd) = 0;
- fdw_rw(cfd) = 0;
- fdw_data(cfd) = NULL;
- fdw_hnd(cfd) = NULL;
-
- return 0;
-}
-
-extern int fdwatch(long timeout_msec)
-{
- return fdw->watch(timeout_msec);
-}
-
-extern void fdwatch_handle(void)
-{
- fdw->handle();
-}
-
-extern void fdwatch_traverse(t_fdw_cb cb, void *data)
-{
- t_elist *curr;
-
- elist_for_each(curr,&uselist)
- {
- if (cb(elist_entry(curr,t_fdwatch_fd,uselist),data)) break;
- }
-}
diff --git a/d2pack109/src/common/fdwatch.h b/d2pack109/src/common/fdwatch.h
deleted file mode 100644
index 1ba97fb..0000000
--- a/d2pack109/src/common/fdwatch.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Abstraction API/layer for the various ways PvPGN can inspect sockets state
- * 2003 (C) dizzy@roedu.net
- *
- * Code is based on the ideas found in thttpd project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __FDWATCH_INCLUDED__
-#define __FDWATCH_INCLUDED__
-
-#include "common/elist.h"
-
-typedef enum {
- fdwatch_type_none = 0,
- fdwatch_type_read = 1,
- fdwatch_type_write = 2
-} t_fdwatch_type;
-
-typedef int (*fdwatch_handler)(void *data, t_fdwatch_type);
-
-typedef struct {
- int fd;
- int rw;
- fdwatch_handler hnd;
- void *data;
-
- t_elist uselist;
- t_elist freelist;
-} t_fdwatch_fd;
-
-#ifdef FDWATCH_BACKEND
-typedef int (*t_fdw_cb)(t_fdwatch_fd *cfd, void *data);
-#endif
-
-typedef struct {
- int (*init)(int nfds);
- int (*close)(void);
- int (*add_fd)(int idx, t_fdwatch_type rw);
- int (*del_fd)(int idx);
- int (*watch)(long timeout_msecs);
- void (*handle)(void);
-} t_fdw_backend;
-
-extern int fdw_maxcons;
-extern t_fdwatch_fd *fdw_fds;
-
-#define fdw_idx(ptr) ((ptr) - fdw_fds)
-#define fdw_fd(ptr) ((ptr)->fd)
-#define fdw_rw(ptr) ((ptr)->rw)
-#define fdw_data(ptr) ((ptr)->data)
-#define fdw_hnd(ptr) ((ptr)->hnd)
-extern int fdwatch_init(int maxcons);
-extern int fdwatch_close(void);
-extern int fdwatch_add_fd(int fd, t_fdwatch_type rw, fdwatch_handler h, void *data);
-extern int fdwatch_update_fd(int idx, t_fdwatch_type rw);
-extern int fdwatch_del_fd(int idx);
-extern int fdwatch(long timeout_msecs);
-extern void fdwatch_handle(void);
-#ifdef FDWATCH_BACKEND
-extern void fdwatch_traverse(t_fdw_cb cb, void *data);
-#endif
-
-#endif /* __FDWATCH_INCLUDED__ */
diff --git a/d2pack109/src/common/fdwatch_epoll.c b/d2pack109/src/common/fdwatch_epoll.c
deleted file mode 100644
index 0435955..0000000
--- a/d2pack109/src/common/fdwatch_epoll.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Abstraction API/layer for the various ways PvPGN can inspect sockets state
- * 2003 (C) dizzy@roedu.net
- *
- * Code is based on the ideas found in thttpd project.
- *
- * Linux epoll(4) based backend
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include "common/setup_before.h"
-#ifdef HAVE_EPOLL
-
-#ifdef STDC_HEADERS
-# include
-#else
-# ifdef HAVE_MALLOC_H
-# include
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# include
-#else
-# ifdef HAVE_STRINGS_H
-# include
-# endif
-#endif
-#ifdef HAVE_SYS_EPOLL_H
-# include "compat/uint.h"
-# include
-#endif
-#include "fdwatch.h"
-#include "common/eventlog.h"
-#include "common/xalloc.h"
-#include "common/setup_after.h"
-
-static int sr;
-static int epfd;
-static struct epoll_event *epevents = NULL; /* events to investigate */
-static struct epoll_event tmpev;
-
-static int fdw_epoll_init(int nfds);
-static int fdw_epoll_close(void);
-static int fdw_epoll_add_fd(int idx, t_fdwatch_type rw);
-static int fdw_epoll_del_fd(int idx);
-static int fdw_epoll_watch(long timeout_msecs);
-static void fdw_epoll_handle(void);
-
-t_fdw_backend fdw_epoll = {
- fdw_epoll_init,
- fdw_epoll_close,
- fdw_epoll_add_fd,
- fdw_epoll_del_fd,
- fdw_epoll_watch,
- fdw_epoll_handle
-};
-
-static int fdw_epoll_init(int nfds)
-{
- if ((epfd = epoll_create(nfds)) < 0)
- return -1;
- epevents = (struct epoll_event *) xmalloc(sizeof(struct epoll_event) * nfds);
-
- memset(epevents, 0, sizeof(struct epoll_event) * nfds);
- sr = 0;
-
- eventlog(eventlog_level_info, __FUNCTION__, "fdwatch epoll() based layer initialized (max %d sockets)", nfds);
- return 0;
-}
-
-static int fdw_epoll_close(void)
-{
- if (epevents != NULL)
- xfree((void *) epevents);
- sr = 0;
-
- return 0;
-}
-
-static int fdw_epoll_add_fd(int idx, t_fdwatch_type rw)
-{
- int op;
-// eventlog(eventlog_level_trace, __FUNCTION__, "called fd: %d rw: %d", fd, rw);
-
- tmpev.events = 0;
- if (rw & fdwatch_type_read)
- tmpev.events |= EPOLLIN;
- if (rw & fdwatch_type_write)
- tmpev.events |= EPOLLOUT;
-
- if (fdw_rw(fdw_fds + idx)) op = EPOLL_CTL_MOD;
- else op = EPOLL_CTL_ADD;
-
- tmpev.data.fd = idx;
- if (epoll_ctl(epfd, op, fdw_fd(fdw_fds + idx), &tmpev)) {
- eventlog(eventlog_level_error, __FUNCTION__, "got error from epoll_ctl()");
- return -1;
- }
-
- return 0;
-}
-
-static int fdw_epoll_del_fd(int idx)
-{
-// eventlog(eventlog_level_trace, __FUNCTION__, "called fd: %d", fd);
- if (sr > 0)
- eventlog(eventlog_level_error, __FUNCTION__, "BUG: called while still handling sockets");
-
- if (fdw_rw(fdw_fds + idx)) {
- tmpev.events = 0;
- tmpev.data.fd = idx;
- if (epoll_ctl(epfd, EPOLL_CTL_DEL, fdw_fd(fdw_fds + idx), &tmpev)) {
- eventlog(eventlog_level_error, __FUNCTION__, "got error from epoll_ctl()");
- return -1;
- }
- }
-
- return 0;
-}
-
-static int fdw_epoll_watch(long timeout_msec)
-{
- return (sr = epoll_wait(epfd, epevents, fdw_maxcons, timeout_msec));
-}
-
-static void fdw_epoll_handle(void)
-{
- struct epoll_event *ev;
- t_fdwatch_fd *cfd;
-
-// eventlog(eventlog_level_trace, __FUNCTION__, "called");
- for (ev = epevents; sr; sr--, ev++)
- {
-// eventlog(eventlog_level_trace, __FUNCTION__, "checking %d ident: %d read: %d write: %d", i, kqevents[i].ident, kqevents[i].filter & EVFILT_READ, kqevents[i].filter & EVFILT_WRITE);
- cfd = fdw_fds + ev->data.fd;
-
- if (fdw_rw(cfd) & fdwatch_type_read && ev->events & (EPOLLIN | EPOLLERR | EPOLLHUP))
- if (fdw_hnd(cfd) (fdw_data(cfd), fdwatch_type_read) == -2)
- continue;
-
- if (fdw_rw(cfd) & fdwatch_type_write && ev->events & (EPOLLOUT | EPOLLERR | EPOLLHUP))
- fdw_hnd(cfd) (fdw_data(cfd), fdwatch_type_write);
- }
- sr = 0;
-}
-
-#endif /* HAVE_EPOLL */
diff --git a/d2pack109/src/common/fdwatch_epoll.h b/d2pack109/src/common/fdwatch_epoll.h
deleted file mode 100644
index dd7a226..0000000
--- a/d2pack109/src/common/fdwatch_epoll.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Abstraction API/layer for the various ways PvPGN can inspect sockets state
- * 2003 (C) dizzy@roedu.net
- *
- * Code is based on the ideas found in thttpd project.
- *
- * Linux epoll(4) based backend
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef __INCLUDED_FDWATCH_EPOLL__
-#define __INCLUDED_FDWATCH_EPOLL__
-
-extern t_fdw_backend fdw_epoll;
-
-#endif /* __INCLUDED_FDWATCH_EPOLL__ */
diff --git a/d2pack109/src/common/fdwatch_kqueue.c b/d2pack109/src/common/fdwatch_kqueue.c
deleted file mode 100644
index 1b91f6e..0000000
--- a/d2pack109/src/common/fdwatch_kqueue.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Abstraction API/layer for the various ways PvPGN can inspect sockets state
- * 2003 (C) dizzy@roedu.net
- *
- * Code is based on the ideas found in thttpd project.
- *
- * *BSD kqueue(2) based backend
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include "common/setup_before.h"
-#ifdef STDC_HEADERS
-# include
-#else
-# ifdef HAVE_MALLOC_H
-# include
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# include
-#else
-# ifdef HAVE_STRINGS_H
-# include
-# endif
-#endif
-#ifdef HAVE_SYS_TYPES_H
-# include
-#endif
-#ifdef HAVE_SYS_EVENT_H
-# include
-#endif
-#ifdef HAVE_SYS_TIME_H
-# include
-#endif
-#include "fdwatch.h"
-#include "common/eventlog.h"
-#include "common/xalloc.h"
-#include "common/setup_after.h"
-
-#ifdef HAVE_KQUEUE
-static int sr;
-static int kq;
-static struct kevent *kqchanges = NULL; /* changes to make to kqueue */
-static struct kevent *kqevents = NULL; /* events to investigate */
-/* r/w indices from idx to the kqchanges index where the change is stored */
-static int *_rridx, *_wridx;
-static unsigned nochanges;
-
-static int fdw_kqueue_init(int nfds);
-static int fdw_kqueue_close(void);
-static int fdw_kqueue_add_fd(int idx, t_fdwatch_type rw);
-static int fdw_kqueue_del_fd(int idx);
-static int fdw_kqueue_watch(long timeout_msecs);
-static void fdw_kqueue_handle(void);
-
-t_fdw_backend fdw_kqueue = {
- fdw_kqueue_init,
- fdw_kqueue_close,
- fdw_kqueue_add_fd,
- fdw_kqueue_del_fd,
- fdw_kqueue_watch,
- fdw_kqueue_handle
-};
-
-static int fdw_kqueue_init(int nfds)
-{
- int i;
-
- if ((kq = kqueue()) == -1)
- return -1;
- kqevents = (struct kevent *) xmalloc(sizeof(struct kevent) * nfds);
- kqchanges = (struct kevent *) xmalloc(sizeof(struct kevent) * nfds * 2);
- _rridx = (int *) xmalloc(sizeof(int) * nfds);
- _wridx = (int *) xmalloc(sizeof(int) * nfds);
-
- memset(kqchanges, 0, sizeof(struct kevent) * nfds);
- for (i = 0; i < nfds; i++)
- {
- _rridx[i] = -1;
- _wridx[i] = -1;
- }
- sr = 0;
- nochanges = 0;
-
- eventlog(eventlog_level_info, __FUNCTION__, "fdwatch kqueue() based layer initialized (max %d sockets)", nfds);
- return 0;
-}
-
-static int fdw_kqueue_close(void)
-{
- if (_rridx) { xfree((void *) _rridx); _rridx = NULL; }
- if (_wridx) { xfree((void *) _wridx); _wridx = NULL; }
- if (kqchanges) { xfree((void *) kqchanges); kqchanges = NULL; }
- if (kqevents) { xfree((void *) kqevents); kqevents = NULL; }
- sr = 0;
- nochanges = 0;
-
- return 0;
-}
-
-static int fdw_kqueue_add_fd(int idx, t_fdwatch_type rw)
-{
- static int ridx;
- t_fdwatch_fd *cfd;
-
-/* eventlog(eventlog_level_trace, __FUNCTION__, "called fd: %d rw: %d", fd, rw); */
-
- cfd = fdw_fds + idx;
- /* adding read event filter */
- if (!(fdw_rw(cfd) & fdwatch_type_read) && rw & fdwatch_type_read)
- {
- if (_rridx[idx] >= 0 && _rridx[idx] < nochanges && kqchanges[_rridx[idx]].ident == fdw_fd(cfd))
- {
- ridx = _rridx[idx];
-/* eventlog(eventlog_level_trace, __FUNCTION__, "updating change event (read) fd on %d", ridx); */
- } else {
- ridx = nochanges++;
- _rridx[idx] = ridx;
-/* eventlog(eventlog_level_trace, __FUNCTION__, "adding new change event (read) fd on %d", ridx); */
- }
- EV_SET(kqchanges + ridx, fdw_fd(cfd), EVFILT_READ, EV_ADD, 0, 0, (void*)idx);
- }
- else if (fdw_rw(cfd) & fdwatch_type_read && !( rw & fdwatch_type_read))
- {
- if (_rridx[idx] >= 0 && _rridx[idx] < nochanges && kqchanges[_rridx[idx]].ident == fdw_fd(cfd))
- {
- ridx = _rridx[idx];
-/* eventlog(eventlog_level_trace, __FUNCTION__, "updating change event (read) fd on %d", ridx); */
- } else {
- ridx = nochanges++;
- _rridx[idx] = ridx;
-/* eventlog(eventlog_level_trace, __FUNCTION__, "adding new change event (read) fd on %d", ridx); */
- }
- EV_SET(kqchanges + ridx, fdw_fd(cfd), EVFILT_READ, EV_DELETE, 0, 0, (void*)idx);
- }
-
- /* adding write event filter */
- if (!(fdw_rw(cfd) & fdwatch_type_write) && rw & fdwatch_type_write)
- {
- if (_wridx[idx] >= 0 && _wridx[idx] < nochanges && kqchanges[_wridx[idx]].ident == fdw_fd(cfd))
- {
- ridx = _wridx[idx];
-/* eventlog(eventlog_level_trace, __FUNCTION__, "updating change event (write) fd on %d", ridx); */
- } else {
- ridx = nochanges++;
- _wridx[idx] = ridx;
-/* eventlog(eventlog_level_trace, __FUNCTION__, "adding new change event (write) fd on %d", ridx); */
- }
- EV_SET(kqchanges + ridx, fdw_fd(cfd), EVFILT_WRITE, EV_ADD, 0, 0, (void*)idx);
- }
- else if (fdw_rw(cfd) & fdwatch_type_write && !(rw & fdwatch_type_write))
- {
- if (_wridx[idx] >= 0 && _wridx[idx] < nochanges && kqchanges[_wridx[idx]].ident == fdw_fd(cfd))
- {
- ridx = _wridx[idx];
-/* eventlog(eventlog_level_trace, __FUNCTION__, "updating change event (write) fd on %d", ridx); */
- } else {
- ridx = nochanges++;
- _wridx[idx] = ridx;
-/* eventlog(eventlog_level_trace, __FUNCTION__, "adding new change event (write) fd on %d", ridx); */
- }
- EV_SET(kqchanges + ridx, fdw_fd(cfd), EVFILT_WRITE, EV_DELETE, 0, 0, (void*)idx);
- }
-
- return 0;
-}
-
-static int fdw_kqueue_del_fd(int idx)
-{
- t_fdwatch_fd *cfd;
-
-/* eventlog(eventlog_level_trace, __FUNCTION__, "called fd: %d", fd); */
- if (sr > 0)
- eventlog(eventlog_level_error, __FUNCTION__, "BUG: called while still handling sockets");
-
- cfd = fdw_fds + idx;
- /* the last event changes about this fd has not yet been sent to kernel */
- if (fdw_rw(cfd) & fdwatch_type_read &&
- nochanges && _rridx[idx] >= 0 && _rridx[idx] < nochanges &&
- kqchanges[_rridx[idx]].ident == fdw_fd(cfd))
- {
- nochanges--;
- if (_rridx[idx] < nochanges)
- {
- int oidx;
-
- oidx = (int)(kqchanges[nochanges].udata);
- if (kqchanges[nochanges].filter == EVFILT_READ &&
- _rridx[oidx] == nochanges)
- {
-/* eventlog(eventlog_level_trace, __FUNCTION__, "not last, moving %d", kqchanges[rnfds].ident); */
- _rridx[oidx] = _rridx[idx];
- memcpy(kqchanges + _rridx[idx], kqchanges + nochanges, sizeof(struct kevent));
- }
-
- if (kqchanges[nochanges].filter == EVFILT_WRITE &&
- _wridx[oidx] == nochanges)
- {
-/* eventlog(eventlog_level_trace, __FUNCTION__, "not last, moving %d", kqchanges[rnfds].ident); */
- _wridx[oidx] = _rridx[idx];
- memcpy(kqchanges + _rridx[idx], kqchanges + nochanges, sizeof(struct kevent));
- }
- }
- _rridx[idx] = -1;
- }
-
- if (fdw_rw(cfd) & fdwatch_type_write &&
- nochanges && _wridx[idx] >= 0 && _wridx[idx] < nochanges &&
- kqchanges[_wridx[idx]].ident == fdw_fd(cfd))
- {
- nochanges--;
- if (_wridx[idx] < nochanges)
- {
- int oidx;
-
- oidx = (int)(kqchanges[nochanges].udata);
- if (kqchanges[nochanges].filter == EVFILT_READ &&
- _rridx[oidx] == nochanges)
- {
-/* eventlog(eventlog_level_trace, __FUNCTION__, "not last, moving %d", kqchanges[rnfds].ident); */
- _rridx[oidx] = _wridx[idx];
- memcpy(kqchanges + _wridx[idx], kqchanges + nochanges, sizeof(struct kevent));
- }
-
- if (kqchanges[nochanges].filter == EVFILT_WRITE &&
- _wridx[oidx] == nochanges)
- {
-/* eventlog(eventlog_level_trace, __FUNCTION__, "not last, moving %d", kqchanges[rnfds].ident); */
- _wridx[oidx] = _wridx[idx];
- memcpy(kqchanges + _wridx[idx], kqchanges + nochanges, sizeof(struct kevent));
- }
- }
- _wridx[idx] = -1;
- }
-
-/* here we presume the calling code does close() on the socket and if so
- * it is automatically removed from any kernel kqueues */
-
- return 0;
-}
-
-static int fdw_kqueue_watch(long timeout_msec)
-{
- static struct timespec ts;
-
- ts.tv_sec = timeout_msec / 1000L;
- ts.tv_nsec = (timeout_msec % 1000L) * 1000000L;
- sr = kevent(kq, nochanges > 0 ? kqchanges : NULL, nochanges, kqevents, fdw_maxcons, &ts);
- nochanges = 0;
- return sr;
-}
-
-static void fdw_kqueue_handle(void)
-{
- register unsigned i;
- t_fdwatch_fd *cfd;
-
-/* eventlog(eventlog_level_trace, __FUNCTION__, "called"); */
- for (i = 0; i < sr; i++)
- {
-/* eventlog(eventlog_level_trace, __FUNCTION__, "checking %d ident: %d read: %d write: %d", i, kqevents[i].ident, kqevents[i].filter & EVFILT_READ, kqevents[i].filter & EVFILT_WRITE); */
- cfd = fdw_fds + (int)kqevents[i].udata;
- if (fdw_rw(cfd) & fdwatch_type_read && kqevents[i].filter == EVFILT_READ)
- if (fdw_hnd(cfd) (fdw_data(cfd), fdwatch_type_read) == -2)
- continue;
-
- if (fdw_rw(cfd) & fdwatch_type_write && kqevents[i].filter == EVFILT_WRITE)
- fdw_hnd(cfd) (fdw_data(cfd), fdwatch_type_write);
- }
- sr = 0;
-}
-
-#endif /* HAVE_KQUEUE */
diff --git a/d2pack109/src/common/fdwatch_kqueue.h b/d2pack109/src/common/fdwatch_kqueue.h
deleted file mode 100644
index 50cec30..0000000
--- a/d2pack109/src/common/fdwatch_kqueue.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Abstraction API/layer for the various ways PvPGN can inspect sockets state
- * 2003 (C) dizzy@roedu.net
- *
- * Code is based on the ideas found in thttpd project.
- *
- * *BSD kqueue() based backend
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef __INCLUDED_FDWATCH_KQUEUE__
-#define __INCLUDED_FDWATCH_KQUEUE__
-
-extern t_fdw_backend fdw_kqueue;
-
-#endif /* __INCLUDED_FDWATCH_KQUEUE__ */
diff --git a/d2pack109/src/common/fdwatch_poll.c b/d2pack109/src/common/fdwatch_poll.c
deleted file mode 100644
index b76405c..0000000
--- a/d2pack109/src/common/fdwatch_poll.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Abstraction API/layer for the various ways PvPGN can inspect sockets state
- * 2003 (C) dizzy@roedu.net
- *
- * Code is based on the ideas found in thttpd project.
- *
- * poll(2) based backend
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include "common/setup_before.h"
-#ifdef STDC_HEADERS
-# include
-#else
-# ifdef HAVE_MALLOC_H
-# include
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# include
-#else
-# ifdef HAVE_STRINGS_H
-# include
-# endif
-#endif
-#ifdef HAVE_POLL_H
-# include
-#else
-# ifdef HAVE_SYS_POLL_H
-# include
-# endif
-#endif
-#include "fdwatch.h"
-#include "common/eventlog.h"
-#include "common/xalloc.h"
-#include "common/setup_after.h"
-
-#ifdef HAVE_POLL
-static int sr;
-static struct pollfd *fds = NULL; /* working set */
-static int *_rridx = NULL;
-static int *_ridx = NULL;
-static unsigned nofds;
-
-static int fdw_poll_init(int nfds);
-static int fdw_poll_close(void);
-static int fdw_poll_add_fd(int idx, t_fdwatch_type rw);
-static int fdw_poll_del_fd(int idx);
-static int fdw_poll_watch(long timeout_msecs);
-static void fdw_poll_handle(void);
-
-t_fdw_backend fdw_poll = {
- fdw_poll_init,
- fdw_poll_close,
- fdw_poll_add_fd,
- fdw_poll_del_fd,
- fdw_poll_watch,
- fdw_poll_handle
-};
-
-static int fdw_poll_init(int nfds)
-{
- int i;
-
- _ridx = xmalloc(sizeof(int) * nfds);
- fds = xmalloc(sizeof(struct pollfd) * nfds);
- _rridx = xmalloc(sizeof(int) * nfds);
-
- memset(fds, 0, sizeof(struct pollfd) * nfds);
- memset(_rridx, 0, sizeof(int) * nfds);
-/* I would use a memset with 255 but that is dirty and doesnt gain us anything */
- for(i = 0; i < nfds; i++) _ridx[i] = -1;
- nofds = sr = 0;
-
- eventlog(eventlog_level_info, __FUNCTION__, "fdwatch poll() based layer initialized (max %d sockets)", nfds);
- return 0;
-}
-
-static int fdw_poll_close(void)
-{
- if (fds) { xfree((void *)fds); fds = NULL; }
- if (_ridx) { xfree((void *)_ridx); _ridx = NULL; }
- if (_rridx) { xfree((void *)_rridx); _rridx = NULL; }
- nofds = sr = 0;
-
- return 0;
-}
-
-static int fdw_poll_add_fd(int idx, t_fdwatch_type rw)
-{
- static int ridx;
-
-// eventlog(eventlog_level_trace, __FUNCTION__, "called fd: %d rw: %d", fd, rw);
- if (_ridx[idx] < 0) {
- ridx = nofds++;
- fds[ridx].fd = fdw_fd(fdw_fds + idx);
- _ridx[idx] = ridx;
- _rridx[ridx] = idx;
-// eventlog(eventlog_level_trace, __FUNCTION__, "adding new fd on %d", ridx);
- } else {
- if (fds[_ridx[idx]].fd != fdw_fd(fdw_fds + idx)) {
- eventlog(eventlog_level_error,__FUNCTION__,"BUG: found existent poll_fd entry for same idx with different fd");
- return -1;
- }
- ridx = _ridx[idx];
-// eventlog(eventlog_level_trace, __FUNCTION__, "updating fd on %d", ridx);
- }
-
- fds[ridx].events = 0;
- if (rw & fdwatch_type_read) fds[ridx].events |= POLLIN;
- if (rw & fdwatch_type_write) fds[ridx].events |= POLLOUT;
-
- return 0;
-}
-
-static int fdw_poll_del_fd(int idx)
-{
-// eventlog(eventlog_level_trace, __FUNCTION__, "called fd: %d", fd);
- if (_ridx[idx] < 0 || !nofds) return -1;
- if (sr > 0)
- eventlog(eventlog_level_error, __FUNCTION__, "BUG: called while still handling sockets");
-
- /* move the last entry to the deleted one and decrement nofds count */
- nofds--;
- if (_ridx[idx] < nofds) {
-// eventlog(eventlog_level_trace, __FUNCTION__, "not last, moving %d", tfds[nofds].fd);
- _ridx[_rridx[nofds]] = _ridx[idx];
- _rridx[_ridx[idx]] = _rridx[nofds];
- memcpy(fds + _ridx[idx], fds + nofds, sizeof(struct pollfd));
- }
- _ridx[idx] = -1;
-
- return 0;
-}
-
-static int fdw_poll_watch(long timeout_msec)
-{
- return (sr = poll(fds, nofds, timeout_msec));
-}
-
-static void fdw_poll_handle(void)
-{
- register unsigned i;
- int changed;
- t_fdwatch_fd *cfd;
-
- for(i = 0; i < nofds && sr; i++) {
- changed = 0;
- cfd = fdw_fds + _rridx[i];
-
- if (fdw_rw(cfd) & fdwatch_type_read &&
- fds[i].revents & (POLLIN | POLLERR | POLLHUP | POLLNVAL))
- {
- if (fdw_hnd(cfd)(fdw_data(cfd), fdwatch_type_read) == -2) {
- sr--;
- continue;
- }
- changed = 1;
- }
-
- if (fdw_rw(cfd) & fdwatch_type_write &&
- fds[i].revents & (POLLOUT | POLLERR | POLLHUP | POLLNVAL))
- {
- fdw_hnd(cfd)(fdw_data(cfd), fdwatch_type_write);
- changed = 1;
- }
-
- if (changed) sr--;
- }
-}
-
-#endif /* HAVE_POLL */
diff --git a/d2pack109/src/common/fdwatch_poll.h b/d2pack109/src/common/fdwatch_poll.h
deleted file mode 100644
index 7d688d3..0000000
--- a/d2pack109/src/common/fdwatch_poll.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Abstraction API/layer for the various ways PvPGN can inspect sockets state
- * 2003 (C) dizzy@roedu.net
- *
- * Code is based on the ideas found in thttpd project.
- *
- * poll() based backend
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef __INCLUDED_FDWATCH_POLL__
-#define __INCLUDED_FDWATCH_POLL__
-
-extern t_fdw_backend fdw_poll;
-
-#endif /* __INCLUDED_FDWATCH_POLL__ */
diff --git a/d2pack109/src/common/fdwatch_select.c b/d2pack109/src/common/fdwatch_select.c
deleted file mode 100644
index 00a0a21..0000000
--- a/d2pack109/src/common/fdwatch_select.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Abstraction API/layer for the various ways PvPGN can inspect sockets state
- * 2003 (C) dizzy@roedu.net
- *
- * Code is based on the ideas found in thttpd project.
- *
- * select() based backend
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#define FDWATCH_BACKEND
-#include "common/setup_before.h"
-#ifdef STDC_HEADERS
-# include
-#else
-# ifdef HAVE_MALLOC_H
-# include
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# include
-#else
-# ifdef HAVE_STRINGS_H
-# include
-# endif
-#endif
-/* According to earlier standards */
-#ifdef HAVE_SYS_TIME_H
-# include
-#endif
-#ifdef HAVE_SYS_TYPES_H
-# include
-#endif
-#ifdef HAVE_UNISTD_H
-# include
-#endif
-/* According to POSIX 1003.1-2001 */
-#ifdef HAVE_SYS_SELECT_H
-# include
-#endif
-#include "compat/psock.h"
-#include "fdwatch.h"
-#include "common/eventlog.h"
-#include "common/xalloc.h"
-#include "common/elist.h"
-#include "common/setup_after.h"
-
-#ifdef HAVE_SELECT
-
-static int sr;
-static int smaxfd;
-static t_psock_fd_set *rfds = NULL, *wfds = NULL, /* working sets (updated often) */
- *trfds = NULL, *twfds = NULL; /* templates (updated rare) */
-
-static int fdw_select_init(int nfds);
-static int fdw_select_close(void);
-static int fdw_select_add_fd(int idx, t_fdwatch_type rw);
-static int fdw_select_del_fd(int idx);
-static int fdw_select_watch(long timeout_msecs);
-static void fdw_select_handle(void);
-
-t_fdw_backend fdw_select = {
- fdw_select_init,
- fdw_select_close,
- fdw_select_add_fd,
- fdw_select_del_fd,
- fdw_select_watch,
- fdw_select_handle
-};
-
-static int fdw_select_init(int nfds)
-{
- if (nfds > FD_SETSIZE) return -1; /* this should not happen */
-
- rfds = xmalloc(sizeof(t_psock_fd_set));
- wfds = xmalloc(sizeof(t_psock_fd_set));
- trfds = xmalloc(sizeof(t_psock_fd_set));
- twfds = xmalloc(sizeof(t_psock_fd_set));
-
- PSOCK_FD_ZERO(trfds); PSOCK_FD_ZERO(twfds);
- smaxfd = sr = 0;
-
- eventlog(eventlog_level_info, __FUNCTION__, "fdwatch select() based layer initialized (max %d sockets)", nfds);
- return 0;
-}
-
-static int fdw_select_close(void)
-{
- if (rfds) { xfree((void *)rfds); rfds = NULL; }
- if (wfds) { xfree((void *)wfds); wfds = NULL; }
- if (trfds) { xfree((void *)trfds); trfds = NULL; }
- if (twfds) { xfree((void *)twfds); twfds = NULL; }
- smaxfd = sr = 0;
-
- return 0;
-}
-
-static int fdw_select_add_fd(int idx, t_fdwatch_type rw)
-{
- int fd;
-
-// eventlog(eventlog_level_trace, __FUNCTION__, "called fd: %d rw: %d", fd, rw);
- fd = fdw_fd(fdw_fds + idx);
-
- /* select() interface is limited by FD_SETSIZE max socket value */
- if (fd >= FD_SETSIZE) return -1;
-
- if (rw & fdwatch_type_read) PSOCK_FD_SET(fd, trfds);
- else PSOCK_FD_CLR(fd, trfds);
- if (rw & fdwatch_type_write) PSOCK_FD_SET(fd, twfds);
- else PSOCK_FD_CLR(fd, twfds);
- if (smaxfd < fd) smaxfd = fd;
-
- return 0;
-}
-
-static int fdw_select_del_fd(int idx)
-{
- int fd;
-
- fd = fdw_fd(fdw_fds + idx);
-// eventlog(eventlog_level_trace, __FUNCTION__, "called fd: %d", fd);
- if (sr > 0)
- eventlog(eventlog_level_error, __FUNCTION__, "BUG: called while still handling sockets");
- PSOCK_FD_CLR(fd, trfds);
- PSOCK_FD_CLR(fd, twfds);
-
- return 0;
-}
-
-static int fdw_select_watch(long timeout_msec)
-{
- static struct timeval tv;
-
- tv.tv_sec = timeout_msec / 1000;
- tv.tv_usec = timeout_msec % 1000;
-
- /* set the working sets based on the templates */
- memcpy(rfds, trfds, sizeof(t_psock_fd_set));
- memcpy(wfds, twfds, sizeof(t_psock_fd_set));
-
- return (sr = psock_select(smaxfd + 1, rfds, wfds, NULL, &tv));
-}
-
-static int fdw_select_cb(t_fdwatch_fd *cfd, void *data)
-{
-// eventlog(eventlog_level_trace, __FUNCTION__, "idx: %d fd: %d", idx, fdw_fd->fd);
- if (fdw_rw(cfd) & fdwatch_type_read && PSOCK_FD_ISSET(fdw_fd(cfd), rfds)
- && fdw_hnd(cfd)(fdw_data(cfd), fdwatch_type_read) == -2) return 0;
- if (fdw_rw(cfd) & fdwatch_type_write && PSOCK_FD_ISSET(fdw_fd(cfd), wfds))
- fdw_hnd(cfd)(fdw_data(cfd), fdwatch_type_write);
-
- return 0;
-}
-
-static void fdw_select_handle(void)
-{
-// eventlog(eventlog_level_trace, __FUNCTION__, "called nofds: %d", fdw_nofds);
- fdwatch_traverse(fdw_select_cb,NULL);
- sr = 0;
-}
-
-#endif /* HAVE_SELECT */
diff --git a/d2pack109/src/common/fdwatch_select.h b/d2pack109/src/common/fdwatch_select.h
deleted file mode 100644
index 34394e4..0000000
--- a/d2pack109/src/common/fdwatch_select.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Abstraction API/layer for the various ways PvPGN can inspect sockets state
- * 2003 (C) dizzy@roedu.net
- *
- * Code is based on the ideas found in thttpd project.
- *
- * select() based backend
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef __INCLUDED_FDWATCH_SELECT__
-#define __INCLUDED_FDWATCH_SELECT__
-
-extern t_fdw_backend fdw_select;
-
-#endif /* __INCLUDED_FDWATCH_SELECT__ */
diff --git a/d2pack109/src/common/field_sizes.h b/d2pack109/src/common/field_sizes.h
deleted file mode 100644
index 19079ea..0000000
--- a/d2pack109/src/common/field_sizes.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 1998,1999,2000 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef INCLUDED_FIELD_SIZES_TYPES
-#define INCLUDED_FIELD_SIZES_TYPES
-
-#define MAX_PACKET_SIZE 3072
-#define MAX_NORMAL_TYPE 0xffff
-#define MAX_FILE_TYPE 0xffff
-#define MAX_AUTH_TYPE 0xff
-#define MAX_GAMES_LIST 20
-#define MAX_MESSAGE_LEN 255
-#define MAX_COMMAND_LEN 32
-#define USER_NAME_MAX 16 /* including terminating NUL char */
-#define USER_NAME_MIN 2
-#define UNCHECKED_NAME_STR 32 /* including terminating NUL char */
- /* (longer than USER_NAME_MAX and CHAR_NAME_LEN so that
- * proper error packets can be returned) */
-#define MAX_CLANNAME_LEN 64
-#define CHANNEL_NAME_LEN 64
-#define CHAR_NAME_LEN 16 /* including terminating NUL char */
-#define REALM_NAME_LEN 32
-#define GAME_NAME_LEN 32
-#define GAME_PASS_LEN 32
-#define GAME_INFO_LEN 256
-#define MAP_NAME_LEN 64
-#define BNETHASH_LEN 20 /* uint32*5, see bnethash.h */
-#define MAX_EXEINFO_STR 256 /* including terminating NUL char */
-#define MAX_OWNER_STR 128 /* including terminating NUL char */
-#define MAX_CDKEY_STR 128 /* including terminating NUL char */
-#define MAX_EMAIL_STR 128 /* including terminating NUL char */
-#define MAX_WINHOST_STR 128 /* including terminating NUL char */
-#define MAX_WINUSER_STR 128 /* including terminating NUL char */
-#define MAX_LANG_STR 64 /* including terminating NUL char */
-#define MAX_COUNTRYNAME_STR 128 /* including terminating NUL char */
-#define MAX_FILENAME_STR 2048 /* including terminating NUL char */
-#define MAX_GAMEREP_HEAD_STR 2048 /* including terminating NUL char */
-#define MAX_GAMEREP_BODY_STR 8192 /* including terminating NUL char */
-#define MAX_PLAYERINFO_STR 2048 /* including terminating NUL char */
-#define MAX_COUNTRYCODE_STR 32 /* including terminating NUL char */
-#define MAX_COUNTRY_STR 32 /* including terminating NUL char */
-#define MAX_ATTRKEY_STR 1024 /* including terminating NUL char */
-#define MAX_ATTRVAL_STR 4096 /* including terminating NUL char */
-#define MAX_IRC_MESSAGE_LEN 512 /* including CRLF (according to RFC 2812) */
-#define MAX_TOPIC_LEN 201 /* including terminating NUL char */
-#define CLANSHORT_NAME_MAX 4
-#define CLAN_NAME_MAX 25 /* including terminating NUL char */
-
-#endif
diff --git a/d2pack109/src/common/flags.h b/d2pack109/src/common/flags.h
deleted file mode 100644
index 7cea849..0000000
--- a/d2pack109/src/common/flags.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2004 Dizzy (dizzy@roedu.net)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef INCLUDED_FLAGS_H
-#define INCLUDED_FLAGS_H
-
-#define FLAG_ZERO(var) *(var) = 0
-#define FLAG_SET(var,flag) *(var) |= flag
-#define FLAG_CLEAR(var,flag) *(var) &= ~flag
-#define FLAG_ISSET(var,flag) (var & flag)
-
-#endif /* INCLUDED_FLAGS_H */
diff --git a/d2pack109/src/common/hashtable.c b/d2pack109/src/common/hashtable.c
deleted file mode 100644
index 772011b..0000000
--- a/d2pack109/src/common/hashtable.c
+++ /dev/null
@@ -1,593 +0,0 @@
-/*
- * Copyright (C) 2000,2001 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#define HASHTABLE_INTERNAL_ACCESS
-#include "common/setup_before.h"
-#ifdef HAVE_STDDEF_H
-# include
-#else
-# ifndef NULL
-# define NULL ((void *)0)
-# endif
-#endif
-#ifdef STDC_HEADERS
-# include
-#else
-# ifdef HAVE_MALLOC_H
-# include
-# endif
-#endif
-#include "common/eventlog.h"
-#include "common/hashtable.h"
-#include "common/xalloc.h"
-#include "common/setup_after.h"
-
-
-static int nodata; /* if data points to this, then the entry was actually deleted */
-
-
-static t_entry * hashtable_entry_export(t_internentry * entry, t_hashtable const * hashtable, unsigned int row);
-
-
-static t_entry * hashtable_entry_export(t_internentry * entry, t_hashtable const * hashtable, unsigned int row)
-{
- t_entry * temp;
-
- if (!entry)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL entry");
- return NULL;
- }
- if (!hashtable)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable");
- return NULL;
- }
- if (row>=hashtable->num_rows)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got bad row %u (max %u)",row,hashtable->num_rows-1);
- return NULL;
- }
-
- temp = xmalloc(sizeof(t_entry));
- temp->row = row;
- temp->real = entry;
- temp->hashtable = hashtable;
-
- return temp;
-}
-
-
-extern t_hashtable * hashtable_create(unsigned int num_rows)
-{
- t_hashtable * new;
- unsigned int i;
-
- if (num_rows<1)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"num_rows must be at least 1");
- return NULL;
- }
-
- new = xmalloc(sizeof(t_hashtable));
- new->rows = xmalloc(sizeof(t_internentry *)*num_rows);
- new->num_rows = num_rows;
- new->len = 0;
- for (i=0; irows[i] = NULL;
-
- return new;
-}
-
-
-extern int hashtable_destroy(t_hashtable * hashtable)
-{
- unsigned int i;
-
- if (!hashtable)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable");
- return -1;
- }
-
- hashtable_purge(hashtable);
- for (i=0; inum_rows; i++)
- if (hashtable->rows[i])
- eventlog(eventlog_level_error,__FUNCTION__,"got non-empty hashtable");
-
- xfree(hashtable->rows);
- xfree(hashtable);
-
- return 0;
-}
-
-
-extern int hashtable_purge(t_hashtable * hashtable)
-{
- unsigned int row;
- t_internentry * curr;
- t_internentry * head;
- t_internentry * next;
- t_internentry * * change;
-
- if (!hashtable)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable");
- return -1;
- }
-
-#ifdef HASHTABLE_DEBUG
- hashtable_check(hashtable);
-#endif
-
- for (row=0; rownum_rows; row++)
- {
- head = NULL;
- change = NULL;
- for (curr=hashtable->rows[row]; curr; curr=next)
- {
- next = curr->next;
- if (curr->data==&nodata)
- {
- if (change)
- *change = next;
- xfree(curr);
- }
- else
- {
- if (!head)
- head = curr;
- change = &curr->next;
- }
- }
- hashtable->rows[row] = head;
- }
-
- return 0;
-}
-
-
-extern int hashtable_check(t_hashtable const * hashtable)
-{
- unsigned int emptycnt;
- unsigned int validcnt;
- unsigned int row;
- unsigned int temp;
- t_internentry const * tail;
- t_internentry const * curr;
-
- if (!hashtable)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable");
- return -1;
- }
- if (hashtable->num_rows<1)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"num_rows=%u",hashtable->num_rows);
- return -1;
- }
- if (!hashtable->rows)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"hashtable->rows is NULL");
- return -1;
- }
-
- emptycnt=validcnt = 0;
- for (row=0; rownum_rows; row++)
- {
- tail = NULL;
- for (curr=hashtable->rows[row]; curr; curr=curr->next)
- {
- if (tail)
- {
- if (curr==tail) /* tail is currently the previous node */
- {
- eventlog(eventlog_level_error,__FUNCTION__,"row %u is circular (curr==prev==%p)",row,curr);
- return -1;
- }
- if (curr->next==tail)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"row %u is circular (curr->next==prev==%p)",row,curr);
- return -1;
- }
- for (temp=0; tempnum_rows; temp++)
- if (curr==hashtable->rows[temp])
- {
- eventlog(eventlog_level_error,__FUNCTION__,"row %u is circular (curr==rows[%u]==%p)",row,temp,curr);
- return -1;
- }
- }
- if (curr->data==&nodata)
- emptycnt++;
- else
- validcnt++;
- tail = curr;
- }
- }
-
- if (emptycnt>10 && emptycnt>validcnt+5) /* arbitrary heuristic to detect missing list_purge() cal
-ls */
- eventlog(eventlog_level_warn,__FUNCTION__,"emptycnt=%u but validcnt=%u",emptycnt,validcnt);
- if (hashtable->len!=validcnt)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"hashtable->len=%u but validcnt=%u",hashtable->len,validcnt);
- return -1;
- }
-
- return 0;
-}
-
-
-extern unsigned int hashtable_get_length(t_hashtable const * hashtable)
-{
- if (!hashtable)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable");
- return 0;
- }
-
- return hashtable->len;
-}
-
-
-extern int hashtable_insert_data(t_hashtable * hashtable, void * data, unsigned int hash)
-{
- unsigned int row;
- t_internentry * entry;
-
- if (!hashtable)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable");
- return -1;
- }
-
- entry = xmalloc(sizeof(t_internentry));
- entry->data = data;
-
- row = hash%hashtable->num_rows;
- entry->next = hashtable->rows[row];
- hashtable->rows[row] = entry;
- hashtable->len++;
-
- return 0;
-}
-
-
-extern t_entry * hashtable_get_entry_by_data(t_hashtable const * hashtable, void const * data, unsigned int hash)
-{
- unsigned int row;
- t_internentry * curr;
-
- if (!hashtable)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable");
- return NULL;
- }
-
- row = hash%hashtable->num_rows;
- for (curr=hashtable->rows[row]; curr; curr=curr->next)
- if (curr->data==data)
- return hashtable_entry_export(curr,hashtable,row);
-
- return NULL;
-}
-
-
-extern t_entry const * hashtable_get_entry_by_data_const(t_hashtable const * hashtable, void const * data, unsigned int hash)
-{
- unsigned int row;
- t_internentry * curr;
-
- if (!hashtable)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable");
- return NULL;
- }
-
- row = hash%hashtable->num_rows;
- for (curr=hashtable->rows[row]; curr; curr=curr->next)
- if (curr->data==data)
- return hashtable_entry_export(curr,hashtable,row);
-
- return NULL;
-}
-
-
-extern int hashtable_remove_entry(t_hashtable * hashtable, t_entry * entry)
-{
- if (!hashtable)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable");
- return -1;
- }
- if (!entry)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL entry");
- return -1;
- }
- if (!entry->real)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"entry has NULL real pointer");
- return -1;
- }
- if (entry->real->data==&nodata)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got deleted entry");
- return -1;
- }
-
- entry->real->data = &nodata;
- hashtable->len--;
-
- return 0;
-}
-
-
-extern int hashtable_remove_data(t_hashtable * hashtable, void const * data, unsigned int hash)
-{
- t_entry * entry;
- int retval;
-
- if (!hashtable)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable");
- return -1;
- }
-
- if (!(entry = hashtable_get_entry_by_data(hashtable,data,hash)))
- return -1;
-
- retval = hashtable_remove_entry(hashtable,entry);
-
- hashtable_entry_release(entry);
-
- return retval;
-}
-
-
-extern void * entry_get_data(t_entry const * entry)
-{
- if (!entry)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL entry");
- return NULL;
- }
- if (!entry->real)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"entry has NULL real pointer");
- return NULL;
- }
- if (entry->real->data==&nodata)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got deleted entry");
- return NULL;
- }
-
- return entry->real->data;
-}
-
-
-extern void * hashtable_get_data_by_pos(t_hashtable const * hashtable, unsigned int pos)
-{
- t_internentry const * curr;
- unsigned int row;
- unsigned int len;
-
- if (!hashtable)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable");
- return NULL;
- }
-
- len = 0;
- row = 0;
- curr = NULL;
- for (;;)
- {
- if (!curr)
- {
- if (row>=hashtable->num_rows)
- break;
- curr = hashtable->rows[row++];
- continue;
- }
- if (curr->data!=&nodata && len++==pos)
- return curr->data;
- curr = curr->next;
- }
-
- eventlog(eventlog_level_error,__FUNCTION__,"requested position %u but len=%u",pos,len);
- return NULL;
-}
-
-
-#ifdef HASHTABLE_DEBUG
-extern t_entry * hashtable_get_first_real(t_hashtable const * hashtable, char const * fn, unsigned int ln)
-#else
-extern t_entry * hashtable_get_first(t_hashtable const * hashtable)
-#endif
-{
- unsigned int row;
- t_internentry * curr;
-
- if (!hashtable)
- {
-#ifdef HASHTABLE_DEBUG
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable from %s:%u",fn,ln);
-#else
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable");
-#endif
- return NULL;
- }
-
- for (row=0; rownum_rows; row++)
- for (curr=hashtable->rows[row]; curr; curr=curr->next)
- if (curr->data!=&nodata)
- return hashtable_entry_export(curr,hashtable,row);
-
- return NULL;
-}
-
-
-extern t_entry * entry_get_next(t_entry * entry)
-{
- t_hashtable const * hashtable;
- unsigned int row;
- t_internentry * curr;
-
- if (!entry)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL entry");
- return NULL;
- }
-
- hashtable = entry->hashtable;
-
- for (curr=entry->real->next; curr; curr=curr->next)
- if (curr->data!=&nodata)
- {
- entry->real = curr;
- return entry;
- }
-
- for (row=entry->row+1; rownum_rows; row++)
- for (curr=hashtable->rows[row]; curr; curr=curr->next)
- if (curr->data!=&nodata)
- {
- entry->real = curr;
- entry->row = row;
- return entry;
- }
-
- hashtable_entry_release(entry);
- return NULL;
-}
-
-
-#ifdef HASHTABLE_DEBUG
-extern t_entry * hashtable_get_first_matching_real(t_hashtable const * hashtable, unsigned int hash, char const * fn, unsigned int ln)
-#else
-extern t_entry * hashtable_get_first_matching(t_hashtable const * hashtable, unsigned int hash)
-#endif
-{
- unsigned int row;
- t_internentry * curr;
-
- if (!hashtable)
- {
-#ifdef HASHTABLE_DEBUG
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable from %s:%u",fn,ln);
-#else
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable");
-#endif
- return NULL;
- }
-
- row = hash%hashtable->num_rows;
- for (curr=hashtable->rows[row]; curr; curr=curr->next)
- if (curr->data!=&nodata)
- return hashtable_entry_export(curr,hashtable,row);
-
- return NULL;
-}
-
-
-extern t_entry * entry_get_next_matching(t_entry * entry)
-{
- t_internentry * curr;
-
- if (!entry)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL entry");
- return NULL;
- }
-
- for (curr=entry->real->next; curr; curr=curr->next)
- if (curr->data!=&nodata)
- {
- entry->real = curr;
- return entry;
- }
-
- hashtable_entry_release(entry);
- return NULL;
-}
-
-
-extern int hashtable_entry_release(t_entry * entry)
-{
- if (!entry)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL entry");
- return -1;
- }
- if (!entry->hashtable)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got entry with NULL hashtable");
- return -1;
- }
- if (!entry->real)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got entry with NULL real pointer");
- return -1;
- }
- if (entry->row>=entry->hashtable->num_rows)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"entry has bad row %u (max %u)",entry->row,entry->hashtable->num_rows-1);
- return -1;
- }
-
-#ifdef HASHTABLE_DEBUG
- hashtable_check(entry->hashtable);
-#endif
- xfree(entry);
- return 0;
-}
-
-
-extern int hashtable_stats(t_hashtable * hashtable)
-{
- unsigned int row;
- t_internentry * curr;
- unsigned int rcount, max, min;
-
- if (!hashtable)
- {
- eventlog(eventlog_level_error, __FUNCTION__,"got NULL hashtable");
- return -1;
- }
-
-#ifdef HASHTABLE_DEBUG
- hashtable_check(hashtable);
-#endif
-
- max = 0;
- min = hashtable->len;
- for (row=0; rownum_rows; row++)
- {
- rcount = 0;
- for (curr=hashtable->rows[row]; curr; curr=curr->next)
- if (curr->data!=&nodata) rcount++;
- if (rcount > max) max = rcount;
- if (rcount < min) min = rcount;
- }
-
- eventlog(eventlog_level_info, __FUNCTION__, "hashsize: %u min: %u max: %u avg: %.2f diff: %.2f%c", hashtable->num_rows, min, max, (float)(min + max)/2, (float)(max - min)/max*100, '%');
- return 0;
-}
-
-
diff --git a/d2pack109/src/common/hashtable.h b/d2pack109/src/common/hashtable.h
deleted file mode 100644
index 0626714..0000000
--- a/d2pack109/src/common/hashtable.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef INCLUDED_HASHTABLE_TYPES
-#define INCLUDED_HASHTABLE_TYPES
-
-#ifdef HASHTABLE_INTERNAL_ACCESS
-struct hashtable; /* forward reference for t_entry */
-#endif
-
-#ifdef HASHTABLE_INTERNAL_ACCESS
-typedef struct internentry
-{
- void * data;
- struct internentry * next;
-}
-t_internentry;
-#endif
-
-typedef struct entry
-#ifdef HASHTABLE_INTERNAL_ACCESS
-{
- unsigned int row;
- t_internentry * real;
- struct hashtable const * hashtable;
-}
-#endif
-t_entry;
-
-typedef struct hashtable
-#ifdef HASHTABLE_INTERNAL_ACCESS
-{
- unsigned int num_rows;
- unsigned int len;
- unsigned int zombies;
- t_internentry * * rows;
-}
-#endif
-t_hashtable;
-
-#endif
-
-
-/*****/
-#ifndef JUST_NEED_TYPES
-#ifndef INCLUDED_HASHTABLE_PROTOS
-#define INCLUDED_HASHTABLE_PROTOS
-
-extern t_hashtable * hashtable_create(unsigned int num_rows) ;
-extern int hashtable_destroy(t_hashtable * hashtable);
-extern int hashtable_purge(t_hashtable * hashtable);
-extern int hashtable_check(t_hashtable const * hashtable);
-extern unsigned int hashtable_get_length(t_hashtable const * hashtable);
-extern int hashtable_insert_data(t_hashtable * hashtable, void * data, unsigned int hash);
-extern t_entry * hashtable_get_entry_by_data(t_hashtable const * hashtable, void const * data, unsigned int hash);
-extern t_entry const * hashtable_get_entry_by_data_const(t_hashtable const * hashtable, void const * data, unsigned int hash);
-extern int hashtable_remove_data(t_hashtable * hashtable, void const * data, unsigned int hash); /* delete matching item */
-extern int hashtable_remove_entry(t_hashtable * hashtable, t_entry * entry);
-extern void * hashtable_get_data_by_pos(t_hashtable const * hashtable, unsigned int pos);
-extern void * entry_get_data(t_entry const * entry);
-#ifdef HASHTABLE_DEBUG
-extern t_entry * hashtable_match_get_first_real(t_hashtable const * hashtable, unsigned int hash, char const * fn, unsigned int ln);
-# define hashtable_match_get_first(L,H) hashtable_match_get_first_real(L,H,__FILE__,__LINE__)
-#else
-extern t_entry * hashtable_match_get_first(t_hashtable const * hashtable, unsigned int hash);
-#endif
-extern t_entry * entry_match_get_next(t_entry const * entry, unsigned int hash);
-#ifdef HASHTABLE_DEBUG
-extern t_entry * hashtable_get_first_real(t_hashtable const * hashtable, char const * fn, unsigned int ln);
-# define hashtable_get_first(L) hashtable_get_first_real(L,__FILE__,__LINE__)
-#else
-extern t_entry * hashtable_get_first(t_hashtable const * hashtable);
-#endif
-extern t_entry * entry_get_next(t_entry * entry);
-#ifdef HASHTABLE_DEBUG
-extern t_entry * hashtable_get_first_matching_real(t_hashtable const * hashtable, unsigned int hash, char const * fn, unsigned int ln);
-# define hashtable_get_first_matching(L,H) hashtable_get_first_matching_real(L,H,__FILE__,__LINE__)
-#else
-extern t_entry * hashtable_get_first_matching(t_hashtable const * hashtable, unsigned int hash);
-#endif
-extern t_entry * entry_get_next_matching(t_entry * entry);
-extern int hashtable_entry_release(t_entry * entry);
-extern int hashtable_stats(t_hashtable * hashtable);
-
-#define HASHTABLE_TRAVERSE(hashtable,curr) for (curr=hashtable_get_first(hashtable); curr; curr=entry_get_next(curr))
-#define HASHTABLE_TRAVERSE_MATCHING(hashtable,curr,hash) for (curr=hashtable_get_first_matching(hashtable,hash); curr; curr=entry_get_next_matching(curr))
-
-#endif
-#endif
diff --git a/d2pack109/src/common/hexdump.c b/d2pack109/src/common/hexdump.c
deleted file mode 100644
index 4b0cb0c..0000000
--- a/d2pack109/src/common/hexdump.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 1998 Mark Baysinger (mbaysing@ucsd.edu)
- * Copyright (C) 1998,1999 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#include "common/setup_before.h"
-#include
-#ifdef HAVE_STDDEF_H
-# include
-#else
-# ifndef NULL
-# define NULL ((void *)0)
-# endif
-#endif
-#include "common/hexdump.h"
-#include "common/setup_after.h"
-
-
-extern void hexdump(FILE * stream, void const * data, unsigned int len)
-{
- unsigned int i;
- unsigned int r,c;
-
- if (!stream)
- return;
- if (!data)
- return;
-
- for (r=0,i=0; r<(len/16+(len%16!=0)); r++,i+=16)
- {
- fprintf(stream,"%04X: ",i); /* location of first byte in line */
-
- for (c=i; c=32 &&
- ((unsigned char const *)data)[c]<127)
- fprintf(stream,"%c",((char const *)data)[c]);
- else
- fprintf(stream,"."); /* put this for non-printables */
- else
- fprintf(stream," "); /* pad if short line */
-
- fprintf(stream,"\n");
- }
-
- fflush(stream);
-}
diff --git a/d2pack109/src/common/hexdump.h b/d2pack109/src/common/hexdump.h
deleted file mode 100644
index cda4619..0000000
--- a/d2pack109/src/common/hexdump.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 1998 Mark Baysinger (mbaysing@ucsd.edu)
- * Copyright (C) 1998,1999 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-
-#ifndef JUST_NEED_TYPES
-#ifndef INCLUDED_HEXDUMP_PROTOS
-#define INCLUDED_HEXDUMP_PROTOS
-
-#define JUST_NEED_TYPES
-#include
-#undef JUST_NEED_TYPES
-
-extern void hexdump(FILE * stream, void const * data, unsigned int len);
-
-#endif
-#endif
diff --git a/d2pack109/src/common/init_protocol.h b/d2pack109/src/common/init_protocol.h
deleted file mode 100644
index 28faaa5..0000000
--- a/d2pack109/src/common/init_protocol.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 1998,1999 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef INCLUDED_INIT_PROTOCOL_TYPES
-#define INCLUDED_INIT_PROTOCOL_TYPES
-
-#ifdef JUST_NEED_TYPES
-# include "common/bn_type.h"
-#else
-# define JUST_NEED_TYPES
-# include "common/bn_type.h"
-# undef JUST_NEED_TYPES
-#endif
-
-/* There is no header for this packet class and there is only
- * one packet type.
- */
-
-/*
- * There is a single byte sent upon initial connections that
- * reports the connection type.
- */
-
-/******************************************************/
-#define CLIENT_INITCONN 0x1
-typedef struct
-{
- bn_byte class;
-} PACKED_ATTR() t_client_initconn;
-/******************************************************/
-
-#endif
-
-
-/*****/
-#ifndef JUST_NEED_TYPES
-#ifndef INCLUDED_INIT_PROTOCOL_PROTOS
-#define INCLUDED_INIT_PROTOCOL_PROTOS
-
-#define CLIENT_INITCONN_CLASS_DEFER 0x01 /* great... means either "bnet protocol" or "auth protocol" */
-#define CLIENT_INITCONN_CLASS_FILE 0x02
-#define CLIENT_INITCONN_CLASS_BOT 0x03
-#define CLIENT_INITCONN_CLASS_ENC 0x04 /* encrypted connection */
-#define CLIENT_INITCONN_CLASS_TELNET 0x0d /* Hack alert: look for user to hit \r when they connect */
-#define CLIENT_INITCONN_CLASS_D2CS 0x01
-#define CLIENT_INITCONN_CLASS_D2GS 0x64
-#define CLIENT_INITCONN_CLASS_D2CS_BNETD 0x65
-
-#endif
-#endif
diff --git a/d2pack109/src/common/list.c b/d2pack109/src/common/list.c
deleted file mode 100644
index c5170ff..0000000
--- a/d2pack109/src/common/list.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * Copyright (C) 1998,1999,2000 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#define LIST_INTERNAL_ACCESS
-#include "common/setup_before.h"
-#ifdef HAVE_STDDEF_H
-# include
-#else
-# ifndef NULL
-# define NULL ((void *)0)
-# endif
-#endif
-#ifdef STDC_HEADERS
-# include
-#else
-# ifdef HAVE_MALLOC_H
-# include
-# endif
-#endif
-#ifdef HAVE_ASSERT_H
-# include
-#endif
-#include "common/eventlog.h"
-#include "common/xalloc.h"
-#include "common/list.h"
-#include "common/setup_after.h"
-
-
-static t_elem listhead;
-
-
-extern t_list * list_create(void)
-{
- t_list * new;
-
- new = xmalloc(sizeof(t_list));
- new->head = NULL;
- new->tail = NULL;
- new->len = 0;
-
- return new;
-}
-
-
-extern int list_destroy(t_list * list)
-{
- if (!list)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL list");
- return -1;
- }
-
- if (list->head)
- eventlog(eventlog_level_error,__FUNCTION__,"got non-empty list");
-
- xfree(list);
-
- return 0;
-}
-
-extern unsigned int list_get_length(t_list const * list)
-{
- if (!list)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL list");
- return 0;
- }
-
- return list->len;
-}
-
-
-extern int list_prepend_data(t_list * list, void * data)
-{
- t_elem * elem;
-
- assert(list != NULL);
-
- elem = xmalloc(sizeof(t_elem));
- elem->data = data;
-
- if (list->head)
- list->head->prev = elem;
- elem->next = list->head;
- elem->prev = NULL;
- list->head = elem;
- if (!list->tail)
- list->tail = elem;
- list->len++;
-
- return 0;
-}
-
-
-extern int list_append_data(t_list * list, void * data)
-{
- t_elem * elem;
-
- assert(list != NULL);
-
- elem = xmalloc(sizeof(t_elem));
- elem->data = data;
-
- elem->next = NULL;
- if (!list->head)
- {
- list->head = elem;
- elem->prev = NULL;
- }
- if (list->tail)
- {
- elem->prev = list->tail;
- list->tail->next = elem;
- }
- list->tail = elem;
- list->len++;
-
- return 0;
-}
-
-
-extern t_elem * list_get_elem_by_data(t_list const * list, void const * data)
-{
- t_elem * curr;
-
- if (!list)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL list");
- return NULL;
- }
-
- LIST_TRAVERSE(list,curr)
- if (curr->data==data)
- return curr;
-
- return NULL;
-}
-
-
-extern t_elem const * list_get_elem_by_data_const(t_list const * list, void const * data)
-{
- t_elem const * curr;
-
- if (!list)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL list");
- return NULL;
- }
-
- LIST_TRAVERSE_CONST(list,curr)
- if (curr->data==data)
- return curr;
-
- return NULL;
-}
-
-
-extern int list_remove_elem(t_list * list, t_elem ** elem)
-{
- t_elem * target;
-
- if (!list)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL list");
- return -1;
- }
-
- if (!elem)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL *elem");
- return -1;
- }
-
- target = *elem;
-
- if (target->prev)
- {
- target->prev->next = target->next;
- }
- if (target->next)
- {
- target->next->prev = target->prev;
- }
-
- if (target == list->tail)
- {
- list->tail = target->prev;
- }
- if (target == list->head)
- {
- list->head = target->next;
- *elem = &listhead;
- }
- else
- *elem = target->prev;
-
- target->next = NULL;
- target->prev = NULL;
- xfree(target);
-
- list->len--;
-
- return 0;
-}
-
-
-extern int list_remove_data(t_list * list, void const * data, t_elem ** elem)
-{
- if (!list)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL list");
- return -1;
- }
-
- if (!(*elem = list_get_elem_by_data(list,data)))
- return -1;
-
- return list_remove_elem(list,elem);
-}
-
-
-extern int elem_set_data(t_elem * elem, void * data)
-{
- if (!elem)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL elem");
- return -1;
- }
-
- elem->data = data;
-
- return 0;
-}
-
-
-extern void * elem_get_data(t_elem const * elem)
-{
- if (!elem)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL elem");
- return NULL;
- }
-
- return elem->data;
-}
-
-
-extern void * list_get_data_by_pos(t_list const * list, unsigned int pos)
-{
- t_elem const * curr;
- unsigned int len;
-
- len = 0;
- LIST_TRAVERSE_CONST(list,curr)
- if (len++==pos)
- return curr->data;
-
- eventlog(eventlog_level_error,__FUNCTION__,"requested position %u but len=%u",pos,len);
- return NULL;
-}
-
-
-#ifdef LIST_DEBUG
-extern t_elem * list_get_first_real(t_list const * list, char const * fn, unsigned int ln)
-#else
-extern t_elem * list_get_first(t_list const * list)
-#endif
-{
- if (!list)
- {
-#ifdef LIST_DEBUG
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL list from %s:%u",fn,ln);
-#else
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL list");
-#endif
- return NULL;
- }
-
-
- return list->head;
-}
-
-
-#ifdef LIST_DEBUG
-extern t_elem const * list_get_first_const_real(t_list const * list, char const * fn, unsigned int ln)
-#else
-extern t_elem const * list_get_first_const(t_list const * list)
-#endif
-{
- if (!list)
- {
-#ifdef LIST_DEBUG
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL list from %s:%u",fn,ln);
-#else
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL list");
-#endif
- return NULL;
- }
-
- return list->head;
-}
-
-
-extern t_elem * elem_get_next_real(t_list const * list, t_elem const * elem, char const * fn, unsigned int ln)
-{
- if (!elem)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL elem from %s:%u",fn,ln);
- return NULL;
- }
-
- if (elem == &listhead)
- return list->head;
- else
- return elem->next;
-}
-
-
-extern t_elem const * elem_get_next_const(t_list const * list, t_elem const * elem)
-{
- if (!elem)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL elem");
- return NULL;
- }
-
- if (elem == &listhead)
- return list->head;
- else
- return elem->next;
-}
diff --git a/d2pack109/src/common/list.h b/d2pack109/src/common/list.h
deleted file mode 100644
index 48958fe..0000000
--- a/d2pack109/src/common/list.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 1999,2000 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef INCLUDED_LIST_TYPES
-#define INCLUDED_LIST_TYPES
-
-typedef struct elem
-#ifdef LIST_INTERNAL_ACCESS
-{
- void * data;
- struct elem * prev;
- struct elem * next;
-}
-#endif
-t_elem;
-
-typedef struct list
-#ifdef LIST_INTERNAL_ACCESS
-{
- unsigned int len;
- t_elem * head;
- t_elem * tail;
-}
-#endif
-t_list;
-
-#endif
-
-
-/*****/
-#ifndef JUST_NEED_TYPES
-#ifndef INCLUDED_LIST_PROTOS
-#define INCLUDED_LIST_PROTOS
-
-extern t_list * list_create(void) ;
-extern int list_destroy(t_list * list);
-extern unsigned int list_get_length(t_list const * list);
-extern int list_prepend_data(t_list * list, void * data);
-extern int list_append_data(t_list * list, void * data);
-extern t_elem * list_get_elem_by_data(t_list const * list, void const * data);
-extern t_elem const * list_get_elem_by_data_const(t_list const * list, void const * data);
-
-/* note changed API for those commands:
- due to direct removal of elements from list, you need to take special care during list traversal.
- a pointer to the traversal variable needs to be passed to the list_remove functions, so they
- can properly modify it to point to the "previous" element (the one before the element to be deleted)
- so the next elem_get_next call will address the "next" element (the one after the element to be deleted) */
-
-extern int list_remove_data(t_list * list, void const * data, t_elem ** elem); /* delete matching item */
-extern int list_remove_elem(t_list * list, t_elem ** elem);
-
-extern void * list_get_data_by_pos(t_list const * list, unsigned int pos);
-#ifdef LIST_DEBUG
-extern t_elem * list_get_first_real(t_list const * list, char const * fn, unsigned int ln);
-# define list_get_first(L) list_get_first_real(L,__FILE__,__LINE__)
-#else
-extern t_elem * list_get_first(t_list const * list);
-#endif
-#ifdef LIST_DEBUG
-extern t_elem const * list_get_first_const_real(t_list const * list, char const * fn, unsigned int ln);
-# define list_get_first_const(L) list_get_first_const_real(L,__FILE__,__LINE__)
-#else
-extern t_elem const * list_get_first_const(t_list const * list);
-#endif
-
-extern void * elem_get_data(t_elem const * elem);
-extern int elem_set_data(t_elem * elem, void * data);
-#define elem_get_next(list,elem) elem_get_next_real(list,elem,__FILE__,__LINE__)
-extern t_elem * elem_get_next_real(t_list const * list, t_elem const * elem,char const * fn, unsigned int ln);
-extern t_elem const * elem_get_next_const(t_list const * list, t_elem const * elem);
-
-#define LIST_TRAVERSE(list,curr) for (curr=(list)?list_get_first(list):(NULL); curr; curr=elem_get_next(list,curr))
-#define LIST_TRAVERSE_CONST(list,curr) for (curr=(list)?list_get_first_const(list):(NULL); curr; curr=elem_get_next_const(list,curr))
-
-#endif
-#endif
diff --git a/d2pack109/src/common/network.c b/d2pack109/src/common/network.c
deleted file mode 100644
index 3f7d527..0000000
--- a/d2pack109/src/common/network.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Copyright (C) 1998 Mark Baysinger (mbaysing@ucsd.edu)
- * Copyright (C) 1998,1999,2000 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#include "common/setup_before.h"
-#ifdef HAVE_STRING_H
-# include
-#else
-# ifdef HAVE_STRINGS_H
-# include
-# endif
-#endif
-#ifdef HAVE_UNISTD_H
-# include
-#endif
-#include
-#include "compat/strerror.h"
-#ifdef HAVE_SYS_TYPES_H
-# include
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-# include
-#endif
-#include "compat/socket.h"
-#include "compat/recv.h"
-#include "compat/send.h"
-#ifdef HAVE_NETINET_IN_H
-# include
-#endif
-#include "compat/netinet_in.h"
-#include "compat/psock.h"
-#include "common/packet.h"
-#include "common/eventlog.h"
-#include "common/field_sizes.h"
-#include "common/network.h"
-#include "common/setup_after.h"
-
-
-extern int net_recv_packet(int sock, t_packet * packet, unsigned int * currsize)
-{
- int addlen;
- unsigned int header_size;
- void * temp;
-
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"[%d] got NULL packet (closing connection)",sock);
- return -1;
- }
- if (!currsize)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"[%d] got NULL currsize (closing connection)",sock);
- return -1;
- }
-
- if ((header_size = packet_get_header_size(packet))>=MAX_PACKET_SIZE)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"[%d] could not determine header size (closing connection)",sock);
- return -1;
- }
-
- if (!(temp = packet_get_raw_data_build(packet,*currsize)))
- {
- eventlog(eventlog_level_error,__FUNCTION__,"[%d] could not obtain raw data pointer at offset %u (closing connection)",sock,*currsize);
- return -1;
- }
-
- if (*currsize=total_size)
- {
- eventlog(eventlog_level_warn,__FUNCTION__,"[%d] more data requested for already complete packet (total_size=%u currsize=%u) (closing connection)",sock,total_size,*currsize);
- return -1;
- }
-
- addlen = psock_recv(sock,
- temp,
- total_size-*currsize,
- 0);
- }
-
- if (addlen==0)
- {
- eventlog(eventlog_level_debug,__FUNCTION__,"[%d] remote host closed connection",sock);
- return -1;
- }
- if (addlen<0)
- {
- if (
-#ifdef PSOCK_EINTR
- psock_errno()==PSOCK_EINTR ||
-#endif
-#ifdef PSOCK_EAGAIN
- psock_errno()==PSOCK_EAGAIN ||
-#endif
-#ifdef PSOCK_EWOULDBLOCK
- psock_errno()==PSOCK_EWOULDBLOCK ||
-#endif
-#ifdef PSOCK_ENOMEM
- psock_errno()==PSOCK_ENOMEM ||
-#endif
- 0) /* try later */
- return 0;
- if (
-#ifdef PSOCK_ENOTCONN
- psock_errno()==PSOCK_ENOTCONN ||
-#endif
-#ifdef PSOCK_ECONNRESET
- psock_errno()==PSOCK_ECONNRESET ||
-#endif
- 0)
- {
-/* eventlog(eventlog_level_debug,__FUNCTION__,"[%d] remote host closed connection (psock_recv: %s)",sock,strerror(psock_errno())); */
- return -1; /* common error: close connection, but no message */
- }
- eventlog(eventlog_level_debug,__FUNCTION__,"[%d] receive error (closing connection) (psock_recv: %s)",sock,strerror(psock_errno()));
- return -1;
- }
-
- *currsize += addlen;
-
- if (*currsize>=header_size && *currsize==packet_get_size(packet))
- return 1;
-
- return 0;
-}
-
-
-extern int net_send_packet(int sock, t_packet const * packet, unsigned int * currsize)
-{
- unsigned int size;
- int addlen;
-
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"[%d] got NULL packet (closing connection)",sock);
- return -1;
- }
- if (!currsize)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"[%d] got NULL currsize (closing connection)",sock);
- return -1;
- }
-
- if ((size = packet_get_size(packet))<1)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"[%d] packet to send is empty (skipping it)",sock);
- *currsize = 0;
- return 1;
- }
-
- addlen = psock_send(sock,
- packet_get_raw_data_const(packet,*currsize),
- size-*currsize,
- 0);
-
- if (addlen<0)
- {
- if (
-#ifdef PSOCK_EINTR
- psock_errno()==PSOCK_EINTR ||
-#endif
-#ifdef PSOCK_EAGAIN
- psock_errno()==PSOCK_EAGAIN ||
-#endif
-#ifdef PSOCK_EWOULDBLOCK
- psock_errno()==PSOCK_EWOULDBLOCK ||
-#endif
-#ifdef PSOCK_ENOBUFS
- psock_errno()==PSOCK_ENOBUFS ||
-#endif
-#ifdef PSOCK_ENOMEM
- psock_errno()==PSOCK_ENOMEM ||
-#endif
- 0)
- return 0; /* try again later */
-
- if (
-#ifdef PSOCK_EPIPE
- psock_errno()!=PSOCK_EPIPE &&
-#endif
-#ifdef PSOCK_ECONNRESET
- psock_errno()!=PSOCK_ECONNRESET &&
-#endif
- 1) eventlog(eventlog_level_debug,__FUNCTION__,"[%d] could not send data (closing connection) (psock_send: %s)",sock,strerror(psock_errno()));
- return -1;
- }
-
- if (addlen==0)
- {
- eventlog(eventlog_level_debug,__FUNCTION__,"[%d] no data sent (closing connection)",sock);
- return -1;
- }
-
- *currsize += addlen;
-
- /* sent all data in this packet? */
- if (size==*currsize)
- {
- *currsize = 0;
- return 1;
- }
-
- return 0;
-}
diff --git a/d2pack109/src/common/network.h b/d2pack109/src/common/network.h
deleted file mode 100644
index 9b49c5c..0000000
--- a/d2pack109/src/common/network.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 1998 Mark Baysinger (mbaysing@ucsd.edu)
- * Copyright (C) 1998,1999 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-
-/*****/
-#ifndef JUST_NEED_TYPES
-#ifndef INCLUDED_NETWORK_PROTOS
-#define INCLUDED_NETWORK_PROTOS
-
-#define JUST_NEED_TYPES
-#include "common/packet.h"
-#undef JUST_NEED_TYPES
-
-extern int net_recv_packet(int sock, t_packet * packet, unsigned int * currsize);
-extern int net_send_packet(int sock, t_packet const * packet, unsigned int * currsize);
-
-#endif
-#endif
diff --git a/d2pack109/src/common/packet.c b/d2pack109/src/common/packet.c
deleted file mode 100644
index 4283332..0000000
--- a/d2pack109/src/common/packet.c
+++ /dev/null
@@ -1,787 +0,0 @@
-/*
- * Copyright (C) 1998,1999,2000 Ross Combs (rocombs@cs.nmsu.edu)
- * Copyright (C) 1999,2000,2001 Marco Ziech (mmz@gmx.net)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#include "common/setup_before.h"
-#ifdef HAVE_STDDEF_H
-# include
-#else
-# ifndef NULL
-# define NULL ((void *)0)
-# endif
-#endif
-#ifdef STDC_HEADERS
-# include
-#else
-# ifdef HAVE_MALLOC_H
-# include
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# include
-#else
-# ifdef HAVE_STRINGS_H
-# include
-# endif
-#endif
-#ifdef HAVE_MEMORY_H
-# include
-#endif
-#include "compat/memcpy.h"
-#include "common/eventlog.h"
-#include "common/bn_type.h"
-#include "common/field_sizes.h"
-#include "common/xalloc.h"
-#include "common/packet.h"
-#include "common/setup_after.h"
-
-
-extern t_packet * packet_create(t_packet_class class)
-{
- t_packet * temp;
-
- if (class!=packet_class_init &&
- class!=packet_class_raw &&
- class!=packet_class_d2game &&
- class!=packet_class_d2cs &&
- class!=packet_class_d2gs &&
- class!=packet_class_d2cs_bnetd)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"invalid packet class %d",(int)class);
- return NULL;
- }
-
- temp = xmalloc(sizeof(t_packet));
- temp->ref = 1;
- temp->class = class;
- temp->flags = 0;
- packet_set_size(temp,0);
-
- return temp;
-}
-
-
-extern void packet_destroy(t_packet const * packet)
-{
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return;
- }
-
- xfree((void *)packet); /* avoid warning */
-}
-
-
-extern t_packet * packet_add_ref(t_packet * packet)
-{
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return NULL;
- }
-
- packet->ref++;
- return packet;
-}
-
-
-extern void packet_del_ref(t_packet * packet)
-{
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return;
- }
-
- if (packet->ref<2) /* if would go to zero */
- packet_destroy(packet);
- else
- packet->ref--;
-}
-
-
-extern t_packet_class packet_get_class(t_packet const * packet)
-{
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return packet_class_none;
- }
-
- switch (packet->class)
- {
- case packet_class_init:
- return packet_class_init;
- case packet_class_raw:
- return packet_class_raw;
- case packet_class_d2game:
- return packet_class_d2game;
- case packet_class_d2cs:
- return packet_class_d2cs;
- case packet_class_d2gs:
- return packet_class_d2gs;
- case packet_class_d2cs_bnetd:
- return packet_class_d2cs_bnetd;
- case packet_class_none:
- return packet_class_none;
- default:
- eventlog(eventlog_level_error,__FUNCTION__,"packet has invalid class %d",(int)packet->class);
- return packet_class_none;
- }
-}
-
-
-extern char const * packet_get_class_str(t_packet const * packet)
-{
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return "unknown";
- }
-
- switch (packet->class)
- {
- case packet_class_init:
- return "init";
- case packet_class_raw:
- return "raw";
- case packet_class_d2game:
- return "d2game";
- case packet_class_d2gs:
- return "d2gs";
- case packet_class_d2cs_bnetd:
- return "d2cs_bnetd";
- case packet_class_d2cs:
- return "d2cs";
- case packet_class_none:
- return "none";
- default:
- eventlog(eventlog_level_error,__FUNCTION__,"packet has invalid class %d",(int)packet->class);
- return "unknown";
- }
-}
-
-
-extern int packet_set_class(t_packet * packet, t_packet_class class)
-{
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return -1;
- }
- if (packet->class!=packet_class_raw)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got non-raw packet");
- return -1;
- }
- if (class!=packet_class_init &&
- class!=packet_class_raw &&
- class!=packet_class_d2game &&
- class!=packet_class_d2cs &&
- class!=packet_class_d2gs &&
- class!=packet_class_d2cs_bnetd)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"invalid packet class %d",(int)class);
- return -1;
- }
-
- packet->class = class;
- return 0;
-}
-
-
-extern unsigned int packet_get_type(t_packet const * packet)
-{
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return 0;
- }
-
- switch (packet->class)
- {
- case packet_class_init:
- return CLIENT_INITCONN; /* all init packets are of this type */
-
- case packet_class_raw:
- return 0; /* raw packets don't have a type, but don't warn because the packet dump tries anyway */
-
- case packet_class_d2game:
- if (packet_get_size(packet)u.d2game.h.type);
-
- case packet_class_d2gs:
- if (packet_get_size(packet)u.d2cs_d2gs.h.type);
- case packet_class_d2cs_bnetd:
- if (packet_get_size(packet)u.d2cs_d2gs.h.type);
-
- case packet_class_d2cs:
- if (packet_get_size(packet)u.d2cs_client.h.type);
-
- default:
- eventlog(eventlog_level_error,__FUNCTION__,"packet has invalid class %d",(int)packet->class);
- return 0;
- }
-}
-
-
-extern char const * packet_get_type_str(t_packet const * packet, t_packet_dir dir)
-{
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return "unknown";
- }
-
- switch (dir)
- {
- case packet_dir_from_client:
- switch (packet->class)
- {
- case packet_class_init:
- return "CLIENT_INITCONN";
- case packet_class_raw:
- return "CLIENT_RAW";
-
- case packet_class_d2game:
- if (packet_get_size(packet)u.d2game.h.type))
- {
- default:
- return "CLIENT_D2GAME";
- }
- return "unknown";
-
- case packet_class_d2cs:
- return "D2CS";
- case packet_class_d2gs:
- return "D2GS";
- case packet_class_d2cs_bnetd:
- return "D2CS_BNETD";
-
- case packet_class_none:
- return "unknown";
- }
-
- eventlog(eventlog_level_error,__FUNCTION__,"packet has invalid class %d",(int)packet->class);
- return "unknown";
-
- case packet_dir_from_server:
- switch (packet->class)
- {
- case packet_class_init:
- return "unknown";
- case packet_class_raw:
- return "SERVER_RAW";
-
- case packet_class_d2game:
- if (packet_get_size(packet)u.d2game.h.type))
- {
- default:
- return "SERVER_D2GAME";
- }
- return "unknown";
-
- case packet_class_d2cs:
- return "D2CS";
- case packet_class_d2gs:
- return "D2GS";
- case packet_class_d2cs_bnetd:
- return "D2CS_BNETD";
-
- case packet_class_none:
- return "unknown";
- }
-
- eventlog(eventlog_level_error,__FUNCTION__,"packet has invalid class %d",(int)packet->class);
- return "unknown";
- }
-
- eventlog(eventlog_level_error,__FUNCTION__,"got unknown direction %d",(int)dir);
- return "unknown";
-}
-
-
-extern int packet_set_type(t_packet * packet, unsigned int type)
-{
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return -1;
- }
-
- switch (packet->class)
- {
- case packet_class_init:
- if (type!=CLIENT_INITCONN)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"init packet type 0x%08x is not valid",type);
- return -1;
- }
- return 0;
-
- case packet_class_d2game:
- if (packet_get_size(packet)u.d2game.h.type,type);
- return 0;
-
- case packet_class_d2gs:
- if (packet_get_size(packet)u.d2cs_d2gs.h.type,type);
- return 0;
-
- case packet_class_d2cs_bnetd:
- if (packet_get_size(packet)u.d2cs_bnetd.h.type,type);
- return 0;
-
- case packet_class_d2cs:
- if (packet_get_size(packet)u.d2cs_client.h.type,type);
- return 0;
-
- case packet_class_raw:
- eventlog(eventlog_level_error,__FUNCTION__,"can not set packet type for raw packet");
- return 0;
-
- default:
- eventlog(eventlog_level_error,__FUNCTION__,"packet has invalid class %d",(int)packet->class);
- return -1;
- }
-}
-
-
-/* size of the _complete_ packet, not the amount currently received or sent */
-extern unsigned int packet_get_size(t_packet const * packet)
-{
- unsigned int size;
-
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return 0;
- }
-
- switch (packet->class)
- {
- case packet_class_init:
- size = sizeof(t_client_initconn);
- break;
- case packet_class_raw:
- size = packet->len;
- break;
- case packet_class_d2game:
- size = packet->len; /* FIXME: does header not contain the size? */
- break;
- case packet_class_d2gs:
- size = (unsigned int)bn_short_get(packet->u.d2cs_d2gs.h.size);
- break;
- case packet_class_d2cs_bnetd:
- size = (unsigned int)bn_short_get(packet->u.d2cs_bnetd.h.size);
- break;
- case packet_class_d2cs:
- size = (unsigned int)bn_short_get(packet->u.d2cs_client.h.size);
- break;
- default:
- eventlog(eventlog_level_error,__FUNCTION__,"packet has invalid class %d",(int)packet->class);
- return 0;
- }
-
- if (size>MAX_PACKET_SIZE)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"packet has bad size %u",size);
- return 0;
- }
- return size;
-}
-
-
-extern int packet_set_size(t_packet * packet, unsigned int size)
-{
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return -1;
- }
- if (size>MAX_PACKET_SIZE)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got bad size %u",size);
- return -1;
- }
-
- switch (packet->class)
- {
- case packet_class_init:
- if (size!=0 && size!=sizeof(t_client_initconn))
- {
- eventlog(eventlog_level_error,__FUNCTION__,"invalid size %u for init packet",size);
- return -1;
- }
- packet->len = size;
- return 0;
- case packet_class_raw:
- packet->len = size;
- return 0;
- case packet_class_d2game:
- packet->len = size; /* FIXME: does header not contain the size? */
- return 0;
- case packet_class_d2cs:
- bn_short_set(&packet->u.d2cs_client.h.size,size);
- return 0;
- case packet_class_d2gs:
- bn_short_set(&packet->u.d2cs_d2gs.h.size,size);
- return 0;
- case packet_class_d2cs_bnetd:
- bn_short_set(&packet->u.d2cs_bnetd.h.size,size);
- return 0;
- default:
- eventlog(eventlog_level_error,__FUNCTION__,"packet has invalid class %d",(int)packet->class);
- return -1;
- }
-}
-
-
-extern unsigned int packet_get_header_size(t_packet const * packet)
-{
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return MAX_PACKET_SIZE;
- }
-
- switch (packet_get_class(packet))
- {
- case packet_class_init:
- return 0;
- case packet_class_raw:
- return 0;
- case packet_class_d2game:
- return 0; /* FIXME: is there no game packet header? */
- case packet_class_d2cs:
- return sizeof(t_d2cs_client_header);
- case packet_class_d2gs:
- return sizeof(t_d2cs_d2gs_header);
- case packet_class_d2cs_bnetd:
- return sizeof(t_d2cs_bnetd_header);
- default:
- eventlog(eventlog_level_error,__FUNCTION__,"packet has bad class %d",(int)packet_get_class(packet));
- return MAX_PACKET_SIZE;
- }
-}
-
-
-extern unsigned int packet_get_flags(t_packet const * packet)
-{
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return 0;
- }
-
- return packet->flags;
-}
-
-
-extern int packet_set_flags(t_packet * packet, unsigned int flags)
-{
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return -1;
- }
-
- packet->flags = flags;
- return 0;
-}
-
-
-extern int packet_append_string(t_packet * packet, char const * str)
-{
- unsigned int len;
- unsigned short addlen;
- unsigned short size;
-
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return -1;
- }
- if (!str)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL string");
- return -1;
- }
-
- len = strlen(str)+1;
- size = packet_get_size(packet);
- if (size>=MAX_PACKET_SIZE)
- return -1;
-
- if (MAX_PACKET_SIZE-(unsigned int)size>len)
- addlen = len;
- else
- addlen = MAX_PACKET_SIZE-size;
- if (addlen<1)
- return -1;
-
- memcpy(packet->u.data+size,str,addlen-1);
- packet->u.data[size+addlen-1] = '\0';
- packet_set_size(packet,size+addlen);
-
- return (int)addlen;
-}
-
-
-extern int packet_append_ntstring(t_packet * packet, char const * str)
-{
- unsigned int len;
- unsigned short addlen;
- unsigned short size;
-
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return -1;
- }
- if (!str)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL string");
- return -1;
- }
-
- len = strlen(str);
- size = packet_get_size(packet);
- if (size>=MAX_PACKET_SIZE)
- return -1;
-
- if (MAX_PACKET_SIZE-(unsigned int)size>len)
- addlen = len;
- else
- addlen = MAX_PACKET_SIZE-size;
- if (addlen<1)
- return -1;
-
- memcpy(packet->u.data+size,str,addlen);
- packet_set_size(packet,size+addlen);
-
- return (int)addlen;
-}
-
-
-extern int packet_append_data(t_packet * packet, void const * data, unsigned int len)
-{
- unsigned short addlen;
- unsigned short size;
-
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return -1;
- }
- if (!data)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL data");
- return -1;
- }
-
- size = packet_get_size(packet);
- if (size>=MAX_PACKET_SIZE)
- return -1;
-
- if (MAX_PACKET_SIZE-(unsigned int)size>len)
- addlen = len;
- else
- addlen = MAX_PACKET_SIZE-size;
- if (addlen<1)
- return -1;
-
- memcpy(packet->u.data+size,data,addlen);
- packet_set_size(packet,size+addlen);
-
- return (int)addlen;
-}
-
-
-extern void const * packet_get_raw_data_const(t_packet const * packet, unsigned int offset)
-{
- unsigned int size;
-
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return NULL;
- }
- size = (unsigned int)packet_get_size(packet);
- if (offset>=size || offset>=MAX_PACKET_SIZE)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got bad offset %u for packet size %u",offset,size);
- return NULL;
- }
-
- return packet->u.data+offset;
-}
-
-
-extern void * packet_get_raw_data(t_packet * packet, unsigned int offset)
-{
- unsigned int size;
-
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return NULL;
- }
- size = (unsigned int)packet_get_size(packet);
- if (offset>=size || offset>=MAX_PACKET_SIZE)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got bad offset %u for packet size %u",offset,size);
- return NULL;
- }
-
- return packet->u.data+offset;
-}
-
-
-extern void * packet_get_raw_data_build(t_packet * packet, unsigned int offset)
-{
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return NULL;
- }
-
- if (offset>=MAX_PACKET_SIZE)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got bad offset %u for packet",offset);
- return NULL;
- }
-
- return packet->u.data+offset;
-}
-
-
-/* maxlen includes room for NUL char */
-extern char const * packet_get_str_const(t_packet const * packet, unsigned int offset, unsigned int maxlen)
-{
- unsigned int size;
- unsigned int pos;
-
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return NULL;
- }
- size = (unsigned int)packet_get_size(packet);
- if (offset>=size)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got bad offset %u for packet size %u",offset,size);
- return NULL;
- }
-
- for (pos=offset; packet->u.data[pos]!='\0'; pos++)
- if (pos>=size || pos-offset>=maxlen)
- return NULL;
- if (pos>=size || pos-offset>=maxlen) /* NUL must be inside too */
- return NULL;
- return packet->u.data+offset;
-}
-
-
-extern void const * packet_get_data_const(t_packet const * packet, unsigned int offset, unsigned int len)
-{
- unsigned int size;
-
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return NULL;
- }
- if (len<1)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got zero length");
- return NULL;
- }
- size = (unsigned int)packet_get_size(packet);
- if (offset+len>size)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got bad offset %u and length %u for packet size %u",offset,len,size);
- return NULL;
- }
-
- return packet->u.data+offset;
-}
-
-
-extern t_packet * packet_duplicate(t_packet const * src)
-{
- t_packet * p;
-
- if (!(p = packet_create(packet_get_class(src))))
- {
- eventlog(eventlog_level_error,__FUNCTION__,"could not create packet");
- return NULL;
- }
- packet_append_data(p,src->u.data,packet_get_size(src));
- packet_set_flags(p,packet_get_flags(src));
-
- return p;
-}
-
diff --git a/d2pack109/src/common/packet.h b/d2pack109/src/common/packet.h
deleted file mode 100644
index 5e31a3d..0000000
--- a/d2pack109/src/common/packet.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (C) 1998 Mark Baysinger (mbaysng@ucsd.edu)
- * Copyright (C) 1998,1999,2000 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef INCLUDED_PACKET_TYPES
-#define INCLUDED_PACKET_TYPES
-
-#ifdef JUST_NEED_TYPES
-# include "common/field_sizes.h"
-# include "common/init_protocol.h"
-# include "common/d2game_protocol.h"
-# include "d2cs/d2cs_protocol.h"
-# include "d2cs/d2cs_d2gs_protocol.h"
-# include "d2cs/d2cs_bnetd_protocol.h"
-#else
-# define JUST_NEED_TYPES
-# include "common/field_sizes.h"
-# include "common/init_protocol.h"
-# include "common/d2game_protocol.h"
-# include "d2cs/d2cs_protocol.h"
-# include "d2cs/d2cs_d2gs_protocol.h"
-# include "d2cs/d2cs_bnetd_protocol.h"
-# undef JUST_NEED_TYPES
-#endif
-
-typedef enum
-{
- packet_class_none,
- packet_class_init,
- packet_class_raw,
- packet_class_d2game,
- packet_class_d2gs,
- packet_class_d2cs,
- packet_class_d2cs_bnetd
-} t_packet_class;
-
-
-typedef enum
-{
- packet_dir_from_client,
- packet_dir_from_server
-} t_packet_dir;
-
-
-/* These aren't really packets so much as records in a TCP stream. They are variable-
- * length structures which make up the Battle.net protocol. It is just easier to call
- * them "packets".
- */
-typedef struct
-{
- unsigned int ref; /* reference count */
- t_packet_class class;
- unsigned int flags; /* user-defined flags (used to mark UDP in bnproxy) */
- unsigned int len; /* raw packets have no header, so we use this */
-
- /* next part looks just like it would on the network (no padding, byte for byte) */
- union
- {
- char data[MAX_PACKET_SIZE];
-
- t_d2game_generic d2game;
-
- t_client_initconn client_initconn;
-
- t_d2cs_bnetd_generic d2cs_bnetd;
- t_bnetd_d2cs_authreq bnetd_d2cs_authreq;
- t_d2cs_bnetd_authreply d2cs_bnetd_authreply;
- t_bnetd_d2cs_authreply bnetd_d2cs_authreply;
- t_d2cs_bnetd_accountloginreq d2cs_bnetd_accountloginreq;
- t_bnetd_d2cs_accountloginreply bnetd_d2cs_accountloginreply;
- t_d2cs_bnetd_charloginreq d2cs_bnetd_charloginreq;
- t_bnetd_d2cs_charloginreply bnetd_d2cs_charloginreply;
- t_bnetd_d2cs_gameinforeq bnetd_d2cs_gameinforeq;
- t_d2cs_bnetd_gameinforeply d2cs_bnetd_gameinforeply;
-
- t_d2cs_d2gs_generic d2cs_d2gs;
- t_d2cs_d2gs_authreq d2cs_d2gs_authreq;
- t_d2gs_d2cs_authreply d2gs_d2cs_authreply;
- t_d2cs_d2gs_authreply d2cs_d2gs_authreply;
- t_d2cs_d2gs_setgsinfo d2cs_d2gs_setgsinfo;
- t_d2gs_d2cs_setgsinfo d2gs_d2cs_setgsinfo;
- t_d2cs_d2gs_creategamereq d2cs_d2gs_creategamereq;
- t_d2gs_d2cs_creategamereply d2gs_d2cs_creategamereply;
- t_d2cs_d2gs_joingamereq d2cs_d2gs_joingamereq;
- t_d2gs_d2cs_joingamereply d2gs_d2cs_joingamereply;
- t_d2gs_d2cs_updategameinfo d2gs_d2cs_updategameinfo;
- t_d2gs_d2cs_closegame d2gs_d2cs_closegame;
- t_d2cs_d2gs_echoreq d2cs_d2gs_echoreq;
- t_d2gs_d2cs_echoreply d2gs_d2cs_echoreply;
- t_d2cs_d2gs_control d2cs_d2gs_control;
-
- t_d2cs_client_generic d2cs_client;
- t_client_d2cs_loginreq client_d2cs_loginreq;
- t_d2cs_client_loginreply d2cs_client_loginreply;
- t_client_d2cs_createcharreq client_d2cs_createcharreq;
- t_d2cs_client_createcharreply d2cs_client_createcharreply;
- t_client_d2cs_creategamereq client_d2cs_creategamereq;
- t_d2cs_client_creategamereply d2cs_client_creategamereply;
- t_client_d2cs_joingamereq client_d2cs_joingamereq;
- t_d2cs_client_joingamereply d2cs_client_joingamereply;
- t_client_d2cs_gamelistreq client_d2cs_gamelistreq;
- t_d2cs_client_gamelistreply d2cs_client_gamelistreply;
- t_client_d2cs_gameinforeq client_d2cs_gameinforeq;
- t_d2cs_client_gameinforeply d2cs_client_gameinforeply;
- t_client_d2cs_charloginreq client_d2cs_charloginreq;
- t_d2cs_client_charloginreply d2cs_client_charloginreply;
- t_client_d2cs_deletecharreq client_d2cs_deletecharreq;
- t_d2cs_client_deletecharreply d2cs_client_deletecharreply;
- t_client_d2cs_ladderreq client_d2cs_ladderreq;
- t_d2cs_client_ladderreply d2cs_client_ladderreply;
- t_client_d2cs_motdreq client_d2cs_motdreq;
- t_d2cs_client_motdreply d2cs_client_motdreply;
- t_client_d2cs_cancelcreategame client_d2cs_cancelcreategame;
- t_d2cs_client_creategamewait d2cs_client_creategamewait;
- t_client_d2cs_charladderreq client_d2cs_charladderreq;
- t_client_d2cs_charlistreq client_d2cs_charlistreq;
- t_d2cs_client_charlistreply d2cs_client_charlistreply;
- t_client_d2cs_convertcharreq client_d2cs_convertcharreq;
- t_d2cs_client_convertcharreply d2cs_client_convertcharreply;
- } u;
-} t_packet;
-
-#endif
-
-/*****/
-#ifndef JUST_NEED_TYPES
-#ifndef INCLUDED_PACKET_PROTOS
-#define INCLUDED_PACKET_PROTOS
-
-extern t_packet * packet_create(t_packet_class class) ;
-extern void packet_destroy(t_packet const * packet);
-extern t_packet * packet_add_ref(t_packet * packet);
-extern void packet_del_ref(t_packet * packet);
-extern t_packet_class packet_get_class(t_packet const * packet);
-extern char const * packet_get_class_str(t_packet const * packet);
-extern int packet_set_class(t_packet * packet, t_packet_class class);
-extern unsigned int packet_get_type(t_packet const * packet);
-extern char const * packet_get_type_str(t_packet const * packet, t_packet_dir dir);
-extern int packet_set_type(t_packet * packet, unsigned int type);
-extern unsigned int packet_get_size(t_packet const * packet);
-extern int packet_set_size(t_packet * packet, unsigned int size);
-extern unsigned int packet_get_header_size(t_packet const * packet);
-extern unsigned int packet_get_flags(t_packet const * packet);
-extern int packet_set_flags(t_packet * packet, unsigned int flags);
-extern int packet_append_string(t_packet * packet, char const * str);
-extern int packet_append_ntstring(t_packet * packet, char const * str);
-extern int packet_append_data(t_packet * packet, void const * data, unsigned int len);
-extern void const * packet_get_raw_data_const(t_packet const * packet, unsigned int offset);
-extern void * packet_get_raw_data(t_packet * packet, unsigned int offset);
-extern void * packet_get_raw_data_build(t_packet * packet, unsigned int offset);
-extern char const * packet_get_str_const(t_packet const * packet, unsigned int offset, unsigned int maxlen);
-extern void const * packet_get_data_const(t_packet const * packet, unsigned int offset, unsigned int len);
-extern t_packet * packet_duplicate(t_packet const * src);
-
-#endif
-#endif
diff --git a/d2pack109/src/common/queue.c b/d2pack109/src/common/queue.c
deleted file mode 100644
index 291f4ba..0000000
--- a/d2pack109/src/common/queue.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright (C) 1998,1999,2001 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#define QUEUE_INTERNAL_ACCESS
-#include "common/setup_before.h"
-#ifdef HAVE_STDDEF_H
-# include
-#else
-# ifndef NULL
-# define NULL ((void *)0)
-# endif
-#endif
-#ifdef STDC_HEADERS
-# include
-#else
-# ifdef HAVE_MALLOC_H
-# include
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# include
-#else
-# ifdef HAVE_STRINGS_H
-# include
-# endif
-# ifdef HAVE_MEMORY_H
-# include
-# endif
-#endif
-#include "common/packet.h"
-#include "common/eventlog.h"
-#include "common/xalloc.h"
-#include "common/queue.h"
-#include "common/setup_after.h"
-
-#define QUEUE_QUANTUM 10 /* allocate ring buffer slots for 10 packets at once */
-
-extern t_packet * queue_pull_packet(t_queue * * queue)
-{
- t_queue * temp;
- t_packet * packet;
-
-// eventlog(eventlog_level_debug, __FUNCTION__, "entered: queue %p", queue);
- if (!queue)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL queue pointer");
- return NULL;
- }
-
- temp = *queue;
-
- if (!temp || !temp->ulen)
- return NULL;
-
-// eventlog(eventlog_level_debug, __FUNCTION__, "getting element from tail (%d/%d head/tail %d/%d)", temp->alen, temp->ulen, temp->head, temp->tail);
- /* getting entry from tail and updating queue */
- packet = temp->ring[temp->tail];
- temp->tail = (temp->tail + 1) % temp->alen;
- temp->ulen--;
-// eventlog(eventlog_level_debug, __FUNCTION__, "read %p element from tail (%d/%d head/tail %d/%d)", packet, temp->alen, temp->ulen, temp->head, temp->tail);
-
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"NULL packet in queue");
- return NULL;
- }
-
- return packet;
-}
-
-
-extern t_packet * queue_peek_packet(t_queue const * const * queue)
-{
- t_packet * packet;
-
-// eventlog(eventlog_level_debug, __FUNCTION__, "entered: queue %p", queue);
- if (!queue)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL queue pointer");
- return NULL;
- }
- if (!*queue || !(*queue)->ulen)
- return NULL;
-
- packet = (*queue)->ring[(*queue)->tail];
-
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"NULL packet in queue");
- return NULL;
- }
-
- return packet;
-}
-
-
-extern void queue_push_packet(t_queue * * queue, t_packet * packet)
-{
- t_queue * temp;
- void *ptr;
-
-// eventlog(eventlog_level_debug, __FUNCTION__, "entered: queue %p packet %p", queue, packet);
- if (!queue)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL queue pointer");
- return;
- }
- if (!packet)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet");
- return;
- }
-
- temp = *queue;
-
- if (!temp)
- {
-// eventlog(eventlog_level_debug, __FUNCTION__, "queue is NULL , initilizing");
- temp = xmalloc(sizeof(t_queue));
- temp->alen = temp->ulen = 0;
- temp->ring = NULL;
- temp->head = temp->tail = 0;
- *queue = temp;
- }
-
- if (temp->ulen == temp->alen) { /* ring queue is full, need to allocate some memory */
-/* FIXME: find a solution
- if (temp->alen)
- eventlog(eventlog_level_error, __FUNCTION__, "queue is full (resizing) (oldsize: %u)", temp->alen);
-*/
-
- ptr = xrealloc(temp->ring, sizeof(t_packet *) * (temp->alen + QUEUE_QUANTUM));
- temp->ring = (t_packet **)ptr;
- temp->alen += QUEUE_QUANTUM;
-
-// eventlog(eventlog_level_debug, __FUNCTION__, "queue new size %d/%d head/tail %d/%d", temp->alen, temp->ulen, temp->head, temp->tail);
- if (temp->head) {
- unsigned moved;
-
- moved = (QUEUE_QUANTUM <= temp->head) ? QUEUE_QUANTUM : temp->head;
- memmove(temp->ring + temp->ulen, temp->ring, sizeof(t_packet *) * moved);
- if (temp->head > QUEUE_QUANTUM) {
- memmove(temp->ring, temp->ring + moved, sizeof(t_packet *) * (temp->head - moved));
- temp->head -= moved;
- } else if (temp->head < QUEUE_QUANTUM)
- temp->head = temp->ulen + moved;
- else temp->head = 0;
- } else temp->head = temp->ulen;
-
- }
-
- temp->ring[temp->head] = packet_add_ref(packet);
-
- temp->head = (temp->head + 1) % temp->alen;
- temp->ulen++;
-// eventlog(eventlog_level_debug, __FUNCTION__, "packet added (%d/%d head/tail %d/%d)", temp->alen, temp->ulen, temp->head, temp->tail);
-}
-
-
-extern int queue_get_length(t_queue const * const * queue)
-{
-// eventlog(eventlog_level_debug, __FUNCTION__, "entered: queue %p", queue);
- if (!queue)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL queue pointer");
- return 0;
- }
-
- if (*queue == NULL) return 0;
-
- return (*queue)->ulen;
-}
-
-
-extern void queue_clear(t_queue * * queue)
-{
- t_packet * temp;
-
-// eventlog(eventlog_level_debug, __FUNCTION__, "entered: queue %p", queue);
- if (!queue)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL queue pointer");
- return;
- }
-
- if (*queue) {
- while ((temp = queue_pull_packet(queue)))
- packet_del_ref(temp);
-
- if ((*queue)->ring) xfree((void*)((*queue)->ring));
- xfree((void*)(*queue));
- }
-}
diff --git a/d2pack109/src/common/queue.h b/d2pack109/src/common/queue.h
deleted file mode 100644
index 0f8a460..0000000
--- a/d2pack109/src/common/queue.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 1998,1999 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef INCLUDED_QUEUE_TYPES
-#define INCLUDED_QUEUE_TYPES
-
-#ifdef QUEUE_INTERNAL_ACCESS
-#ifdef JUST_NEED_TYPES
-# include "common/packet.h"
-#else
-# define JUST_NEED_TYPES
-# include "common/packet.h"
-# undef JUST_NEED_TYPES
-#endif
-#endif
-
-typedef struct queue
-#ifdef QUEUE_INTERNAL_ACCESS
-{
- unsigned ulen, alen;
- t_packet ** ring;
- unsigned head, tail;
-}
-#endif
-t_queue;
-
-#endif
-
-
-/*****/
-#ifndef JUST_NEED_TYPES
-#ifndef INCLUDED_QUEUE_PROTOS
-#define INCLUDED_QUEUE_PROTOS
-
-#define JUST_NEED_TYPES
-#include "common/packet.h"
-#undef JUST_NEED_TYPES
-
-extern t_packet * queue_pull_packet(t_queue * * queue);
-extern t_packet * queue_peek_packet(t_queue const * const * queue);
-extern void queue_push_packet(t_queue * * queue, t_packet * packet);
-extern int queue_get_length(t_queue const * const * queue);
-extern void queue_clear(t_queue * * queue);
-
-#endif
-#endif
diff --git a/d2pack109/src/common/rlimit.c b/d2pack109/src/common/rlimit.c
deleted file mode 100644
index 1bf64d2..0000000
--- a/d2pack109/src/common/rlimit.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include "common/setup_before.h"
-#include
-#ifdef HAVE_UNISTD_H
-# include
-#endif
-#include
-#include "compat/strerror.h"
-#ifdef TIME_WITH_SYS_TIME
-# include
-# include
-#else
-# ifdef HAVE_SYS_TIME_H
-# include
-# else
-# include
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# include
-#endif
-#ifdef HAVE_SYS_RESOURCE_H
-# include
-#endif
-#include "common/eventlog.h"
-#include "common/bn_type.h"
-#include "common/setup_after.h"
-
-
-/* file descriptor limit has different name on BSD and Linux */
-#ifdef RLIMIT_NOFILE
-# define RLIM_NUMFILES RLIMIT_NOFILE
-#else
-# ifdef RLIMIT_OFILE
-# define RLIM_NUMFILES RLIMIT_OFILE
-# endif
-#endif
-
-extern int get_socket_limit(void)
-{
- unsigned int socklimit = BNETD_MAX_SOCKETS;
-#ifdef HAVE_GETRLIMIT
- struct rlimit rlim;
- if(getrlimit(RLIM_NUMFILES, &rlim) < 0)
- eventlog(eventlog_level_error, __FUNCTION__, "getrlimit returned error: %s", strerror(errno));
- socklimit = rlim.rlim_cur;
-#else
- /* FIXME: WIN32: somehow get WSAData win32 socket limit here */
-#endif
-
-#if !(defined HAVE_POLL || defined HAVE_KQUEUE || defined HAVE_EPOLL)
- if(FD_SETSIZE < socklimit)
- socklimit = FD_SETSIZE;
-#endif
-
-
- /* make socket limit smaller than file limit to make sure log files,
- db connections and save files will still work */
- socklimit -= 64;
-
- eventlog(eventlog_level_debug, __FUNCTION__, "limit: %d", socklimit);
-
- return socklimit;
-}
diff --git a/d2pack109/src/common/rlimit.h b/d2pack109/src/common/rlimit.h
deleted file mode 100644
index 80e7427..0000000
--- a/d2pack109/src/common/rlimit.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/*****/
-
-extern int get_socket_limit(void);
diff --git a/d2pack109/src/common/setup_before.h b/d2pack109/src/common/setup_before.h
deleted file mode 100644
index d71dff4..0000000
--- a/d2pack109/src/common/setup_before.h
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * Copyright (C) 1998,1999,2000 Ross Combs (rocombs@cs.nmsu.edu)
- * Copyright (C) 1999 Rob Crittenden (rcrit@greyoak.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifdef INCLUDED_SETUP_AFTER_H
-# error "This file must be included before all other header files"
-#endif
-#ifndef INCLUDED_SETUP_BEFORE_H
-#define INCLUDED_SETUP_BEFORE_H
-
-/* get autoconf defines */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#ifdef WIN32
-#ifndef __BORLANDC__ /* Borland uses config.h.win32borland instead */
-# include "win32/configwin.h"
-#endif
-#endif
-
-/* This file contains compile-time configuration parameters including
- * debugging options, default configuration values, and format strings.
- */
-
-#include "version.h"
-
-/***************************************************************/
-/* Debugging options */
-
-/* print bad calling locations of account functions */
-#define DEBUG_ACCOUNT
-
-/* make bnchat, etc. print debug messages */
-#define CLIENTDEBUG
-
-/* make the routines call xxx_check() and notice
- xxx_purge() calls during list traversal */
-#undef LIST_DEBUG
-#undef HASHTABLE_DEBUG
-
-/* this will use GCC evensions to verify that all module arguments to
- eventlog() are correct. */
-#undef DEBUGMODSTRINGS
-/*
- After you compile, use this script:
- strings bnetd |
- egrep '@\([^@]*@@[a-z_]*\)@' |
- sed -e 's/@(\([^:]*\):\([a-z_]*\)@@\([a-z_]*\))@/\1 \2 \3/g' |
- awk '{ if ( $2 != $3 ) printf("%s: %s->%s\n",$1,$2,$3); }'
-*/
-
-/* this will test get/unget memory management in account.c */
-#undef TESTUNGET
-
-/* check ladders for impossible combinations when returning them */
-#define LADDER_DEBUG
-
-/***************************************************************/
-/* compile-time options */
-
-/* how long do we wait for the UDP test reply? */
-#define CLIENT_MAX_UDPTEST_WAIT 5
-
-/* length of listen socket queue */
-/* #define LISTEN_QUEUE SOMAXCONN */
-#define LISTEN_QUEUE 10
-
-/* the format for account numbers */
-#define UID_FORMAT "#%08u"
-#define UID_MAXLEN 8
-
-/* the format for game ids */
-#define GAMEID_FORMAT "#%06u"
-#define GAMEID_MAXLEN 8
-
-/* the format of timestamps in the logfile */
-#define EVENT_TIME_FORMAT "%b %d %H:%M:%S"
-#define EVENT_TIME_MAXLEN 32
-
-/* the format of the stat times in bnstat */
-#define STAT_TIME_FORMAT "%Y %b %d %H:%M:%S"
-#define STAT_TIME_MAXLEN 32
-
-/* the format of the file modification time in bnftp */
-#define FILE_TIME_FORMAT "%Y %b %d %H:%M:%S"
-#define FILE_TIME_MAXLEN 32
-
-/* the format of the dates in the game report and for /gameinfo */
-#define GAME_TIME_FORMAT "%a %b %d %H:%M:%S %Z"
-#define GAME_TIME_MAXLEN 32
-
-/* the format of the timestamps for the start/end of channel log files */
-#define CHANLOG_TIME_FORMAT "%Y %b %d %H:%M:%S %Z"
-#define CHANLOG_TIME_MAXLEN 32
-
-/* the format of the timestamps for lines in the channel log files */
-#define CHANLOGLINE_TIME_FORMAT "%b %d %H:%M:%S"
-#define CHANLOGLINE_TIME_MAXLEN 32
-
-/* adjustable constants */
-#define BNETD_LADDER_DEFAULT_TIME "19764578 0" /* 0:00 1 Jan 1970 GMT */
-
-/* for clients if ioctl(TIOCGWINSZ) fails and $LINES and $COLUMNS aren't set */
-#define DEF_SCREEN_WIDTH 80
-#define DEF_SCREEN_HEIGHT 24
-
-/***************************************************************/
-/* default values for bnetd.conf */
-
-/* default Boolean setup values */
-#define BNETD_CHANLOG 0
-
-/* default path configuration values */
-#ifndef BNETD_DEFAULT_CONF_FILE
-# define BNETD_DEFAULT_CONF_FILE "conf/bnetd.conf"
-#endif
-#define BNETD_FILE_DIR "files"
-#define BNETD_STORAGE_PATH ""
-#define BNETD_REPORT_DIR "reports"
-#define BNETD_LOG_FILE "logs/bnetd.log"
-#define BNETD_MOTD_FILE "conf/bnmotd.txt"
-#define BNETD_NEWS_DIR "news"
-#define BNETD_AD_FILE "conf/ad.conf"
-#define BNETD_CHANNEL_FILE "conf/channel.list"
-#define BNETD_PID_FILE "" /* this means "none" */
-#define BNETD_ACCOUNT_TMP ".bnetd_acct_temp"
-#define BNETD_IPBAN_FILE "conf/bnban"
-#define BNETD_HELP_FILE "conf/bnhelpfile"
-#define BNETD_FORTUNECMD "/usr/games/fortune"
-#define BNETD_TRANS_FILE "conf/gametrans"
-#define BNETD_CHANLOG_DIR "chanlogs"
-#define BNETD_REALM_FILE "conf/realm.list"
-#define BNETD_ISSUE_FILE "conf/bnissue.txt"
-#define BNETD_MAIL_DIR "var/bnmail"
-#define PVPGN_VERSIONCHECK "conf/versioncheck"
-#define BNETD_LADDER_DIR "var/ladders"
-#define BNETD_STATUS_DIR "var/status"
-#define BNETD_TOPIC_FILE "var/topics"
-#define BNETD_DBLAYOUT_FILE "conf/sql_DB_layout"
-
-#define BNETD_COMMAND_GROUPS_FILE "conf/command_groups.txt"
-#define BNETD_TOURNAMENT_FILE "conf/tournament.conf"
-#define BNETD_ALIASFILE "conf/bnalias.list"
-#define BNETD_W3TRANS_FILE "conf/w3trans"
-/* ADDED BY UNDYING SOULZZ 4/9/02 */
-/* default identify timeout value */
-#define W3_IDENTTIMEOUT 15 /* seconds */
-/* Added by Soar */
-/* time limit for new member as newer(whom cannot be promoted) in clan, (hrs) */
-#define CLAN_NEWER_TIME 168
-#define CLAN_MAX_MEMBERS 50
-
-/* moved from account.h */
-#define MAX_FRIENDS 20
-
-/* maximum ammount of bytes sent in a single server.c/sd_tcpoutput call */
-#define BNETD_MAX_OUTBURST 16384
-
-/* default files relative to FILE_DIR */
-#define BNETD_TOS_FILE "tos.txt"
-#define BNETD_ICON_FILE "icons.bni"
-#define BNETD_WAR3_ICON_FILE "icons-WAR3.bni"
-#define BNETD_STAR_ICON_FILE "icons_STAR.bni"
-#define BNETD_MPQ_FILE "autoupdate"
-
-/* other default configuration values */
-#define BNETD_LOG_LEVELS "warn,error"
-#define BNETD_SERV_ADDRS ":" /* this means "all" */
-#define BNETD_SERV_PORT 6112
-#define BNETD_W3ROUTE_ADDR "0.0.0.0"
-#define BNETD_W3ROUTE_PORT 6200
-#define BNETD_IRC_ADDRS "" /* this means none */
-#define BNETD_IRC_PORT 6667 /* used if port not specified */
-#define BNETD_TRACK_ADDRS "track.pvpgn.org"
-#define BNETD_TRACK_PORT 6114 /* use this port if not specified */
-#define BNETD_DEF_TEST_PORT 6112 /* default guess for UDP test port */
-#define BNETD_MIN_TEST_PORT 6112
-#define BNETD_MAX_TEST_PORT 6500
-#define BNETD_USERSYNC 300 /* s */
-#define BNETD_USERFLUSH 1000
-#define BNETD_LATENCY 10 /* s */
-#define BNETD_IRC_LATENCY 180 /* s */ /* Ping timeout for IRC connections */
-#define BNETD_DEF_NULLMSG 120 /* s */
-#define BNETD_TRACK_TIME 0
-#define BNETD_POLL_INTERVAL 20 /* 20 ms */
-#define BNETD_JIFFIES 50 /* 50 ms jiffies time quantum */
-#define BNETD_SHUTDELAY 300 /* s */
-#define BNETD_SHUTDECR 60 /* s */
-#define BNETD_DEFAULT_OWNER "PvPGN"
-#define BNETD_DEFAULT_KEY "3310541526205"
-#define BNETD_DEFAULT_HOST "localhost"
-#define BNETD_QUOTA_DOBAE 7 /* lines */
-#define BNETD_QUOTA_LINES 5 /* lines */
-#define BNETD_QUOTA_TIME 5 /* s */
-#define BNETD_QUOTA_WLINE 40 /* chars */
-#define BNETD_QUOTA_MLINE 200 /* chars */
-#define BNETD_LADDER_INIT_RAT 1000
-#define BNETD_MAIL_SUPPORT 0
-#define BNETD_MAIL_QUOTA 5
-#define BNETD_LOG_NOTICE "*** Please note this channel is logged! ***"
-#define BNETD_HASHTABLE_SIZE 61
-#define BNETD_REALM_PORT 6113 /* where D2CS listens */
-#define BNETD_TELNET_ADDRS "" /* this means none */
-#define BNETD_TELNET_PORT 23 /* used if port not specified */
-#define BNETD_EXEINFO_MATCH "exact"
-#define PVPGN_VERSION_TIMEDIV 3600 /* 1 hour */
-#define PVPGN_CACHE_MEMLIMIT 5000000 /* bytes */
-#define PVPGN_DEFAULT_SYMB "-_[]"
-
-/***************************************************************/
-/* default values for the tracking server */
-
-#define BNTRACKD_EXPIRE 600
-#define BNTRACKD_UPDATE 150
-#define BNTRACKD_GRANULARITY 5
-#define BNTRACKD_SERVER_PORT 6114
-#define BNTRACKD_PIDFILE "" /* this means "none" */
-#define BNTRACKD_OUTFILE "pvpgnlist.txt"
-#ifdef WIN32
-#define BNTRACKD_PROCESS "process.pl"
-#define BNTRACKD_LOGFILE "bntrackd.log"
-#else
-#define BNTRACKD_PROCESS "scripts/process.pl"
-#define BNTRACKD_LOGFILE "logs/bntrackd.log"
-#endif
-
-/***************************************************************/
-/* default values for W3XP anongameinfo packet */
-
-#define PVPGN_DEFAULT_URL "www.pvpgn.org"
-
-#define PVPGN_PG_1V1_DESC "Solo Games"
-#define PVPGN_AT_2V2_DESC "2 player team"
-#define PVPGN_AT_3V3_DESC "3 player team"
-#define PVPGN_AT_4V4_DESC "4 player team"
-#define PVPGN_PG_TEAM_DESC "Team Games"
-#define PVPGN_PG_FFA_DESC "Free for All Games"
-
-#define PVPGN_1V1_GT_DESC "One vs. One"
-#define PVPGN_1V1_GT_LONG "Two players fight to the death"
-
-#define PVPGN_2V2_GT_DESC "Two vs. Two"
-#define PVPGN_2V2_GT_LONG "Two teams of two vie for dominance"
-
-#define PVPGN_3V3_GT_DESC "Three vs. Three"
-#define PVPGN_3V3_GT_LONG "Two teams of three face off on the battlefield"
-
-#define PVPGN_4V4_GT_DESC "Four vs. Four"
-#define PVPGN_4V4_GT_LONG "Two teams of four head to battle"
-
-#define PVPGN_5V5_GT_DESC "Five vs. Five"
-#define PVPGN_5V5_GT_LONG "Two teams of five - who will prevail?"
-
-#define PVPGN_6V6_GT_DESC "Six vs. Six"
-#define PVPGN_6V6_GT_LONG "Two teams of six - get ready to rumble!"
-
-#define PVPGN_SFFA_GT_DESC "Small Free for All"
-#define PVPGN_SFFA_GT_LONG "Can you defeat 3-5 opponents alone?"
-
-#define PVPGN_TFFA_GT_DESC "Team Free for All"
-#define PVPGN_TFFA_GT_LONG "Can your team defeat 1-2 others?"
-
-#define PVPGN_2V2V2_GT_DESC "Two vs. Two vs. Two"
-#define PVPGN_2V2V2_GT_LONG "Three teams of two, can you handle it?"
-
-#define PVPGN_3V3V3_GT_DESC "Three vs. Three vs. Three"
-#define PVPGN_3V3V3_GT_LONG "Three teams of three battle each other "
-
-#define PVPGN_4V4V4_GT_DESC "Four vs. Four vs. Four"
-#define PVPGN_4V4V4_GT_LONG "Three teams of four - things getting crowded?"
-
-#define PVPGN_2V2V2V2_GT_DESC "Two vs. Two vs. Two vs. Two"
-#define PVPGN_2V2V2V2_GT_LONG "Four teams of two, is this a challenge?"
-
-#define PVPGN_3V3V3V3_GT_DESC "Three vs. Three vs. Three vs. Three"
-#define PVPGN_3V3V3V3_GT_LONG "Four teams of three, the ultimate challenge!"
-
-#define PVPGN_AINFO_FILE "conf/anongame_infos.conf"
-
-/* max number of players in an anongame match [Omega] */
-#define ANONGAME_MAX_GAMECOUNT 12
-
-/* max level of players*/
-#define ANONGAME_MAX_LEVEL 100
-
-/***************************************************************/
-/* platform dependent features */
-
-/* conditionally enabled features */
-
-#if defined(HAVE_SIGACTION) && defined(HAVE_SIGPROCMASK) && defined(HAVE_SIGADDSET)
-# define DO_POSIXSIG
-#endif
-
-#if defined(HAVE_FORK) && defined(HAVE_PIPE)
-# define DO_SUBPROC
-#endif
-
-#if defined(HAVE_FORK) && defined(HAVE_CHDIR) && (defined(HAVE_SETPGID) || defined(HAVE_SETPGRP))
-# define DO_DAEMONIZE
-#endif
-
-
-/* GCC attributes */
-
-/* enable format mismatch warnings from gcc */
-#if defined(__GNUC__) && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-# if __GNUC__ == 2 && __GNUC_MINOR__ < 7
-/* namespace clean versions were available starting in 2.6.4 */
-# define __format__ format
-# define __printf__ printf
-# endif
-# define PRINTF_ATTR(FMTARG,VARG) __attribute__((__format__(printf,FMTARG,VARG)))
-#else
-# define PRINTF_ATTR(FMTARG,VARG)
-#endif
-
-/* type attributes */
-
-/* set GCC machine storage mode */
-#if defined(__GNUC__) && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ > 2)
-# define MODE_ATTR(M) __attribute__((__mode__(M)))
-# define HAVE_MODE_ATTR
-#else
-# define MODE_ATTR(M)
-#endif
-
-/* avoid using padding on GCC, for other compilers you need alternate solutions */
-#if defined(__GNUC__)
-# define PACKED_ATTR() __attribute__((__packed__))
-#else
-# define PACKED_ATTR()
-#endif
-
-/* default maxim number of sockets in the fdwatch pool */
-#define BNETD_MAX_SOCKETS 1000
-
-/* Used for FDSETSIZE redefine (only on WIN32 so so far) */
-#define BNETD_MAX_SOCKVAL 8192
-
-/*
- * select() hackery... works most places, need to add autoconf checks
- * because some systems may redefine FD_SETSIZE, have it as a variable,
- * or not have the concept of such a value.
- * dizzy: this is a total hack. only WIN32 so far specifies this as beeing
- * "legal"; in UNIX in general it should be NOT because the kernel interface
- * of select will never notice your userland changes to the fd_sets
- */
-/* Win32 defaults to 64, BSD and Linux default to 1024 */
-/* FIXME: how big can this be before things break? */
-#ifdef WIN32
-# define FD_SETSIZE BNETD_MAX_SOCKVAL
-#endif
-
-#ifdef HAVE_EPOLL_CREATE
-# define HAVE_EPOLL 1
-#endif
-
-#endif
diff --git a/d2pack109/src/common/tag.c b/d2pack109/src/common/tag.c
deleted file mode 100644
index e533ebe..0000000
--- a/d2pack109/src/common/tag.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Copyright (C) 2004 Aaron
- * Copyright (C) 2004 CreepLord (creeplord@pvpgn.org)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#include "common/setup_before.h"
-#ifdef HAVE_STDDEF_H
-# include
-#else
-# ifndef NULL
-# define NULL ((void *)0)
-# endif
-#endif
-#ifdef STDC_HEADERS
-# include
-#else
-# ifdef HAVE_MALLOC_H
-# include
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# include
-#else
-# ifdef HAVE_STRINGS_H
-# include
-# endif
-#endif
-#include
-#include "errno.h"
-#include "compat/strerror.h"
-#include "common/eventlog.h"
-#include "common/tag.h"
-#include "common/setup_after.h"
-
-/* fixme: have all functions call tag_str_to_uint() */
-extern t_clienttag clienttag_str_to_uint(char const * clienttag)
-{
- if (!clienttag)
- {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL clienttag");
- return CLIENTTAG_UNKNOWN_UINT;
- }
-
- return tag_str_to_uint(clienttag);
-}
-
-/* fixme: have all fuctions call tag_uint_to_str() */
-extern char const * clienttag_uint_to_str(t_clienttag clienttag)
-{
- switch (clienttag)
- {
- case CLIENTTAG_BNCHATBOT_UINT:
- return CLIENTTAG_BNCHATBOT;
- case CLIENTTAG_STARCRAFT_UINT:
- return CLIENTTAG_STARCRAFT;
- case CLIENTTAG_BROODWARS_UINT:
- return CLIENTTAG_BROODWARS;
- case CLIENTTAG_SHAREWARE_UINT:
- return CLIENTTAG_SHAREWARE;
- case CLIENTTAG_DIABLORTL_UINT:
- return CLIENTTAG_DIABLORTL;
- case CLIENTTAG_DIABLOSHR_UINT:
- return CLIENTTAG_DIABLOSHR;
- case CLIENTTAG_WARCIIBNE_UINT:
- return CLIENTTAG_WARCIIBNE;
- case CLIENTTAG_DIABLO2DV_UINT:
- return CLIENTTAG_DIABLO2DV;
- case CLIENTTAG_STARJAPAN_UINT:
- return CLIENTTAG_STARJAPAN;
- case CLIENTTAG_DIABLO2ST_UINT:
- return CLIENTTAG_DIABLO2ST;
- case CLIENTTAG_DIABLO2XP_UINT:
- return CLIENTTAG_DIABLO2XP;
- case CLIENTTAG_WARCRAFT3_UINT:
- return CLIENTTAG_WARCRAFT3;
- case CLIENTTAG_WAR3XP_UINT:
- return CLIENTTAG_WAR3XP;
- default:
- return CLIENTTAG_UNKNOWN;
- }
-}
-
-/*****/
-/* make all letters in string upper case - used in command.c*/
-extern t_tag tag_case_str_to_uint(char const * tag_str)
-{
- unsigned int i, len;
- char temp_str[5];
-
- len = strlen(tag_str);
- if (len != 4)
- eventlog(eventlog_level_warn,__FUNCTION__,"got unusual sized clienttag '%s'",tag_str);
-
- for (i=0; i>24) );
- tag_str[1] = ((unsigned char)(tag_uint>>16)&0xff);
- tag_str[2] = ((unsigned char)(tag_uint>> 8)&0xff);
- tag_str[3] = ((unsigned char)(tag_uint )&0xff);
- tag_str[4] = '\0';
- return tag_str;
-}
-
-extern int tag_check_arch(t_tag tag_uint)
-{
- switch (tag_uint)
- {
- case ARCHTAG_WINX86_UINT:
- case ARCHTAG_MACPPC_UINT:
- case ARCHTAG_OSXPPC_UINT:
- return 1;
- default:
- return 0;
- }
-}
-
-extern int tag_check_client(t_tag tag_uint)
-{
- switch (tag_uint)
- {
- case CLIENTTAG_BNCHATBOT_UINT:
- case CLIENTTAG_STARCRAFT_UINT:
- case CLIENTTAG_BROODWARS_UINT:
- case CLIENTTAG_SHAREWARE_UINT:
- case CLIENTTAG_DIABLORTL_UINT:
- case CLIENTTAG_DIABLOSHR_UINT:
- case CLIENTTAG_WARCIIBNE_UINT:
- case CLIENTTAG_DIABLO2DV_UINT:
- case CLIENTTAG_STARJAPAN_UINT:
- case CLIENTTAG_DIABLO2ST_UINT:
- case CLIENTTAG_DIABLO2XP_UINT:
- case CLIENTTAG_WARCRAFT3_UINT:
- case CLIENTTAG_WAR3XP_UINT:
- return 1;
- default:
- return 0;
- }
-}
-
-extern int tag_check_gamelang(t_tag gamelang)
-{
- switch (gamelang)
- {
- case GAMELANG_ENGLISH_UINT: /* enUS */
- case GAMELANG_GERMAN_UINT: /* deDE */
- case GAMELANG_CZECH_UINT: /* csCZ */
- case GAMELANG_SPANISH_UINT: /* esES */
- case GAMELANG_FRENCH_UINT: /* frFR */
- case GAMELANG_ITALIAN_UINT: /* itIT */
- case GAMELANG_JAPANESE_UINT: /* jaJA */
- case GAMELANG_KOREAN_UINT: /* koKR */
- case GAMELANG_POLISH_UINT: /* plPL */
- case GAMELANG_RUSSIAN_UINT: /* ruRU */
- case GAMELANG_CHINESE_S_UINT: /* zhCN */
- case GAMELANG_CHINESE_T_UINT: /* zhTW */
- return 1;
- default:
- return 0;
- }
-}
-
-extern char const * clienttag_get_title(t_clienttag clienttag)
-{
- switch (clienttag)
- {
- case CLIENTTAG_WAR3XP_UINT:
- return "Warcraft III Frozen Throne";
- case CLIENTTAG_WARCRAFT3_UINT:
- return "Warcraft III";
- case CLIENTTAG_DIABLO2XP_UINT:
- return "Diablo II Lord of Destruction";
- case CLIENTTAG_DIABLO2DV_UINT:
- return "Diablo II";
- case CLIENTTAG_STARJAPAN_UINT:
- return "Starcraft (Japan)";
- case CLIENTTAG_WARCIIBNE_UINT:
- return "Warcraft II";
- case CLIENTTAG_DIABLOSHR_UINT:
- return "Diablo I (Shareware)";
- case CLIENTTAG_DIABLORTL_UINT:
- return "Diablo I";
- case CLIENTTAG_SHAREWARE_UINT:
- return "Starcraft (Shareware)";
- case CLIENTTAG_BROODWARS_UINT:
- return "Starcraft: BroodWars";
- case CLIENTTAG_STARCRAFT_UINT:
- return "Starcraft";
- case CLIENTTAG_BNCHATBOT_UINT:
- return "Chat";
- default:
- return "Unknown";
- }
-}
-
diff --git a/d2pack109/src/common/tag.h b/d2pack109/src/common/tag.h
deleted file mode 100644
index a0c1399..0000000
--- a/d2pack109/src/common/tag.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 1998 Mark Baysinger (mbaysing@ucsd.edu)
- * Copyright (C) 1998,1999,2000 Ross Combs (rocombs@cs.nmsu.edu)
- * Copyright (C) 2004 CreepLord (creeplord@pvpgn.org)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef INCLUDED_TAG_TYPES
-#define INCLUDED_TAG_TYPES
-
-#ifdef JUST_NEED_TYPES
-#include "compat/uint.h"
-#else
-#define JUST_NEED_TYPES
-#include "compat/uint.h"
-#undef JUST_NEED_TYPES
-#endif
-
-typedef t_uint32 t_tag;
-typedef t_tag t_archtag;
-typedef t_tag t_clienttag;
-typedef t_tag t_gamelang;
-
-#endif
-
-/*****/
-#ifndef JUST_NEED_TYPES
-#ifndef INCLUDED_TAG_PROTOS
-#define INCLUDED_TAG_PROTOS
-
-/* Software tags */
-#define CLIENTTAG_BNCHATBOT "CHAT" /* CHAT bot */
-#define CLIENTTAG_BNCHATBOT_UINT 0x43484154
-#define CLIENTTAG_STARCRAFT "STAR" /* Starcraft (original) */
-#define CLIENTTAG_STARCRAFT_UINT 0x53544152
-#define CLIENTTAG_BROODWARS "SEXP" /* Starcraft EXpansion Pack */
-#define CLIENTTAG_BROODWARS_UINT 0x53455850
-#define CLIENTTAG_SHAREWARE "SSHR" /* Starcraft Shareware */
-#define CLIENTTAG_SHAREWARE_UINT 0x53534852
-#define CLIENTTAG_DIABLORTL "DRTL" /* Diablo ReTaiL */
-#define CLIENTTAG_DIABLORTL_UINT 0x4452544C
-#define CLIENTTAG_DIABLOSHR "DSHR" /* Diablo SHaReware */
-#define CLIENTTAG_DIABLOSHR_UINT 0x44534852
-#define CLIENTTAG_WARCIIBNE "W2BN" /* WarCraft II Battle.net Edition */
-#define CLIENTTAG_WARCIIBNE_UINT 0x5732424E
-#define CLIENTTAG_DIABLO2DV "D2DV" /* Diablo II Diablo's Victory */
-#define CLIENTTAG_DIABLO2DV_UINT 0x44324456
-#define CLIENTTAG_STARJAPAN "JSTR" /* Starcraft (Japan) */
-#define CLIENTTAG_STARJAPAN_UINT 0x4A535452
-#define CLIENTTAG_DIABLO2ST "D2ST" /* Diablo II Stress Test */
-#define CLIENTTAG_DIABLO2ST_UINT 0x44325354
-#define CLIENTTAG_DIABLO2XP "D2XP" /* Diablo II Extension Pack */
-#define CLIENTTAG_DIABLO2XP_UINT 0x44325850
-/* FIXME: according to FSGS:
- SJPN==Starcraft (Japanese)
- SSJP==Starcraft (Japanese,Spawn)
-*/
-#define CLIENTTAG_WARCRAFT3 "WAR3" /* WarCraft III */
-#define CLIENTTAG_WARCRAFT3_UINT 0x57415233
-#define CLIENTTAG_WAR3XP "W3XP" /* WarCraft III Expansion */
-#define CLIENTTAG_WAR3XP_UINT 0x57335850
-
-/* BNETD-specific software tags - we try to use lowercase to avoid collisions */
-#define CLIENTTAG_FREECRAFT "free" /* FreeCraft http://www.freecraft.com/ */
-
-#define CLIENTTAG_UNKNOWN "UNKN"
-#define CLIENTTAG_UNKNOWN_UINT 0x554E4B4E
-
-/* Architecture tags */
-#define ARCHTAG_WINX86 "IX86" /* MS Windows on Intel x86 */
-#define ARCHTAG_MACPPC "PMAC" /* MacOS on PowerPC */
-#define ARCHTAG_OSXPPC "XMAC" /* MacOS X on PowerPC */
-
-#define ARCHTAG_WINX86_UINT 0x49583836 /* IX86 */
-#define ARCHTAG_MACPPC_UINT 0x504D4143 /* PMAC */
-#define ARCHTAG_OSXPPC_UINT 0x584D4143 /* XMAC */
-
-/* game languages */
-#define GAMELANG_ENGLISH_UINT 0x656E5553 /* enUS */
-#define GAMELANG_GERMAN_UINT 0x64654445 /* deDE */
-#define GAMELANG_CZECH_UINT 0x6373435A /* csCZ */
-#define GAMELANG_SPANISH_UINT 0x65734553 /* esES */
-#define GAMELANG_FRENCH_UINT 0x66724652 /* frFR */
-#define GAMELANG_ITALIAN_UINT 0x69744954 /* itIT */
-#define GAMELANG_JAPANESE_UINT 0x6A614A41 /* jaJA */
-#define GAMELANG_KOREAN_UINT 0x6B6F4B52 /* koKR */
-#define GAMELANG_POLISH_UINT 0x706C504C /* plPL */
-#define GAMELANG_RUSSIAN_UINT 0x72755255 /* ruRU */
-#define GAMELANG_CHINESE_S_UINT 0x7A68434E /* zhCN */
-#define GAMELANG_CHINESE_T_UINT 0x7A685457 /* zhTW */
-
-#define TAG_UNKNOWN_UINT 0x554E4B4E /* UNKN */
-#define TAG_UNKNOWN "UNKN"
-
-/* Server tag */
-#define BNETTAG "bnet" /* Battle.net */
-
-/* Filetype tags (note these are "backwards") */
-#define EXTENSIONTAG_PCX "xcp."
-#define EXTENSIONTAG_SMK "kms."
-#define EXTENSIONTAG_MNG "gnm."
-
-extern t_clienttag clienttag_str_to_uint(char const * clienttag);
-extern char const * clienttag_uint_to_str(t_clienttag clienttag);
-extern char const * clienttag_get_title(t_clienttag clienttag);
-
-extern t_tag tag_str_to_uint(char const * tag_str);
-extern t_tag tag_case_str_to_uint(char const * tag_str);
-extern char * tag_uint_to_str(char * tag_str, t_tag tag_uint);
-extern int tag_check_arch(t_tag tag_uint);
-extern int tag_check_client(t_tag tag_uint);
-extern int tag_check_gamelang(t_tag tag_uint);
-
-#endif
-#endif
diff --git a/d2pack109/src/common/trans.c b/d2pack109/src/common/trans.c
deleted file mode 100644
index 4b0e094..0000000
--- a/d2pack109/src/common/trans.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * Copyright (C) 2004 CreepLord (creeplord@pvpgn.org)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#define TRANS_INTERNAL_ACCESS
-#include "common/setup_before.h"
-#include
-#ifdef HAVE_STDDEF_H
-# include
-#else
-# ifndef NULL
-# define NULL ((void *)0)
-# endif
-#endif
-#ifdef STDC_HEADERS
-# include
-#else
-# ifdef HAVE_MALLOC_H
-# include
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# include
-#else
-# ifdef HAVE_STRINGS_H
-# include
-# endif
-#endif
-#include "compat/strrchr.h"
-#include
-#include "compat/strerror.h"
-#include "common/eventlog.h"
-#include "common/list.h"
-#include "common/addr.h"
-#include "common/util.h"
-#include "common/xalloc.h"
-#include "trans.h"
-#include "common/setup_after.h"
-
-#define DEBUG_TRANS
-
-static t_list * trans_head=NULL;
-
-extern int trans_load(char const * filename, int program)
-{
- FILE *fp;
- unsigned int line;
- unsigned int pos;
- char *buff;
- char *temp;
- char const *input;
- char const *output;
- char const *exclude;
- char const *include;
- unsigned int npos;
- char *network;
- char *tmp;
- char tmp1[32];
- char tmp2[32];
- char tmp3[32];
- t_trans *entry;
-
- if (!filename) {
- eventlog(eventlog_level_error,__FUNCTION__,"got NULL filename");
- return -1;
- }
- if (!(fp = fopen(filename,"r"))) {
- eventlog(eventlog_level_error,__FUNCTION__,"could not open file \"%s\" for reading (fopen: %s)",filename,strerror(errno));
- return -1;
- }
- trans_head = list_create();
- for (line=1; (buff = file_get_line(fp)); line++) {
- for (pos=0; buff[pos]=='\t' || buff[pos]==' '; pos++);
- if (buff[pos]=='\0' || buff[pos]=='#') {
- xfree(buff);
- continue;
- }
- if ((temp = strrchr(buff,'#'))) {
- unsigned int len;
- unsigned int endpos;
-
- *temp = '\0';
- len = strlen(buff)+1;
- for (endpos=len-1; buff[endpos]=='\t' || buff[endpos]==' '; endpos--);
- buff[endpos+1] = '\0';
- }
- if (!(input = strtok(buff," \t"))) { /* strtok modifies the string it is passed */
- eventlog(eventlog_level_error,__FUNCTION__,"missing input line %u of file \"%s\"",line,filename);
- xfree(buff);
- continue;
- }
- /* check for port number - this tells us what programs will use this entry */
- if (!(temp = strrchr(input,':'))) {
- eventlog(eventlog_level_error,__FUNCTION__,"missing port # on input line %u of file \"%s\"",line,filename);
- xfree(buff);
- continue;
- }
- temp++;
- /* bnetd doesn't want the port 4000 entries */
- if (program==TRANS_BNETD && strcmp(temp,"4000")==0) {
-#ifdef DEBUG_TRANS
- eventlog(eventlog_level_debug,__FUNCTION__,"d2gs input (ignoring) \"%s\"",input);
-#endif
- xfree(buff);
- continue;
- }
- /* d2cs only wants the port 4000 entries */
- if (program==TRANS_D2CS && strcmp(temp,"4000")!=0) {
-#ifdef DEBUG_TRANS
- eventlog(eventlog_level_debug,__FUNCTION__,"non d2gs input (ignoring) \"%s\"",input);
-#endif
- xfree(buff);
- continue;
- }
- if (!(output = strtok(NULL," \t"))) {
- eventlog(eventlog_level_error,__FUNCTION__,"missing output on line %u of file \"%s\"",line,filename);
- xfree(buff);
- continue;
- }
- if (!(exclude = strtok(NULL," \t"))) {
- eventlog(eventlog_level_error,__FUNCTION__,"missing exclude on line %u of file \"%s\"",line,filename);
- xfree(buff);
- continue;
- }
- if (!(include = strtok(NULL," \t"))) {
- eventlog(eventlog_level_error,__FUNCTION__,"missing include on line %u of file \"%s\"",line,filename);
- xfree(buff);
- continue;
- }
- /* add exlude networks */
- tmp = xstrdup(exclude);
- npos=0;
- while (tmp[npos]) {
- network = &tmp[npos];
- for (; tmp[npos]!=',' && tmp[npos]!='\0'; npos++);
- if (tmp[npos]=='\0')
- npos--;
- else
- tmp[npos]='\0';
- if (strcmp(network,"NONE")==0) {
- npos++;
- continue;
- }
- entry = xmalloc(sizeof(t_trans));
- if (!(entry->input = addr_create_str(input,0,0))) {
- eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for input address");
- xfree(entry);
- npos++;
- continue;
- }
- if (!(entry->output = addr_create_str(input,0,0))) {
- eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for output address");
- addr_destroy(entry->input);
- xfree(entry);
- npos++;
- continue;
- }
- if (strcmp(network,"ANY")==0) {
- if (!(entry->network = netaddr_create_str("0.0.0.0/0"))) {
- eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for network address");
- addr_destroy(entry->output);
- addr_destroy(entry->input);
- xfree(entry);
- npos++;
- continue;
- }
- } else {
- if (!(entry->network = netaddr_create_str(network))) {
- eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for network address");
- addr_destroy(entry->output);
- addr_destroy(entry->input);
- xfree(entry);
- npos++;
- continue;
- }
- }
-#ifdef DEBUG_TRANS
- eventlog(eventlog_level_debug,__FUNCTION__,
- "Adding Host -> %s, Output -> %s, Network %s - (exclude)",
- addr_get_addr_str(entry->input,tmp1,sizeof(tmp1)),
- addr_get_addr_str(entry->output,tmp2,sizeof(tmp2)),
- netaddr_get_addr_str(entry->network,tmp3,sizeof(tmp3)));
-#endif
- list_append_data(trans_head,entry);
- npos++;
- }
- xfree(tmp);
- /* add include networks */
- tmp = xstrdup(include);
- npos=0;
- while (tmp[npos]) {
- network = &tmp[npos];
- for (; tmp[npos]!=',' && tmp[npos]!='\0'; npos++);
- if (tmp[npos]=='\0')
- npos--;
- else
- tmp[npos]='\0';
- if (strcmp(network,"NONE")==0) {
- npos++;
- continue;
- }
- entry = xmalloc(sizeof(t_trans));
- if (!(entry->input = addr_create_str(input,0,0))) {
- eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for input address");
- xfree(entry);
- npos++;
- continue;
- }
- if (!(entry->output = addr_create_str(output,0,0))) {
- eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for output address");
- addr_destroy(entry->input);
- xfree(entry);
- npos++;
- continue;
- }
- if (strcmp(network,"ANY")==0) {
- if (!(entry->network = netaddr_create_str("0.0.0.0/0"))) {
- eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for network address");
- addr_destroy(entry->output);
- addr_destroy(entry->input);
- xfree(entry);
- npos++;
- continue;
- }
- } else {
- if (!(entry->network = netaddr_create_str(network))) {
- eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for network address");
- addr_destroy(entry->output);
- addr_destroy(entry->input);
- xfree(entry);
- npos++;
- continue;
- }
- }
-#ifdef DEBUG_TRANS
- eventlog(eventlog_level_debug,__FUNCTION__,
- "Adding Host -> %s, Output -> %s, Network %s - (include)",
- addr_get_addr_str(entry->input,tmp1,sizeof(tmp1)),
- addr_get_addr_str(entry->output,tmp2,sizeof(tmp2)),
- netaddr_get_addr_str(entry->network,tmp3,sizeof(tmp3)));
-#endif
- list_append_data(trans_head,entry);
- npos++;
- }
- xfree(tmp);
- xfree(buff);
- }
- fclose(fp);
- eventlog(eventlog_level_info,__FUNCTION__,"trans file loaded");
- return 0;
-}
-
-extern int trans_unload(void)
-{
- t_elem *curr;
- t_trans *entry;
-
- if (trans_head) {
- LIST_TRAVERSE(trans_head,curr)
- {
- if (!(entry = elem_get_data(curr))) {
- eventlog(eventlog_level_error,__FUNCTION__,"found NULL entry in list");
- } else {
- netaddr_destroy(entry->network);
- addr_destroy(entry->output);
- addr_destroy(entry->input);
- xfree(entry);
- }
- list_remove_elem(trans_head,&curr);
- }
- list_destroy(trans_head);
- trans_head = NULL;
- }
- return 0;
-}
-
-extern int trans_reload(char const * filename, int program)
-{
- trans_unload();
- if(trans_load(filename,program)<0) return -1;
- return 0;
-}
-
-extern int trans_net(unsigned int clientaddr, unsigned int *addr, unsigned short *port)
-{
- t_elem const *curr;
- t_trans *entry;
- char temp1[32];
- char temp2[32];
- char temp3[32];
- char temp4[32];
-
-#ifdef DEBUG_TRANS
- eventlog(eventlog_level_debug,__FUNCTION__,"checking %s for client %s ...",
- addr_num_to_addr_str(*addr, *port),
- addr_num_to_ip_str(clientaddr));
-#endif
-
- if (trans_head) {
- LIST_TRAVERSE_CONST(trans_head,curr)
- {
- if (!(entry = elem_get_data(curr))) {
- eventlog(eventlog_level_error,__FUNCTION__,"found NULL entry in list");
- continue;
- }
-
-#ifdef DEBUG_TRANS
- eventlog(eventlog_level_debug,__FUNCTION__,"against entry -> %s output %s network %s",
- addr_get_addr_str(entry->input,temp1,sizeof(temp1)),
- addr_get_addr_str(entry->output,temp2,sizeof(temp2)),
- netaddr_get_addr_str(entry->network,temp3,sizeof(temp3)));
-#endif
- if (addr_get_ip(entry->input)!=*addr || addr_get_port(entry->input)!=*port) {
-#ifdef DEBUG_TRANS
- eventlog(eventlog_level_debug,__FUNCTION__,"entry does match input address");
-#endif
- continue;
- }
- if (netaddr_contains_addr_num(entry->network,clientaddr)==0) {
-#ifdef DEBUG_TRANS
- eventlog(eventlog_level_debug,__FUNCTION__,"client is not in the correct network");
-#endif
- continue;
- }
-#ifdef DEBUG_TRANS
- eventlog(eventlog_level_debug,__FUNCTION__,"%s translated to %s",
- addr_num_to_addr_str(*addr, *port),
- addr_get_addr_str(entry->output,temp4,sizeof(temp4)));
-#endif
- *addr = addr_get_ip(entry->output);
- *port = addr_get_port(entry->output);
- return 1; /* match found in list */
- }
- }
-#ifdef DEBUG_TRANS
- eventlog(eventlog_level_debug,__FUNCTION__,"no match found for %s (not translated)",
- addr_num_to_addr_str(*addr, *port));
-#endif
- return 0; /* no match found in list */
-}
diff --git a/d2pack109/src/common/trans.h b/d2pack109/src/common/trans.h
deleted file mode 100644
index 3e9bc1b..0000000
--- a/d2pack109/src/common/trans.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2004 CreepLord (creeplord@pvpgn.org)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef INCLUDED_TRANS_TYPES
-#define INCLUDED_TRANS_TYPES
-
-#ifdef TRANS_INTERNAL_ACCESS
-
-#ifdef JUST_NEED_TYPES
-# include "common/addr.h"
-#else
-# define JUST_NEED_TYPES
-# include "common/addr.h"
-# undef JUST_NEED_TYPES
-#endif
-
-typedef struct
-{
- t_addr *input;
- t_addr *output;
- t_netaddr *network;
-} t_trans;
-
-#endif
-
-#endif
-
-#ifndef JUST_NEED_TYPES
-#ifndef INCLUDED_TRANS_PROTOS
-#define INCLUDED_TRANS_PROTOS
-
-#define TRANS_BNETD 1
-#define TRANS_D2CS 2
-
-extern int trans_load(char const * filename, int program);
-extern int trans_unload(void);
-extern int trans_reload(char const * filename, int program);
-extern int trans_net(unsigned int clientaddr, unsigned int *addr, unsigned short *port);
-
-#endif
-#endif
diff --git a/d2pack109/src/common/util.c b/d2pack109/src/common/util.c
deleted file mode 100644
index 68fd627..0000000
--- a/d2pack109/src/common/util.c
+++ /dev/null
@@ -1,634 +0,0 @@
-/*
- * Copyright (C) 1998 Mark Baysinger (mbaysing@ucsd.edu)
- * Copyright (C) 1998,1999,2000,2001 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#include "common/setup_before.h"
-#include
-#ifdef HAVE_STDDEF_H
-# include
-#else
-# ifndef NULL
-# define NULL ((void *)0)
-# endif
-#endif
-#ifdef STDC_HEADERS
-# include
-#else
-# ifdef HAVE_MALLOC_H
-# include
-# endif
-#endif
-#include "compat/strtoul.h"
-#ifdef HAVE_STRING_H
-# include
-#else
-# ifdef HAVE_STRINGS_H
-# include
-# endif
-#endif
-#include "compat/strcasecmp.h"
-#include "compat/strncasecmp.h"
-#include "common/xalloc.h"
-#include
-#include "common/util.h"
-#include "common/setup_after.h"
-
-
-extern int strstart(char const * full, char const * part)
-{
- size_t strlen_full, strlen_part;
- if (!full || !part)
- return 1;
- strlen_full = strlen(full);
- strlen_part = strlen(part);
- if (strlen_fullstrlen_part && full[strlen_part]!=' ' && full[strlen_part]!='\0')
- return 1;
- return strncasecmp(full,part,strlen_part);
-}
-
-
-#define DEF_LEN 64
-#define INC_LEN 16
-
-extern char * file_get_line(FILE * fp)
-{
- char * line;
- unsigned int len=DEF_LEN;
- unsigned int pos=0;
- int prev_char,curr_char;
-
- line = xmalloc(DEF_LEN);
- prev_char = '\0';
- while ((curr_char = fgetc(fp))!=EOF)
- {
- if (((char)curr_char)=='\r')
- continue; /* make DOS line endings look Unix-like */
- if (((char)curr_char)=='\n')
- {
- if (pos<1 || ((char)prev_char)!='\\')
- break;
- pos--; /* throw away the backslash */
- prev_char = '\0';
- continue;
- }
- prev_char = curr_char;
-
- line[pos++] = (char)curr_char;
- if ((pos+1)>=len)
- {
- len += INC_LEN;
- line = xrealloc(line,len);
- }
- }
-
- if (curr_char==EOF && pos<1) /* not even an empty line */
- {
- xfree(line);
- return NULL;
- }
-
- if (pos+1='\000' && str[i]<'\040')) &&
- (!allow_nl || (str[i]!='\r' && str[i]!='\n')))
- fprintf(fp,"^%c",str[i]+64);
- else
- fputc((int)str[i],fp);
-
- return 0;
-}
-
-
-extern int str_get_bool(char const * str)
-{
- if (!str)
- return -1;
-
- if (strcasecmp(str,"true")==0 ||
- strcasecmp(str,"yes")==0 ||
- strcasecmp(str,"on")==0 ||
- strcmp(str,"1")==0)
- return 1;
-
- if (strcasecmp(str,"false")==0 ||
- strcasecmp(str,"no")==0 ||
- strcasecmp(str,"off")==0 ||
- strcmp(str,"0")==0)
- return 0;
-
- return -1;
-}
-
-
-extern char const * seconds_to_timestr(unsigned int totsecs)
-{
- static char temp[256];
- int days;
- int hours;
- int minutes;
- int seconds;
-
- days = totsecs/(24*60*60);
- hours = totsecs/(60*60) - days*24;
- minutes = totsecs/60 - days*24*60 - hours*60;
- seconds = totsecs - days*24*60*60 - hours*60*60 - minutes*60;
-
- if (days>0)
- sprintf(temp,"%d day%s %d hour%s %d minute%s %d second%s",
- days,days==1 ? "" : "s",
- hours,hours==1 ? "" : "s",
- minutes,minutes==1 ? "" : "s",
- seconds,seconds==1 ? "" : "s");
- else if (hours>0)
- sprintf(temp,"%d hour%s %d minute%s %d second%s",
- hours,hours==1 ? "" : "s",
- minutes,minutes==1 ? "" : "s",
- seconds,seconds==1 ? "" : "s");
- else if (minutes>0)
- sprintf(temp,"%d minute%s %d second%s",
- minutes,minutes==1 ? "" : "s",
- seconds,seconds==1 ? "" : "s");
- else
- sprintf(temp,"%d second%s.",
- seconds,seconds==1 ? "" : "s");
-
- return temp;
-}
-
-
-extern int clockstr_to_seconds(char const * clockstr, unsigned int * totsecs)
-{
- unsigned int i,j;
- unsigned int temp;
-
- if (!clockstr)
- return -1;
- if (!totsecs)
- return -1;
-
- for (i=j=temp=0; j= len*3+1 then the buffer was overflowed */
- out[outpos] = '\0';
-
- return out;
-}
-
-
-extern char * escape_chars(char const * in, unsigned int len)
-{
- char * out;
- unsigned int inpos;
- unsigned int outpos;
-
- if (!in)
- return NULL;
- out = xmalloc(len*4+1); /* if all turn into \xxx */
-
- for (inpos=0,outpos=0; inpos= len*4+1 then the buffer was overflowed */
- out[outpos] = '\0';
-
- return out;
-}
-
-
-extern char * unescape_chars(char const * in)
-{
- char * out;
- unsigned int inpos;
- unsigned int outpos;
-
- if (!in)
- return NULL;
- out = xmalloc(strlen(in)+1);
-
- for (inpos=0,outpos=0; inpos255) /* bad escape (including \000), leave it as-is */
- {
- out[outpos++] = '\\';
- strcpy(&out[outpos],temp);
- outpos += strlen(temp);
- }
- else
- out[outpos++] = (unsigned char)num;
- }
- }
- }
- out[outpos] = '\0';
-
- return out;
-}
-
-
-extern void str_to_hex(char * target, char * data, int datalen)
-{
- unsigned char c;
- int i;
- for (i = 0; i < datalen; i++)
- {
- c = (data[i]) & 0xff;
-
- sprintf(target + i*3, "%02X ", c);
- target[i*3+3] = '\0';
-
- /* fprintf(stderr, "str_to_hex %d | '%02x' '%s'\n", i, c, target); */
- }
-}
-
-
-extern int hex_to_str(char const * source, char * data, int datalen)
-{
- /*
- * TODO: We really need a more robust function here,
- * for now, I'll just use this hack for a quick evaluation
- */
- char byte;
- char c;
- int i;
-
- for (i = 0; i < datalen; i++)
- {
- byte = 0;
-
- /* fprintf(stderr, "hex_to_str %d | '%02x'", i, byte); */
-
- c = source [i*3 + 0];
- byte += 16 * ( c > '9' ? (c - 'A' + 10) : (c - '0'));
-
- /* fprintf(stderr, " | '%c' '%02x'", c, byte); */
-
- c = source [i*3 + 1];
- byte += 1 * ( c > '9' ? (c - 'A' + 10) : (c - '0'));
-
- /* fprintf(stderr, " | '%c' '%02x'", c, byte); */
-
- /* fprintf(stderr, "\n"); */
-
- data[i] = byte;
- }
-
- /* fprintf(stderr, "finished, returning %d from '%s'\n", i, source); */
-
- return i;
-}
diff --git a/d2pack109/src/common/util.h b/d2pack109/src/common/util.h
deleted file mode 100644
index 194bf65..0000000
--- a/d2pack109/src/common/util.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 1998,1999,2000 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-
-/*****/
-#ifndef JUST_NEED_TYPES
-#ifndef INCLUDED_UTIL_PROTOS
-#define INCLUDED_UTIL_PROTOS
-
-#define JUST_NEED_TYPES
-#include
-#undef JUST_NEED_TYPES
-
-extern int strstart(char const * full, char const * part) ;
-extern char * file_get_line(FILE * fp) ;
-extern char * strreverse(char * str);
-extern int str_to_uint(char const * str, unsigned int * num);
-extern int str_to_ushort(char const * str, unsigned short * num);
-extern int str_print_term(FILE * fp, char const * str, unsigned int len, int allow_nl);
-extern int str_get_bool(char const * str) ;
-extern char const * seconds_to_timestr(unsigned int totsecs); /* FIXME: can this be marked pure? */
-extern int clockstr_to_seconds(char const * clockstr, unsigned int * totsecs);
-extern char * escape_fs_chars(char const * in, unsigned int len) ;
-extern char * escape_chars(char const * in, unsigned int len) ;
-extern char * unescape_chars(char const * in) ;
-extern void str_to_hex(char * target, char * data, int datalen);
-extern int hex_to_str(char const * source, char * data, int datalen);
-
-#endif
-#endif
diff --git a/d2pack109/src/common/version.h b/d2pack109/src/common/version.h
deleted file mode 100644
index 68a7cb5..0000000
--- a/d2pack109/src/common/version.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef PVPGN_VERSION
-#define PVPGN_VERSION "0.7-CVS"
-#endif
-#ifndef PVPGN_SOFTWARE
-#define PVPGN_SOFTWARE "PvPGN D2Pack109"
-#endif
diff --git a/d2pack109/src/common/xalloc.c b/d2pack109/src/common/xalloc.c
deleted file mode 100644
index 5e8eb29..0000000
--- a/d2pack109/src/common/xalloc.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (C) 2004 Dizzy (dizzy@roedu.net)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include "common/setup_before.h"
-#ifndef XALLOC_SKIP
-
-#ifdef HAVE_STDDEF_H
-# include
-#endif
-#ifdef STDC_HEADERS
-# include
-#else
-# ifdef HAVE_MALLOC_H
-# include
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# include
-#else
-# ifdef HAVE_STRINGS_H
-# include
-# endif
-#endif
-#include "compat/strdup.h"
-#include "common/eventlog.h"
-#include "common/xalloc.h"
-#define XALLOC_INTERNAL_ACCESS
-#include "common/setup_after.h"
-#undef XALLOC_INTERNAL_ACCESS
-
-static t_oom_cb oom_cb = NULL;
-
-void *xmalloc_real(size_t size, const char *fn, unsigned ln)
-{
- void *res;
-
- res = malloc(size);
- if (!res) {
- eventlog(eventlog_level_fatal, __FUNCTION__, "out of memory (from %s:%u)",fn,ln);
- if (oom_cb && oom_cb() && (res = malloc(size))) return res;
- abort();
- }
-
- return res;
-}
-
-void *xcalloc_real(size_t nmemb, size_t size, const char *fn, unsigned ln)
-{
- void *res;
-
- res = calloc(nmemb,size);
- if (!res) {
- eventlog(eventlog_level_fatal, __FUNCTION__, "out of memory (from %s:%u)",fn,ln);
- if (oom_cb && oom_cb() && (res = calloc(nmemb,size))) return res;
- abort();
- }
-
- return res;
-}
-
-void *xrealloc_real(void *ptr, size_t size, const char *fn, unsigned ln)
-{
- void *res;
-
- res = realloc(ptr,size);
- if (!res) {
- eventlog(eventlog_level_fatal, __FUNCTION__, "out of memory (from %s:%u)",fn,ln);
- if (oom_cb && oom_cb() && (res = realloc(ptr,size))) return res;
- abort();
- }
-
- return res;
-}
-
-char *xstrdup_real(const char *str, const char *fn, unsigned ln)
-{
- char *res;
-
- res = strdup(str);
- if (!res) {
- eventlog(eventlog_level_fatal, __FUNCTION__, "out of memory (from %s:%u)",fn,ln);
- if (oom_cb && oom_cb() && (res = strdup(str))) return res;
- abort();
- }
-
- return res;
-}
-
-void xfree_real(void *ptr, const char *fn, unsigned ln)
-{
- if (!ptr) {
- eventlog(eventlog_level_error, __FUNCTION__, "got NULL ptr (from %s:%u)",fn,ln);
- return;
- }
-
- free(ptr);
-}
-
-void xalloc_setcb(t_oom_cb cb)
-{
- oom_cb = cb;
-}
-
-#endif /* XALLOC_SKIP */
diff --git a/d2pack109/src/common/xalloc.h b/d2pack109/src/common/xalloc.h
deleted file mode 100644
index b409944..0000000
--- a/d2pack109/src/common/xalloc.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2004 Dizzy (dizzy@roedu.net)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef INCLUDED_XALLOC_TYPES
-
-/* out of memory callback function */
-typedef int (*t_oom_cb)(void);
-
-#define INCLUDED_XALLOC_TYPES
-
-#endif /* INCLUDED_XALLOC_TYPES */
-
-#ifndef INCLUDED_XALLOC_PROTOS
-#define INCLUDED_XALLOC_PROTOS
-
-#ifdef HAVE_STDDEF_H
-# include
-#endif
-#ifdef STDC_HEADERS
-# include
-#else
-# ifdef HAVE_MALLOC_H
-# include
-# endif
-#endif
-
-#ifndef XALLOC_SKIP
-
-#define xmalloc(size) xmalloc_real(size,__FILE__,__LINE__)
-void *xmalloc_real(size_t size, const char *fn, unsigned ln);
-#define xcalloc(no,size) xcalloc_real(no,size,__FILE__,__LINE__)
-void *xcalloc_real(size_t nmemb, size_t size, const char *fn, unsigned ln);
-#define xrealloc(ptr,size) xrealloc_real(ptr,size,__FILE__,__LINE__)
-void *xrealloc_real(void *ptr, size_t size, const char *fn, unsigned ln);
-#define xstrdup(str) xstrdup_real(str,__FILE__,__LINE__)
-char *xstrdup_real(const char *str, const char *fn, unsigned ln);
-#define xfree(ptr) xfree_real(ptr,__FILE__,__LINE__)
-void xfree_real(void *ptr, const char *fn, unsigned ln);
-void xalloc_setcb(t_oom_cb cb);
-
-#else /* XALLOC_SKIP */
-
-#define xmalloc(size) malloc(size)
-#define xcalloc(no,size) calloc(no,size)
-#define xrealloc(ptr,size) realloc(ptr,size)
-#define xstrdup(str) strdup(str)
-#define xfree(ptr) free(ptr)
-#define xalloc_setcb(cb)
-
-#endif
-
-#endif /* INCLUDED_XALLOC_PROTOS */
diff --git a/d2pack109/src/compat/access.h b/d2pack109/src/compat/access.h
deleted file mode 100644
index 079d3ff..0000000
--- a/d2pack109/src/compat/access.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef INCLUDED_ACCESS_PROTOS
-#define INCLUDED_ACCESS_PROTOS
-
-#ifdef WIN32
-# include
-/* Values for the second argument to access. These may be OR'd together. */
-# define R_OK 4 /* Test for read permission. */
-# define W_OK 2 /* Test for write permission. */
-# define X_OK 1 /* Test for execute permission. */
-# define F_OK 0 /* Test for existence. */
-#endif
-
-#endif
diff --git a/d2pack109/src/compat/char_bit.h b/d2pack109/src/compat/char_bit.h
deleted file mode 100644
index 8a32ff6..0000000
--- a/d2pack109/src/compat/char_bit.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2000,2001 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef INCLUDED_CHAR_BIT_TYPES
-#define INCLUDED_CHAR_BIT_TYPES
-
-# ifdef HAVE_LIMITS_H
-# include
-# endif
-# ifdef HAVE_SYS_PARAM_H
-# include
-# endif
-# ifndef CHAR_BIT
-# ifdef NBBY
-# define CHAR_BIT NBBY
-# else
-# define CHAR_BIT 8 /* well, this is usually true :) */
-# endif
-# endif
-
-#endif
diff --git a/d2pack109/src/compat/difftime.c b/d2pack109/src/compat/difftime.c
deleted file mode 100644
index be649c8..0000000
--- a/d2pack109/src/compat/difftime.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#include "common/setup_before.h"
-#ifndef HAVE_DIFFTIME
-
-#ifdef TIME_WITH_SYS_TIME
-# include
-# include
-#else
-# ifdef HAVE_SYS_TIME_H
-# include
-# else
-# include
-# endif
-#endif
-#include "difftime.h"
-#include "common/setup_after.h"
-
-
-extern double difftime(time_t after, time_t before)
-{
- return ((double)after)-((double)before);
-}
-
-#else
-typedef int filenotempty; /* make ISO standard happy */
-#endif
diff --git a/d2pack109/src/compat/difftime.h b/d2pack109/src/compat/difftime.h
deleted file mode 100644
index 367d997..0000000
--- a/d2pack109/src/compat/difftime.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef INCLUDED_DIFFTIME_PROTOS
-#define INCLUDED_DIFFTIME_PROTOS
-
-#ifndef HAVE_DIFFTIME
-
-#ifdef TIME_WITH_SYS_TIME
-# include
-# include
-#else
-# ifdef HAVE_SYS_TIME_H
-# include
-# else
-# include
-# endif
-#endif
-
-extern double difftime(time_t after, time_t before);
-
-#endif
-
-#endif
diff --git a/d2pack109/src/compat/exitstatus.h b/d2pack109/src/compat/exitstatus.h
deleted file mode 100644
index 429de58..0000000
--- a/d2pack109/src/compat/exitstatus.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef INCLUDED_EXITSTATUS_PROTOS
-#define INCLUDED_EXITSTATUS_PROTOS
-
-#ifdef EXIT_FAILURE
-# if !EXIT_FAILURE
-# define STATUS_FAILURE 1
-# else
-# define STATUS_FAILURE EXIT_FAILURE
-# endif
-#else
-# define STATUS_FAILURE 1
-#endif
-
-#ifdef EXIT_SUCCESS
-# define STATUS_SUCCESS EXIT_SUCCESS
-#else
-# define STATUS_SUCCESS 0
-#endif
-
-#endif
diff --git a/d2pack109/src/compat/gethostname.h b/d2pack109/src/compat/gethostname.h
deleted file mode 100644
index 4ff4071..0000000
--- a/d2pack109/src/compat/gethostname.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef INCLUDED_GETHOSTNAME_PROTOS
-#define INCLUDED_GETHOSTNAME_PROTOS
-
-/*
- * This is from unistd.h on Unix systems, but it's included with
- * the socket stuff under Windows. This tries to hide that.
- */
-
-#ifdef WIN32
-# include
-#endif
-
-#ifndef HAVE_GETHOSTNAME
-# error "This program requires gethostname()"
-#endif
-
-#endif
diff --git a/d2pack109/src/compat/getopt.c b/d2pack109/src/compat/getopt.c
deleted file mode 100644
index 20e06eb..0000000
--- a/d2pack109/src/compat/getopt.c
+++ /dev/null
@@ -1,1009 +0,0 @@
-/* Getopt for GNU.
- NOTE: getopt is now part of the C library, so if you don't know what
- "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
- before changing it!
-
- Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97
- Free Software Foundation, Inc.
-
- This file is part of the GNU C Library. Its master source is NOT part of
- the C library, however. The master source lives in /gd/gnu/lib.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef __WIN32__ /* caused problems/warnings compiling on bcc/vs.net otherwise */
-#include
-#endif
-
-/* This tells Alpha OSF/1 not to define a getopt prototype in .
- Ditto for AIX 3.2 and . */
-#ifndef _NO_PROTO
-#define _NO_PROTO
-#endif
-
-
-#ifndef HAVE_GETOPT
-
-#if !defined (__STDC__) || !__STDC__
-/* This is a separate conditional since some stdc systems
- reject `defined (const)'. */
-#ifndef const
-#define const
-#endif
-#endif
-
-#include
-#include
-
-
-/* Comment out all this code if we are using the GNU C Library, and are not
- actually compiling the library itself. This code is part of the GNU C
- Library, but also included in many other GNU distributions. Compiling
- and linking in this code is a waste when using the GNU C library
- (especially if it is a shared library). Rather than having every GNU
- program understand `configure --with-gnu-libc' and omit the object files,
- it is simpler to just do this in the source for each such file. */
-
-#define GETOPT_INTERFACE_VERSION 2
-#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
-#include
-#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
-#define ELIDE_CODE
-#endif
-#endif
-
-#ifndef ELIDE_CODE
-
-
-/* This needs to come after some library #include
- to get __GNU_LIBRARY__ defined. */
-#ifdef __GNU_LIBRARY__
-/* Don't include stdlib.h for non-GNU C libraries because some of them
- contain conflicting prototypes for getopt. */
-#include
-#include
-#endif /* GNU C library. */
-
-#ifdef VMS
-#include
-#if HAVE_STRING_H - 0
-#include
-#endif
-#endif
-
-#if defined (WIN32) && !defined (__CYGWIN32__)
-/* It's not Unix, really. See? Capital letters. */
-#include
-#define getpid() GetCurrentProcessId()
-#endif
-
-#ifndef _
-/* This is for other GNU distributions with internationalized messages.
- When compiling libc, the _ macro is predefined. */
-#ifdef HAVE_LIBINTL_H
-# include
-# define _(msgid) gettext (msgid)
-#else
-# define _(msgid) (msgid)
-#endif
-#endif
-
-/* This version of `getopt' appears to the caller like standard Unix `getopt'
- but it behaves differently for the user, since it allows the user
- to intersperse the options with the other arguments.
-
- As `getopt' works, it permutes the elements of ARGV so that,
- when it is done, all the options precede everything else. Thus
- all application programs are extended to handle flexible argument order.
-
- Setting the environment variable POSIXLY_CORRECT disables permutation.
- Then the behavior is completely standard.
-
- GNU application programs can use a third alternative mode in which
- they can distinguish the relative order of options and other arguments. */
-
-#include "getopt.h"
-
-#include "common/setup_after.h"
-
-/* For communication from `getopt' to the caller.
- When `getopt' finds an option that takes an argument,
- the argument value is returned here.
- Also, when `ordering' is RETURN_IN_ORDER,
- each non-option ARGV-element is returned here. */
-
-char *optarg = NULL;
-
-/* Index in ARGV of the next element to be scanned.
- This is used for communication to and from the caller
- and for communication between successive calls to `getopt'.
-
- On entry to `getopt', zero means this is the first call; initialize.
-
- When `getopt' returns -1, this is the index of the first of the
- non-option elements that the caller should itself scan.
-
- Otherwise, `optind' communicates from one call to the next
- how much of ARGV has been scanned so far. */
-
-/* 1003.2 says this must be 1 before any call. */
-int optind = 1;
-
-/* Formerly, initialization of getopt depended on optind==0, which
- causes problems with re-calling getopt as programs generally don't
- know that. */
-
-int __getopt_initialized = 0;
-
-/* The next char to be scanned in the option-element
- in which the last option character we returned was found.
- This allows us to pick up the scan where we left off.
-
- If this is zero, or a null string, it means resume the scan
- by advancing to the next ARGV-element. */
-
-static char *nextchar;
-
-/* Callers store zero here to inhibit the error message
- for unrecognized options. */
-
-int opterr = 1;
-
-/* Set to an option character which was unrecognized.
- This must be initialized on some systems to avoid linking in the
- system's own getopt implementation. */
-
-int optopt = '?';
-
-/* Describe how to deal with options that follow non-option ARGV-elements.
-
- If the caller did not specify anything,
- the default is REQUIRE_ORDER if the environment variable
- POSIXLY_CORRECT is defined, PERMUTE otherwise.
-
- REQUIRE_ORDER means don't recognize them as options;
- stop option processing when the first non-option is seen.
- This is what Unix does.
- This mode of operation is selected by either setting the environment
- variable POSIXLY_CORRECT, or using `+' as the first character
- of the list of option characters.
-
- PERMUTE is the default. We permute the contents of ARGV as we scan,
- so that eventually all the non-options are at the end. This allows options
- to be given in any order, even with programs that were not written to
- expect this.
-
- RETURN_IN_ORDER is an option available to programs that were written
- to expect options and other ARGV-elements in any order and that care about
- the ordering of the two. We describe each non-option ARGV-element
- as if it were the argument of an option with character code 1.
- Using `-' as the first character of the list of option characters
- selects this mode of operation.
-
- The special argument `--' forces an end of option-scanning regardless
- of the value of `ordering'. In the case of RETURN_IN_ORDER, only
- `--' can cause `getopt' to return -1 with `optind' != ARGC. */
-
-static enum
-{
- REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
-} ordering;
-
-/* Value of POSIXLY_CORRECT environment variable. */
-static char *posixly_correct;
-
-#ifdef __GNU_LIBRARY__
-/* We want to avoid inclusion of string.h with non-GNU libraries
- because there are many ways it can cause trouble.
- On some systems, it contains special magic macros that don't work
- in GCC. */
-#include
-#define my_index strchr
-#else
-
-/* Avoid depending on library functions or files
- whose names are inconsistent. */
-
-char *getenv ();
-
-static char *
-my_index (str, chr)
- const char *str;
- int chr;
-{
- while (*str)
- {
- if (*str == chr)
- return (char *) str;
- str++;
- }
- return 0;
-}
-
-/* If using GCC, we can safely declare strlen this way.
- If not using GCC, it is ok not to declare it. */
-#ifdef __GNUC__
-/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
- That was relevant to code that was here before. */
-#if !defined (__STDC__) || !__STDC__
-/* gcc with -traditional declares the built-in strlen to return int,
- and has done so at least since version 2.4.5. -- rms. */
-extern int strlen (const char *);
-#endif /* not __STDC__ */
-#endif /* __GNUC__ */
-
-#endif /* not __GNU_LIBRARY__ */
-
-/* Handle permutation of arguments. */
-
-/* Describe the part of ARGV that contains non-options that have
- been skipped. `first_nonopt' is the index in ARGV of the first of them;
- `last_nonopt' is the index after the last of them. */
-
-static int first_nonopt;
-static int last_nonopt;
-
-#ifdef _LIBC
-/* Bash 2.0 gives us an environment variable containing flags
- indicating ARGV elements that should not be considered arguments. */
-
-static const char *nonoption_flags;
-static int nonoption_flags_len;
-
-static int original_argc;
-static char *const *original_argv;
-
-/* Make sure the environment variable bash 2.0 puts in the environment
- is valid for the getopt call we must make sure that the ARGV passed
- to getopt is that one passed to the process. */
-static void store_args (int argc, char *const *argv) __attribute__ ((unused));
-static void
-store_args (int argc, char *const *argv)
-{
- /* XXX This is no good solution. We should rather copy the args so
- that we can compare them later. But we must not use malloc(3). */
- original_argc = argc;
- original_argv = argv;
-}
-text_set_element (__libc_subinit, store_args);
-#endif
-
-/* Exchange two adjacent subsequences of ARGV.
- One subsequence is elements [first_nonopt,last_nonopt)
- which contains all the non-options that have been skipped so far.
- The other is elements [last_nonopt,optind), which contains all
- the options processed since those non-options were skipped.
-
- `first_nonopt' and `last_nonopt' are relocated so that they describe
- the new indices of the non-options in ARGV after they are moved. */
-
-#if defined (__STDC__) && __STDC__
-static void exchange (char **);
-#endif
-
-static void
-exchange (argv)
- char **argv;
-{
- int bottom = first_nonopt;
- int middle = last_nonopt;
- int top = optind;
- char *tem;
-
- /* Exchange the shorter segment with the far end of the longer segment.
- That puts the shorter segment into the right place.
- It leaves the longer segment in the right place overall,
- but it consists of two parts that need to be swapped next. */
-
- while (top > middle && middle > bottom)
- {
- if (top - middle > middle - bottom)
- {
- /* Bottom segment is the short one. */
- int len = middle - bottom;
- register int i;
-
- /* Swap it with the top part of the top segment. */
- for (i = 0; i < len; i++)
- {
- tem = argv[bottom + i];
- argv[bottom + i] = argv[top - (middle - bottom) + i];
- argv[top - (middle - bottom) + i] = tem;
- }
- /* Exclude the moved bottom segment from further swapping. */
- top -= len;
- }
- else
- {
- /* Top segment is the short one. */
- int len = top - middle;
- register int i;
-
- /* Swap it with the bottom part of the bottom segment. */
- for (i = 0; i < len; i++)
- {
- tem = argv[bottom + i];
- argv[bottom + i] = argv[middle + i];
- argv[middle + i] = tem;
- }
- /* Exclude the moved top segment from further swapping. */
- bottom += len;
- }
- }
-
- /* Update records for the slots the non-options now occupy. */
-
- first_nonopt += (optind - last_nonopt);
- last_nonopt = optind;
-}
-
-/* Initialize the internal data when the first call is made. */
-
-#if defined (__STDC__) && __STDC__
-static const char *_getopt_initialize (int, char *const *, const char *);
-#endif
-static const char *
-_getopt_initialize (argc, argv, optstring)
- int argc;
- char *const *argv;
- const char *optstring;
-{
- /* Start processing options with ARGV-element 1 (since ARGV-element 0
- is the program name); the sequence of previously skipped
- non-option ARGV-elements is empty. */
-
- first_nonopt = last_nonopt = optind = 1;
-
- nextchar = NULL;
-
- posixly_correct = getenv ("POSIXLY_CORRECT");
-
- /* Determine how to handle the ordering of options and nonoptions. */
-
- if (optstring[0] == '-')
- {
- ordering = RETURN_IN_ORDER;
- ++optstring;
- }
- else if (optstring[0] == '+')
- {
- ordering = REQUIRE_ORDER;
- ++optstring;
- }
- else if (posixly_correct != NULL)
- ordering = REQUIRE_ORDER;
- else
- ordering = PERMUTE;
-
-#ifdef _LIBC
- if (posixly_correct == NULL
- && argc == original_argc && argv == original_argv)
- {
- /* Bash 2.0 puts a special variable in the environment for each
- command it runs, specifying which ARGV elements are the results of
- file name wildcard expansion and therefore should not be
- considered as options. */
- char var[100];
- sprintf (var, "_%d_GNU_nonoption_argv_flags_", getpid ());
- nonoption_flags = getenv (var);
- if (nonoption_flags == NULL)
- nonoption_flags_len = 0;
- else
- nonoption_flags_len = strlen (nonoption_flags);
- }
- else
- nonoption_flags_len = 0;
-#endif
-
- return optstring;
-}
-
-/* Scan elements of ARGV (whose length is ARGC) for option characters
- given in OPTSTRING.
-
- If an element of ARGV starts with '-', and is not exactly "-" or "--",
- then it is an option element. The characters of this element
- (aside from the initial '-') are option characters. If `getopt'
- is called repeatedly, it returns successively each of the option characters
- from each of the option elements.
-
- If `getopt' finds another option character, it returns that character,
- updating `optind' and `nextchar' so that the next call to `getopt' can
- resume the scan with the following option character or ARGV-element.
-
- If there are no more option characters, `getopt' returns -1.
- Then `optind' is the index in ARGV of the first ARGV-element
- that is not an option. (The ARGV-elements have been permuted
- so that those that are not options now come last.)
-
- OPTSTRING is a string containing the legitimate option characters.
- If an option character is seen that is not listed in OPTSTRING,
- return '?' after printing an error message. If you set `opterr' to
- zero, the error message is suppressed but we still return '?'.
-
- If a char in OPTSTRING is followed by a colon, that means it wants an arg,
- so the following text in the same ARGV-element, or the text of the following
- ARGV-element, is returned in `optarg'. Two colons mean an option that
- wants an optional arg; if there is text in the current ARGV-element,
- it is returned in `optarg', otherwise `optarg' is set to zero.
-
- If OPTSTRING starts with `-' or `+', it requests different methods of
- handling the non-option ARGV-elements.
- See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
-
- Long-named options begin with `--' instead of `-'.
- Their names may be abbreviated as long as the abbreviation is unique
- or is an exact match for some defined option. If they have an
- argument, it follows the option name in the same ARGV-element, separated
- from the option name by a `=', or else the in next ARGV-element.
- When `getopt' finds a long-named option, it returns 0 if that option's
- `flag' field is nonzero, the value of the option's `val' field
- if the `flag' field is zero.
-
- The elements of ARGV aren't really const, because we permute them.
- But we pretend they're const in the prototype to be compatible
- with other systems.
-
- LONGOPTS is a vector of `struct option' terminated by an
- element containing a name which is zero.
-
- LONGIND returns the index in LONGOPT of the long-named option found.
- It is only valid when a long-named option has been found by the most
- recent call.
-
- If LONG_ONLY is nonzero, '-' as well as '--' can introduce
- long-named options. */
-
-int
-_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
- int argc;
- char *const *argv;
- const char *optstring;
- const struct option *longopts;
- int *longind;
- int long_only;
-{
- optarg = NULL;
-
- if (!__getopt_initialized || optind == 0)
- {
- optstring = _getopt_initialize (argc, argv, optstring);
- optind = 1; /* Don't scan ARGV[0], the program name. */
- __getopt_initialized = 1;
- }
-
- /* Test whether ARGV[optind] points to a non-option argument.
- Either it does not have option syntax, or there is an environment flag
- from the shell indicating it is not an option. The later information
- is only used when the used in the GNU libc. */
-#ifdef _LIBC
-#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
- || (optind < nonoption_flags_len \
- && nonoption_flags[optind] == '1'))
-#else
-#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
-#endif
-
- if (nextchar == NULL || *nextchar == '\0')
- {
- /* Advance to the next ARGV-element. */
-
- /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
- moved back by the user (who may also have changed the arguments). */
- if (last_nonopt > optind)
- last_nonopt = optind;
- if (first_nonopt > optind)
- first_nonopt = optind;
-
- if (ordering == PERMUTE)
- {
- /* If we have just processed some options following some non-options,
- exchange them so that the options come first. */
-
- if (first_nonopt != last_nonopt && last_nonopt != optind)
- exchange ((char **) argv);
- else if (last_nonopt != optind)
- first_nonopt = optind;
-
- /* Skip any additional non-options
- and extend the range of non-options previously skipped. */
-
- while (optind < argc && NONOPTION_P)
- optind++;
- last_nonopt = optind;
- }
-
- /* The special ARGV-element `--' means premature end of options.
- Skip it like a null option,
- then exchange with previous non-options as if it were an option,
- then skip everything else like a non-option. */
-
- if (optind != argc && !strcmp (argv[optind], "--"))
- {
- optind++;
-
- if (first_nonopt != last_nonopt && last_nonopt != optind)
- exchange ((char **) argv);
- else if (first_nonopt == last_nonopt)
- first_nonopt = optind;
- last_nonopt = argc;
-
- optind = argc;
- }
-
- /* If we have done all the ARGV-elements, stop the scan
- and back over any non-options that we skipped and permuted. */
-
- if (optind == argc)
- {
- /* Set the next-arg-index to point at the non-options
- that we previously skipped, so the caller will digest them. */
- if (first_nonopt != last_nonopt)
- optind = first_nonopt;
- return -1;
- }
-
- /* If we have come to a non-option and did not permute it,
- either stop the scan or describe it to the caller and pass it by. */
-
- if (NONOPTION_P)
- {
- if (ordering == REQUIRE_ORDER)
- return -1;
- optarg = argv[optind++];
- return 1;
- }
-
- /* We have found another option-ARGV-element.
- Skip the initial punctuation. */
-
- nextchar = (argv[optind] + 1
- + (longopts != NULL && argv[optind][1] == '-'));
- }
-
- /* Decode the current option-ARGV-element. */
-
- /* Check whether the ARGV-element is a long option.
-
- If long_only and the ARGV-element has the form "-f", where f is
- a valid short option, don't consider it an abbreviated form of
- a long option that starts with f. Otherwise there would be no
- way to give the -f short option.
-
- On the other hand, if there's a long option "fubar" and
- the ARGV-element is "-fu", do consider that an abbreviation of
- the long option, just like "--fu", and not "-f" with arg "u".
-
- This distinction seems to be the most useful approach. */
-
- if (longopts != NULL
- && (argv[optind][1] == '-'
- || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
- {
- char *nameend;
- const struct option *p;
- const struct option *pfound = NULL;
- int exact = 0;
- int ambig = 0;
- int indfound = -1;
- int option_index;
-
- for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
- /* Do nothing. */ ;
-
- /* Test all long options for either exact match
- or abbreviated matches. */
- for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (!strncmp (p->name, nextchar, nameend - nextchar))
- {
- if ((unsigned int) (nameend - nextchar)
- == (unsigned int) strlen (p->name))
- {
- /* Exact match found. */
- pfound = p;
- indfound = option_index;
- exact = 1;
- break;
- }
- else if (pfound == NULL)
- {
- /* First nonexact match found. */
- pfound = p;
- indfound = option_index;
- }
- else
- /* Second or later nonexact match found. */
- ambig = 1;
- }
-
- if (ambig && !exact)
- {
- if (opterr)
- fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
- argv[0], argv[optind]);
- nextchar += strlen (nextchar);
- optind++;
- optopt = 0;
- return '?';
- }
-
- if (pfound != NULL)
- {
- option_index = indfound;
- optind++;
- if (*nameend)
- {
- /* Don't test has_arg with >, because some C compilers don't
- allow it to be used on enums. */
- if (pfound->has_arg)
- optarg = nameend + 1;
- else
- {
- if (opterr)
- if (argv[optind - 1][1] == '-')
- /* --option */
- fprintf (stderr,
- _("%s: option `--%s' doesn't allow an argument\n"),
- argv[0], pfound->name);
- else
- /* +option or -option */
- fprintf (stderr,
- _("%s: option `%c%s' doesn't allow an argument\n"),
- argv[0], argv[optind - 1][0], pfound->name);
-
- nextchar += strlen (nextchar);
-
- optopt = pfound->val;
- return '?';
- }
- }
- else if (pfound->has_arg == 1)
- {
- if (optind < argc)
- optarg = argv[optind++];
- else
- {
- if (opterr)
- fprintf (stderr,
- _("%s: option `%s' requires an argument\n"),
- argv[0], argv[optind - 1]);
- nextchar += strlen (nextchar);
- optopt = pfound->val;
- return optstring[0] == ':' ? ':' : '?';
- }
- }
- nextchar += strlen (nextchar);
- if (longind != NULL)
- *longind = option_index;
- if (pfound->flag)
- {
- *(pfound->flag) = pfound->val;
- return 0;
- }
- return pfound->val;
- }
-
- /* Can't find it as a long option. If this is not getopt_long_only,
- or the option starts with '--' or is not a valid short
- option, then it's an error.
- Otherwise interpret it as a short option. */
- if (!long_only || argv[optind][1] == '-'
- || my_index (optstring, *nextchar) == NULL)
- {
- if (opterr)
- {
- if (argv[optind][1] == '-')
- /* --option */
- fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
- argv[0], nextchar);
- else
- /* +option or -option */
- fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
- argv[0], argv[optind][0], nextchar);
- }
- nextchar = (char *) "";
- optind++;
- optopt = 0;
- return '?';
- }
- }
-
- /* Look at and handle the next short option-character. */
-
- {
- char c = *nextchar++;
- char *temp = my_index (optstring, c);
-
- /* Increment `optind' when we start to process its last character. */
- if (*nextchar == '\0')
- ++optind;
-
- if (temp == NULL || c == ':')
- {
- if (opterr)
- {
- if (posixly_correct)
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr, _("%s: illegal option -- %c\n"),
- argv[0], c);
- else
- fprintf (stderr, _("%s: invalid option -- %c\n"),
- argv[0], c);
- }
- optopt = c;
- return '?';
- }
- /* Convenience. Treat POSIX -W foo same as long option --foo */
- if (temp[0] == 'W' && temp[1] == ';')
- {
- char *nameend;
- const struct option *p;
- const struct option *pfound = NULL;
- int exact = 0;
- int ambig = 0;
- int indfound = 0;
- int option_index;
-
- /* This is an option that requires an argument. */
- if (*nextchar != '\0')
- {
- optarg = nextchar;
- /* If we end this ARGV-element by taking the rest as an arg,
- we must advance to the next element now. */
- optind++;
- }
- else if (optind == argc)
- {
- if (opterr)
- {
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr, _("%s: option requires an argument -- %c\n"),
- argv[0], c);
- }
- optopt = c;
- if (optstring[0] == ':')
- c = ':';
- else
- c = '?';
- return c;
- }
- else
- /* We already incremented `optind' once;
- increment it again when taking next ARGV-elt as argument. */
- optarg = argv[optind++];
-
- /* optarg is now the argument, see if it's in the
- table of longopts. */
-
- for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++)
- /* Do nothing. */ ;
-
- /* Test all long options for either exact match
- or abbreviated matches. */
- for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (!strncmp (p->name, nextchar, nameend - nextchar))
- {
- if ((unsigned int) (nameend - nextchar) == strlen (p->name))
- {
- /* Exact match found. */
- pfound = p;
- indfound = option_index;
- exact = 1;
- break;
- }
- else if (pfound == NULL)
- {
- /* First nonexact match found. */
- pfound = p;
- indfound = option_index;
- }
- else
- /* Second or later nonexact match found. */
- ambig = 1;
- }
- if (ambig && !exact)
- {
- if (opterr)
- fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
- argv[0], argv[optind]);
- nextchar += strlen (nextchar);
- optind++;
- return '?';
- }
- if (pfound != NULL)
- {
- option_index = indfound;
- if (*nameend)
- {
- /* Don't test has_arg with >, because some C compilers don't
- allow it to be used on enums. */
- if (pfound->has_arg)
- optarg = nameend + 1;
- else
- {
- if (opterr)
- fprintf (stderr, _("\
-%s: option `-W %s' doesn't allow an argument\n"),
- argv[0], pfound->name);
-
- nextchar += strlen (nextchar);
- return '?';
- }
- }
- else if (pfound->has_arg == 1)
- {
- if (optind < argc)
- optarg = argv[optind++];
- else
- {
- if (opterr)
- fprintf (stderr,
- _("%s: option `%s' requires an argument\n"),
- argv[0], argv[optind - 1]);
- nextchar += strlen (nextchar);
- return optstring[0] == ':' ? ':' : '?';
- }
- }
- nextchar += strlen (nextchar);
- if (longind != NULL)
- *longind = option_index;
- if (pfound->flag)
- {
- *(pfound->flag) = pfound->val;
- return 0;
- }
- return pfound->val;
- }
- nextchar = NULL;
- return 'W'; /* Let the application handle it. */
- }
- if (temp[1] == ':')
- {
- if (temp[2] == ':')
- {
- /* This is an option that accepts an argument optionally. */
- if (*nextchar != '\0')
- {
- optarg = nextchar;
- optind++;
- }
- else
- optarg = NULL;
- nextchar = NULL;
- }
- else
- {
- /* This is an option that requires an argument. */
- if (*nextchar != '\0')
- {
- optarg = nextchar;
- /* If we end this ARGV-element by taking the rest as an arg,
- we must advance to the next element now. */
- optind++;
- }
- else if (optind == argc)
- {
- if (opterr)
- {
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr,
- _("%s: option requires an argument -- %c\n"),
- argv[0], c);
- }
- optopt = c;
- if (optstring[0] == ':')
- c = ':';
- else
- c = '?';
- }
- else
- /* We already incremented `optind' once;
- increment it again when taking next ARGV-elt as argument. */
- optarg = argv[optind++];
- nextchar = NULL;
- }
- }
- return c;
- }
-}
-
-int
-getopt (argc, argv, optstring)
- int argc;
- char *const *argv;
- const char *optstring;
-{
- return _getopt_internal (argc, argv, optstring,
- (const struct option *) 0,
- (int *) 0,
- 0);
-}
-
-#endif /* Not ELIDE_CODE. */
-
-#ifdef TEST
-
-/* Compile with -DTEST to make an executable for use in testing
- the above definition of `getopt'. */
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- int c;
- int digit_optind = 0;
-
- while (1)
- {
- int this_option_optind = optind ? optind : 1;
-
- c = getopt (argc, argv, "abc:d:0123456789");
- if (c == -1)
- break;
-
- switch (c)
- {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- if (digit_optind != 0 && digit_optind != this_option_optind)
- printf ("digits occur in two different argv-elements.\n");
- digit_optind = this_option_optind;
- printf ("option %c\n", c);
- break;
-
- case 'a':
- printf ("option a\n");
- break;
-
- case 'b':
- printf ("option b\n");
- break;
-
- case 'c':
- printf ("option c with value `%s'\n", optarg);
- break;
-
- case '?':
- break;
-
- default:
- printf ("?? getopt returned character code 0%o ??\n", c);
- }
- }
-
- if (optind < argc)
- {
- printf ("non-option ARGV-elements: ");
- while (optind < argc)
- printf ("%s ", argv[optind++]);
- printf ("\n");
- }
-
- exit (0);
-}
-
-#endif /* TEST */
-
-#endif /* !HAVE_GETOPT */
diff --git a/d2pack109/src/compat/getopt.h b/d2pack109/src/compat/getopt.h
deleted file mode 100644
index 561fa53..0000000
--- a/d2pack109/src/compat/getopt.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/* Declarations for getopt.
- Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
-
- This file is part of the GNU C Library. Its master source is NOT part of
- the C library, however. The master source lives in /gd/gnu/lib.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _PVPGN_GETOPT_H_
-#define _PVPGN_GETOPT_H_ 1
-
-#include "common/setup_before.h"
-
-#ifdef HAVE_UNISTD_H
-# include
-#endif
-
-#ifndef HAVE_GETOPT
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* For communication from `getopt' to the caller.
- When `getopt' finds an option that takes an argument,
- the argument value is returned here.
- Also, when `ordering' is RETURN_IN_ORDER,
- each non-option ARGV-element is returned here. */
-
-extern char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
- This is used for communication to and from the caller
- and for communication between successive calls to `getopt'.
-
- On entry to `getopt', zero means this is the first call; initialize.
-
- When `getopt' returns -1, this is the index of the first of the
- non-option elements that the caller should itself scan.
-
- Otherwise, `optind' communicates from one call to the next
- how much of ARGV has been scanned so far. */
-
-extern int optind;
-
-/* Callers store zero here to inhibit the error message `getopt' prints
- for unrecognized options. */
-
-extern int opterr;
-
-/* Set to an option character which was unrecognized. */
-
-extern 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
- of `struct option' terminated by an element containing a name which is
- zero.
-
- The field `has_arg' is:
- no_argument (or 0) if the option does not take an argument,
- required_argument (or 1) if the option requires an argument,
- optional_argument (or 2) if the option takes an optional argument.
-
- If the field `flag' is not NULL, it points to a variable that is set
- to the value given in the field `val' when the option is found, but
- left unchanged if the option is not found.
-
- To have a long-named option do something other than set an `int' to
- a compiled-in constant, such as set a value from `optarg', set the
- option's `flag' field to zero and its `val' field to a nonzero
- value (the equivalent single-letter option character, if there is
- one). For long options that have a zero `flag' field, `getopt'
- returns the contents of the `val' field. */
-
-struct option
-{
-#if defined (__STDC__) && __STDC__
- const char *name;
-#else
- char *name;
-#endif
- /* has_arg can't be an enum because some compilers complain about
- type mismatches in all the code that assumes it is an int. */
- int has_arg;
- int *flag;
- int val;
-};
-
-/* Names for the values of the `has_arg' field of `struct option'. */
-
-#define no_argument 0
-#define required_argument 1
-#define optional_argument 2
-
-#ifdef WIN32
-#define extern
-#endif
-
-#if defined (__STDC__) && __STDC__
-#ifdef __GNU_LIBRARY__
-/* Many other libraries have conflicting prototypes for getopt, with
- differences in the consts, in stdlib.h. To avoid compilation
- errors, only prototype getopt for the GNU C library. */
-extern int getopt (int argc, char *const *argv, const char *shortopts);
-#else /* not __GNU_LIBRARY__ */
-extern int getopt ();
-#endif /* __GNU_LIBRARY__ */
-extern int getopt_long (int argc, char *const *argv, const char *shortopts,
- const struct option *longopts, int *longind);
-extern int getopt_long_only (int argc, char *const *argv,
- const char *shortopts,
- const struct option *longopts, int *longind);
-
-/* Internal only. Users should not call this directly. */
-extern int _getopt_internal (int argc, char *const *argv,
- const char *shortopts,
- const struct option *longopts, int *longind,
- int long_only);
-#else /* not __STDC__ */
-extern int getopt ();
-extern int getopt_long ();
-extern int getopt_long_only ();
-
-extern int _getopt_internal ();
-#endif /* __STDC__ */
-
-#ifdef WIN32
-#undef extern
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !HAVE_GETOPT */
-
-#endif /* _PVPGN_GETOPT_H_ */
diff --git a/d2pack109/src/compat/gettimeofday.c b/d2pack109/src/compat/gettimeofday.c
deleted file mode 100644
index 6633b34..0000000
--- a/d2pack109/src/compat/gettimeofday.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#include "common/setup_before.h"
-#ifndef HAVE_GETTIMEOFDAY
-
-#include
-#ifdef TIME_WITH_SYS_TIME
-# include
-# include
-#else
-# ifdef HAVE_SYS_TIME_H
-# include
-# else
-# include
-# endif
-#endif
-#ifdef HAVE_SYS_TIMEB_H
-# include
-#endif
-#include "gettimeofday.h"
-#include "common/setup_after.h"
-
-
-extern int gettimeofday(struct timeval * tv, struct timezone * tz)
-{
-#ifdef HAVE_FTIME
- struct timeb tb;
-#endif
-
- if (!tv)
- {
- errno = EFAULT;
- return -1;
- }
-
-#ifdef HAVE_FTIME
- tb.millitm = 0; /* apparently the MS CRT version of this doesn't set this member */
- /* FIXME: what would be a more appropriate function for that platform? */
- ftime(&tb); /* FIXME: some versions are void return others int */
-
- tv->tv_sec = tb.time;
- tv->tv_usec = ((long)tb.millitm)*1000;
- if (tz)
- {
- tz->tz_minuteswest = 0;
- tz->tz_dsttime = 0;
- }
-
- return 0;
-#else
-# error "This program requires either gettimeofday() or ftime()"
-#endif
-}
-
-#else
-typedef int filenotempty; /* make ISO standard happy */
-#endif
diff --git a/d2pack109/src/compat/gettimeofday.h b/d2pack109/src/compat/gettimeofday.h
deleted file mode 100644
index 33164ee..0000000
--- a/d2pack109/src/compat/gettimeofday.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#ifndef INCLUDED_GETTIMEOFDAY_TYPES
-#define INCLUDED_GETTIMEOFDAY_TYPES
-
-#ifndef HAVE_GETTIMEOFDAY
-
-/* FIXME: these might already exist even if gettimeofday() doesn't */
-struct timeval
-{
- long tv_sec;
- long tv_usec;
-};
-
-
-struct timezone
-{
- int tz_minuteswest;
- int tz_dsttime;
-};
-
-#endif
-
-#endif
-
-
-#ifndef INCLUDED_GETTIMEOFDAY_PROTOS
-#define INCLUDED_GETTIMEOFDAY_PROTOS
-
-#ifndef HAVE_GETTIMEOFDAY
-extern int gettimeofday(struct timeval * tv, struct timezone * tz);
-#endif
-
-#endif
diff --git a/d2pack109/src/compat/inet_aton.c b/d2pack109/src/compat/inet_aton.c
deleted file mode 100644
index 9088313..0000000
--- a/d2pack109/src/compat/inet_aton.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * ++Copyright++ 1983, 1990, 1993
- * -
- * Copyright (c) 1983, 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-#include "common/setup_before.h"
-#ifndef HAVE_INET_ATON
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93";
-static char rcsid[] = "$Id: inet_aton.c,v 1.1.1.1 2004/03/11 18:57:31 dizzy Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include
-#ifdef HAVE_SYS_TYPES_H
-# include
-#endif
-#ifdef HAVE_SYS_PARAM_H
-# include
-#endif
-#ifdef HAVE_NETINET_IN_H
-# include
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include
-#endif
-#include "compat/socket.h" /* for Win32 address types, maybe there should be compat/netinet_in.h */
-#include "inet_aton.h"
-#include "common/setup_after.h"
-
-
-/*
- * Check whether "cp" is a valid ASCII representation
- * of an Internet address and convert to a binary address.
- * Returns 1 if the address is valid, 0 if not.
- * This replaces inet_addr, the return value from which
- * cannot distinguish between failure and a local wildcard address.
- * Only handles IPv4.
- * Assumes 32-bit ints.
- */
-extern int inet_aton(char const * cp, struct in_addr * addr)
-{
- unsigned int val;
- int base, n;
- char c;
- unsigned int parts[4];
- unsigned int *pp = parts;
-
- c = *cp;
- for (;;) {
- /*
- * Collect number up to ``.''.
- * Values are specified as for C:
- * 0x=hex, 0=octal, isdigit=decimal.
- */
- if (!isdigit((int)c))
- return (0);
- val = 0; base = 10;
- if (c == '0') {
- c = *++cp;
- if (c == 'x' || c == 'X')
- base = 16, c = *++cp;
- else
- base = 8;
- }
- for (;;) {
- if (isascii((int)c) && isdigit((int)c)) {
- val = (val * base) + (c - '0');
- c = *++cp;
- } else if (base == 16 && isascii((int)c) && isxdigit((int)c)) {
- val = (val << 4) |
- (c + 10 - (islower((int)c) ? 'a' : 'A'));
- c = *++cp;
- } else
- break;
- }
- if (c == '.') {
- /*
- * Internet format:
- * a.b.c.d
- * a.b.c (with c treated as 16 bits)
- * a.b (with b treated as 24 bits)
- */
- if (pp >= parts + 3)
- return (0);
- *pp++ = val;
- c = *++cp;
- } else
- break;
- }
- /*
- * Check for trailing characters.
- */
- if (c != '\0' && (!isascii((int)c) || !isspace((int)c)))
- return (0);
- /*
- * Concoct the address according to
- * the number of parts specified.
- */
- n = pp - parts + 1;
- switch (n) {
-
- case 0:
- return (0); /* initial nondigit */
-
- case 1: /* a -- 32 bits */
- break;
-
- case 2: /* a.b -- 8.24 bits */
- if (val > 0xffffff)
- return (0);
- val |= parts[0] << 24;
- break;
-
- case 3: /* a.b.c -- 8.8.16 bits */
- if (val > 0xffff)
- return (0);
- val |= (parts[0] << 24) | (parts[1] << 16);
- break;
-
- case 4: /* a.b.c.d -- 8.8.8.8 bits */
- if (val > 0xff)
- return (0);
- val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
- break;
- }
- if (addr)
- addr->s_addr = htonl(val);
- return (1);
-}
-
-#else
-typedef int filenotempty; /* make ISO standard happy */
-#endif
diff --git a/d2pack109/src/compat/inet_aton.h b/d2pack109/src/compat/inet_aton.h
deleted file mode 100644
index 87a5a0a..0000000
--- a/d2pack109/src/compat/inet_aton.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * ++Copyright++ 1983, 1990, 1993
- * -
- * Copyright (c) 1983, 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-#ifndef INCLUDED_INET_ATON_H
-#define INCLUDED_INET_ATON_H
-
-#ifndef HAVE_INET_ATON
-
-#ifdef HAVE_NETINET_IN_H
-# include
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include
-#endif
-
-extern int inet_aton(char const * cp, struct in_addr * addr);
-
-#endif
-
-#endif
diff --git a/d2pack109/src/compat/inet_ntoa.c b/d2pack109/src/compat/inet_ntoa.c
deleted file mode 100644
index 997e52c..0000000
--- a/d2pack109/src/compat/inet_ntoa.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-#include "common/setup_before.h"
-#ifndef HAVE_INET_NTOA
-
-#include
-#ifdef HAVE_STDDEF_H
-# include
-#else
-# ifndef NULL
-# define NULL ((void *)0)
-# endif
-#endif
-#ifdef HAVE_SYS_TYPES
-# include
-#endif
-#ifdef HAVE_SYS_PARAM_H
-# include
-#endif
-#ifdef HAVE_NETINET_IN_H
-# include
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include