diff --git a/.gitignore b/.gitignore index 2069415..378eac2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,40 +1 @@ -COPYING -INSTALL -README -AUTHORS -NEWS -Makefile.in -Makefile -aclocal.m4 -autom4te.cache -configure -config.cache -config.h -config.log -config.rpath -config.status -compile -depcomp -description-pak -install-sh -missing -po/stamp-it -src/gamesxml2c -.*.swp -*.o -*.a -*.mo -intl -intltool-extract.in -intltool-merge.in -intltool-update.in -intltool-extract -intltool-merge -intltool-update -intltool-modules -libtool -m4 -mkinstalldirs -xqf.spec -xqf.desktop -xqf +build diff --git a/.travis.yml b/.travis.yml index d8af5ba..d199830 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,11 +6,12 @@ compiler: before_install: - sudo apt-get update -qq - - sudo apt-get install -q -y qstat intltool - - ./autogen.sh + - sudo apt-get install -q -y qstat intltool cmake + - echo 'install libminizip-dev from ubuntu vivid if current release is older than vivid:' + - echo 'c2V0IC14CgojIGlmIHJlbGVhc2Ugb2xkZXIgdGhhbiB2aXZpZCAoMTUuMDQpCmlmIFsgIiQobHNiX3JlbGVhc2UgLXNyIHwgY3V0IC1jMS0yKSIgLWx0ICcxNScgXQp0aGVuCgogICAgIyBhZGQgdml2aWQgcmVwb3NpdG9yeSAobGlibWluaXppcC1kZXYgaXMgc2hpcGVkIGluIHVuaXZlcnNlKQogICAgZWNobzE9Ii9ldGMvYXB0L3NvdXJjZXMubGlzdC5kL3VidW50dS12aXZpZC1tYWluLmxpc3QiCgogICAgZWNobyAiZGViIGh0dHA6Ly9hcmNoaXZlLnVidW50dS5jb20vdWJ1bnR1IHZpdmlkIG1haW4gdW5pdmVyc2UiID4+ICR7ZWNobzF9CgogICAgIyBwaW4gdml2aWQgcmVwb3NpdG9yeSB0byBkaXNhYmxlIHBhY2thZ2UgaW5zdGFsbGF0aW9uIGZyb20gdGhpcyByZXBvc2l0b3J5IGJ5IGRlZmF1bHQKICAgIGVjaG8yPSIvZXRjL2FwdC9wcmVmZXJlbmNlcy5kL3ZpdmlkLXBpbm5pbmciCgogICAgZWNobyAiUGFja2FnZTogKiIgPj4gJHtlY2hvMn0KICAgIGVjaG8gIlBpbjogcmVsZWFzZSBuPXZpdmlkIiA+PiAke2VjaG8yfQogICAgZWNobyAiUGluLVByaW9yaXR5OiAtMTAwIiA+PiAke2VjaG8yfQoKICAgICMgYWRkIHRoZSB2aXZpZCByZXBvc2l0b3J5IGtleQogICAgYXB0LWtleSBhZHYgLS1yZWN2LWtleXMgLS1rZXlzZXJ2ZXIga2V5c2VydmVyLnVidW50dS5jb20gM0I0RkU2QUNDMEIyMUYzMgoKICAgICMgdXBkYXRlIHRoZSByZXBvc2l0b3JpZXMKICAgIGFwdC1nZXQgdXBkYXRlIC1xcQoKICAgICMgaW5zdGFsbCBsaWJtaW5pemlwLWRldiAoYW5kIGRlcGVuZGVuY2llcykgZnJvbSB2aXZpZAogICAgYXB0LWdldCBpbnN0YWxsIC15IC1xIC10IHZpdmlkIGxpYmdlb2lwLWRldiBsaWJtaW5pemlwLWRldiBnZXR0ZXh0CmZpCg==' | base64 -d | sudo -s script: - - ./configure --with-qstat=quakestat + - cmake -DWITH_QSTAT=/usr/bin/quakestat . - make notifications: diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..3d22f60 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,286 @@ +cmake_minimum_required(VERSION 2.8.7) + +# Project information +project(xqf) + +set (VERSION "1.0.6.2") +set (DOMAIN ${PROJECT_NAME}) + +set (LINGUAS ca da de es fi fr pl ru) + +# Paths +set (PACKAGE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/xqf") +set (LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/locale") +set (PIXMAPS_ENTRY_PATH ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor) + +if (NOT CMAKE_INSTALL_PREFIX) + set (CMAKE_INSTALL_PREFIX "/usr") +endif (NOT CMAKE_INSTALL_PREFIX) + +# Definitions +add_definitions (-DPACKAGE="${PROJECT_NAME}" -DPACKAGE_VERSION="${VERSION}" -DXQF_VERSION="${VERSION}" -DDOMAIN="${DOMAIN}" -DLOCALEDIR="${LOCALEDIR}" -DPACKAGE_DATA_DIR="${PACKAGE_DATA_DIR}") + +# Options +option(USE_GTK3 "Use GTK+ toolkit version 3" OFF) +option(DEPRECATED_DISABLE "Disable deprecated parts of GLib, GObject, GDK and GTK+" OFF) + +option(USE_GEOIP "Depend on GeoIP library for geolocation" ON) +option(USE_GZIP "Enable gzip compressor support" ON) +option(RCON_STANDALONE "Build standalone RCON" OFF) + +if (NOT WITH_QSTAT) + set (WITH_QSTAT "/usr/bin/qstat") +endif (NOT WITH_QSTAT) + +add_definitions (-DQSTAT_EXEC="${WITH_QSTAT}") + +if (CMAKE_BUILD_TYPE EQUAL DEBUG) + add_definitions (-DDEBUG) +endif (CMAKE_BUILD_TYPE EQUAL DEBUG) + +if (RCON_STANDALONE) + add_definitions (-DRCON_STANDALONE) +endif (RCON_STANDALONE) + +if (USE_GEOIP) + add_definitions (-DUSE_GEOIP) +endif (USE_GEOIP) + +if (USE_GZIP) + add_definitions (-DUSE_GZIP) +endif (USE_GZIP) + +# Source list +set (xqf_HEADERS_DIR ${CMAKE_SOURCE_DIR}/src) + +set (xqf_SOURCES + + ${CMAKE_SOURCE_DIR}/src/xqf.ui + + ${CMAKE_SOURCE_DIR}/src/addmaster.c + ${CMAKE_SOURCE_DIR}/src/addserver.c + ${CMAKE_SOURCE_DIR}/src/config.c + ${CMAKE_SOURCE_DIR}/src/country-filter.c + ${CMAKE_SOURCE_DIR}/src/debug.c + ${CMAKE_SOURCE_DIR}/src/dialogs.c + ${CMAKE_SOURCE_DIR}/src/dns.c + ${CMAKE_SOURCE_DIR}/src/filter.c + ${CMAKE_SOURCE_DIR}/src/flt-player.c + ${CMAKE_SOURCE_DIR}/src/game.c + ${CMAKE_SOURCE_DIR}/src/history.c + ${CMAKE_SOURCE_DIR}/src/host.c + ${CMAKE_SOURCE_DIR}/src/launch.c + ${CMAKE_SOURCE_DIR}/src/menus.c + ${CMAKE_SOURCE_DIR}/src/pixmaps.c + ${CMAKE_SOURCE_DIR}/src/pref.c + ${CMAKE_SOURCE_DIR}/src/psearch.c + ${CMAKE_SOURCE_DIR}/src/rc.c + ${CMAKE_SOURCE_DIR}/src/rcon.c + ${CMAKE_SOURCE_DIR}/src/server.c + ${CMAKE_SOURCE_DIR}/src/skin.c + ${CMAKE_SOURCE_DIR}/src/skin_pcx.c + ${CMAKE_SOURCE_DIR}/src/sort.c + ${CMAKE_SOURCE_DIR}/src/source.c + ${CMAKE_SOURCE_DIR}/src/srv-info.c + ${CMAKE_SOURCE_DIR}/src/srv-list.c + ${CMAKE_SOURCE_DIR}/src/srv-prop.c + ${CMAKE_SOURCE_DIR}/src/stat.c + ${CMAKE_SOURCE_DIR}/src/statistics.c + ${CMAKE_SOURCE_DIR}/src/utils.c + ${CMAKE_SOURCE_DIR}/src/xqf.c + ${CMAKE_SOURCE_DIR}/src/xqf-ui.c + ${CMAKE_SOURCE_DIR}/src/zipped.c + ${CMAKE_SOURCE_DIR}/src/redial.c + ${CMAKE_SOURCE_DIR}/src/q3maps.c + ${CMAKE_SOURCE_DIR}/src/utmaps.c + ${CMAKE_SOURCE_DIR}/src/loadpixmap.c + ${CMAKE_SOURCE_DIR}/src/scripts.c + ${CMAKE_SOURCE_DIR}/src/tga/memtopixmap.c + ${CMAKE_SOURCE_DIR}/src/tga/tga.c + + ${CMAKE_SOURCE_DIR}/src/addmaster.h + ${CMAKE_SOURCE_DIR}/src/addserver.h + ${CMAKE_SOURCE_DIR}/src/config.h + ${CMAKE_SOURCE_DIR}/src/country-filter.h + ${CMAKE_SOURCE_DIR}/src/debug.h + ${CMAKE_SOURCE_DIR}/src/dialogs.h + ${CMAKE_SOURCE_DIR}/src/dns.h + ${CMAKE_SOURCE_DIR}/src/filter.h + ${CMAKE_SOURCE_DIR}/src/flt-player.h + ${CMAKE_SOURCE_DIR}/src/game.h + ${CMAKE_SOURCE_DIR}/src/history.h + ${CMAKE_SOURCE_DIR}/src/host.h + ${CMAKE_SOURCE_DIR}/src/launch.h + ${CMAKE_SOURCE_DIR}/src/menus.h + ${CMAKE_SOURCE_DIR}/src/pixmaps.h + ${CMAKE_SOURCE_DIR}/src/pref.h + ${CMAKE_SOURCE_DIR}/src/psearch.h + ${CMAKE_SOURCE_DIR}/src/quake2_pal.h + ${CMAKE_SOURCE_DIR}/src/quake_pal.h + ${CMAKE_SOURCE_DIR}/src/rc.h + ${CMAKE_SOURCE_DIR}/src/rcon.h + ${CMAKE_SOURCE_DIR}/src/server.h + ${CMAKE_SOURCE_DIR}/src/skin.h + ${CMAKE_SOURCE_DIR}/src/skin_pcx.h + ${CMAKE_SOURCE_DIR}/src/sort.h + ${CMAKE_SOURCE_DIR}/src/source.h + ${CMAKE_SOURCE_DIR}/src/srv-info.h + ${CMAKE_SOURCE_DIR}/src/srv-list.h + ${CMAKE_SOURCE_DIR}/src/srv-prop.h + ${CMAKE_SOURCE_DIR}/src/stat.h + ${CMAKE_SOURCE_DIR}/src/statistics.h + ${CMAKE_SOURCE_DIR}/src/utils.h + ${CMAKE_SOURCE_DIR}/src/xqf-ui.h + ${CMAKE_SOURCE_DIR}/src/xqf.h + ${CMAKE_SOURCE_DIR}/src/zipped.h + ${CMAKE_SOURCE_DIR}/src/redial.h + ${CMAKE_SOURCE_DIR}/src/q3maps.h + ${CMAKE_SOURCE_DIR}/src/utmaps.h + ${CMAKE_SOURCE_DIR}/src/loadpixmap.h + ${CMAKE_SOURCE_DIR}/src/scripts.h + ${CMAKE_SOURCE_DIR}/src/tga/memtopixmap.h + ${CMAKE_SOURCE_DIR}/src/tga/tga.h + ) + +set (flag_DATA ${CMAKE_SOURCE_DIR}/src/xpm/lan.png) + +set (xpm_MAIN ${CMAKE_SOURCE_DIR}/pixmaps/xqf.xpm) + +set (xpm_DATA + + ${CMAKE_SOURCE_DIR}/src/xpm/update.xpm + ${CMAKE_SOURCE_DIR}/src/xpm/refresh.xpm + ${CMAKE_SOURCE_DIR}/src/xpm/refrsel.xpm + ${CMAKE_SOURCE_DIR}/src/xpm/stop.xpm + ${CMAKE_SOURCE_DIR}/src/xpm/connect.xpm + ${CMAKE_SOURCE_DIR}/src/xpm/observe.xpm + ${CMAKE_SOURCE_DIR}/src/xpm/record.xpm + ${CMAKE_SOURCE_DIR}/src/xpm/sfilter.xpm + ${CMAKE_SOURCE_DIR}/src/xpm/pfilter.xpm + ) + +set (icon_SIZE 22 32 48 128) + +include_directories (${xqf_HEADERS_DIR} ${CMAKE_BINARY_DIR}) + +if (DEPRECATED_DISABLE) + add_definitions (-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED + -DG_DISABLE_SINGLE_INCLUDES -DGDK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES) +endif (DEPRECATED_DISABLE) + +# Use the package PkgConfig to detect GTK+ headers/library files +find_package (PkgConfig REQUIRED) +find_package (Gettext REQUIRED) +pkg_check_modules (UNZIP REQUIRED minizip) +pkg_check_modules (XML REQUIRED libxml-2.0) + +if (USE_GTK3) + pkg_check_modules (GTK3 REQUIRED gtk+-3.0) + include_directories (${GTK3_INCLUDE_DIRS}) + link_directories (${GTK3_LIBRARY_DIRS}) + add_definitions (${GTK3_CFLAGS_OTHER}) +else (USE_GTK3) + pkg_check_modules (GTK2 REQUIRED gtk+-2.0) + include_directories (${GTK2_INCLUDE_DIRS}) + link_directories (${GTK2_LIBRARY_DIRS}) + add_definitions (${GTK2_CFLAGS_OTHER}) +endif (USE_GTK3) + +if (USE_GEOIP) + pkg_check_modules (GEOIP REQUIRED geoip) + include_directories (${GEOIP_INCLUDE_DIRS}) + link_directories (${GEOIP_LIBRARY_DIRS}) +endif (USE_GEOIP) + +include_directories (${UNZIP_INCLUDE_DIRS}) +link_directories (${UNZIP_LIBRARY_DIRS}) + +include_directories (${XML_INCLUDE_DIRS}) +link_directories (${XML_LIBRARY_DIRS}) + +include_directories (${GETTEXT_INCLUDE_DIRS}) +link_directories (${GETTEXT_LIBRARY_DIRS}) + +# Compile and link +add_executable (gamesxml2c ${CMAKE_SOURCE_DIR}/src/gamesxml2c.c) +target_link_libraries (gamesxml2c xml2) +add_custom_command (TARGET gamesxml2c COMMAND gamesxml2c ${CMAKE_SOURCE_DIR}/src/games.xml > ${CMAKE_BINARY_DIR}/games.c DEPENDS gamesxml2c) +add_definitions (-DGAMES_INCLUDE="${CMAKE_BINARY_DIR}/games.c") + +# Compile and link +add_executable (xqf ${xqf_SOURCES}) +target_link_libraries (xqf ${UNZIP_LIBRARIES} dl) + +if (USE_GTK3) + target_link_libraries (xqf ${GTK3_LIBRARIES}) +else (USE_GTK3) + target_link_libraries (xqf ${GTK2_LIBRARIES}) +endif (USE_GTK3) + +if (USE_GEOIP) + target_link_libraries (xqf GeoIP) +endif (USE_GEOIP) + +if (RCON_STANDALONE) + target_link_libraries (xqf -lreadline) +endif (RCON_STANDALONE) + +# i18n +add_custom_target (translation ALL DEPENDS) + +foreach (LANG ${LINGUAS}) + set (_poFile ${CMAKE_SOURCE_DIR}/po/${LANG}.po) + + if (EXISTS ${_poFile}) + + set (POT_FILE ${CMAKE_SOURCE_DIR}/po/${DOMAIN}.pot) + set (PO_FILE_NEW ${CMAKE_BINARY_DIR}/${LANG}.po) + set (GMO_FILE_NEW ${CMAKE_BINARY_DIR}/${LANG}.gmo) + + add_custom_command (TARGET translation + + COMMAND msgmerge ${_poFile} ${POT_FILE} -o ${PO_FILE_NEW} + COMMAND msgfmt -c -o ${GMO_FILE_NEW} ${PO_FILE_NEW}) + + endif (EXISTS ${_poFile}) +endforeach (LANG ${LINGUAS}) + +add_custom_command (TARGET translation + + COMMAND echo ${LINGUAS} > ${CMAKE_BINARY_DIR}/LINGUAS + COMMAND msgfmt --desktop -d ${CMAKE_BINARY_DIR} --template=${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.desktop.in -c -o ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.desktop + ) + +# Installation +# Executable +install (TARGETS xqf DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") + +# UI +install (FILES ${CMAKE_SOURCE_DIR}/src/xqf.ui DESTINATION ${PACKAGE_DATA_DIR}/ui) + +# Icons +install (FILES ${xpm_DATA} DESTINATION ${PACKAGE_DATA_DIR}/xpm) + +install (FILES ${xpm_MAIN} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps) + +install (FILES ${flag_DATA} DESTINATION ${PACKAGE_DATA_DIR}/default/flags) + +foreach (SIZE ${icon_SIZE}) + install (FILES ${CMAKE_SOURCE_DIR}/pixmaps/${SIZE}x${SIZE}/xqf.png + DESTINATION ${PIXMAPS_ENTRY_PATH}/${SIZE}x${SIZE}/apps) +endforeach (SIZE ${icon_SIZE}) + +install (FILES ${CMAKE_SOURCE_DIR}/pixmaps/scalable/xqf.svg DESTINATION ${PIXMAPS_ENTRY_PATH}/scalable/apps) + +# Config +install (FILES ${CMAKE_SOURCE_DIR}/src/qstat.cfg ${CMAKE_SOURCE_DIR}/src/qstat_savage.sh DESTINATION ${PACKAGE_DATA_DIR}) + +# Man pages +install (FILES ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.6 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man6) + +# i18n +foreach (LANG ${LINGUAS}) + install (FILES ${CMAKE_BINARY_DIR}/${LANG}.gmo DESTINATION ${LOCALEDIR}/${LANG}/LC_MESSAGES RENAME ${DOMAIN}.mo ) +endforeach (LANG ${LINGUAS}) + +install (FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 7d71424..0000000 --- a/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -SUBDIRS = po src docs pixmaps - -man_MANS = xqf.6 - -@INTLTOOL_DESKTOP_RULE@ - -DESKTOP_IN_FILES = xqf.desktop.in -DESKTOP_FILES = $(DESKTOP_IN_FILES:.desktop.in=.desktop) - -desktopdir= $(datadir)/applications -desktop_DATA = $(DESKTOP_FILES) - -EXTRA_DIST = \ - BUGS \ - autogen.sh \ - clean.sh \ - $(man_MANS) \ - xqf.spec \ - $(DESKTOP_IN_FILES) \ - intltool-merge.in \ - intltool-update.in \ - intltool-extract.in - -DISTCLEANFILES = \ - po/.intltool-merge-cache \ - intltool-extract \ - intltool-merge \ - intltool-update \ - $(DESKTOP_FILES) - diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index daab243..0000000 --- a/autogen.sh +++ /dev/null @@ -1,168 +0,0 @@ -#! /bin/sh -# Run this to generate all the initial makefiles, etc. - -# Stolen from the GNU Midnight Commander. Customized for giFTcurs. -# adapted for xqf - -# Make it possible to specify path in the environment -: ${AUTOCONF=autoconf} -: ${AUTOHEADER=autoheader} -: ${AUTOMAKE=automake} -: ${ACLOCAL=aclocal} -: ${GETTEXTIZE=gettextize} - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -( -cd $srcdir - -# For autotools compatibility -if ! test -e README; then - ln -s README.md README -fi - -# For autotools compatibility -if ! test -e NEWS; then - ln -s NEWS.md NEWS -fi - -# For autotools compatibility -if ! test -e AUTHORS; then - ln -s AUTHORS.md AUTHORS -fi - -# extract flag icons -rm pixmaps/flags/*.png -tar -C pixmaps -xzf pixmaps/flags.tar.gz - -# The autoconf cache (version after 2.52) is not reliable yet. -rm -rf autom4te.cache - -# Ensure that gettext is reasonably new. -gettext_ver=`$GETTEXTIZE --version | sed -n '1s/\.//g;1s/.* //;1s/^\(...\)$/\100/;1s/^\(...\)\(.\)$/\10\2/;1p'` -if test $gettext_ver -lt 01038; then - echo "Don't use gettext older than 0.10.38" 2>&1 - exit 1 -fi - -echo "Running $GETTEXTIZE and intltoolize..." -rm -rf intl -if test $gettext_ver -ge 01100; then - if test $gettext_ver -ge 01104; then - # gettextize doesn't want us to run it in a non-interactive script. - GETTEXTIZE_FIXED=./gettextize.fixed - egrep -v "read.*/dev/tty" `which $GETTEXTIZE` > $GETTEXTIZE_FIXED - chmod +x $GETTEXTIZE_FIXED - GETTEXTIZE=$GETTEXTIZE_FIXED - fi - -# $GETTEXTIZE --copy --force --intl --no-changelog >tmpout || exit 1 - glib-gettextize --copy --force || exit 1 - intltoolize --copy --force --automake || exit 1 - - if test -f Makefile.am~; then - rm -rf Makefile.am - mv Makefile.am~ Makefile.am - fi - if test -f configure.in~ ; then - rm -rf configure.in - mv configure.in~ configure.in - fi - for i in po/Rules-quot po/boldquot.sed po/en@boldquot.header \ - po/en@quot.header po/insert-header.sin po/quot.sed \ - po/remove-potcdate.sin po/Makefile.in.in - do - if diff -s $i $i~ >/dev/null 2>&1 ; then - mv $i~ $i - fi - done - # Do we need po/Makevars.in and family for gettext 0.11 ? - if test ! -f po/Makevars; then - cat > po/Makevars <tmpout || exit 1 - if test -f po/ChangeLog~; then - rm -f po/ChangeLog - mv po/ChangeLog~ po/ChangeLog - fi -fi - -rm -f aclocal.m4 -if test -f `aclocal --print-ac-dir`/gettext.m4; then - : # gettext macro files are available to aclocal. -else - # gettext macro files are not available. - # Find them and copy to a local directory. - # Ugly way to parse the instructions gettexize gives us. - m4files="`cat tmpout | sed -n -e '/^Please/,/^from/s/^ *//p'`" - fromdir=`cat tmpout | sed -n -e '/^Please/,/^from/s/^from the \([^ ]*\) .*$/\1/p'` - rm -rf gettext.m4 - mkdir gettext.m4 - for i in $m4files; do - cp -f $fromdir/$i gettext.m4 - done - ACLOCAL_INCLUDES="-I gettext.m4" -fi - -if test -d m4; then - # gettextize 0.11.4 wants this for some reason - ACLOCAL_INCLUDES="$ACLOCAL_INCLUDES -I m4" -fi - -rm -f tmpout $GETTEXTIZE_FIXED - -## workaround for libtoolize putting files in .. -#if [ ! -e install-sh ]; then -# removeinstallsh=1 -# touch install-sh -#fi -# -#echo "running libtoolize ..." -#libtoolize --force || die libtoolize libtool -# -#[ -n "$removeinstallsh" ] && rm install-sh - -# Some old version of GNU build tools fail to set error codes. -# Check that they generate some of the files they should. - -echo "Running $ACLOCAL..." -$ACLOCAL $ACLOCAL_INCLUDES $ACLOCAL_FLAGS || exit 1 -test -f aclocal.m4 || \ - { echo "aclocal failed to generate aclocal.m4" 2>&1; exit 1; } - -echo "Running $AUTOHEADER..." -$AUTOHEADER || exit 1 -test -f src/gnuconfig.h.in || \ - { echo "autoheader failed to generate src/gnuconfig.h.in" 2>&1; exit 1; } - -echo "Running $AUTOCONF..." -$AUTOCONF || exit 1 -test -f configure || \ - { echo "autoconf failed to generate configure" 2>&1; exit 1; } - -## Workaround for Automake 1.5 to ensure that depcomp is distributed. -echo "Running $AUTOMAKE..." -## doesn't work $AUTOMAKE -a src/Makefile || exit 1 -$AUTOMAKE -a || exit 1 -test -f Makefile.in || \ - { echo "automake failed to generate Makefile.in" 2>&1; exit 1; } - -) || exit 1 - -#conf_flags="--enable-maintainer-mode --enable-compile-warnings" -#echo Running $srcdir/configure $conf_flags "$@" ... -#$srcdir/configure --cache-file=config.cache $conf_flags "$@" && \ -# echo "Now type \`make' (\`gmake' on some systems) to compile XQF" diff --git a/clean.sh b/clean.sh deleted file mode 100755 index ce66057..0000000 --- a/clean.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh -rm -f \ -Makefile \ -config.status \ -config.cache \ -config.log \ -configure \ -Makefile.in \ -aclocal.m4 \ -config.guess \ -config.sub \ -install-sh \ -mkinstalldirs \ -missing \ -depcomp \ -*/Makefile \ -src/Makefile.in \ -ltconfig \ -ltmain.sh \ -libtool \ -compile \ -config.h \ -intl/libintl.h \ -src/gnuconfig.h \ -src/gnuconfig.h.in \ -src/xpm/Makefile.in \ -src/xpm/Makefile \ -src/*.o \ -src/test_utils \ -src/xqf \ -pixmaps/Makefile.in \ -pixmaps/flags/Makefile.in \ -po/Makefile.in \ -po/POTFILES \ -po/*.gmo \ -INSTALL - -# gettextize -rm -rf \ -ABOUT-NLS \ -config.rpath \ -mkinstalldirs \ -m4 \ -po/Makefile.in \ -po/Makevars.template \ -po/Rules-quot \ -po/boldquot.sed \ -po/en@boldquot.header \ -po/en@quot.header \ -po/insert-header.sin \ -po/quot.sed \ -po/remove-potcdate.sin \ -intl/*.* \ -intl/ChangeLog \ -intl/VERSION - -#intltool -rm -rf \ -intltool-*.in \ -po/remove-potcdate.sed \ -po/stamp-po - -rm -rf \ -pixmaps/flags/*.png diff --git a/configure.ac b/configure.ac deleted file mode 100644 index d5fa65e..0000000 --- a/configure.ac +++ /dev/null @@ -1,236 +0,0 @@ -# -# Autoconf support for XQF -# Initially written by Markus Fischer -# - -AC_INIT([XQF],[1.0.6.2],[xqf-developer@lists.sourceforge.net], [xqf]) -AC_CONFIG_SRCDIR([src/xqf.c]) -AC_PREREQ(2.52) - -AM_INIT_AUTOMAKE -dnl AM_CONFIG_HEADER(src/gnuconfig.h:src/gnuconfig.h.in) -AM_CONFIG_HEADER(src/gnuconfig.h) - -AM_GLIB_GNU_GETTEXT -IT_PROG_INTLTOOL([0.40.0]) - -GETTEXT_PACKAGE=xqf -AC_SUBST(GETTEXT_PACKAGE) -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext domain name.]) - -dnl Checks for programs. -AC_PROG_CC -AC_ISC_POSIX -AC_PROG_LN_S -AC_PROG_RANLIB - -dnl Checks for header files. -AC_HEADER_STDC - -#The Release stuff for the spec file. -RELEASE="1" -AC_ARG_WITH(rpm_release,[ --with-rpm-release=VAL RPM Release (e.g. 1mdk)]) -if test "x$with_rpm_release" != "x" ; then - RELEASE="$with_rpm_release" -fi -AC_SUBST(RELEASE) - -pkg_modules="gtk+-2.0 >= 2.0.0 gdk-pixbuf-xlib-2.0 x11" -PKG_CHECK_MODULES(PACKAGE, [$pkg_modules]) -AC_SUBST(PACKAGE_CFLAGS) -AC_SUBST(PACKAGE_LIBS) - -dnl check for qstat -AC_ARG_WITH(qstat,[ --with-qstat=CMD use CMD to run qstat]) - -AC_MSG_CHECKING(qstat version) - -QSTATEXEC="qstat" - -if test "x$with_qstat" != "x" ; then - QSTATEXEC="$with_qstat" -fi - -qstat_version=`$QSTATEXEC 2>/dev/null | grep version | cut -d' ' -f 3` - -if test "x$qstat_version" = "x" ; then - AC_MSG_RESULT(qstat not found) - qstat_is=notfound -else - AC_MSG_RESULT($qstat_version) -fi - -AC_SUBST(QSTATEXEC) - -AC_CHECK_HEADER(zlib.h,,[AC_MSG_ERROR([zlib.h not found, please install zlib development files])]) -AC_CHECK_LIB(z, crc32,[AC_DEFINE([HAVE_LIBZ],[],[Whether libz is installed])],[AC_MSG_ERROR([libz not found])]) - -dnl determine if we should include readline support... -dnl ripped from physfs package -dnl AC_ARG_ENABLE(readline, -dnl AC_HELP_STRING([--enable-externalrcon],[compile external rcon program (default=yes)]) -dnl , ,enable_rcon=yes) -XQFRCON_LIBS= -AC_ARG_ENABLE(externalrcon,[ --enable-externalrcon compile external rcon program (default=no)]) -if test x$enable_externalrcon = xyes; then - AC_CHECK_HEADER(readline/readline.h, have_readline_hdr=yes) - AC_CHECK_LIB(readline, readline, have_readline_lib=yes) - AC_CHECK_HEADER(readline/history.h, have_history_hdr=yes) - AC_CHECK_LIB(readline, add_history, have_history_lib=yes) - if test x$have_readline_hdr = xyes -a x$have_readline_lib = xyes; then - if test x$have_history_hdr = xyes -a x$have_history_lib = xyes; then - XQFRCON_LIBS="-lreadline" - AC_SUBST(XQFRCON_LIBS) - else - AC_MSG_WARN([libreadline not found, rcon program disabled]) - fi - else - AC_MSG_WARN([libreadline not found, rcon program disabled]) - fi -fi -AM_CONDITIONAL(BUILD_XQFRCON, test "x$XQFRCON_LIBS" != x) - -dnl determine whether GeoIP should be used -AC_CHECK_HEADER(GeoIP.h,have_geoip_hdr=yes,have_geoip_hdr=no) -AC_MSG_CHECKING([whether GeoIP should be used]) -AC_ARG_ENABLE(geoip,[ --enable-geoip use GeoIP (default=auto)],USE_GEOIP=$enableval, USE_GEOIP=yes) -AC_MSG_RESULT([$USE_GEOIP]) - -# --enable-geoip-dummy=/usr/lib/libGeoIP.so -AC_MSG_CHECKING([whether a GeoIP dummy library should be used]) -AC_ARG_ENABLE(geoip_dummy, - [ --enable-geoip-dummy=FILE use dummy GeoIP lib based on FILE (default=no)], - use_geoip_dummy="$enableval", use_geoip_dummy=no) -AC_MSG_RESULT([$use_geoip_dummy]) - -if test "x$USE_GEOIP" != "xno"; then - if test "x$have_geoip_hdr" = "xyes";then - AC_DEFINE_UNQUOTED(USE_GEOIP,1,Define if we should use GeoIP) - if test "x$USE_GEOIP" = "xyes"; then - if test "x$use_geoip_dummy" != "xno"; then - DUMMY_LIBGEOIP_SONAME=`objdump -p "$use_geoip_dummy"|awk '$1 == "SONAME" {print $2}'` - if test "x$DUMMY_LIBGEOIP_SONAME" != x; then - DUMMY_LIBGEOIP_ORIG="$use_geoip_dummy" - GEOIP_LIB='-L$(top_builddir)/src -lxqf_dummy_GeoIP' - - AC_SUBST(DUMMY_LIBGEOIP_SONAME) - AC_SUBST(DUMMY_LIBGEOIP_ORIG) - else - AC_MSG_ERROR([$use_geoip_dummy is no valid GeoIP library]) - fi - else - GEOIP_LIB="-lGeoIP" - fi - else - GEOIP_LIB="$USE_GEOIP" - fi - AC_SUBST(GEOIP_LIB) - - else - AC_MSG_WARN([GeoIP.h not found, GeoIP feature disabled]) - fi -fi - -AM_CONDITIONAL(DUMMY_LIBGEOIP, test x$DUMMY_LIBGEOIP_SONAME != x) - -# --enable-geoip-dummy=/usr/lib/libGeoIP.so -AC_MSG_CHECKING([whether a GDK-Pixbuf dummy library should be used]) -AC_ARG_ENABLE(pixbuf_dummy, - [ --enable-pixbuf-dummy=FILE use dummy gdk-pixbuf lib based on FILE (default=no)], - use_pixbuf_dummy="$enableval", use_pixbuf_dummy=no) -AC_MSG_RESULT([$use_pixbuf_dummy]) -if test "x$use_pixbuf_dummy" != "xno"; then - DUMMY_LIBGDKPIXBUF_SONAME=`objdump -p "$use_pixbuf_dummy"|awk '$1 == "SONAME" {print $2}'` - if test "x$DUMMY_LIBGDKPIXBUF_SONAME" != x; then - DUMMY_LIBGDKPIXBUF_ORIG="$use_pixbuf_dummy" - GDK_PIXBUF_LIBS='-L$(top_builddir)/src -lxqf_dummy_gdk_pixbuf' - - AC_SUBST(DUMMY_LIBGDKPIXBUF_SONAME) - AC_SUBST(DUMMY_LIBGDKPIXBUF_ORIG) - else - AC_MSG_ERROR([$use_pixbuf_dummy is no valid library]) - fi - AC_SUBST(GDK_PIXBUF_LIBS) -fi -AM_CONDITIONAL(DUMMY_LIBGDKPIXBUF, test x$DUMMY_LIBGDKPIXBUF_SONAME != x) - -dnl check if user wants bzip2 compression instead of gzip -COMPRESSION="-DCOMPRESSOR_GZIP" -AC_ARG_ENABLE(bzip2,[ --enable-bzip2 use bzip2 for data compression]) -if test x$enable_bzip2 = xyes; then - COMPRESSION="-DCOMPRESSOR_BZIP2" -fi -AC_SUBST(COMPRESSION) - -dnl check if user wants debug -AC_ARG_ENABLE(debug,[ --enable-debug turn on debugging ]) -if test x$enable_debug = xyes; then - DEBUG="-DDEBUG" - CFLAGS="-g -O0" -else - DEBUG="" -fi -AC_SUBST(DEBUG) - -AC_SUBST(VERSION) -AC_SUBST(QSTATEXEC) - -AC_DEFINE_UNQUOTED(XQF_VERSION, "$VERSION", XQF Version number) -AC_DEFINE_UNQUOTED(QSTAT_EXEC, "$QSTATEXEC", QSTAT executable path) - -# workaround for intl/ which requires config.h -echo "configure: creating link config.h -> src/gnuconfig.h" -test -e config.h -a ! -L config.h && rm config.h -test ! -e config.h && ln -s src/gnuconfig.h config.h - -rm -f intl/libintl.h -# damn gettext should do that itself! -if test "$USE_INCLUDED_LIBINTL" = "yes"; then - echo "configure: creating link intl/libintl.h -> libgnuintl.h" - ln -s libgnuintl.h intl/libintl.h -fi - -dnl Use -Wall if we have gcc. -changequote(,)dnl -if test "x$GCC" = "xyes"; then - case " $CFLAGS " in - *[\ \ ]-Wall[\ \ ]*) ;; - *) CFLAGS="$CFLAGS -Wall" ;; - esac -fi -changequote([,])dnl - -AC_ARG_ENABLE(profiling,[ --enable-profiling compile with profiling (default=no)]) -AC_MSG_CHECKING(whether profiling is requested) -if test x$enable_profiling = xyes; then - CFLAGS="$CFLAGS -pg" - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi - -AC_CONFIG_FILES([ - Makefile - src/Makefile - src/xpm/Makefile - src/zip/Makefile - src/tga/Makefile - docs/Makefile - pixmaps/Makefile - pixmaps/128x128/Makefile - pixmaps/22x22/Makefile - pixmaps/32x32/Makefile - pixmaps/48x48/Makefile - pixmaps/flags/Makefile - pixmaps/scalable/Makefile - po/Makefile.in -]) -AC_OUTPUT - -if test "x$qstat_is" = "xnotfound" ; then - AC_MSG_RESULT([ -*** QStat is *required* to run XQF -*** Get it from http://qstat.org/ -*** and put it in your path -]) -fi diff --git a/docs/.gitignore b/docs/.gitignore deleted file mode 100644 index 282522d..0000000 --- a/docs/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/docs/Makefile.am b/docs/Makefile.am deleted file mode 100644 index a1c0b1d..0000000 --- a/docs/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -EXTRA_DIST = xqfdocs.html PreLaunch.example diff --git a/pixmaps/.gitignore b/pixmaps/.gitignore deleted file mode 100644 index 282522d..0000000 --- a/pixmaps/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/pixmaps/128x128/Makefile.am b/pixmaps/128x128/Makefile.am deleted file mode 100644 index d6188b4..0000000 --- a/pixmaps/128x128/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -themedir = $(datadir)/icons/hicolor -size = 128x128 -context = apps - -iconsdir = $(themedir)/$(size)/$(context) - -icons_DATA = \ - xqf.png - -EXTRA_DIST = $(icons_DATA) diff --git a/pixmaps/22x22/Makefile.am b/pixmaps/22x22/Makefile.am deleted file mode 100644 index b9945d6..0000000 --- a/pixmaps/22x22/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -themedir = $(datadir)/icons/hicolor -size = 22x22 -context = apps - -iconsdir = $(themedir)/$(size)/$(context) - -icons_DATA = \ - xqf.png - -EXTRA_DIST = $(icons_DATA) diff --git a/pixmaps/32x32/Makefile.am b/pixmaps/32x32/Makefile.am deleted file mode 100644 index 49b9547..0000000 --- a/pixmaps/32x32/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -themedir = $(datadir)/icons/hicolor -size = 32x32 -context = apps - -iconsdir = $(themedir)/$(size)/$(context) - -icons_DATA = \ - xqf.png - -EXTRA_DIST = $(icons_DATA) diff --git a/pixmaps/48x48/Makefile.am b/pixmaps/48x48/Makefile.am deleted file mode 100644 index 10cc454..0000000 --- a/pixmaps/48x48/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -themedir = $(datadir)/icons/hicolor -size = 48x48 -context = apps - -iconsdir = $(themedir)/$(size)/$(context) - -icons_DATA = \ - xqf.png - -EXTRA_DIST = $(icons_DATA) diff --git a/pixmaps/Makefile.am b/pixmaps/Makefile.am deleted file mode 100644 index 375adac..0000000 --- a/pixmaps/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -SUBDIRS = 128x128 22x22 32x32 48x48 flags scalable - -desktopicondir = $(datadir)/pixmaps -desktopicon_DATA = xqf.xpm - -EXTRA_DIST = $(pixmap_DATA) $(desktopicon_DATA) diff --git a/pixmaps/flags/.gitignore b/pixmaps/flags/.gitignore deleted file mode 100644 index f439522..0000000 --- a/pixmaps/flags/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -Makefile -Makefile.in -??.png diff --git a/pixmaps/flags/Makefile.am b/pixmaps/flags/Makefile.am deleted file mode 100644 index dc0ed2d..0000000 --- a/pixmaps/flags/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -EXTRA_DIST = $(flag_DATA) - -flagdir = $(pkgdatadir)/default/flags -flag_DATA = $(wildcard $(srcdir)/*.png) diff --git a/pixmaps/scalable/Makefile.am b/pixmaps/scalable/Makefile.am deleted file mode 100644 index 770cc64..0000000 --- a/pixmaps/scalable/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -themedir = $(datadir)/icons/hicolor -size = scalable -context = apps - -iconsdir = $(themedir)/$(size)/$(context) - -icons_DATA = \ - xqf.svg - -EXTRA_DIST = $(icons_DATA) diff --git a/po/.gitignore b/po/.gitignore deleted file mode 100644 index 8356710..0000000 --- a/po/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -Makefile -Makefile.in -Makefile.in.in -POTFILES -*.gmo -messages -messages.mo -xqf.pot -*.header -*.sin -*.sed -Rules-quot -Makevars.template -.intltool-merge-cache diff --git a/po/LINGUAS b/po/LINGUAS deleted file mode 100644 index df2666c..0000000 --- a/po/LINGUAS +++ /dev/null @@ -1,8 +0,0 @@ -ca -da -de -es -fi -fr -pl -ru diff --git a/po/Makefile.in.in b/po/Makefile.in.in deleted file mode 100644 index 06a8cfe..0000000 --- a/po/Makefile.in.in +++ /dev/null @@ -1,222 +0,0 @@ -# Makefile for program source directory in GNU NLS utilities package. -# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper -# Copyright (C) 2004-2008 Rodney Dawes -# -# This file may be copied and used freely without restrictions. It may -# be used in projects which are not available under a GNU Public License, -# but which still want to provide support for the GNU gettext functionality. -# -# - Modified by Owen Taylor to use GETTEXT_PACKAGE -# instead of PACKAGE and to look for po2tbl in ./ not in intl/ -# -# - Modified by jacob berkman to install -# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize -# -# - Modified by Rodney Dawes for use with intltool -# -# We have the following line for use by intltoolize: -# INTLTOOL_MAKEFILE - -GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ -PACKAGE = @PACKAGE@ -VERSION = @VERSION@ - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -top_builddir = @top_builddir@ -VPATH = @srcdir@ - -prefix = @prefix@ -exec_prefix = @exec_prefix@ -datadir = @datadir@ -datarootdir = @datarootdir@ -libdir = @libdir@ -DATADIRNAME = @DATADIRNAME@ -itlocaledir = $(prefix)/$(DATADIRNAME)/locale -subdir = po -install_sh = @install_sh@ -# Automake >= 1.8 provides @mkdir_p@. -# Until it can be supposed, use the safe fallback: -mkdir_p = $(install_sh) -d - -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ - -GMSGFMT = @GMSGFMT@ -MSGFMT = @MSGFMT@ -XGETTEXT = @XGETTEXT@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -MSGMERGE = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist -GENPOT = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot - -ALL_LINGUAS = @ALL_LINGUAS@ - -PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi) - -USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi) - -USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) - -POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) - -DISTFILES = Makefile.in.in POTFILES.in $(POFILES) -EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS - -POTFILES = \ -# This comment gets stripped out - -CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) - -.SUFFIXES: -.SUFFIXES: .po .pox .gmo .mo .msg .cat - -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -INTLTOOL_V_MSGFMT = $(INTLTOOL__v_MSGFMT_$(V)) -INTLTOOL__v_MSGFMT_= $(INTLTOOL__v_MSGFMT_$(AM_DEFAULT_VERBOSITY)) -INTLTOOL__v_MSGFMT_0 = @echo " MSGFMT" $@; - -.po.pox: - $(MAKE) $(GETTEXT_PACKAGE).pot - $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox - -.po.mo: - $(INTLTOOL_V_MSGFMT)$(MSGFMT) -o $@ $< - -.po.gmo: - $(INTLTOOL_V_MSGFMT)file=`echo $* | sed 's,.*/,,'`.gmo \ - && rm -f $$file && $(GMSGFMT) -o $$file $< - -.po.cat: - sed -f ../intl/po2msg.sed < $< > $*.msg \ - && rm -f $@ && gencat $@ $*.msg - - -all: all-@USE_NLS@ - -all-yes: $(CATALOGS) -all-no: - -$(GETTEXT_PACKAGE).pot: $(POTFILES) - $(GENPOT) - -install: install-data -install-data: install-data-@USE_NLS@ -install-data-no: all -install-data-yes: all - linguas="$(USE_LINGUAS)"; \ - for lang in $$linguas; do \ - dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ - $(mkdir_p) $$dir; \ - if test -r $$lang.gmo; then \ - $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ - echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ - else \ - $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ - echo "installing $(srcdir)/$$lang.gmo as" \ - "$$dir/$(GETTEXT_PACKAGE).mo"; \ - fi; \ - if test -r $$lang.gmo.m; then \ - $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ - echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ - else \ - if test -r $(srcdir)/$$lang.gmo.m ; then \ - $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ - $$dir/$(GETTEXT_PACKAGE).mo.m; \ - echo "installing $(srcdir)/$$lang.gmo.m as" \ - "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ - else \ - true; \ - fi; \ - fi; \ - done - -# Empty stubs to satisfy archaic automake needs -dvi info ctags tags CTAGS TAGS ID: - -# Define this as empty until I found a useful application. -install-exec installcheck: - -uninstall: - linguas="$(USE_LINGUAS)"; \ - for lang in $$linguas; do \ - rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ - rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ - done - -check: all $(GETTEXT_PACKAGE).pot - rm -f missing notexist - srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m - if [ -r missing -o -r notexist ]; then \ - exit 1; \ - fi - -mostlyclean: - rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp - rm -f .intltool-merge-cache - -clean: mostlyclean - -distclean: clean - rm -f Makefile Makefile.in POTFILES stamp-it - rm -f *.mo *.msg *.cat *.cat.m *.gmo - -maintainer-clean: distclean - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - rm -f Makefile.in.in - -distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) -dist distdir: $(DISTFILES) - dists="$(DISTFILES)"; \ - extra_dists="$(EXTRA_DISTFILES)"; \ - for file in $$extra_dists; do \ - test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ - done; \ - for file in $$dists; do \ - test -f $$file || file="$(srcdir)/$$file"; \ - ln $$file $(distdir) 2> /dev/null \ - || cp -p $$file $(distdir); \ - done - -update-po: Makefile - $(MAKE) $(GETTEXT_PACKAGE).pot - tmpdir=`pwd`; \ - linguas="$(USE_LINGUAS)"; \ - for lang in $$linguas; do \ - echo "$$lang:"; \ - result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ - if $$result; then \ - if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ - rm -f $$tmpdir/$$lang.new.po; \ - else \ - if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ - :; \ - else \ - echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ - rm -f $$tmpdir/$$lang.new.po; \ - exit 1; \ - fi; \ - fi; \ - else \ - echo "msgmerge for $$lang.gmo failed!"; \ - rm -f $$tmpdir/$$lang.new.po; \ - fi; \ - done - -Makefile POTFILES: stamp-it - @if test ! -f $@; then \ - rm -f stamp-it; \ - $(MAKE) stamp-it; \ - fi - -stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ - $(SHELL) ./config.status - -# Tell versions [3.59,3.63) of GNU make not to export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/po/Makevars b/po/Makevars deleted file mode 100644 index c90ce54..0000000 --- a/po/Makevars +++ /dev/null @@ -1,41 +0,0 @@ -# Makefile variables for PO directory in any package using GNU gettext. - -# Usually the message domain is the same as the package name. -DOMAIN = xqf - -# These two variables depend on the location of this directory. -subdir = po -top_builddir = .. - -# These options get passed to xgettext. -XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ - -# This is the copyright holder that gets inserted into the header of the -# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding -# package. (Note that the msgstr strings, extracted from the package's -# sources, belong to the copyright holder of the package.) Translators are -# expected to transfer the copyright for their translations to this person -# or entity, or to disclaim their copyright. The empty string stands for -# the public domain; in this case the translators are expected to disclaim -# their copyright. -COPYRIGHT_HOLDER = Free Software Foundation, Inc. - -# This is the email address or URL to which the translators shall report -# bugs in the untranslated strings: -# - Strings which are not entire sentences, see the maintainer guidelines -# in the GNU gettext documentation, section 'Preparing Strings'. -# - Strings which use unclear terms or require additional context to be -# understood. -# - Strings which make invalid assumptions about notation of date, time or -# money. -# - Pluralisation problems. -# - Incorrect English spelling. -# - Incorrect formatting. -# It can be your email address, or a mailing list address where translators -# can write to without being subscribed, or the URL of a web page through -# which the translators can contact you. -MSGID_BUGS_ADDRESS = xqf-developer@lists.sourceforge.net - -# This is the list of locale categories, beyond LC_MESSAGES, for which the -# message catalogs shall be used. It is usually empty. -EXTRA_LOCALE_CATEGORIES = diff --git a/po/POTFILES.in b/po/POTFILES.in deleted file mode 100644 index 4a5503c..0000000 --- a/po/POTFILES.in +++ /dev/null @@ -1,39 +0,0 @@ -# List of source files containing translatable strings. -xqf.desktop.in - -# Package source files -src/addmaster.c -src/addserver.c -#src/config.c -#src/debug.c -src/dialogs.c -#src/dns.c -src/filter.c -src/flt-player.c -src/game.c -#src/history.c -#src/host.c -src/launch.c -#src/menus.c -#src/pixmaps.c -src/pref.c -src/psearch.c -#src/rc.c -src/rcon.c -src/redial.c -#src/server.c -#src/skin.c -#src/skin_pcx.c -#src/sort.c -src/source.c -#src/srv-info.c -#src/srv-list.c -src/srv-prop.c -src/stat.c -src/statistics.c -src/utils.c -src/xqf-ui.c -src/xqf.c -#src/zipped.c -src/country-filter.c -src/loadpixmap.c diff --git a/src/.gitignore b/src/.gitignore deleted file mode 100644 index ab5305a..0000000 --- a/src/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -gnuconfig.h -gnuconfig.h.in -Makefile -Makefile.in -stamp-h.in -stamp-h -stamp-h1 -.libs -.deps -xqf -xqf-rcon -test_utils diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index a6fbdc7..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,206 +0,0 @@ -SUBDIRS = xpm zip tga - -localedir = $(datadir)/locale -AM_CPPFLAGS = -I$(top_srcdir)/intl \ - -DLOCALEDIR=\"$(localedir)\" \ - -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" \ - -DPIXMAPSDIR=\"$(datadir)/pixmaps\" \ - $(GTK_CFLAGS) \ - $(QSTAT23) \ - $(DEBUG) \ - $(COMPRESSION) \ - $(GDK_PIXBUF_CFLAGS) \ - $(PACKAGE_CFLAGS) - -qstatcfgdir = $(pkgdatadir) -qstatcfg_DATA = qstat.cfg - -uidir = $(pkgdatadir)/ui -ui_DATA = \ - xqf.ui - -qstatsavagedir = $(pkgdatadir) -qstatsavage_DATA = qstat_savage.sh - -EXTRA_DIST = \ - games.xml \ - games.c \ - qstat.cfg \ - qstat_savage.sh \ - xqf.map \ - $(noinst_SCRIPTS) - -bin_PROGRAMS = xqf -if BUILD_XQFRCON -bin_PROGRAMS += xqf-rcon -endif - -EXTRA_PROGRAMS = gamesxml2c - -xqf_LDADD = $(INTLLIBS) \ - $(top_builddir)/src/zip/libunzip.a \ - $(top_builddir)/src/tga/libtga.a \ - $(GTK_LIBS) \ - $(GEOIP_LIB) \ - $(PACKAGE_LIBS) \ - $(GDK_PIXBUF_LIBS) \ - -lz -ldl - -xqf_LDFLAGS = -Wl,-rpath,$(pkglibdir) -Wl,--export-dynamic -Wl,--version-script=$(top_srcdir)/src/xqf.map - -xqf_CFLAGS = -DQSTAT_SAVAGE_SCRIPT=\"$(qstatsavagedir)/$(qstatsavage_DATA)\" - -# we need to specify all deps manually due to dummy libs -xqf_DEPENDENCIES = \ - $(top_builddir)/src/zip/libunzip.a \ - $(top_builddir)/src/tga/libtga.a - -xqf_rcon_LDADD = @INTLLIBS@ $(GLIB_LIBS) $(XQFRCON_LIBS) @PACKAGE_LIBS@ -xqf_rcon_SOURCES = \ - rcon.c rcon.h \ - debug.c debug.h \ - utils.c utils.h -xqf_rcon_CFLAGS = -DRCON_STANDALONE $(GLIB_CFLAGS) - -xqf_SOURCES = \ -addmaster.c \ -addserver.c \ -config.c \ -country-filter.c \ -debug.c \ -dialogs.c \ -dns.c \ -filter.c \ -flt-player.c \ -game.c \ -history.c \ -host.c \ -launch.c \ -menus.c \ -pixmaps.c \ -pref.c \ -psearch.c \ -rc.c \ -rcon.c \ -server.c \ -skin.c \ -skin_pcx.c \ -sort.c \ -source.c \ -srv-info.c \ -srv-list.c \ -srv-prop.c \ -stat.c \ -statistics.c \ -utils.c \ -xqf.c \ -xqf-ui.c \ -zipped.c \ -redial.c \ -q3maps.c \ -utmaps.c \ -loadpixmap.c \ -scripts.c \ -addmaster.h \ -addserver.h \ -config.h \ -country-filter.h \ -debug.h \ -dialogs.h \ -dns.h \ -filter.h \ -flt-player.h \ -game.h \ -history.h \ -host.h \ -launch.h \ -menus.h \ -pixmaps.h \ -pref.h \ -psearch.h \ -quake2_pal.h \ -quake_pal.h \ -rc.h \ -rcon.h \ -server.h \ -skin.h \ -skin_pcx.h \ -sort.h \ -source.h \ -srv-info.h \ -srv-list.h \ -srv-prop.h \ -stat.h \ -statistics.h \ -utils.h \ -xqf-ui.h \ -xqf.h \ -zipped.h \ -redial.h \ -q3maps.h \ -utmaps.h \ -loadpixmap.h \ -scripts.h - -noinst_SCRIPTS = gensyms.pl -noinst_PROGRAMS = test_utils -test_utils_SOURCES = test_utils.c \ - utils.c utils.h \ - debug.c debug.h -test_utils_LDADD = $(xqf_LDADD) - -# it's only temporary, so ... -gamesxml2c_LDFLAGS = -lxml2 -gamesxml2c_LDADD = -lxml2 -gamesxml2c_CFLAGS = $(shell xml2-config --cflags) - -gamesxml2c_SOURCES = \ -gamesxml2c.c - -pkglibexec_PROGRAMS = - -if DUMMY_LIBGEOIP -pkglibexec_PROGRAMS += libxqf_dummy_GeoIP.so.0 -xqf_DEPENDENCIES += libxqf_dummy_GeoIP.so -endif -if DUMMY_LIBGDKPIXBUF -pkglibexec_PROGRAMS += libxqf_dummy_gdk_pixbuf.so.0 -xqf_DEPENDENCIES += libxqf_dummy_gdk_pixbuf.so -endif - -libxqf_dummy_gdk_pixbuf.c: - $(top_srcdir)/src/gensyms.pl -x gdk_pixbuf_new_from_file,gdk_pixbuf_render_pixmap_and_mask,gdk_pixbuf_unref $(DUMMY_LIBGDKPIXBUF_ORIG) -o $(top_srcdir)/src/libxqf_dummy_gdk_pixbuf.c || rm $(top_srcdir)/src/libxqf_dummy_gdk_pixbuf.c - test -s $(top_srcdir)/src/libxqf_dummy_gdk_pixbuf.c - -nodist_libxqf_dummy_gdk_pixbuf_so_0_SOURCES = libxqf_dummy_gdk_pixbuf.c -libxqf_dummy_gdk_pixbuf_so_0_SOURCES = libxqf_dummy_gdk_pixbuf_stubs.c -libxqf_dummy_gdk_pixbuf_so_0_LDFLAGS = -nostdlib -shared -Wl,-f,$(DUMMY_LIBGDKPIXBUF_SONAME) -Wl,-soname,libxqf_dummy_gdk_pixbuf.so.0 -libxqf_dummy_gdk_pixbuf_so_0_CFLAGS = -fPIC -DPIC - -libxqf_dummy_gdk_pixbuf.so: libxqf_dummy_gdk_pixbuf.so.0 - rm -f $@ - $(LN_S) $< $@ - -libxqf_dummy_GeoIP.c: - $(top_srcdir)/src/gensyms.pl -x GeoIP_new,GeoIP_open $(DUMMY_LIBGEOIP_ORIG) -o $(top_srcdir)/src/libxqf_dummy_GeoIP.c || rm $(top_srcdir)/src/libxqf_dummy_GeoIP.c - test -s $(top_srcdir)/src/libxqf_dummy_GeoIP.c - -nodist_libxqf_dummy_GeoIP_so_0_SOURCES = libxqf_dummy_GeoIP.c -libxqf_dummy_GeoIP_so_0_SOURCES = libxqf_dummy_GeoIP_stubs.c -libxqf_dummy_GeoIP_so_0_LDFLAGS = -nostdlib -shared -Wl,-f,$(DUMMY_LIBGEOIP_SONAME) -Wl,-soname,libxqf_dummy_GeoIP.so.0 -libxqf_dummy_GeoIP_so_0_CFLAGS = -fPIC -DPIC - -libxqf_dummy_GeoIP.so: libxqf_dummy_GeoIP.so.0 - rm -f $@ - $(LN_S) $< $@ - -CLEANFILES = \ - $(nodist_libxqf_dummy_gdk_pixbuf_so_0_SOURCES) \ - $(nodist_libxqf_dummy_GeoIP_so_0_SOURCES) \ - libxqf_dummy_GeoIP.so \ - libxqf_dummy_gdk_pixbuf.so - -gamelist: gamesxml2c - $(top_builddir)/src/gamesxml2c $(top_srcdir)/src/games.xml > $(top_srcdir)/src/games.c - -.PHONY: gamelist diff --git a/src/addmaster.c b/src/addmaster.c index 535c83c..834ceca 100644 --- a/src/addmaster.c +++ b/src/addmaster.c @@ -16,8 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include #include /* strlen, strstr, strcpy */ diff --git a/src/addserver.c b/src/addserver.c index 85db6a6..ff9fd29 100644 --- a/src/addserver.c +++ b/src/addserver.c @@ -16,8 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include #include diff --git a/src/country-filter.c b/src/country-filter.c index 21a1f82..8248118 100644 --- a/src/country-filter.c +++ b/src/country-filter.c @@ -15,7 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" #ifdef USE_GEOIP diff --git a/src/dialogs.c b/src/dialogs.c index a75129f..8485899 100644 --- a/src/dialogs.c +++ b/src/dialogs.c @@ -16,8 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include #include #include /* va_start, va_end */ diff --git a/src/filter.c b/src/filter.c index 35a0599..cef59dc 100644 --- a/src/filter.c +++ b/src/filter.c @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" + #include #include diff --git a/src/flt-player.c b/src/flt-player.c index 1f1a077..e38ccfb 100644 --- a/src/flt-player.c +++ b/src/flt-player.c @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" + #include #include diff --git a/src/game.c b/src/game.c index 73c7824..096a686 100644 --- a/src/game.c +++ b/src/game.c @@ -16,8 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include #include /* FILE, fprintf, fopen, fclose */ #include /* strlen, strcpy, strcmp, strtok */ @@ -185,7 +183,7 @@ static struct quake_private zeq2lite_private; static struct quake_private turtlearena_private; static struct quake_private alienarena_private; -#include "games.c" +#include GAMES_INCLUDE struct gsname2type_s { diff --git a/src/games.c b/src/games.c deleted file mode 100644 index a63e05f..0000000 --- a/src/games.c +++ /dev/null @@ -1,1508 +0,0 @@ -// DO NOT EDIT THIS FILE, AUTOMATICALLY GENERATED -static char* stringlist000[] = { "id1", NULL }; -static char* stringlist001[] = { "twilight-nq", "nq-sgl", "nq-glx", "nq-sdl", "nq-x11", NULL }; -static char* stringlist002[] = { "id1", "qw", NULL }; -static char* stringlist003[] = { "twilight-qw", "qw-client-sgl", "qw-client-glx", "qw-client-sdl", "qw-client-x11", NULL }; -static char* stringlist004[] = { "baseq2", NULL }; -static char* stringlist005[] = { "quake2", NULL }; -static char* stringlist006[] = { "baseq3", "demoq3", NULL }; -static char* stringlist007[] = { "ioquake3", "q3", "quake3", NULL }; -static char* stringlist008[] = { "q4base", NULL }; -static char* stringlist009[] = { "quake4", NULL }; -static char* stringlist010[] = { "+rconpassword", "+net_clientRemoteConsolePassword", NULL }; -static char* stringlist011[] = { "wolfmp", "main", "demomain", NULL }; -static char* stringlist012[] = { "wolf", NULL }; -static char* stringlist013[] = { "etmain", NULL }; -static char* stringlist014[] = { "et", NULL }; -static char* stringlist015[] = { "etmain", NULL }; -static char* stringlist016[] = { "etl", NULL }; -static char* stringlist017[] = { "base", NULL }; -static char* stringlist018[] = { "doom3", NULL }; -static char* stringlist019[] = { "+rconpassword", "+net_clientRemoteConsolePassword", NULL }; -static char* stringlist020[] = { "base", NULL }; -static char* stringlist021[] = { "etqw", NULL }; -static char* stringlist022[] = { "+rconpassword", "+net_clientRemoteConsolePassword", NULL }; -static char* stringlist023[] = { "BaseEF", NULL }; -static char* stringlist024[] = { "sof", NULL }; -static char* stringlist025[] = { "main", NULL }; -static char* stringlist026[] = { "tribes2", NULL }; -static char* stringlist027[] = { "ut", NULL }; -static char* stringlist028[] = { "ut2003", "ut2003_demo", NULL }; -static char* stringlist029[] = { "ut2004", "ut2004demo", NULL }; -static char* stringlist030[] = { "rune", NULL }; -static char* stringlist031[] = { "postal2mp", "postal2mpdemo", NULL }; -static char* stringlist032[] = { "armyops", NULL }; -static char* stringlist033[] = { "descent3", NULL }; -static char* stringlist034[] = { "ssamtfe", NULL }; -static char* stringlist035[] = { "ssamtse", NULL }; -static char* stringlist036[] = { "main", NULL }; -static char* stringlist037[] = { "mohaa", NULL }; -static char* stringlist038[] = { "main", NULL }; -static char* stringlist039[] = { "codmp", NULL }; -static char* stringlist040[] = { "savage", NULL }; -static char* stringlist041[] = { "base", NULL }; -static char* stringlist042[] = { "jk2mp", NULL }; -static char* stringlist043[] = { "base", NULL }; -static char* stringlist044[] = { "jamp", NULL }; -static char* stringlist045[] = { "netpanzer", NULL }; -static char* stringlist046[] = { "data", NULL }; -static char* stringlist047[] = { "nexuiz", NULL }; -static char* stringlist048[] = { "data", NULL }; -static char* stringlist049[] = { "xonotic", NULL }; -static char* stringlist050[] = { "basewsw", NULL }; -static char* stringlist051[] = { "warsow", NULL }; -static char* stringlist052[] = { "base", NULL }; -static char* stringlist053[] = { "tremulous", NULL }; -static char* stringlist054[] = { "base", NULL }; -static char* stringlist055[] = { "tremulous-gpp", NULL }; -static char* stringlist056[] = { "base", NULL }; -static char* stringlist057[] = { "tremfusion", NULL }; -static char* stringlist058[] = { "main", NULL }; -static char* stringlist059[] = { "unvanquished", NULL }; -static char* stringlist060[] = { "baseq3", NULL }; -static char* stringlist061[] = { "openarena", NULL }; -static char* stringlist062[] = { "openttd", NULL }; -static char* stringlist063[] = { "baseq3", NULL }; -static char* stringlist064[] = { "q3rally", NULL }; -static char* stringlist065[] = { "wop", NULL }; -static char* stringlist066[] = { "worldofpadman", NULL }; -static char* stringlist067[] = { "q3ut4", NULL }; -static char* stringlist068[] = { "Urban Terror", "Quake3-UrT", "urbanterror", NULL }; -static char* stringlist069[] = { "rq3", NULL }; -static char* stringlist070[] = { "Reaction", NULL }; -static char* stringlist071[] = { "smokinguns", NULL }; -static char* stringlist072[] = { "smokinguns", NULL }; -static char* stringlist073[] = { "ZEQ2", NULL }; -static char* stringlist074[] = { "ZEQ2.i386", NULL }; -static char* stringlist075[] = { "base", NULL }; -static char* stringlist076[] = { "turtlearena", NULL }; -static char* stringlist077[] = { "arena", NULL }; -static char* stringlist078[] = { "alienarena", NULL }; -struct game games[] = { - { - .type = Q1_SERVER, - .flags = GAME_CONNECT | GAME_RECORD | GAME_QUAKE1_PLAYER_COLORS | GAME_QUAKE1_SKIN, - .name = "Quake", - .default_port = 26000, - .id = "QS", - .qstat_str = "QS", - .qstat_option = "-qs", - .icon = "q1.xpm", - .parse_player = poqs_parse_player, - .parse_server = quake_parse_server, - .config_is_valid = quake_config_is_valid, - .write_config = write_q1_vars, - .exec_client = q1_exec_generic, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = quake_init_maps, - .has_map = quake_has_map, - .cmd_or_dir_changed = q1_cmd_or_dir_changed, - .prefs_load = q1_prefs_load, - .update_prefs = q1_update_prefs, - .pd = &q1_private, - .main_mod = stringlist000, - .command = stringlist001, - }, - { - .type = QW_SERVER, - .flags = GAME_CONNECT | GAME_RECORD | GAME_SPECTATE | GAME_RCON | GAME_QUAKE1_PLAYER_COLORS | GAME_QUAKE1_SKIN, - .name = "QuakeWorld", - .default_port = 27500, - .default_master_port = 27000, - .id = "QWS", - .qstat_str = "QWS", - .qstat_option = "-qws", - .qstat_master_option = "-qwm", - .icon = "q.xpm", - .parse_player = qw_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = qw_analyze_serverinfo, - .config_is_valid = quake_config_is_valid, - .write_config = write_qw_vars, - .exec_client = qw_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = quake_init_maps, - .has_map = quake_has_map, - .cmd_or_dir_changed = qw_cmd_or_dir_changed, - .prefs_load = qw_prefs_load, - .update_prefs = qw_update_prefs, - .pd = &qw_private, - .main_mod = stringlist002, - .command = stringlist003, - }, - { - .type = Q2_SERVER, - .flags = GAME_CONNECT | GAME_RECORD | GAME_SPECTATE | GAME_PASSWORD | GAME_RCON, - .name = "Quake2", - .default_port = 27910, - .default_master_port = 27900, - .id = "Q2S", - .qstat_str = "Q2S", - .qstat_option = "-q2s", - .qstat_master_option = "-q2m", - .icon = "q2.xpm", - .parse_player = q2_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q2_analyze_serverinfo, - .config_is_valid = quake_config_is_valid, - .write_config = write_q2_vars, - .exec_client = q2_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = quake_init_maps, - .has_map = quake_has_map, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .cmd_or_dir_changed = q2_cmd_or_dir_changed, - .prefs_load = q2_prefs_load, - .update_prefs = q2_update_prefs, - .pd = &q2_private, - .main_mod = stringlist004, - .command = stringlist005, - }, - { - .type = Q3_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Quake III Arena", - .default_port = 27960, - .default_master_port = 27950, - .id = "Q3S", - .qstat_str = "Q3S", - .qstat_option = "-q3s", - .qstat_master_option = "-q3m", - .icon = "q3.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load, - .update_prefs = q3_update_prefs, - .default_home = "~/.q3a", - .pd = &q3_private, - .main_mod = stringlist006, - .command = stringlist007, - }, - { - .type = Q4_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Quake 4", - .default_port = 28004, - .default_master_port = 27650, - .id = "Q4S", - .qstat_str = "Q4S", - .qstat_option = "-q4s", - .qstat_master_option = "-q4m", - .icon = "q4.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = doom3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = quake4_init_maps, - .has_map = quake4_has_map, - .get_mapshot = quake4_get_mapshot, - .arch_identifier = "si_version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .cmd_or_dir_changed = doom3_cmd_or_dir_changed, - .prefs_load = q3_prefs_load_common, - .update_prefs = quake4_update_prefs, - .default_home = "~/.quake4", - .pd = &quake4_private, - .main_mod = stringlist008, - .command = stringlist009, - .attributes = stringlist010, - }, - { - .type = WO_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Return to Castle Wolfenstein", - .default_port = 27960, - .default_master_port = 27950, - .id = "WOS", - .qstat_str = "RWS", - .qstat_option = "-rws", - .qstat_master_option = "-rwm", - .icon = "wo.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs_common, - .default_home = "~/.wolf", - .pd = &wolf_private, - .main_mod = stringlist011, - .command = stringlist012, - }, - { - .type = WOET_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Wolfenstein: Enemy Territory", - .default_port = 27960, - .default_master_port = 27950, - .id = "WOETS", - .qstat_str = "WOETS", - .qstat_option = "-woets", - .qstat_master_option = "-woetm", - .icon = "et.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs_common, - .default_home = "~/.etwolf", - .pd = &wolfet_private, - .main_mod = stringlist013, - .command = stringlist014, - }, - { - .type = ETL_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Enemy Territory: Legacy", - .default_port = 27960, - .default_master_port = 27950, - .id = "ETLS", - .qstat_str = "ETLS", - .qstat_option = "-etls", - .qstat_master_option = "-etlm", - .icon = "etl.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs_common, - .default_home = "~/.etlwolf", - .pd = &etl_private, - .main_mod = stringlist015, - .command = stringlist016, - }, - { - .type = DOOM3_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Doom 3", - .default_port = 27666, - .default_master_port = 27650, - .id = "DM3S", - .qstat_str = "DM3S", - .qstat_option = "-dm3s", - .qstat_master_option = "-dm3m", - .icon = "doom3.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = doom3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = doom3_init_maps, - .has_map = doom3_has_map, - .get_mapshot = doom3_get_mapshot, - .arch_identifier = "si_version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .cmd_or_dir_changed = doom3_cmd_or_dir_changed, - .prefs_load = q3_prefs_load_common, - .update_prefs = doom3_update_prefs, - .default_home = "~/.doom3", - .pd = &doom3_private, - .main_mod = stringlist017, - .command = stringlist018, - .attributes = stringlist019, - }, - { - .type = ETQW_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "ET: Quake Wars", - .default_port = 27733, - .default_master_port = 27950, - .id = "ETQWS", - .qstat_str = "ETQWS", - .qstat_option = "-etqws", - .qstat_master_option = "-q3m", - .icon = "etqw.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = doom3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = etqw_init_maps, - .has_map = quake4_has_map, - .get_mapshot = quake4_get_mapshot, - .arch_identifier = "si_version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .cmd_or_dir_changed = doom3_cmd_or_dir_changed, - .prefs_load = q3_prefs_load_common, - .update_prefs = quake4_update_prefs, - .default_home = "~/.etqwcl", - .pd = &etqw_private, - .main_mod = stringlist020, - .command = stringlist021, - .attributes = stringlist022, - }, - { - .type = EF_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Voyager Elite Force", - .default_port = 27960, - .default_master_port = 27950, - .id = "EFS", - .qstat_str = "Q3S", - .qstat_option = "-q3s", - .qstat_master_option = "-efm", - .icon = "ef.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs_common, - .main_mod = stringlist023, - }, - { - .type = H2_SERVER, - .flags = GAME_CONNECT | GAME_QUAKE1_PLAYER_COLORS, - .name = "Hexen2", - .default_port = 26900, - .id = "H2S", - .qstat_str = "H2S", - .qstat_option = "-h2s", - .icon = "hex.xpm", - .parse_player = poqs_parse_player, - .parse_server = quake_parse_server, - .config_is_valid = config_is_valid_generic, - .exec_client = q1_exec_generic, - .save_info = quake_save_info, - }, - { - .type = HW_SERVER, - .flags = GAME_CONNECT | GAME_QUAKE1_PLAYER_COLORS | GAME_RCON, - .name = "HexenWorld", - .default_port = 26950, - .default_master_port = 26900, - .id = "HWS", - .qstat_str = "HWS", - .qstat_option = "-hws", - .qstat_master_option = "-hwm", - .icon = "hw.xpm", - .parse_player = qw_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = qw_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q1_exec_generic, - .save_info = quake_save_info, - }, - { - .type = SN_SERVER, - .flags = GAME_CONNECT | GAME_RCON, - .name = "Sin", - .default_port = 22450, - .id = "SNS", - .qstat_str = "SNS", - .qstat_option = "-sns", - .icon = "sn.xpm", - .parse_player = q2_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q2_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q2_exec_generic, - .save_info = quake_save_info, - }, - { - .type = HL_SERVER_OLD, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_MASTER_STEAM, - .name = "Half-Life (old)", - .default_port = 27015, - .default_master_port = 27010, - .id = "HLS", - .qstat_str = "HLS", - .qstat_option = "-hls", - .qstat_master_option = "-hlm", - .icon = "hl.xpm", - .parse_player = hl_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = hl_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = hl_exec, - .save_info = quake_save_info, - .init_maps = quake_init_maps, - .has_map = quake_has_map, - .arch_identifier = "sv_os", - .identify_os = identify_os, - .pd = &hl_private, - }, - { - .type = HL_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_MASTER_STEAM, - .name = "Half-Life", - .default_port = 27015, - .default_master_port = 27010, - .id = "HLA2S", - .qstat_str = "HLA2S", - .qstat_option = "-hla2s", - .qstat_master_option = "-hla2sm", - .icon = "hl.xpm", - .parse_player = hl_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = hl_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = hl_exec, - .save_info = quake_save_info, - .init_maps = quake_init_maps, - .has_map = quake_has_map, - .arch_identifier = "sv_os", - .identify_os = identify_os, - .pd = &hl_private, - }, - { - .type = HL2_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_MASTER_STEAM, - .name = "Half-Life 2", - .default_port = 27015, - .default_master_port = 27011, - .id = "A2S", - .qstat_str = "A2S", - .qstat_option = "-a2s", - .qstat_master_option = "-stma2s", - .icon = "hl2.xpm", - .parse_player = hl_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = hl_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = hl_exec, - .save_info = quake_save_info, - .arch_identifier = "sv_os", - .identify_os = identify_os, - }, - { - .type = KP_SERVER, - .flags = GAME_CONNECT | GAME_RCON, - .name = "Kingpin", - .default_port = 31510, - .id = "Q2S:KP", - .qstat_str = "Q2S", - .qstat_option = "-q2s", - .icon = "kp.xpm", - .parse_player = q2_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q2_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q2_exec_generic, - .save_info = quake_save_info, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - }, - { - .type = SFS_SERVER, - .flags = GAME_CONNECT | GAME_RCON, - .name = "Soldier of Fortune", - .default_port = 28910, - .id = "SFS", - .qstat_str = "SFS", - .qstat_option = "-sfs", - .icon = "sfs.xpm", - .parse_player = q2_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q2_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q2_exec_generic, - .save_info = quake_save_info, - .command = stringlist024, - }, - { - .type = SOF2S_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Soldier of Fortune 2", - .default_port = 20100, - .default_master_port = 20110, - .id = "SOF2S", - .qstat_str = "SOF2S", - .qstat_option = "-sof2s", - .qstat_master_option = "-sof2m", - .icon = "sof2s.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs_common, - .main_mod = stringlist025, - }, - { - .type = T2_SERVER, - .flags = GAME_CONNECT | GAME_RCON, - .name = "Tribes 2", - .default_port = 28000, - .default_master_port = 28000, - .id = "T2S", - .qstat_str = "T2S", - .qstat_option = "-t2s", - .qstat_master_option = "-t2m", - .icon = "t2.xpm", - .parse_player = t2_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = t2_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = t2_exec, - .save_info = quake_save_info, - .arch_identifier = "linux", - .identify_os = t2_identify_os, - .prefs_load = tribes2_prefs_load, - .update_prefs = tribes2_update_prefs, - .command = stringlist026, - }, - { - .type = HR_SERVER, - .flags = GAME_CONNECT | GAME_RCON, - .name = "Heretic2", - .default_port = 28910, - .id = "Q2S:HR", - .qstat_str = "Q2S", - .qstat_option = "-q2s", - .icon = "hr2.xpm", - .parse_player = q2_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q2_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q2_exec_generic, - .save_info = quake_save_info, - }, - { - .type = UN_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD, - .name = "Unreal / Unreal Tournament", - .default_port = 7777, - .id = "UNS", - .qstat_str = "UNS", - .qstat_option = "-uns", - .icon = "un.xpm", - .parse_player = un_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = un_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = ut_exec, - .save_info = quake_save_info, - .init_maps = unreal_init_maps, - .has_map = unreal_has_map, - .pd = &ut_private, - .command = stringlist027, - }, - { - .type = UT2_SERVER, - .flags = GAME_CONNECT | GAME_SPECTATE | GAME_PASSWORD | GAME_LAUNCH_HOSTPORT, - .name = "UT 2003", - .default_port = 7777, - .id = "UT2S", - .qstat_str = "UT2S", - .qstat_option = "-ut2s", - .icon = "ut2.xpm", - .parse_player = un_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = un_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = ut_exec, - .save_info = quake_save_info, - .init_maps = unreal_init_maps, - .has_map = unreal_has_map, - .default_home = "~/.ut2003", - .pd = &ut2_private, - .command = stringlist028, - }, - { - .type = UT2004_SERVER, - .flags = GAME_CONNECT | GAME_SPECTATE | GAME_PASSWORD | GAME_LAUNCH_HOSTPORT | GAME_MASTER_CDKEY, - .name = "UT 2004", - .default_port = 7777, - .default_master_port = 28902, - .id = "UT2004S", - .qstat_str = "UT2004S", - .qstat_option = "-ut2004s", - .qstat_master_option = "-ut2004m", - .icon = "ut2004.xpm", - .parse_player = un_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = un_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = ut_exec, - .save_info = quake_save_info, - .init_maps = unreal_init_maps, - .has_map = unreal_has_map, - .cmd_or_dir_changed = ut2004_cmd_or_dir_changed, - .update_prefs = ut2004_update_prefs, - .default_home = "~/.ut2004", - .pd = &ut2004_private, - .command = stringlist029, - }, - { - .type = RUNE_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD, - .name = "Rune", - .default_port = 7777, - .id = "RUNESRV", - .qstat_str = "UNS", - .qstat_option = "-uns", - .icon = "rune.xpm", - .parse_player = un_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = un_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = ut_exec, - .save_info = quake_save_info, - .init_maps = unreal_init_maps, - .has_map = unreal_has_map, - .pd = &rune_private, - .command = stringlist030, - }, - { - .type = POSTAL2_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD, - .name = "Postal 2", - .default_port = 7777, - .id = "POSTAL2", - .qstat_str = "UNS", - .qstat_option = "-uns", - .icon = "postal2.xpm", - .parse_player = un_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = un_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = ut_exec, - .save_info = quake_save_info, - .init_maps = unreal_init_maps, - .has_map = unreal_has_map, - .pd = &postal2_private, - .command = stringlist031, - }, - { - .type = AAO_SERVER, - .flags = GAME_CONNECT | GAME_SPECTATE | GAME_PASSWORD | GAME_LAUNCH_HOSTPORT, - .name = "America's Army", - .default_port = 1716, - .id = "AMS", - .qstat_str = "AMS", - .qstat_option = "-ams", - .icon = "aao.xpm", - .parse_player = un_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = un_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = ut_exec, - .save_info = quake_save_info, - .init_maps = unreal_init_maps, - .has_map = unreal_has_map, - .pd = &aao_private, - .command = stringlist032, - }, - { - .type = DESCENT3_SERVER, - .flags = GAME_CONNECT, - .name = "Descent3", - .default_port = 20142, - .id = "D3G", - .qstat_str = "D3G", - .qstat_option = "-d3g", - .icon = "descent3.xpm", - .parse_player = descent3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = descent3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = descent3_exec, - .save_info = quake_save_info, - .command = stringlist033, - }, - { - .type = SSAM_SERVER, - .flags = GAME_CONNECT, - .name = "Serious Sam", - .default_port = 25600, - .id = "SMS", - .qstat_str = "SMS", - .qstat_option = "-sms", - .icon = "ssam.xpm", - .parse_player = un_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = un_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = ssam_exec, - .save_info = quake_save_info, - .command = stringlist034, - }, - { - .type = SSAMSE_SERVER, - .flags = GAME_CONNECT, - .name = "Serious Sam TSE", - .default_port = 25600, - .id = "SMSSE", - .qstat_str = "SMS", - .qstat_option = "-sms", - .icon = "ssam.xpm", - .parse_player = un_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = un_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = ssam_exec, - .save_info = quake_save_info, - .command = stringlist035, - }, - { - .type = MOHAA_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Medal of Honor: Allied Assault", - .default_port = 12204, - .default_master_port = 27950, - .id = "MHS", - .qstat_str = "MHS", - .qstat_option = "-mhs", - .qstat_master_option = "-q3m", - .icon = "mohaa.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .default_home = "~/.mohaa", - .pd = &mohaa_private, - .main_mod = stringlist036, - .command = stringlist037, - }, - { - .type = COD_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Call of Duty", - .default_port = 28960, - .default_master_port = 20510, - .id = "CODS", - .qstat_str = "CODS", - .qstat_option = "-cods", - .qstat_master_option = "-codm", - .icon = "cod.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs_common, - .pd = &cod_private, - .main_mod = stringlist038, - .command = stringlist039, - }, - { - .type = SAS_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_ADMIN | GAME_Q3COLORS, - .name = "Savage", - .default_port = 11235, - .id = "SAS", - .qstat_str = "SAS", - .qstat_option = "-sas", - .icon = "savage.xpm", - .parse_player = savage_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = savage_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = savage_exec, - .save_info = quake_save_info, - .command = stringlist040, - }, - { - .type = BF1942_SERVER, - .flags = GAME_CONNECT, - .name = "Battlefield 1942", - .default_port = 14567, - .id = "BF1942", - .qstat_str = "EYE", - .qstat_option = "-eye", - .icon = "bf1942.xpm", - .parse_player = un_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = bf1942_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = bf1942_exec, - .save_info = quake_save_info, - }, - { - .type = JK2_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Jedi Outcast", - .default_port = 28070, - .default_master_port = 28060, - .id = "JK2S", - .qstat_str = "JK2S", - .qstat_option = "-jk2s", - .qstat_master_option = "-jk2m", - .icon = "jk2.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs_common, - .pd = &jk2_private, - .main_mod = stringlist041, - .command = stringlist042, - }, - { - .type = JK3_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Jedi Academy", - .default_port = 29070, - .default_master_port = 29060, - .id = "JK3S", - .qstat_str = "JK3S", - .qstat_option = "-jk3s", - .qstat_master_option = "-jk3m", - .icon = "jk3.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs_common, - .pd = &jk3_private, - .main_mod = stringlist043, - .command = stringlist044, - }, - { - .type = NETP_SERVER, - .flags = GAME_CONNECT, - .name = "NetPanzer", - .default_port = 3030, - .default_master_port = 28900, - .id = "NETP", - .qstat_str = "GPS", - .qstat_option = "-netp", - .qstat_master_option = "-netpm,netpanzer", - .icon = "netp.xpm", - .parse_player = un_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = un_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = netpanzer_exec, - .save_info = quake_save_info, - .command = stringlist045, - }, - { - .type = NEXUIZ_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Nexuiz", - .default_port = 26000, - .default_master_port = 27950, - .id = "NEXUIZS", - .qstat_str = "NEXUIZS", - .qstat_option = "-nexuizs", - .qstat_master_option = "-nexuizm", - .icon = "nexuiz.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs_common, - .default_home = "~/.nexuiz", - .main_mod = stringlist046, - .command = stringlist047, - }, - { - .type = XONOTIC_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Xonotic", - .default_port = 26000, - .default_master_port = 27950, - .id = "XONOTICS", - .qstat_str = "XONOTICS", - .qstat_option = "-xonotics", - .qstat_master_option = "-xonoticm", - .icon = "xonotic.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs_common, - .default_home = "~/.xonotic", - .main_mod = stringlist048, - .command = stringlist049, - }, - { - .type = WARSOW_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Warsow", - .default_port = 44400, - .default_master_port = 27950, - .id = "WARSOWS", - .qstat_str = "WARSOWS", - .qstat_option = "-warsows", - .qstat_master_option = "-warsowm", - .icon = "warsow.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs_common, - .default_home = "~/.warsow", - .pd = &warsow_private, - .main_mod = stringlist050, - .command = stringlist051, - }, - { - .type = TREMULOUS_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Tremulous", - .default_port = 30720, - .default_master_port = 30710, - .id = "TREMULOUSS", - .qstat_str = "TREMULOUSS", - .qstat_option = "-tremulouss", - .qstat_master_option = "-tremulousm", - .icon = "tremulous.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .cmd_or_dir_changed = tremulous_cmd_or_dir_changed, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs, - .default_home = "~/.tremulous", - .pd = &tremulous_private, - .main_mod = stringlist052, - .command = stringlist053, - }, - { - .type = TREMULOUSGPP_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Tremulous GPP", - .default_port = 30720, - .default_master_port = 30700, - .id = "TREMULOUSGPPS", - .qstat_str = "TREMULOUSGPPS", - .qstat_option = "-tremulousgpps", - .qstat_master_option = "-tremulousgppm", - .icon = "tremulousgpp.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs, - .default_home = "~/.tremulous", - .pd = &tremulousgpp_private, - .main_mod = stringlist054, - .command = stringlist055, - }, - { - .type = TREMFUSION_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "TremFusion", - .default_port = 30720, - .default_master_port = 30710, - .id = "TREMFUSIONS", - .qstat_str = "TREMFUSIONS", - .qstat_option = "-tremfusions", - .qstat_master_option = "-tremfusionm", - .icon = "tremfusion.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs, - .default_home = "~/.tremulous", - .pd = &tremfusion_private, - .main_mod = stringlist056, - .command = stringlist057, - }, - { - .type = UNVANQUISHED_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Unvanquished", - .default_port = 27960, - .default_master_port = 27950, - .id = "UNVANQUISHEDS", - .qstat_str = "UNVANQUISHEDS", - .qstat_option = "-unvanquisheds", - .qstat_master_option = "-unvanquishedm", - .icon = "unvanquished.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs, - .default_home = "~/.Unvanquished", - .pd = &unvanquished_private, - .main_mod = stringlist058, - .command = stringlist059, - }, - { - .type = OPENARENA_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "OpenArena", - .default_port = 27960, - .default_master_port = 27950, - .id = "OPENARENAS", - .qstat_str = "OPENARENAS", - .qstat_option = "-openarenas", - .qstat_master_option = "-openarenam", - .icon = "openarena.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs, - .default_home = "~/.openarena", - .pd = &openarena_private, - .main_mod = stringlist060, - .command = stringlist061, - }, - { - .type = OTTD_SERVER, - .flags = GAME_CONNECT, - .name = "OpenTTD", - .default_port = 3979, - .default_master_port = 3978, - .id = "OTTDS", - .qstat_str = "OTTDS", - .qstat_option = "-ottds", - .qstat_master_option = "-ottdm", - .icon = "openttd.xpm", - .parse_player = ottd_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = ottd_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = ottd_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .default_home = "~/.openttd", - .command = stringlist062, - }, - { - .type = Q3RALLY_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Q3 Rally", - .default_port = 27960, - .default_master_port = 27950, - .id = "Q3RALLYS", - .qstat_str = "Q3RALLYS", - .qstat_option = "-q3rallys", - .qstat_master_option = "-q3rallym", - .icon = "q3rally.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs, - .default_home = "~/.q3rally", - .pd = &q3rally_private, - .main_mod = stringlist063, - .command = stringlist064, - }, - { - .type = WOP_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "World of Padman", - .default_port = 27960, - .default_master_port = 27950, - .id = "WOPS", - .qstat_str = "WOPS", - .qstat_option = "-wops", - .qstat_master_option = "-wopm", - .icon = "wop.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs, - .default_home = "~/.WoPadman", - .pd = &wop_private, - .main_mod = stringlist065, - .command = stringlist066, - }, - { - .type = IOURT_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Urban Terror", - .default_port = 27960, - .default_master_port = 27900, - .id = "IOURTS", - .qstat_str = "IOURTS", - .qstat_option = "-iourts", - .qstat_master_option = "-iourtm", - .icon = "iourt.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs, - .default_home = "~/.q3a", - .pd = &iourt_private, - .main_mod = stringlist067, - .command = stringlist068, - }, - { - .type = REACTION_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Reaction", - .default_port = 27960, - .default_master_port = 27950, - .id = "REACTIONS", - .qstat_str = "REACTIONS", - .qstat_option = "-reactions", - .qstat_master_option = "-reactionm", - .icon = "reaction.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs, - .default_home = "~/.Reaction", - .pd = &reaction_private, - .main_mod = stringlist069, - .command = stringlist070, - }, - { - .type = SMOKINGUNS_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Smokin' Guns", - .default_port = 27960, - .default_master_port = 27950, - .id = "SMOKINGUNSS", - .qstat_str = "SMOKINGUNSS", - .qstat_option = "-smokingunss", - .qstat_master_option = "-smokingunsm", - .icon = "smokinguns.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs, - .default_home = "~/.smokinguns", - .pd = &smokinguns_private, - .main_mod = stringlist071, - .command = stringlist072, - }, - { - .type = ZEQ2LITE_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "ZEQ2 Lite", - .default_port = 27960, - .default_master_port = 27950, - .id = "ZEQ2LITES", - .qstat_str = "ZEQ2LITES", - .qstat_option = "-zeq2lites", - .qstat_master_option = "-zeq2litem", - .icon = "zeq2lite.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs, - .default_home = "~/.ZEQ2", - .pd = &zeq2lite_private, - .main_mod = stringlist073, - .command = stringlist074, - }, - { - .type = TURTLEARENA_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Turtle Arena", - .default_port = 27960, - .default_master_port = 27950, - .id = "TURTLEARENAS", - .qstat_str = "TURTLEARENAS", - .qstat_option = "-turtlearenas", - .qstat_master_option = "-turtlearenam", - .icon = "turtlearena.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q3_prefs_load_common, - .update_prefs = q3_update_prefs, - .default_home = "~/.turtlearena", - .pd = &turtlearena_private, - .main_mod = stringlist075, - .command = stringlist076, - }, - { - .type = ALIENARENA_SERVER, - .flags = GAME_CONNECT | GAME_PASSWORD | GAME_RCON | GAME_QUAKE3_MASTERPROTOCOL | GAME_Q3COLORS, - .name = "Alien Arena", - .default_port = 27960, - .default_master_port = 27950, - .id = "ALIENARENAS", - .qstat_str = "ALIENARENAS", - .qstat_option = "-alienarenas", - .qstat_master_option = "-alienarenam", - .icon = "alienarena.xpm", - .parse_player = q3_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = q3_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = q3_exec, - .custom_cfgs = quake_custom_cfgs, - .save_info = quake_save_info, - .init_maps = q3_init_maps, - .has_map = quake_has_map, - .get_mapshot = q3_get_mapshot, - .arch_identifier = "version", - .identify_cpu = identify_cpu, - .identify_os = identify_os, - .prefs_load = q2_prefs_load, - .update_prefs = q3_update_prefs, - .default_home = "~/.codered/", - .pd = &alienarena_private, - .main_mod = stringlist077, - .command = stringlist078, - }, - { - .type = GPS_SERVER, - .flags = GAME_CONNECT, - .name = "Generic Gamespy", - .default_port = 27888, - .id = "GPS", - .qstat_str = "GPS", - .qstat_option = "-gps", - .icon = "gamespy3d.xpm", - .parse_player = un_parse_player, - .parse_server = quake_parse_server, - .analyze_serverinfo = un_analyze_serverinfo, - .config_is_valid = config_is_valid_generic, - .exec_client = gamespy_exec, - .save_info = quake_save_info, - }, - { - .type = UNKNOWN_SERVER, - .name = "unknown", - .parse_server = quake_parse_server, - .config_is_valid = config_is_valid_generic, - .exec_client = exec_generic, - .save_info = quake_save_info, - }, -}; diff --git a/src/launch.c b/src/launch.c index 60bbdbf..fc9b56d 100644 --- a/src/launch.c +++ b/src/launch.c @@ -16,8 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include /* chmod, waitpid, kill */ #include /* memchr, strlen */ #include /* execvp, fork, _exit, chdir, read, close, write, fcntl, sleep */ @@ -409,4 +407,3 @@ void condef_free (struct condef *con) { g_free (con); } - diff --git a/src/libxqf_dummy_GeoIP_stubs.c b/src/libxqf_dummy_GeoIP_stubs.c deleted file mode 100644 index 06b64ff..0000000 --- a/src/libxqf_dummy_GeoIP_stubs.c +++ /dev/null @@ -1,28 +0,0 @@ -/* XQF - Quake server browser and launcher - * Dummy functions for GeoIP - * Copyright (C) 2005 Ludwig Nussel - * - * 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 - -GEOIP_API GeoIP* GeoIP_new(int flags) { - return 0; -} - -GEOIP_API GeoIP* GeoIP_open(const char * filename, int flags) { - return 0; -} diff --git a/src/libxqf_dummy_gdk_pixbuf_stubs.c b/src/libxqf_dummy_gdk_pixbuf_stubs.c deleted file mode 100644 index 2fd6cd6..0000000 --- a/src/libxqf_dummy_gdk_pixbuf_stubs.c +++ /dev/null @@ -1,36 +0,0 @@ -/* XQF - Quake server browser and launcher - * Dummy functions for gdk pixbuf - * Copyright (C) 2005 Ludwig Nussel - * - * 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 - -unsigned int gdk_pixbuf_major_version; -unsigned int gdk_pixbuf_minor_version; - -void *gdk_pixbuf_new_from_file (const char *filename) { - return NULL; -} - -void gdk_pixbuf_render_pixmap_and_mask(void *pixbuf, - void **pixmap_return, void **mask_return, - int alpha_threshold) { - *pixmap_return = NULL; - *mask_return = NULL; -} - -void gdk_pixbuf_unref(void *p) {}; diff --git a/src/loadpixmap.c b/src/loadpixmap.c index 537bfb3..147a9e6 100644 --- a/src/loadpixmap.c +++ b/src/loadpixmap.c @@ -19,8 +19,6 @@ // modified version of what glade generates -#include "gnuconfig.h" - #include #include #include diff --git a/src/menus.c b/src/menus.c index 8c0ca3a..26a5909 100644 --- a/src/menus.c +++ b/src/menus.c @@ -16,8 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include #include @@ -172,4 +170,3 @@ GtkWidget *create_menubar (const struct menuitem *items, return menubar; } - diff --git a/src/pixmaps.c b/src/pixmaps.c index 92fc275..c4cbfc3 100644 --- a/src/pixmaps.c +++ b/src/pixmaps.c @@ -16,8 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include #include "utils.h" @@ -605,4 +603,3 @@ void pixmap_cache_clear (GSList **cache, int maxitems) { g_slist_free (tmp); } } - diff --git a/src/pref.c b/src/pref.c index 893995a..7c551db 100644 --- a/src/pref.c +++ b/src/pref.c @@ -16,8 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include /* FD_SETSIZE */ #include /* fprintf */ #include /* strtol */ diff --git a/src/psearch.c b/src/psearch.c index d813440..c028ce9 100644 --- a/src/psearch.c +++ b/src/psearch.c @@ -16,8 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include #include #include /* strcmp */ @@ -403,4 +401,3 @@ void find_player (int find_next) { reset_main_status_bar(); } } - diff --git a/src/q3maps.c b/src/q3maps.c index 288e173..30466a7 100644 --- a/src/q3maps.c +++ b/src/q3maps.c @@ -17,8 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include #include #include @@ -28,10 +26,10 @@ #include #include +#include #include "debug.h" #include "utils.h" -#include "zip/unzip.h" #include "q3maps.h" diff --git a/src/rcon.c b/src/rcon.c index c146837..3110ebb 100644 --- a/src/rcon.c +++ b/src/rcon.c @@ -16,8 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include /* socket, send, bind, connect */ #include /* fprintf */ #include /* va_start, va_end */ @@ -32,9 +30,7 @@ #include // select #ifdef RCON_STANDALONE -# ifdef ENABLE_NLS -# include -# endif +#include #include #include #include @@ -356,7 +352,7 @@ static char* rcon_receive() { /* Q2, Q3 */ - default: + default: // "\377\377\377\377print\n" msg = packet + 4 + 6; size = size - 4 - 6; @@ -652,11 +648,9 @@ int main(int argc, char* argv[]) { char* buf = NULL; int res; -#ifdef ENABLE_NLS setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); -#endif rcon_servertype = Q3_SERVER; diff --git a/src/redial.c b/src/redial.c index 24e74ee..e05c7ed 100644 --- a/src/redial.c +++ b/src/redial.c @@ -16,8 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include #include /* strlen, strstr, strcpy */ diff --git a/src/scripts.c b/src/scripts.c index 1a2afa2..e3e113c 100644 --- a/src/scripts.c +++ b/src/scripts.c @@ -17,8 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include #include #include @@ -134,7 +132,7 @@ static enum script_option_type scriptoption_get_type(const char* str) { if (!strcmp(str, "list")) { return SCRIPT_OPTION_TYPE_LIST; } - + return SCRIPT_OPTION_TYPE_INVALID; } diff --git a/src/source.c b/src/source.c index e207713..065b337 100644 --- a/src/source.c +++ b/src/source.c @@ -16,8 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include #include #include /* strtol */ diff --git a/src/srv-list.c b/src/srv-list.c index f7bd22c..7010e9b 100644 --- a/src/srv-list.c +++ b/src/srv-list.c @@ -16,8 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include #include /* inet_ntoa */ #include /* inet_ntoa */ diff --git a/src/srv-prop.c b/src/srv-prop.c index 766248e..eb9113e 100644 --- a/src/srv-prop.c +++ b/src/srv-prop.c @@ -16,8 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include /* chmod */ #include /* FILE, fprintf, etc... */ #include /* strchr, strcmp */ diff --git a/src/stat.c b/src/stat.c index 6e8f791..aba9ba5 100644 --- a/src/stat.c +++ b/src/stat.c @@ -16,8 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include /* kill */ #include /* FILE, fopen, fclose, fprintf, ... */ #include /* strchr, strcmp, strlen, strcpy, memchr, strtok */ @@ -302,7 +300,7 @@ static gboolean stat_master_input_callback (GIOChannel *chan, GIOCondition condi } strncpy(conn->buf + (conn->bufsize - res), buf, res); - + if (status == G_IO_STATUS_EOF) { debug(3, "stat_master_input_callback -- eof"); debug(6, "conn->buf: [%d]", buf); @@ -813,7 +811,7 @@ static gboolean stat_servers_input_callback (GIOChannel *chan, GIOCondition cond debug(3, "stat_servers_input_callback -- eof"); debug(6, "conn->buf: [%d]", buf); debug(3, "Conn %ld Sub Process Done with server list %lx", conn, conn->job->servers); - + strings = stat_buffer_to_strings(conn->buf, conn->bufsize); current = strings; @@ -832,7 +830,7 @@ static gboolean stat_servers_input_callback (GIOChannel *chan, GIOCondition cond current = current->next; } g_slist_free(strings); - + stat_servers_update_done (conn); stat_next (job); g_free(buf); @@ -1065,7 +1063,7 @@ static struct stat_conn *stat_update_master_qstat (struct stat_job *job, struct if (m->type == SAS_SERVER) { argv[argi++] = "sh"; argv[argi++] = QSTAT_SAVAGE_SCRIPT; - argv[argi++] = m->url; + argv[argi++] = m->url; } else if (m->master_type == MASTER_GSLIST) { int ret = 0; @@ -2024,4 +2022,3 @@ void stat_job_free (struct stat_job *job) { g_free (job); } - diff --git a/src/stat.h b/src/stat.h index 52e379a..cfb22b7 100644 --- a/src/stat.h +++ b/src/stat.h @@ -28,9 +28,12 @@ #ifndef HTTP_HELPER -# define HTTP_HELPER "wget -t 1 -T 20 -q -e robots=off --user-agent=XQF/" VERSION " -O -" +# define HTTP_HELPER "wget -t 1 -T 20 -q -e robots=off --user-agent=XQF/" XQF_VERSION " -O -" #endif +#ifndef QSTAT_SAVAGE_SCRIPT +#define QSTAT_SAVAGE_SCRIPT "qstat_savage.sh" +#endif #define QSTAT_DELIM '\t' #define QSTAT_DELIM_STR "\t" @@ -137,4 +140,3 @@ extern void stat_job_free (struct stat_job *job); #endif /* __QSTAT_H__ */ - diff --git a/src/statistics.c b/src/statistics.c index 9a9a59d..20b0be2 100644 --- a/src/statistics.c +++ b/src/statistics.c @@ -16,8 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include #include #include diff --git a/src/test_utils.c b/src/test_utils.c index da347bf..1c32521 100644 --- a/src/test_utils.c +++ b/src/test_utils.c @@ -17,7 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" #include #include #include diff --git a/src/tga/.gitignore b/src/tga/.gitignore deleted file mode 100644 index 051d1bd..0000000 --- a/src/tga/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -Makefile -Makefile.in -.deps diff --git a/src/tga/Makefile.am b/src/tga/Makefile.am deleted file mode 100644 index 341b979..0000000 --- a/src/tga/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/intl \ - -I$(top_srcdir)/src \ - -DLOCALEDIR=\"$(localedir)\" \ - -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" \ - -DPIXMAPSDIR=\"$(datadir)/pixmaps\" \ - $(GTK_CFLAGS) \ - $(QSTAT23) \ - $(DEBUG) \ - $(COMPRESSION) \ - $(GDK_PIXBUF_CFLAGS) \ - $(PACKAGE_CFLAGS) \ - $(OLD_GTK_SUPPORT) - -libtga_a_SOURCES=memtopixmap.c memtopixmap.h tga.c tga.h -noinst_LIBRARIES=libtga.a - -EXTRA_PROGRAMS=memtopixmap - -memtopixmap_CFLAGS = -DSTANDALONE $(INCLUDES) -memtopixmap_SOURCES = $(libtga_a_SOURCES) -memtopixmap_LDADD = @INTLLIBS@ $(GTK_LIBS) $(GDK_PIXBUF_LIBS) @PACKAGE_LIBS@ diff --git a/src/tga/memtopixmap.c b/src/tga/memtopixmap.c index f5ebaa1..8b6f832 100644 --- a/src/tga/memtopixmap.c +++ b/src/tga/memtopixmap.c @@ -17,8 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include #include #include diff --git a/src/utils.c b/src/utils.c index aa6f898..f7c2d2e 100644 --- a/src/utils.c +++ b/src/utils.c @@ -16,8 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include /* getpwnam, readdir, dirent */ #include /* FILE, putc */ #include /* strlen, strncpy, strcmp, strspn, strcspn, strchr */ diff --git a/src/utmaps.c b/src/utmaps.c index 4bc7499..1bf1c4c 100644 --- a/src/utmaps.c +++ b/src/utmaps.c @@ -17,8 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include #include #include diff --git a/src/xpm/.gitignore b/src/xpm/.gitignore deleted file mode 100644 index 282522d..0000000 --- a/src/xpm/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/src/xpm/Makefile.am b/src/xpm/Makefile.am deleted file mode 100644 index 8521fc5..0000000 --- a/src/xpm/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -EXTRA_DIST=$(wildcard *.xpm) $(flag_DATA) - -flagdir = $(pkgdatadir)/default/flags -flag_DATA = lan.png - -xpmdir = $(pkgdatadir)/xpm -xpm_DATA = \ - update.xpm \ - refresh.xpm \ - refrsel.xpm \ - stop.xpm \ - connect.xpm \ - observe.xpm \ - record.xpm \ - sfilter.xpm \ - pfilter.xpm diff --git a/src/xqf-ui.c b/src/xqf-ui.c index f8b77c0..aaa2ac0 100644 --- a/src/xqf-ui.c +++ b/src/xqf-ui.c @@ -16,8 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include #include #include /* va_start, va_end */ diff --git a/src/xqf.c b/src/xqf.c index 03370f2..d6c6071 100644 --- a/src/xqf.c +++ b/src/xqf.c @@ -16,8 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnuconfig.h" - #include #include #include /* atoi */ @@ -37,10 +35,7 @@ #include /* kill... */ #include - -#ifdef ENABLE_NLS -# include -#endif +#include #include #include @@ -4124,12 +4119,10 @@ int main (int argc, char *argv[]) { xqf_LOCALEDIR = var; } -#ifdef ENABLE_NLS setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, xqf_LOCALEDIR); bind_textdomain_codeset (PACKAGE, "UTF-8"); textdomain (PACKAGE); -#endif set_debug_level (DEFAULT_DEBUG_LEVEL); debug (5, "main() -- Debug Level Default Set at %d", DEFAULT_DEBUG_LEVEL); diff --git a/src/xqf.h b/src/xqf.h index 88b7d26..4ecbf9e 100644 --- a/src/xqf.h +++ b/src/xqf.h @@ -19,8 +19,6 @@ #ifndef __XQF_H__ #define __XQF_H__ -#include "gnuconfig.h" /* GNU autoconf */ - #include #include /* struct in_addr */ #include /* struct in_addr */ diff --git a/src/zip/.gitignore b/src/zip/.gitignore deleted file mode 100644 index e995588..0000000 --- a/src/zip/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.deps -Makefile -Makefile.in diff --git a/src/zip/Makefile.am b/src/zip/Makefile.am deleted file mode 100644 index d946e93..0000000 --- a/src/zip/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -libunzip_a_SOURCES=unzip.c ioapi.c unzip.h ioapi.h -noinst_LIBRARIES=libunzip.a diff --git a/src/zip/README b/src/zip/README deleted file mode 100644 index ecdf696..0000000 --- a/src/zip/README +++ /dev/null @@ -1,5 +0,0 @@ -ioapi.c, ioapi.h, unzip.c and unzip.h are taken from - -http://www.winimage.com/zLibDll/unzip.htm - -see unzip.h for details diff --git a/src/zip/ioapi.c b/src/zip/ioapi.c deleted file mode 100644 index 23497b5..0000000 --- a/src/zip/ioapi.c +++ /dev/null @@ -1,177 +0,0 @@ -/* ioapi.c -- IO base function header for compress/uncompress .zip - files using zlib + zip or unzip API - - Version 0.21, March 10th, 2003 - - Copyright (C) 1998-2003 Gilles Vollant -*/ - -#include -#include -#include - -#include "zlib.h" -#include "ioapi.h" - - - -/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ - -#ifndef SEEK_CUR -#define SEEK_CUR 1 -#endif - -#ifndef SEEK_END -#define SEEK_END 2 -#endif - -#ifndef SEEK_SET -#define SEEK_SET 0 -#endif - -voidpf ZCALLBACK fopen_file_func OF(( - voidpf opaque, - const char* filename, - int mode)); - -uLong ZCALLBACK fread_file_func OF(( - voidpf opaque, - voidpf stream, - void* buf, - uLong size)); - -uLong ZCALLBACK fwrite_file_func OF(( - voidpf opaque, - voidpf stream, - const void* buf, - uLong size)); - -long ZCALLBACK ftell_file_func OF(( - voidpf opaque, - voidpf stream)); - -long ZCALLBACK fseek_file_func OF(( - voidpf opaque, - voidpf stream, - uLong offset, - int origin)); - -int ZCALLBACK fclose_file_func OF(( - voidpf opaque, - voidpf stream)); - -int ZCALLBACK ferror_file_func OF(( - voidpf opaque, - voidpf stream)); - - -voidpf ZCALLBACK fopen_file_func (opaque, filename, mode) - voidpf opaque; - const char* filename; - int mode; -{ - FILE* file = NULL; - const char* mode_fopen = NULL; - if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) - mode_fopen = "rb"; - else - if (mode & ZLIB_FILEFUNC_MODE_EXISTING) - mode_fopen = "r+b"; - else - if (mode & ZLIB_FILEFUNC_MODE_CREATE) - mode_fopen = "wb"; - - if ((filename!=NULL) && (mode_fopen != NULL)) - file = fopen(filename, mode_fopen); - return file; -} - - -uLong ZCALLBACK fread_file_func (opaque, stream, buf, size) - voidpf opaque; - voidpf stream; - void* buf; - uLong size; -{ - uLong ret; - ret = fread(buf, 1, size, (FILE *)stream); - return ret; -} - - -uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size) - voidpf opaque; - voidpf stream; - const void* buf; - uLong size; -{ - uLong ret; - ret = fwrite(buf, 1, size, (FILE *)stream); - return ret; -} - -long ZCALLBACK ftell_file_func (opaque, stream) - voidpf opaque; - voidpf stream; -{ - long ret; - ret = ftell((FILE *)stream); - return ret; -} - -long ZCALLBACK fseek_file_func (opaque, stream, offset, origin) - voidpf opaque; - voidpf stream; - uLong offset; - int origin; -{ - int fseek_origin=0; - long ret; - switch (origin) - { - case ZLIB_FILEFUNC_SEEK_CUR : - fseek_origin = SEEK_CUR; - break; - case ZLIB_FILEFUNC_SEEK_END : - fseek_origin = SEEK_END; - break; - case ZLIB_FILEFUNC_SEEK_SET : - fseek_origin = SEEK_SET; - break; - default: return -1; - } - ret = 0; - fseek((FILE *)stream, offset, fseek_origin); - return ret; -} - -int ZCALLBACK fclose_file_func (opaque, stream) - voidpf opaque; - voidpf stream; -{ - int ret; - ret = fclose((FILE *)stream); - return ret; -} - -int ZCALLBACK ferror_file_func (opaque, stream) - voidpf opaque; - voidpf stream; -{ - int ret; - ret = ferror((FILE *)stream); - return ret; -} - -void fill_fopen_filefunc (pzlib_filefunc_def) - zlib_filefunc_def* pzlib_filefunc_def; -{ - pzlib_filefunc_def->zopen_file = fopen_file_func; - pzlib_filefunc_def->zread_file = fread_file_func; - pzlib_filefunc_def->zwrite_file = fwrite_file_func; - pzlib_filefunc_def->ztell_file = ftell_file_func; - pzlib_filefunc_def->zseek_file = fseek_file_func; - pzlib_filefunc_def->zclose_file = fclose_file_func; - pzlib_filefunc_def->zerror_file = ferror_file_func; - pzlib_filefunc_def->opaque = NULL; -} diff --git a/src/zip/ioapi.h b/src/zip/ioapi.h deleted file mode 100644 index 610f579..0000000 --- a/src/zip/ioapi.h +++ /dev/null @@ -1,79 +0,0 @@ -/* ioapi.h -- IO base function header for compress/uncompress .zip - files using zlib + zip or unzip API - - Version 0.21, March 10th, 2003 - - Copyright (C) 1998-2003 Gilles Vollant -*/ - -#ifndef _ZLIBIOAPI_H -#define _ZLIBIOAPI_H - - -#define ZLIB_FILEFUNC_SEEK_CUR (1) -#define ZLIB_FILEFUNC_SEEK_END (2) -#define ZLIB_FILEFUNC_SEEK_SET (0) - -#define ZLIB_FILEFUNC_MODE_READ (1) -#define ZLIB_FILEFUNC_MODE_WRITE (2) -#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) - -#define ZLIB_FILEFUNC_MODE_EXISTING (4) -#define ZLIB_FILEFUNC_MODE_CREATE (8) - - -#ifndef ZCALLBACK - -#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) -#define ZCALLBACK CALLBACK -#else -#define ZCALLBACK -#endif -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef OF -#define OF(args) args -#endif - -typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); -typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); -typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); -typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); -typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); -typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); -typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); - -typedef struct zlib_filefunc_def_s -{ - open_file_func zopen_file; - read_file_func zread_file; - write_file_func zwrite_file; - tell_file_func ztell_file; - seek_file_func zseek_file; - close_file_func zclose_file; - testerror_file_func zerror_file; - voidpf opaque; -} zlib_filefunc_def; - - - -void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); - -#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size)) -#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size)) -#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream)) -#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode)) -#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream)) -#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream)) - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/src/zip/unzip.c b/src/zip/unzip.c deleted file mode 100644 index ba0e367..0000000 --- a/src/zip/unzip.c +++ /dev/null @@ -1,1436 +0,0 @@ -/* unzip.c -- IO for uncompress .zip files using zlib - Version 0.21, March 10th, 2003 - - Copyright (C) 1998-2003 Gilles Vollant - - Read unzip.h for more info -*/ - - -#include -#include -#include -#include "zlib.h" -#include "unzip.h" - -#ifdef STDC -# include -# include -# include -#endif -#ifdef NO_ERRNO_H - extern int errno; -#else -# include -#endif - - -#ifndef local -# define local static -#endif -/* compile with -Dlocal if your debugger can't find static symbols */ - - - -#if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) && \ - !defined(CASESENSITIVITYDEFAULT_NO) -#define CASESENSITIVITYDEFAULT_NO -#endif - - -#ifndef UNZ_BUFSIZE -#define UNZ_BUFSIZE (16384) -#endif - -#ifndef UNZ_MAXFILENAMEINZIP -#define UNZ_MAXFILENAMEINZIP (256) -#endif - -#ifndef ALLOC -# define ALLOC(size) (malloc(size)) -#endif -#ifndef TRYFREE -# define TRYFREE(p) {if (p) free(p);} -#endif - -#define SIZECENTRALDIRITEM (0x2e) -#define SIZEZIPLOCALHEADER (0x1e) - - - - -const char unz_copyright[] = - " unzip 0.21 Copyright 1998-2003 Gilles Vollant - http://www.winimage.com/zLibDll"; - -/* unz_file_info_interntal contain internal info about a file in zipfile*/ -typedef struct unz_file_info_internal_s -{ - uLong offset_curfile;/* relative offset of local header 4 bytes */ -} unz_file_info_internal; - - -/* file_in_zip_read_info_s contain internal information about a file in zipfile, - when reading and decompress it */ -typedef struct -{ - char *read_buffer; /* internal buffer for compressed data */ - z_stream stream; /* zLib stream structure for inflate */ - - uLong pos_in_zipfile; /* position in byte on the zipfile, for fseek*/ - uLong stream_initialised; /* flag set if stream structure is initialised*/ - - uLong offset_local_extrafield;/* offset of the local extra field */ - uInt size_local_extrafield;/* size of the local extra field */ - uLong pos_local_extrafield; /* position in the local extra field in read*/ - - uLong crc32; /* crc32 of all data uncompressed */ - uLong crc32_wait; /* crc32 we must obtain after decompress all */ - uLong rest_read_compressed; /* number of byte to be decompressed */ - uLong rest_read_uncompressed;/*number of byte to be obtained after decomp*/ - zlib_filefunc_def z_filefunc; - voidpf filestream; /* io structore of the zipfile */ - uLong compression_method; /* compression method (0==store) */ - uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ - int raw; -} file_in_zip_read_info_s; - - -/* unz_s contain internal information about the zipfile -*/ -typedef struct -{ - zlib_filefunc_def z_filefunc; - voidpf filestream; /* io structore of the zipfile */ - unz_global_info gi; /* public global information */ - uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ - uLong num_file; /* number of the current file in the zipfile*/ - uLong pos_in_central_dir; /* pos of the current file in the central dir*/ - uLong current_file_ok; /* flag about the usability of the current file*/ - uLong central_pos; /* position of the beginning of the central dir*/ - - uLong size_central_dir; /* size of the central directory */ - uLong offset_central_dir; /* offset of start of central directory with - respect to the starting disk number */ - - unz_file_info cur_file_info; /* public info about the current file in zip*/ - unz_file_info_internal cur_file_info_internal; /* private info about it*/ - file_in_zip_read_info_s* pfile_in_zip_read; /* structure about the current - file if we are decompressing it */ -} unz_s; - - -/* =========================================================================== - Read a byte from a gz_stream; update next_in and avail_in. Return EOF - for end of file. - IN assertion: the stream s has been sucessfully opened for reading. -*/ - - -local int unzlocal_getByte OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - int *pi)); - -local int unzlocal_getByte(pzlib_filefunc_def,filestream,pi) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - int *pi; -{ - unsigned char c; - int err = ZREAD(*pzlib_filefunc_def,filestream,&c,1); - if (err==1) - { - *pi = (int)c; - return UNZ_OK; - } - else - { - if (ZERROR(*pzlib_filefunc_def,filestream)) - return UNZ_ERRNO; - else - return UNZ_EOF; - } -} - - -/* =========================================================================== - Reads a long in LSB order from the given gz_stream. Sets -*/ -local int unzlocal_getShort OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int unzlocal_getShort (pzlib_filefunc_def,filestream,pX) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - uLong *pX; -{ - uLong x ; - int i; - int err; - - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==UNZ_OK) - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<8; - - if (err==UNZ_OK) - *pX = x; - else - *pX = 0; - return err; -} - -local int unzlocal_getLong OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int unzlocal_getLong (pzlib_filefunc_def,filestream,pX) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - uLong *pX; -{ - uLong x ; - int i; - int err; - - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==UNZ_OK) - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<8; - - if (err==UNZ_OK) - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<16; - - if (err==UNZ_OK) - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<24; - - if (err==UNZ_OK) - *pX = x; - else - *pX = 0; - return err; -} - - -/* My own strcmpi / strcasecmp */ -local int strcmpcasenosensitive_internal (fileName1,fileName2) - const char* fileName1; - const char* fileName2; -{ - for (;;) - { - char c1=*(fileName1++); - char c2=*(fileName2++); - if ((c1>='a') && (c1<='z')) - c1 -= 0x20; - if ((c2>='a') && (c2<='z')) - c2 -= 0x20; - if (c1=='\0') - return ((c2=='\0') ? 0 : -1); - if (c2=='\0') - return 1; - if (c1c2) - return 1; - } -} - - -#ifdef CASESENSITIVITYDEFAULT_NO -#define CASESENSITIVITYDEFAULTVALUE 2 -#else -#define CASESENSITIVITYDEFAULTVALUE 1 -#endif - -#ifndef STRCMPCASENOSENTIVEFUNCTION -#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal -#endif - -/* - Compare two filename (fileName1,fileName2). - If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) - If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi - or strcasecmp) - If iCaseSenisivity = 0, case sensitivity is defaut of your operating system - (like 1 on Unix, 2 on Windows) - -*/ -extern int ZEXPORT unzStringFileNameCompare (fileName1,fileName2,iCaseSensitivity) - const char* fileName1; - const char* fileName2; - int iCaseSensitivity; -{ - if (iCaseSensitivity==0) - iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE; - - if (iCaseSensitivity==1) - return strcmp(fileName1,fileName2); - - return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2); -} - -#define BUFREADCOMMENT (0x400) - -/* - Locate the Central directory of a zipfile (at the end, just before - the global comment) -*/ -local uLong unzlocal_SearchCentralDir OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream)); - -local uLong unzlocal_SearchCentralDir(pzlib_filefunc_def,filestream) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; -{ - unsigned char* buf; - uLong uSizeFile; - uLong uBackRead; - uLong uMaxBack=0xffff; /* maximum size of global comment */ - uLong uPosFound=0; - - if (ZSEEK(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) - return 0; - - - uSizeFile = ZTELL(*pzlib_filefunc_def,filestream); - - if (uMaxBack>uSizeFile) - uMaxBack = uSizeFile; - - buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); - if (buf==NULL) - return 0; - - uBackRead = 4; - while (uBackReaduMaxBack) - uBackRead = uMaxBack; - else - uBackRead+=BUFREADCOMMENT; - uReadPos = uSizeFile-uBackRead ; - - uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? - (BUFREADCOMMENT+4) : (uSizeFile-uReadPos); - if (ZSEEK(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) - break; - - if (ZREAD(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) - break; - - for (i=(int)uReadSize-3; (i--)>0;) - if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && - ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) - { - uPosFound = uReadPos+i; - break; - } - - if (uPosFound!=0) - break; - } - TRYFREE(buf); - return uPosFound; -} - -/* - Open a Zip file. path contain the full pathname (by example, - on a Windows NT computer "c:\\test\\zlib109.zip" or on an Unix computer - "zlib/zlib109.zip". - If the zipfile cannot be opened (file don't exist or in not valid), the - return value is NULL. - Else, the return value is a unzFile Handle, usable with other function - of this unzip package. -*/ -extern unzFile ZEXPORT unzOpen2 (path, pzlib_filefunc_def) - const char *path; - zlib_filefunc_def* pzlib_filefunc_def; -{ - unz_s us; - unz_s *s; - uLong central_pos,uL; - - uLong number_disk; /* number of the current dist, used for - spaning ZIP, unsupported, always 0*/ - uLong number_disk_with_CD; /* number the the disk with central dir, used - for spaning ZIP, unsupported, always 0*/ - uLong number_entry_CD; /* total number of entries in - the central dir - (same than number_entry on nospan) */ - - int err=UNZ_OK; - - if (unz_copyright[0]!=' ') - return NULL; - - if (pzlib_filefunc_def==NULL) - fill_fopen_filefunc(&us.z_filefunc); - else - us.z_filefunc = *pzlib_filefunc_def; - - us.filestream= (*(us.z_filefunc.zopen_file))(us.z_filefunc.opaque, - path, - ZLIB_FILEFUNC_MODE_READ | - ZLIB_FILEFUNC_MODE_EXISTING); - if (us.filestream==NULL) - return NULL; - - central_pos = unzlocal_SearchCentralDir(&us.z_filefunc,us.filestream); - if (central_pos==0) - err=UNZ_ERRNO; - - if (ZSEEK(us.z_filefunc, us.filestream, - central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) - err=UNZ_ERRNO; - - /* the signature, already checked */ - if (unzlocal_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of this disk */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of the disk with the start of the central directory */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) - err=UNZ_ERRNO; - - /* total number of entries in the central dir on this disk */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK) - err=UNZ_ERRNO; - - /* total number of entries in the central dir */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK) - err=UNZ_ERRNO; - - if ((number_entry_CD!=us.gi.number_entry) || - (number_disk_with_CD!=0) || - (number_disk!=0)) - err=UNZ_BADZIPFILE; - - /* size of the central directory */ - if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK) - err=UNZ_ERRNO; - - /* offset of start of central directory with respect to the - starting disk number */ - if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK) - err=UNZ_ERRNO; - - /* zipfile comment length */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK) - err=UNZ_ERRNO; - - if ((central_pospfile_in_zip_read!=NULL) - unzCloseCurrentFile(file); - - ZCLOSE(s->z_filefunc, s->filestream); - TRYFREE(s); - return UNZ_OK; -} - - -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. */ -extern int ZEXPORT unzGetGlobalInfo (file,pglobal_info) - unzFile file; - unz_global_info *pglobal_info; -{ - unz_s* s; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - *pglobal_info=s->gi; - return UNZ_OK; -} - - -/* - Translate date/time from Dos format to tm_unz (readable more easilty) -*/ -local void unzlocal_DosDateToTmuDate (ulDosDate, ptm) - uLong ulDosDate; - tm_unz* ptm; -{ - uLong uDate; - uDate = (uLong)(ulDosDate>>16); - ptm->tm_mday = (uInt)(uDate&0x1f) ; - ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ; - ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ; - - ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800); - ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ; - ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ; -} - -/* - Get Info about the current file in the zipfile, with internal only info -*/ -local int unzlocal_GetCurrentFileInfoInternal OF((unzFile file, - unz_file_info *pfile_info, - unz_file_info_internal - *pfile_info_internal, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); - -local int unzlocal_GetCurrentFileInfoInternal (file, - pfile_info, - pfile_info_internal, - szFileName, fileNameBufferSize, - extraField, extraFieldBufferSize, - szComment, commentBufferSize) - unzFile file; - unz_file_info *pfile_info; - unz_file_info_internal *pfile_info_internal; - char *szFileName; - uLong fileNameBufferSize; - void *extraField; - uLong extraFieldBufferSize; - char *szComment; - uLong commentBufferSize; -{ - unz_s* s; - unz_file_info file_info; - unz_file_info_internal file_info_internal; - int err=UNZ_OK; - uLong uMagic; - long lSeek=0; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - if (ZSEEK(s->z_filefunc, s->filestream, - s->pos_in_central_dir+s->byte_before_the_zipfile, - ZLIB_FILEFUNC_SEEK_SET)!=0) - err=UNZ_ERRNO; - - - /* we check the magic */ - if (err==UNZ_OK) - { - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) - err=UNZ_ERRNO; - else if (uMagic!=0x02014b50) - err=UNZ_BADZIPFILE; - } - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK) - err=UNZ_ERRNO; - - unzlocal_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date); - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK) - err=UNZ_ERRNO; - - lSeek+=file_info.size_filename; - if ((err==UNZ_OK) && (szFileName!=NULL)) - { - uLong uSizeRead ; - if (file_info.size_filename0) && (fileNameBufferSize>0)) - if (ZREAD(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - lSeek -= uSizeRead; - } - - - if ((err==UNZ_OK) && (extraField!=NULL)) - { - uLong uSizeRead ; - if (file_info.size_file_extraz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) - lSeek=0; - else - err=UNZ_ERRNO; - } - if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) - if (ZREAD(s->z_filefunc, s->filestream,extraField,uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - lSeek += file_info.size_file_extra - uSizeRead; - } - else - lSeek+=file_info.size_file_extra; - - - if ((err==UNZ_OK) && (szComment!=NULL)) - { - uLong uSizeRead ; - if (file_info.size_file_commentz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) - lSeek=0; - else - err=UNZ_ERRNO; - } - if ((file_info.size_file_comment>0) && (commentBufferSize>0)) - if (ZREAD(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - lSeek+=file_info.size_file_comment - uSizeRead; - } - else - lSeek+=file_info.size_file_comment; - - if ((err==UNZ_OK) && (pfile_info!=NULL)) - *pfile_info=file_info; - - if ((err==UNZ_OK) && (pfile_info_internal!=NULL)) - *pfile_info_internal=file_info_internal; - - return err; -} - - - -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. -*/ -extern int ZEXPORT unzGetCurrentFileInfo (file, - pfile_info, - szFileName, fileNameBufferSize, - extraField, extraFieldBufferSize, - szComment, commentBufferSize) - unzFile file; - unz_file_info *pfile_info; - char *szFileName; - uLong fileNameBufferSize; - void *extraField; - uLong extraFieldBufferSize; - char *szComment; - uLong commentBufferSize; -{ - return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,NULL, - szFileName,fileNameBufferSize, - extraField,extraFieldBufferSize, - szComment,commentBufferSize); -} - -/* - Set the current file of the zipfile to the first file. - return UNZ_OK if there is no problem -*/ -extern int ZEXPORT unzGoToFirstFile (file) - unzFile file; -{ - int err=UNZ_OK; - unz_s* s; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - s->pos_in_central_dir=s->offset_central_dir; - s->num_file=0; - err=unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - return err; -} - -/* - Set the current file of the zipfile to the next file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. -*/ -extern int ZEXPORT unzGoToNextFile (file) - unzFile file; -{ - unz_s* s; - int err; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - if (s->num_file+1==s->gi.number_entry) - return UNZ_END_OF_LIST_OF_FILE; - - s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + - s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ; - s->num_file++; - err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - return err; -} - - -/* - Try locate the file szFileName in the zipfile. - For the iCaseSensitivity signification, see unzipStringFileNameCompare - - return value : - UNZ_OK if the file is found. It becomes the current file. - UNZ_END_OF_LIST_OF_FILE if the file is not found -*/ -extern int ZEXPORT unzLocateFile (file, szFileName, iCaseSensitivity) - unzFile file; - const char *szFileName; - int iCaseSensitivity; -{ - unz_s* s; - int err; - - - uLong num_fileSaved; - uLong pos_in_central_dirSaved; - - - if (file==NULL) - return UNZ_PARAMERROR; - - if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP) - return UNZ_PARAMERROR; - - s=(unz_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - - num_fileSaved = s->num_file; - pos_in_central_dirSaved = s->pos_in_central_dir; - - err = unzGoToFirstFile(file); - - while (err == UNZ_OK) - { - char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1]; - unzGetCurrentFileInfo(file,NULL, - szCurrentFileName,sizeof(szCurrentFileName)-1, - NULL,0,NULL,0); - if (unzStringFileNameCompare(szCurrentFileName, - szFileName,iCaseSensitivity)==0) - return UNZ_OK; - err = unzGoToNextFile(file); - } - - s->num_file = num_fileSaved ; - s->pos_in_central_dir = pos_in_central_dirSaved ; - return err; -} - - -/* -/////////////////////////////////////////// -// Contributed by Ryan Haksi (mailto://cryogen@infoserve.net) -// I need random access -// -// Further optimization could be realized by adding an ability -// to cache the directory in memory. The goal being a single -// comprehensive file read to put the file I need in a memory. -*/ - -/* -typedef struct unz_file_pos_s -{ - uLong pos_in_zip_directory; // offset in file - uLong num_of_file; // # of file -} unz_file_pos; -*/ - -extern int ZEXPORT unzGetFilePos(file, file_pos) - unzFile file; - unz_file_pos* file_pos; -{ - unz_s* s; - - if (file==NULL || file_pos==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - - file_pos->pos_in_zip_directory = s->pos_in_central_dir; - file_pos->num_of_file = s->num_file; - - return UNZ_OK; -} - -extern int ZEXPORT unzGoToFilePos(file, file_pos) - unzFile file; - unz_file_pos* file_pos; -{ - unz_s* s; - int err; - - if (file==NULL || file_pos==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - - /* jump to the right spot */ - s->pos_in_central_dir = file_pos->pos_in_zip_directory; - s->num_file = file_pos->num_of_file; - - /* set the current file */ - err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - /* return results */ - s->current_file_ok = (err == UNZ_OK); - return err; -} - -/* -// Unzip Helper Functions - should be here? -/////////////////////////////////////////// -*/ - -/* - Read the local header of the current zipfile - Check the coherency of the local header and info in the end of central - directory about this file - store in *piSizeVar the size of extra info in local header - (filename and size of extra field data) -*/ -local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar, - poffset_local_extrafield, - psize_local_extrafield) - unz_s* s; - uInt* piSizeVar; - uLong *poffset_local_extrafield; - uInt *psize_local_extrafield; -{ - uLong uMagic,uData,uFlags; - uLong size_filename; - uLong size_extra_field; - int err=UNZ_OK; - - *piSizeVar = 0; - *poffset_local_extrafield = 0; - *psize_local_extrafield = 0; - - if (ZSEEK(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile + - s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - - if (err==UNZ_OK) - { - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) - err=UNZ_ERRNO; - else if (uMagic!=0x04034b50) - err=UNZ_BADZIPFILE; - } - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) - err=UNZ_ERRNO; -/* - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion)) - err=UNZ_BADZIPFILE; -*/ - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method)) - err=UNZ_BADZIPFILE; - - if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) && - (s->cur_file_info.compression_method!=Z_DEFLATED)) - err=UNZ_BADZIPFILE; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */ - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */ - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && - ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */ - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && - ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */ - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && - ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK) - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename)) - err=UNZ_BADZIPFILE; - - *piSizeVar += (uInt)size_filename; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK) - err=UNZ_ERRNO; - *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile + - SIZEZIPLOCALHEADER + size_filename; - *psize_local_extrafield = (uInt)size_extra_field; - - *piSizeVar += (uInt)size_extra_field; - - return err; -} - -/* - Open for reading data the current file in the zipfile. - If there is no error and the file is opened, the return value is UNZ_OK. -*/ -extern int ZEXPORT unzOpenCurrentFile2 (file, method, level, raw) - unzFile file; - int* method; - int* level; - int raw; - -{ - int err=UNZ_OK; - uInt iSizeVar; - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - uLong offset_local_extrafield; /* offset of the local extra field */ - uInt size_local_extrafield; /* size of the local extra field */ - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - if (!s->current_file_ok) - return UNZ_PARAMERROR; - - if (s->pfile_in_zip_read != NULL) - unzCloseCurrentFile(file); - - if (unzlocal_CheckCurrentFileCoherencyHeader(s,&iSizeVar, - &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK) - return UNZ_BADZIPFILE; - - pfile_in_zip_read_info = (file_in_zip_read_info_s*) - ALLOC(sizeof(file_in_zip_read_info_s)); - if (pfile_in_zip_read_info==NULL) - return UNZ_INTERNALERROR; - - pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE); - pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield; - pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield; - pfile_in_zip_read_info->pos_local_extrafield=0; - pfile_in_zip_read_info->raw=raw; - - if (pfile_in_zip_read_info->read_buffer==NULL) - { - TRYFREE(pfile_in_zip_read_info); - return UNZ_INTERNALERROR; - } - - pfile_in_zip_read_info->stream_initialised=0; - - if (method!=NULL) - *method = s->cur_file_info.compression_method; - - if (level!=NULL) - { - *level = 6; - switch (s->cur_file_info.flag & 0x06) - { - case 6 : *level = 1; break; - case 4 : *level = 2; break; - case 2 : *level = 9; break; - } - } - - if ((s->cur_file_info.compression_method!=0) && - (s->cur_file_info.compression_method!=Z_DEFLATED)) - err=UNZ_BADZIPFILE; - - pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; - pfile_in_zip_read_info->crc32=0; - pfile_in_zip_read_info->compression_method = - s->cur_file_info.compression_method; - pfile_in_zip_read_info->filestream=s->filestream; - pfile_in_zip_read_info->z_filefunc=s->z_filefunc; - pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile; - - pfile_in_zip_read_info->stream.total_out = 0; - - if ((s->cur_file_info.compression_method==Z_DEFLATED) && - (!raw)) - { - pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; - pfile_in_zip_read_info->stream.zfree = (free_func)0; - pfile_in_zip_read_info->stream.opaque = (voidpf)0; - - err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); - if (err == Z_OK) - pfile_in_zip_read_info->stream_initialised=1; - else - return err; - /* windowBits is passed < 0 to tell that there is no zlib header. - * Note that in this case inflate *requires* an extra "dummy" byte - * after the compressed stream in order to complete decompression and - * return Z_STREAM_END. - * In unzip, i don't wait absolutely Z_STREAM_END because I known the - * size of both compressed and uncompressed data - */ - } - pfile_in_zip_read_info->rest_read_compressed = - s->cur_file_info.compressed_size ; - pfile_in_zip_read_info->rest_read_uncompressed = - s->cur_file_info.uncompressed_size ; - - - pfile_in_zip_read_info->pos_in_zipfile = - s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + - iSizeVar; - - pfile_in_zip_read_info->stream.avail_in = (uInt)0; - - - s->pfile_in_zip_read = pfile_in_zip_read_info; - return UNZ_OK; -} - -extern int ZEXPORT unzOpenCurrentFile (file) - unzFile file; -{ - return unzOpenCurrentFile2(file, NULL, NULL, 0); -} -/* - Read bytes from the current file. - buf contain buffer where data must be copied - len the size of buf. - - return the number of byte copied if somes bytes are copied - return 0 if the end of file was reached - return <0 with error code if there is an error - (UNZ_ERRNO for IO error, or zLib error for uncompress error) -*/ -extern int ZEXPORT unzReadCurrentFile (file, buf, len) - unzFile file; - voidp buf; - unsigned len; -{ - int err=UNZ_OK; - uInt iRead = 0; - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - - if (pfile_in_zip_read_info->read_buffer == NULL) - return UNZ_END_OF_LIST_OF_FILE; - if (len==0) - return 0; - - pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; - - pfile_in_zip_read_info->stream.avail_out = (uInt)len; - - if (len>pfile_in_zip_read_info->rest_read_uncompressed) - pfile_in_zip_read_info->stream.avail_out = - (uInt)pfile_in_zip_read_info->rest_read_uncompressed; - - while (pfile_in_zip_read_info->stream.avail_out>0) - { - if ((pfile_in_zip_read_info->stream.avail_in==0) && - (pfile_in_zip_read_info->rest_read_compressed>0)) - { - uInt uReadThis = UNZ_BUFSIZE; - if (pfile_in_zip_read_info->rest_read_compressedrest_read_compressed; - if (uReadThis == 0) - return UNZ_EOF; - if (ZSEEK(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->pos_in_zipfile + - pfile_in_zip_read_info->byte_before_the_zipfile, - ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - if (ZREAD(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->read_buffer, - uReadThis)!=uReadThis) - return UNZ_ERRNO; - pfile_in_zip_read_info->pos_in_zipfile += uReadThis; - - pfile_in_zip_read_info->rest_read_compressed-=uReadThis; - - pfile_in_zip_read_info->stream.next_in = - (Bytef*)pfile_in_zip_read_info->read_buffer; - pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; - } - - if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw)) - { - uInt uDoCopy,i ; - - if ((pfile_in_zip_read_info->stream.avail_in == 0) && - (pfile_in_zip_read_info->rest_read_compressed == 0)) - return (iRead==0) ? UNZ_EOF : iRead; - - if (pfile_in_zip_read_info->stream.avail_out < - pfile_in_zip_read_info->stream.avail_in) - uDoCopy = pfile_in_zip_read_info->stream.avail_out ; - else - uDoCopy = pfile_in_zip_read_info->stream.avail_in ; - - for (i=0;istream.next_out+i) = - *(pfile_in_zip_read_info->stream.next_in+i); - - pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, - pfile_in_zip_read_info->stream.next_out, - uDoCopy); - pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy; - pfile_in_zip_read_info->stream.avail_in -= uDoCopy; - pfile_in_zip_read_info->stream.avail_out -= uDoCopy; - pfile_in_zip_read_info->stream.next_out += uDoCopy; - pfile_in_zip_read_info->stream.next_in += uDoCopy; - pfile_in_zip_read_info->stream.total_out += uDoCopy; - iRead += uDoCopy; - } - else - { - uLong uTotalOutBefore,uTotalOutAfter; - const Bytef *bufBefore; - uLong uOutThis; - int flush=Z_SYNC_FLUSH; - - uTotalOutBefore = pfile_in_zip_read_info->stream.total_out; - bufBefore = pfile_in_zip_read_info->stream.next_out; - - /* - if ((pfile_in_zip_read_info->rest_read_uncompressed == - pfile_in_zip_read_info->stream.avail_out) && - (pfile_in_zip_read_info->rest_read_compressed == 0)) - flush = Z_FINISH; - */ - err=inflate(&pfile_in_zip_read_info->stream,flush); - - uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; - uOutThis = uTotalOutAfter-uTotalOutBefore; - - pfile_in_zip_read_info->crc32 = - crc32(pfile_in_zip_read_info->crc32,bufBefore, - (uInt)(uOutThis)); - - pfile_in_zip_read_info->rest_read_uncompressed -= - uOutThis; - - iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); - - if (err==Z_STREAM_END) - return (iRead==0) ? UNZ_EOF : iRead; - if (err!=Z_OK) - break; - } - } - - if (err==Z_OK) - return iRead; - return err; -} - - -/* - Give the current position in uncompressed data -*/ -extern z_off_t ZEXPORT unztell (file) - unzFile file; -{ - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - return (z_off_t)pfile_in_zip_read_info->stream.total_out; -} - - -/* - return 1 if the end of file was reached, 0 elsewhere -*/ -extern int ZEXPORT unzeof (file) - unzFile file; -{ - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - if (pfile_in_zip_read_info->rest_read_uncompressed == 0) - return 1; - else - return 0; -} - - - -/* - Read extra field from the current file (opened by unzOpenCurrentFile) - This is the local-header version of the extra field (sometimes, there is - more info in the local-header version than in the central-header) - - if buf==NULL, it return the size of the local extra field that can be read - - if buf!=NULL, len is the size of the buffer, the extra header is copied in - buf. - the return value is the number of bytes copied in buf, or (if <0) - the error code -*/ -extern int ZEXPORT unzGetLocalExtrafield (file,buf,len) - unzFile file; - voidp buf; - unsigned len; -{ - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - uInt read_now; - uLong size_to_read; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - size_to_read = (pfile_in_zip_read_info->size_local_extrafield - - pfile_in_zip_read_info->pos_local_extrafield); - - if (buf==NULL) - return (int)size_to_read; - - if (len>size_to_read) - read_now = (uInt)size_to_read; - else - read_now = (uInt)len ; - - if (read_now==0) - return 0; - - if (ZSEEK(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->offset_local_extrafield + - pfile_in_zip_read_info->pos_local_extrafield, - ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - if (ZREAD(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - buf,size_to_read)!=size_to_read) - return UNZ_ERRNO; - - return (int)read_now; -} - -/* - Close the file in zip opened with unzipOpenCurrentFile - Return UNZ_CRCERROR if all the file was read but the CRC is not good -*/ -extern int ZEXPORT unzCloseCurrentFile (file) - unzFile file; -{ - int err=UNZ_OK; - - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - - if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) && - (!pfile_in_zip_read_info->raw)) - { - if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait) - err=UNZ_CRCERROR; - } - - - TRYFREE(pfile_in_zip_read_info->read_buffer); - pfile_in_zip_read_info->read_buffer = NULL; - if (pfile_in_zip_read_info->stream_initialised) - inflateEnd(&pfile_in_zip_read_info->stream); - - pfile_in_zip_read_info->stream_initialised = 0; - TRYFREE(pfile_in_zip_read_info); - - s->pfile_in_zip_read=NULL; - - return err; -} - - -/* - Get the global comment string of the ZipFile, in the szComment buffer. - uSizeBuf is the size of the szComment buffer. - return the number of byte copied or an error code <0 -*/ -extern int ZEXPORT unzGetGlobalComment (file, szComment, uSizeBuf) - unzFile file; - char *szComment; - uLong uSizeBuf; -{ - unz_s* s; - uLong uReadThis ; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - - uReadThis = uSizeBuf; - if (uReadThis>s->gi.size_comment) - uReadThis = s->gi.size_comment; - - if (ZSEEK(s->z_filefunc,s->filestream,s->central_pos+22,ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - if (uReadThis>0) - { - *szComment='\0'; - if (ZREAD(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis) - return UNZ_ERRNO; - } - - if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) - *(szComment+s->gi.size_comment)='\0'; - return (int)uReadThis; -} diff --git a/src/zip/unzip.h b/src/zip/unzip.h deleted file mode 100644 index 26cda61..0000000 --- a/src/zip/unzip.h +++ /dev/null @@ -1,323 +0,0 @@ -/* unzip.h -- IO for uncompress .zip files using zlib - Version 0.21, March 10th, 2003 - - Copyright (C) 1998-2003 Gilles Vollant - - This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g - WinZip, InfoZip tools and compatible. - Encryption and multi volume ZipFile (span) are not supported. - Old compressions used by old PKZip 1.x are not supported - - - I WAIT FEEDBACK at mail info@winimage.com - Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution - - Condition of use and distribution are the same than zlib : - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - -*/ - -/* for more info about .ZIP format, see - http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip - http://www.info-zip.org/pub/infozip/doc/ - PkWare has also a specification at : - ftp://ftp.pkware.com/probdesc.zip -*/ - -#ifndef _unz_H -#define _unz_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _ZLIB_H -#include "zlib.h" -#endif - -#ifndef _ZLIBIOAPI_H -#include "ioapi.h" -#endif - -//khorben -#ifndef ZEXPORT -#define ZEXPORT -#endif - -#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) -/* like the STRICT of WIN32, we define a pointer that cannot be converted - from (void*) without cast */ -typedef struct TagunzFile__ { int unused; } unzFile__; -typedef unzFile__ *unzFile; -#else -typedef voidp unzFile; -#endif - - -#define UNZ_OK (0) -#define UNZ_END_OF_LIST_OF_FILE (-100) -#define UNZ_ERRNO (Z_ERRNO) -#define UNZ_EOF (0) -#define UNZ_PARAMERROR (-102) -#define UNZ_BADZIPFILE (-103) -#define UNZ_INTERNALERROR (-104) -#define UNZ_CRCERROR (-105) - -/* tm_unz contain date/time info */ -typedef struct tm_unz_s -{ - uInt tm_sec; /* seconds after the minute - [0,59] */ - uInt tm_min; /* minutes after the hour - [0,59] */ - uInt tm_hour; /* hours since midnight - [0,23] */ - uInt tm_mday; /* day of the month - [1,31] */ - uInt tm_mon; /* months since January - [0,11] */ - uInt tm_year; /* years - [1980..2044] */ -} tm_unz; - -/* unz_global_info structure contain global data about the ZIPfile - These data comes from the end of central dir */ -typedef struct unz_global_info_s -{ - uLong number_entry; /* total number of entries in - the central dir on this disk */ - uLong size_comment; /* size of the global comment of the zipfile */ -} unz_global_info; - - -/* unz_file_info contain information about a file in the zipfile */ -typedef struct unz_file_info_s -{ - uLong version; /* version made by 2 bytes */ - uLong version_needed; /* version needed to extract 2 bytes */ - uLong flag; /* general purpose bit flag 2 bytes */ - uLong compression_method; /* compression method 2 bytes */ - uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ - uLong crc; /* crc-32 4 bytes */ - uLong compressed_size; /* compressed size 4 bytes */ - uLong uncompressed_size; /* uncompressed size 4 bytes */ - uLong size_filename; /* filename length 2 bytes */ - uLong size_file_extra; /* extra field length 2 bytes */ - uLong size_file_comment; /* file comment length 2 bytes */ - - uLong disk_num_start; /* disk number start 2 bytes */ - uLong internal_fa; /* internal file attributes 2 bytes */ - uLong external_fa; /* external file attributes 4 bytes */ - - tm_unz tmu_date; -} unz_file_info; - -extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, - const char* fileName2, - int iCaseSensitivity)); -/* - Compare two filename (fileName1,fileName2). - If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) - If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi - or strcasecmp) - If iCaseSenisivity = 0, case sensitivity is defaut of your operating system - (like 1 on Unix, 2 on Windows) -*/ - - -extern unzFile ZEXPORT unzOpen OF((const char *path)); -/* - Open a Zip file. path contain the full pathname (by example, - on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer - "zlib/zlib113.zip". - If the zipfile cannot be opened (file don't exist or in not valid), the - return value is NULL. - Else, the return value is a unzFile Handle, usable with other function - of this unzip package. -*/ - -extern unzFile ZEXPORT unzOpen2 OF((const char *path, - zlib_filefunc_def* pzlib_filefunc_def)); -/* - Open a Zip file, like unzOpen, but provide a set of file low level API - for read/write the zip file (see ioapi.h) -*/ - -extern int ZEXPORT unzClose OF((unzFile file)); -/* - Close a ZipFile opened with unzipOpen. - If there is files inside the .Zip opened with unzOpenCurrentFile (see later), - these files MUST be closed with unzipCloseCurrentFile before call unzipClose. - return UNZ_OK if there is no problem. */ - -extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, - unz_global_info *pglobal_info)); -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. */ - - -extern int ZEXPORT unzGetGlobalComment OF((unzFile file, - char *szComment, - uLong uSizeBuf)); -/* - Get the global comment string of the ZipFile, in the szComment buffer. - uSizeBuf is the size of the szComment buffer. - return the number of byte copied or an error code <0 -*/ - - -/***************************************************************************/ -/* Unzip package allow you browse the directory of the zipfile */ - -extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); -/* - Set the current file of the zipfile to the first file. - return UNZ_OK if there is no problem -*/ - -extern int ZEXPORT unzGoToNextFile OF((unzFile file)); -/* - Set the current file of the zipfile to the next file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. -*/ - -extern int ZEXPORT unzLocateFile OF((unzFile file, - const char *szFileName, - int iCaseSensitivity)); -/* - Try locate the file szFileName in the zipfile. - For the iCaseSensitivity signification, see unzStringFileNameCompare - - return value : - UNZ_OK if the file is found. It becomes the current file. - UNZ_END_OF_LIST_OF_FILE if the file is not found -*/ - - -/* ****************************************** */ -/* Ryan supplied functions */ -/* unz_file_info contain information about a file in the zipfile */ -typedef struct unz_file_pos_s -{ - uLong pos_in_zip_directory; /* offset in zip file directory */ - uLong num_of_file; /* # of file */ -} unz_file_pos; - -extern int ZEXPORT unzGetFilePos( - unzFile file, - unz_file_pos* file_pos); - -extern int ZEXPORT unzGoToFilePos( - unzFile file, - unz_file_pos* file_pos); - -/* ****************************************** */ - -extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, - unz_file_info *pfile_info, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); -/* - Get Info about the current file - if pfile_info!=NULL, the *pfile_info structure will contain somes info about - the current file - if szFileName!=NULL, the filemane string will be copied in szFileName - (fileNameBufferSize is the size of the buffer) - if extraField!=NULL, the extra field information will be copied in extraField - (extraFieldBufferSize is the size of the buffer). - This is the Central-header version of the extra field - if szComment!=NULL, the comment string of the file will be copied in szComment - (commentBufferSize is the size of the buffer) -*/ - -/***************************************************************************/ -/* for reading the content of the current zipfile, you can open it, read data - from it, and close it (you can close it before reading all the file) - */ - -extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); -/* - Open for reading data the current file in the zipfile. - If there is no error, the return value is UNZ_OK. -*/ - -extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, - int* method, - int* level, - int raw)); -/* - Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) - *method will receive method of compression, *level will receive level of - compression - note : you can set level parameter as NULL (if you did not want known level, - but you CANNOT set method parameter as NULL -*/ - -extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); -/* - Close the file in zip opened with unzOpenCurrentFile - Return UNZ_CRCERROR if all the file was read but the CRC is not good -*/ - -extern int ZEXPORT unzReadCurrentFile OF((unzFile file, - voidp buf, - unsigned len)); -/* - Read bytes from the current file (opened by unzOpenCurrentFile) - buf contain buffer where data must be copied - len the size of buf. - - return the number of byte copied if somes bytes are copied - return 0 if the end of file was reached - return <0 with error code if there is an error - (UNZ_ERRNO for IO error, or zLib error for uncompress error) -*/ - -extern z_off_t ZEXPORT unztell OF((unzFile file)); -/* - Give the current position in uncompressed data -*/ - -extern int ZEXPORT unzeof OF((unzFile file)); -/* - return 1 if the end of file was reached, 0 elsewhere -*/ - -extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, - voidp buf, - unsigned len)); -/* - Read extra field from the current file (opened by unzOpenCurrentFile) - This is the local-header version of the extra field (sometimes, there is - more info in the local-header version than in the central-header) - - if buf==NULL, it return the size of the local extra field - - if buf!=NULL, len is the size of the buffer, the extra header is copied in - buf. - the return value is the number of bytes copied in buf, or (if <0) - the error code -*/ - -#ifdef __cplusplus -} -#endif - -#endif /* _unz_H */ diff --git a/src/zipped.c b/src/zipped.c index e0a9429..eb454c9 100644 --- a/src/zipped.c +++ b/src/zipped.c @@ -33,20 +33,15 @@ struct compr { }; -#ifdef COMPRESSOR_BZIP2 -# define COMPRESSOR_DEFAULT 1 +#ifdef USE_GZIP +# define COMPRESSOR_DEFAULT 1 /* gzip */ #else -# ifdef COMPRESSOR_GZIP -# define COMPRESSOR_DEFAULT 2 -# else -# define COMPRESSOR_DEFAULT 0 /* None */ -# endif +# define COMPRESSOR_DEFAULT 0 /* none */ #endif static struct compr compressor[] = { { "", NULL, NULL }, - { ".bz2", "bzip2 -1", "bzip2 -d -c" }, { ".gz", "gzip -1", "gzip -d -c" }, { NULL, NULL, NULL } }; @@ -141,4 +136,3 @@ void zstream_unlink (const char *name) { g_free (fn); } } - diff --git a/xqf.desktop.in b/xqf.desktop.in index e045f36..66f9b4b 100644 --- a/xqf.desktop.in +++ b/xqf.desktop.in @@ -1,10 +1,10 @@ [Desktop Entry] -_Name=XQF Game Server Browser -_GenericName=Game Server Browser -_Comment=Locate and connect to game servers +Name=XQF Game Server Browser +GenericName=Game Server Browser +Comment=Locate and connect to game servers Exec=xqf Icon=xqf StartupNotify=true Terminal=false Type=Application -Categories=GTK;Game;ActionGame;X-SuSE-Core-Game; +Categories=GTK;Game;ActionGame;