[Pkg-allegro-commits] r31 - in unstable: . liquidwar liquidwar/branches liquidwar/branches/upstream liquidwar/branches/upstream/current liquidwar/branches/upstream/current/custom liquidwar/branches/upstream/current/custom/map liquidwar/branches/upstream/current/custom/music liquidwar/branches/upstream/current/custom/texture liquidwar/branches/upstream/current/data liquidwar/branches/upstream/current/data/back liquidwar/branches/upstream/current/data/font liquidwar/branches/upstream/current/data/help liquidwar/branches/upstream/current/data/map liquidwar/branches/upstream/current/data/maptex liquidwar/branches/upstream/current/data/music liquidwar/branches/upstream/current/data/sfx liquidwar/branches/upstream/current/data/texture liquidwar/branches/upstream/current/data/water liquidwar/branches/upstream/current/doc liquidwar/branches/upstream/current/doc/html liquidwar/branches/upstream/current/doc/info liquidwar/branches/upstream/current/doc/man liquidwar/branches/upstream/current/doc/pdf liquidwar/branches/upstream/current/doc/php3 liquidwar/branches/upstream/current/doc/ps liquidwar/branches/upstream/current/doc/tex liquidwar/branches/upstream/current/doc/texi liquidwar/branches/upstream/current/doc/txt liquidwar/branches/upstream/current/doc/uwc liquidwar/branches/upstream/current/doc/xml liquidwar/branches/upstream/current/misc liquidwar/branches/upstream/current/src liquidwar/branches/upstream/current/utils liquidwar/branches/upstream/current/utils/lwmapgen liquidwar/branches/upstream/current/utils/lwmapgen/old liquidwar/branches/upstream/current/utils/snprintf liquidwar/branches/upstream/current/www liquidwar/branches/upstream/current/www/mysql liquidwar/branches/upstream/current/www/php3

Alexandre Pineau apineau-guest at alioth.debian.org
Mon Nov 13 19:54:02 CET 2006


Author: apineau-guest
Date: 2006-11-13 19:23:22 +0100 (Mon, 13 Nov 2006)
New Revision: 31

Added:
   unstable/liquidwar/
   unstable/liquidwar/branches/
   unstable/liquidwar/branches/upstream/
   unstable/liquidwar/branches/upstream/current/
   unstable/liquidwar/branches/upstream/current/COPYING
   unstable/liquidwar/branches/upstream/current/ChangeLog
   unstable/liquidwar/branches/upstream/current/INSTALL
   unstable/liquidwar/branches/upstream/current/Makefile.dos
   unstable/liquidwar/branches/upstream/current/Makefile.in
   unstable/liquidwar/branches/upstream/current/Makefile.win
   unstable/liquidwar/branches/upstream/current/README
   unstable/liquidwar/branches/upstream/current/README.de
   unstable/liquidwar/branches/upstream/current/README.dk
   unstable/liquidwar/branches/upstream/current/README.fr
   unstable/liquidwar/branches/upstream/current/config.guess
   unstable/liquidwar/branches/upstream/current/config.sub
   unstable/liquidwar/branches/upstream/current/configure
   unstable/liquidwar/branches/upstream/current/configure.in
   unstable/liquidwar/branches/upstream/current/custom/
   unstable/liquidwar/branches/upstream/current/custom/map/
   unstable/liquidwar/branches/upstream/current/custom/map/meditate.bmp
   unstable/liquidwar/branches/upstream/current/custom/map/pacman.bmp
   unstable/liquidwar/branches/upstream/current/custom/map/paille.bmp
   unstable/liquidwar/branches/upstream/current/custom/map/t4.bmp
   unstable/liquidwar/branches/upstream/current/custom/music/
   unstable/liquidwar/branches/upstream/current/custom/music/colossus.mid
   unstable/liquidwar/branches/upstream/current/custom/texture/
   unstable/liquidwar/branches/upstream/current/custom/texture/bluesq.bmp
   unstable/liquidwar/branches/upstream/current/custom/texture/clovers.bmp
   unstable/liquidwar/branches/upstream/current/custom/texture/meditate.bmp
   unstable/liquidwar/branches/upstream/current/custom/texture/rust.bmp
   unstable/liquidwar/branches/upstream/current/custom/texture/warning.bmp
   unstable/liquidwar/branches/upstream/current/data/
   unstable/liquidwar/branches/upstream/current/data/.cvsignore
   unstable/liquidwar/branches/upstream/current/data/Makefile.in
   unstable/liquidwar/branches/upstream/current/data/back/
   unstable/liquidwar/branches/upstream/current/data/back/.cvsignore
   unstable/liquidwar/branches/upstream/current/data/back/Makefile.in
   unstable/liquidwar/branches/upstream/current/data/back/lw5back.pcx
   unstable/liquidwar/branches/upstream/current/data/font/
   unstable/liquidwar/branches/upstream/current/data/font/.cvsignore
   unstable/liquidwar/branches/upstream/current/data/font/Makefile.in
   unstable/liquidwar/branches/upstream/current/data/font/degrad10.pcx
   unstable/liquidwar/branches/upstream/current/data/font/degrad20.pcx
   unstable/liquidwar/branches/upstream/current/data/font/mouse20.pcx
   unstable/liquidwar/branches/upstream/current/data/font/mouse40.pcx
   unstable/liquidwar/branches/upstream/current/data/font/void1.pcx
   unstable/liquidwar/branches/upstream/current/data/help/
   unstable/liquidwar/branches/upstream/current/data/help/english/
   unstable/liquidwar/branches/upstream/current/data/help/francais/
   unstable/liquidwar/branches/upstream/current/data/map/
   unstable/liquidwar/branches/upstream/current/data/map/.cvsignore
   unstable/liquidwar/branches/upstream/current/data/map/007.pcx
   unstable/liquidwar/branches/upstream/current/data/map/007.txt
   unstable/liquidwar/branches/upstream/current/data/map/213.pcx
   unstable/liquidwar/branches/upstream/current/data/map/213.txt
   unstable/liquidwar/branches/upstream/current/data/map/2d.bmp
   unstable/liquidwar/branches/upstream/current/data/map/2d.txt
   unstable/liquidwar/branches/upstream/current/data/map/3d.bmp
   unstable/liquidwar/branches/upstream/current/data/map/3d.txt
   unstable/liquidwar/branches/upstream/current/data/map/3x3.bmp
   unstable/liquidwar/branches/upstream/current/data/map/3x3.txt
   unstable/liquidwar/branches/upstream/current/data/map/4zones.pcx
   unstable/liquidwar/branches/upstream/current/data/map/4zones.txt
   unstable/liquidwar/branches/upstream/current/data/map/666.pcx
   unstable/liquidwar/branches/upstream/current/data/map/666.txt
   unstable/liquidwar/branches/upstream/current/data/map/8.bmp
   unstable/liquidwar/branches/upstream/current/data/map/8.txt
   unstable/liquidwar/branches/upstream/current/data/map/Makefile.in
   unstable/liquidwar/branches/upstream/current/data/map/ac.bmp
   unstable/liquidwar/branches/upstream/current/data/map/ac.txt
   unstable/liquidwar/branches/upstream/current/data/map/alstar1.pcx
   unstable/liquidwar/branches/upstream/current/data/map/alstar1.txt
   unstable/liquidwar/branches/upstream/current/data/map/anaglyph1.bmp
   unstable/liquidwar/branches/upstream/current/data/map/anaglyph1.txt
   unstable/liquidwar/branches/upstream/current/data/map/anaglyph2.bmp
   unstable/liquidwar/branches/upstream/current/data/map/anaglyph2.txt
   unstable/liquidwar/branches/upstream/current/data/map/aquarium.pcx
   unstable/liquidwar/branches/upstream/current/data/map/aquarium.txt
   unstable/liquidwar/branches/upstream/current/data/map/around.bmp
   unstable/liquidwar/branches/upstream/current/data/map/around.txt
   unstable/liquidwar/branches/upstream/current/data/map/bestiole.pcx
   unstable/liquidwar/branches/upstream/current/data/map/bestiole.txt
   unstable/liquidwar/branches/upstream/current/data/map/biere.pcx
   unstable/liquidwar/branches/upstream/current/data/map/biere.txt
   unstable/liquidwar/branches/upstream/current/data/map/big.bmp
   unstable/liquidwar/branches/upstream/current/data/map/big.txt
   unstable/liquidwar/branches/upstream/current/data/map/bigm.txt
   unstable/liquidwar/branches/upstream/current/data/map/blemmya.bmp
   unstable/liquidwar/branches/upstream/current/data/map/blemmya.txt
   unstable/liquidwar/branches/upstream/current/data/map/boa.pcx
   unstable/liquidwar/branches/upstream/current/data/map/boa.txt
   unstable/liquidwar/branches/upstream/current/data/map/bonoball.pcx
   unstable/liquidwar/branches/upstream/current/data/map/bonoball.txt
   unstable/liquidwar/branches/upstream/current/data/map/bored.bmp
   unstable/liquidwar/branches/upstream/current/data/map/bored.txt
   unstable/liquidwar/branches/upstream/current/data/map/bubbles.bmp
   unstable/liquidwar/branches/upstream/current/data/map/bubbles.txt
   unstable/liquidwar/branches/upstream/current/data/map/card.bmp
   unstable/liquidwar/branches/upstream/current/data/map/card.txt
   unstable/liquidwar/branches/upstream/current/data/map/carreaux.pcx
   unstable/liquidwar/branches/upstream/current/data/map/carreaux.txt
   unstable/liquidwar/branches/upstream/current/data/map/carres.pcx
   unstable/liquidwar/branches/upstream/current/data/map/carres.txt
   unstable/liquidwar/branches/upstream/current/data/map/centrik.pcx
   unstable/liquidwar/branches/upstream/current/data/map/centrik.txt
   unstable/liquidwar/branches/upstream/current/data/map/charming.bmp
   unstable/liquidwar/branches/upstream/current/data/map/charming.txt
   unstable/liquidwar/branches/upstream/current/data/map/chenille.pcx
   unstable/liquidwar/branches/upstream/current/data/map/chenille.txt
   unstable/liquidwar/branches/upstream/current/data/map/chess.bmp
   unstable/liquidwar/branches/upstream/current/data/map/chess.txt
   unstable/liquidwar/branches/upstream/current/data/map/chinois.pcx
   unstable/liquidwar/branches/upstream/current/data/map/chinois.txt
   unstable/liquidwar/branches/upstream/current/data/map/circle.bmp
   unstable/liquidwar/branches/upstream/current/data/map/circle.txt
   unstable/liquidwar/branches/upstream/current/data/map/circlus.bmp
   unstable/liquidwar/branches/upstream/current/data/map/circlus.txt
   unstable/liquidwar/branches/upstream/current/data/map/clean.bmp
   unstable/liquidwar/branches/upstream/current/data/map/clean.txt
   unstable/liquidwar/branches/upstream/current/data/map/clown.pcx
   unstable/liquidwar/branches/upstream/current/data/map/clown.txt
   unstable/liquidwar/branches/upstream/current/data/map/coccinel.pcx
   unstable/liquidwar/branches/upstream/current/data/map/coccinel.txt
   unstable/liquidwar/branches/upstream/current/data/map/coeurs.pcx
   unstable/liquidwar/branches/upstream/current/data/map/coeurs.txt
   unstable/liquidwar/branches/upstream/current/data/map/confuse.bmp
   unstable/liquidwar/branches/upstream/current/data/map/confuse.txt
   unstable/liquidwar/branches/upstream/current/data/map/cornet3b.pcx
   unstable/liquidwar/branches/upstream/current/data/map/cornet3b.txt
   unstable/liquidwar/branches/upstream/current/data/map/crown.pcx
   unstable/liquidwar/branches/upstream/current/data/map/crown.txt
   unstable/liquidwar/branches/upstream/current/data/map/darkone1.bmp
   unstable/liquidwar/branches/upstream/current/data/map/darkone1.txt
   unstable/liquidwar/branches/upstream/current/data/map/darkone2.bmp
   unstable/liquidwar/branches/upstream/current/data/map/darkone2.txt
   unstable/liquidwar/branches/upstream/current/data/map/darkone3.bmp
   unstable/liquidwar/branches/upstream/current/data/map/darkone3.txt
   unstable/liquidwar/branches/upstream/current/data/map/darkone4.bmp
   unstable/liquidwar/branches/upstream/current/data/map/darkone4.txt
   unstable/liquidwar/branches/upstream/current/data/map/derivsol.pcx
   unstable/liquidwar/branches/upstream/current/data/map/derivsol.txt
   unstable/liquidwar/branches/upstream/current/data/map/dirt.bmp
   unstable/liquidwar/branches/upstream/current/data/map/dirt.txt
   unstable/liquidwar/branches/upstream/current/data/map/donuts.pcx
   unstable/liquidwar/branches/upstream/current/data/map/donuts.txt
   unstable/liquidwar/branches/upstream/current/data/map/echange.pcx
   unstable/liquidwar/branches/upstream/current/data/map/echange.txt
   unstable/liquidwar/branches/upstream/current/data/map/echlune.pcx
   unstable/liquidwar/branches/upstream/current/data/map/echlune.txt
   unstable/liquidwar/branches/upstream/current/data/map/egg.bmp
   unstable/liquidwar/branches/upstream/current/data/map/egg.txt
   unstable/liquidwar/branches/upstream/current/data/map/etoile.pcx
   unstable/liquidwar/branches/upstream/current/data/map/etoile.txt
   unstable/liquidwar/branches/upstream/current/data/map/eyes.bmp
   unstable/liquidwar/branches/upstream/current/data/map/eyes.txt
   unstable/liquidwar/branches/upstream/current/data/map/feuille.pcx
   unstable/liquidwar/branches/upstream/current/data/map/feuille.txt
   unstable/liquidwar/branches/upstream/current/data/map/fille.pcx
   unstable/liquidwar/branches/upstream/current/data/map/fille.txt
   unstable/liquidwar/branches/upstream/current/data/map/fils.pcx
   unstable/liquidwar/branches/upstream/current/data/map/fils.txt
   unstable/liquidwar/branches/upstream/current/data/map/flo1.pcx
   unstable/liquidwar/branches/upstream/current/data/map/flo1.txt
   unstable/liquidwar/branches/upstream/current/data/map/garcon.pcx
   unstable/liquidwar/branches/upstream/current/data/map/garcon.txt
   unstable/liquidwar/branches/upstream/current/data/map/garden.bmp
   unstable/liquidwar/branches/upstream/current/data/map/garden.txt
   unstable/liquidwar/branches/upstream/current/data/map/glasses.pcx
   unstable/liquidwar/branches/upstream/current/data/map/glasses.txt
   unstable/liquidwar/branches/upstream/current/data/map/h.bmp
   unstable/liquidwar/branches/upstream/current/data/map/h.txt
   unstable/liquidwar/branches/upstream/current/data/map/haricot.pcx
   unstable/liquidwar/branches/upstream/current/data/map/haricot.txt
   unstable/liquidwar/branches/upstream/current/data/map/hi.bmp
   unstable/liquidwar/branches/upstream/current/data/map/hi.txt
   unstable/liquidwar/branches/upstream/current/data/map/honey.bmp
   unstable/liquidwar/branches/upstream/current/data/map/honey.txt
   unstable/liquidwar/branches/upstream/current/data/map/honeymoon.bmp
   unstable/liquidwar/branches/upstream/current/data/map/honeymoon.txt
   unstable/liquidwar/branches/upstream/current/data/map/jabberwocky.bmp
   unstable/liquidwar/branches/upstream/current/data/map/jabberwocky.txt
   unstable/liquidwar/branches/upstream/current/data/map/labyrint.bmp
   unstable/liquidwar/branches/upstream/current/data/map/labyrint.txt
   unstable/liquidwar/branches/upstream/current/data/map/lapin.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lapin.txt
   unstable/liquidwar/branches/upstream/current/data/map/liqwar.pcx
   unstable/liquidwar/branches/upstream/current/data/map/liqwar.txt
   unstable/liquidwar/branches/upstream/current/data/map/logo.bmp
   unstable/liquidwar/branches/upstream/current/data/map/logo.txt
   unstable/liquidwar/branches/upstream/current/data/map/lost.bmp
   unstable/liquidwar/branches/upstream/current/data/map/lost.txt
   unstable/liquidwar/branches/upstream/current/data/map/lw.bmp
   unstable/liquidwar/branches/upstream/current/data/map/lw.txt
   unstable/liquidwar/branches/upstream/current/data/map/lwtab002.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lwtab002.txt
   unstable/liquidwar/branches/upstream/current/data/map/lwtab003.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lwtab003.txt
   unstable/liquidwar/branches/upstream/current/data/map/lwtab004.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lwtab004.txt
   unstable/liquidwar/branches/upstream/current/data/map/lwtab005.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lwtab005.txt
   unstable/liquidwar/branches/upstream/current/data/map/lwtab006.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lwtab006.txt
   unstable/liquidwar/branches/upstream/current/data/map/lwtab008.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lwtab008.txt
   unstable/liquidwar/branches/upstream/current/data/map/lwtab009.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lwtab009.txt
   unstable/liquidwar/branches/upstream/current/data/map/lwtabbar.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lwtabbar.txt
   unstable/liquidwar/branches/upstream/current/data/map/lwtabdrt.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lwtabdrt.txt
   unstable/liquidwar/branches/upstream/current/data/map/lwtabgen.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lwtabgen.txt
   unstable/liquidwar/branches/upstream/current/data/map/lwtabmic.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lwtabmic.txt
   unstable/liquidwar/branches/upstream/current/data/map/lwtabrec.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lwtabrec.txt
   unstable/liquidwar/branches/upstream/current/data/map/lwtabses.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lwtabses.txt
   unstable/liquidwar/branches/upstream/current/data/map/lwtabto2.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lwtabto2.txt
   unstable/liquidwar/branches/upstream/current/data/map/lwtabto3.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lwtabto3.txt
   unstable/liquidwar/branches/upstream/current/data/map/lwtabto4.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lwtabto4.txt
   unstable/liquidwar/branches/upstream/current/data/map/lwtabtom.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lwtabtom.txt
   unstable/liquidwar/branches/upstream/current/data/map/lwtabtru.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lwtabtru.txt
   unstable/liquidwar/branches/upstream/current/data/map/lwtabvid.pcx
   unstable/liquidwar/branches/upstream/current/data/map/lwtabvid.txt
   unstable/liquidwar/branches/upstream/current/data/map/marionet.pcx
   unstable/liquidwar/branches/upstream/current/data/map/marionet.txt
   unstable/liquidwar/branches/upstream/current/data/map/metation.bmp
   unstable/liquidwar/branches/upstream/current/data/map/metation.txt
   unstable/liquidwar/branches/upstream/current/data/map/mouse1.bmp
   unstable/liquidwar/branches/upstream/current/data/map/mouse1.txt
   unstable/liquidwar/branches/upstream/current/data/map/muehle.bmp
   unstable/liquidwar/branches/upstream/current/data/map/muehle.txt
   unstable/liquidwar/branches/upstream/current/data/map/musique.pcx
   unstable/liquidwar/branches/upstream/current/data/map/musique.txt
   unstable/liquidwar/branches/upstream/current/data/map/net1.pcx
   unstable/liquidwar/branches/upstream/current/data/map/net1.txt
   unstable/liquidwar/branches/upstream/current/data/map/net2.pcx
   unstable/liquidwar/branches/upstream/current/data/map/net2.txt
   unstable/liquidwar/branches/upstream/current/data/map/ordino.pcx
   unstable/liquidwar/branches/upstream/current/data/map/ordino.txt
   unstable/liquidwar/branches/upstream/current/data/map/paper.bmp
   unstable/liquidwar/branches/upstream/current/data/map/paper.txt
   unstable/liquidwar/branches/upstream/current/data/map/papercut.bmp
   unstable/liquidwar/branches/upstream/current/data/map/papercut.txt
   unstable/liquidwar/branches/upstream/current/data/map/papillon.pcx
   unstable/liquidwar/branches/upstream/current/data/map/papillon.txt
   unstable/liquidwar/branches/upstream/current/data/map/pastel.bmp
   unstable/liquidwar/branches/upstream/current/data/map/pastel.txt
   unstable/liquidwar/branches/upstream/current/data/map/penta.pcx
   unstable/liquidwar/branches/upstream/current/data/map/penta.txt
   unstable/liquidwar/branches/upstream/current/data/map/peur.pcx
   unstable/liquidwar/branches/upstream/current/data/map/peur.txt
   unstable/liquidwar/branches/upstream/current/data/map/pieuvre.pcx
   unstable/liquidwar/branches/upstream/current/data/map/pieuvre.txt
   unstable/liquidwar/branches/upstream/current/data/map/pigface.pcx
   unstable/liquidwar/branches/upstream/current/data/map/pigface.txt
   unstable/liquidwar/branches/upstream/current/data/map/place.bmp
   unstable/liquidwar/branches/upstream/current/data/map/place.txt
   unstable/liquidwar/branches/upstream/current/data/map/platform.pcx
   unstable/liquidwar/branches/upstream/current/data/map/platform.txt
   unstable/liquidwar/branches/upstream/current/data/map/poisson.pcx
   unstable/liquidwar/branches/upstream/current/data/map/poisson.txt
   unstable/liquidwar/branches/upstream/current/data/map/policier.pcx
   unstable/liquidwar/branches/upstream/current/data/map/policier.txt
   unstable/liquidwar/branches/upstream/current/data/map/portable.pcx
   unstable/liquidwar/branches/upstream/current/data/map/portable.txt
   unstable/liquidwar/branches/upstream/current/data/map/puckman.bmp
   unstable/liquidwar/branches/upstream/current/data/map/puckman.txt
   unstable/liquidwar/branches/upstream/current/data/map/quaders.bmp
   unstable/liquidwar/branches/upstream/current/data/map/quaders.txt
   unstable/liquidwar/branches/upstream/current/data/map/rect.bmp
   unstable/liquidwar/branches/upstream/current/data/map/rect.txt
   unstable/liquidwar/branches/upstream/current/data/map/rectangle.bmp
   unstable/liquidwar/branches/upstream/current/data/map/rectangle.txt
   unstable/liquidwar/branches/upstream/current/data/map/rene02.bmp
   unstable/liquidwar/branches/upstream/current/data/map/rene02.txt
   unstable/liquidwar/branches/upstream/current/data/map/rene03.bmp
   unstable/liquidwar/branches/upstream/current/data/map/rene03.txt
   unstable/liquidwar/branches/upstream/current/data/map/rene04.bmp
   unstable/liquidwar/branches/upstream/current/data/map/rene04.txt
   unstable/liquidwar/branches/upstream/current/data/map/rolz.bmp
   unstable/liquidwar/branches/upstream/current/data/map/rolz.txt
   unstable/liquidwar/branches/upstream/current/data/map/rough.bmp
   unstable/liquidwar/branches/upstream/current/data/map/rough.txt
   unstable/liquidwar/branches/upstream/current/data/map/sgdb.pcx
   unstable/liquidwar/branches/upstream/current/data/map/sgdb.txt
   unstable/liquidwar/branches/upstream/current/data/map/skull.bmp
   unstable/liquidwar/branches/upstream/current/data/map/skull.txt
   unstable/liquidwar/branches/upstream/current/data/map/skullbig.bmp
   unstable/liquidwar/branches/upstream/current/data/map/skullbig.txt
   unstable/liquidwar/branches/upstream/current/data/map/slimy.bmp
   unstable/liquidwar/branches/upstream/current/data/map/slimy.txt
   unstable/liquidwar/branches/upstream/current/data/map/smile.bmp
   unstable/liquidwar/branches/upstream/current/data/map/smile.txt
   unstable/liquidwar/branches/upstream/current/data/map/sol.pcx
   unstable/liquidwar/branches/upstream/current/data/map/sol.txt
   unstable/liquidwar/branches/upstream/current/data/map/sonnesystem.bmp
   unstable/liquidwar/branches/upstream/current/data/map/sonnesystem.txt
   unstable/liquidwar/branches/upstream/current/data/map/spagueti.pcx
   unstable/liquidwar/branches/upstream/current/data/map/spagueti.txt
   unstable/liquidwar/branches/upstream/current/data/map/strike.pcx
   unstable/liquidwar/branches/upstream/current/data/map/strike.txt
   unstable/liquidwar/branches/upstream/current/data/map/tag.bmp
   unstable/liquidwar/branches/upstream/current/data/map/tag.txt
   unstable/liquidwar/branches/upstream/current/data/map/tiles.bmp
   unstable/liquidwar/branches/upstream/current/data/map/tiles.txt
   unstable/liquidwar/branches/upstream/current/data/map/tilt.pcx
   unstable/liquidwar/branches/upstream/current/data/map/tilt.txt
   unstable/liquidwar/branches/upstream/current/data/map/tipi.pcx
   unstable/liquidwar/branches/upstream/current/data/map/tipi.txt
   unstable/liquidwar/branches/upstream/current/data/map/titanic.pcx
   unstable/liquidwar/branches/upstream/current/data/map/titanic.txt
   unstable/liquidwar/branches/upstream/current/data/map/trumpet.pcx
   unstable/liquidwar/branches/upstream/current/data/map/trumpet.txt
   unstable/liquidwar/branches/upstream/current/data/map/tulipes.pcx
   unstable/liquidwar/branches/upstream/current/data/map/tulipes.txt
   unstable/liquidwar/branches/upstream/current/data/map/tuyaux.pcx
   unstable/liquidwar/branches/upstream/current/data/map/tuyaux.txt
   unstable/liquidwar/branches/upstream/current/data/map/underground.bmp
   unstable/liquidwar/branches/upstream/current/data/map/underground.txt
   unstable/liquidwar/branches/upstream/current/data/map/velo.pcx
   unstable/liquidwar/branches/upstream/current/data/map/velo.txt
   unstable/liquidwar/branches/upstream/current/data/map/village.pcx
   unstable/liquidwar/branches/upstream/current/data/map/village.txt
   unstable/liquidwar/branches/upstream/current/data/map/void.pcx
   unstable/liquidwar/branches/upstream/current/data/map/void.txt
   unstable/liquidwar/branches/upstream/current/data/map/volet.pcx
   unstable/liquidwar/branches/upstream/current/data/map/volet.txt
   unstable/liquidwar/branches/upstream/current/data/map/watch.bmp
   unstable/liquidwar/branches/upstream/current/data/map/watch.txt
   unstable/liquidwar/branches/upstream/current/data/map/world1.bmp
   unstable/liquidwar/branches/upstream/current/data/map/world1.txt
   unstable/liquidwar/branches/upstream/current/data/map/world2.bmp
   unstable/liquidwar/branches/upstream/current/data/map/world2.txt
   unstable/liquidwar/branches/upstream/current/data/map/world3.bmp
   unstable/liquidwar/branches/upstream/current/data/map/world3.txt
   unstable/liquidwar/branches/upstream/current/data/map/world4.bmp
   unstable/liquidwar/branches/upstream/current/data/map/world4.txt
   unstable/liquidwar/branches/upstream/current/data/map/z.pcx
   unstable/liquidwar/branches/upstream/current/data/map/z.txt
   unstable/liquidwar/branches/upstream/current/data/maptex/
   unstable/liquidwar/branches/upstream/current/data/maptex/.cvsignore
   unstable/liquidwar/branches/upstream/current/data/maptex/2d.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/3d.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/3x3.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/Makefile.in
   unstable/liquidwar/branches/upstream/current/data/maptex/ac.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/anaglyph1.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/anaglyph2.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/around.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/big.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/blemmya.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/bored.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/card.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/charming.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/chess.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/circle.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/circlus.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/clean.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/confuse.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/dirt.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/egg.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/eyes.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/garden.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/honey.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/honeymoon.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/jabberwocky.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/labyrint.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/logo.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/lost.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/lw.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/lwtab002.orig.pcx
   unstable/liquidwar/branches/upstream/current/data/maptex/lwtab003.orig.pcx
   unstable/liquidwar/branches/upstream/current/data/maptex/lwtab004.orig.pcx
   unstable/liquidwar/branches/upstream/current/data/maptex/lwtab006.orig.pcx
   unstable/liquidwar/branches/upstream/current/data/maptex/lwtab007.orig.pcx
   unstable/liquidwar/branches/upstream/current/data/maptex/lwtab008.orig.pcx
   unstable/liquidwar/branches/upstream/current/data/maptex/lwtab009.orig.pcx
   unstable/liquidwar/branches/upstream/current/data/maptex/lwtabbar.orig.pcx
   unstable/liquidwar/branches/upstream/current/data/maptex/lwtabdrt.orig.pcx
   unstable/liquidwar/branches/upstream/current/data/maptex/lwtabmic.orig.pcx
   unstable/liquidwar/branches/upstream/current/data/maptex/lwtabrec.orig.pcx
   unstable/liquidwar/branches/upstream/current/data/maptex/lwtabses.orig.pcx
   unstable/liquidwar/branches/upstream/current/data/maptex/lwtabto2.orig.pcx
   unstable/liquidwar/branches/upstream/current/data/maptex/lwtabto3.orig.pcx
   unstable/liquidwar/branches/upstream/current/data/maptex/lwtabto4.orig.pcx
   unstable/liquidwar/branches/upstream/current/data/maptex/lwtabtom.orig.pcx
   unstable/liquidwar/branches/upstream/current/data/maptex/lwtabtru.orig.pcx
   unstable/liquidwar/branches/upstream/current/data/maptex/lwtabvid.orig.pcx
   unstable/liquidwar/branches/upstream/current/data/maptex/metation.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/paper.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/papercut.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/pastel.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/place.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/puckman.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/rect.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/rectangle.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/rough.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/skull.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/skullbig.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/slimy.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/smile.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/sonnesystem.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/tiles.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/underground.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/maptex/watch.orig.bmp
   unstable/liquidwar/branches/upstream/current/data/music/
   unstable/liquidwar/branches/upstream/current/data/music/.cvsignore
   unstable/liquidwar/branches/upstream/current/data/music/Makefile.in
   unstable/liquidwar/branches/upstream/current/data/music/clarity.mid
   unstable/liquidwar/branches/upstream/current/data/music/fodder.mid
   unstable/liquidwar/branches/upstream/current/data/music/headless.mid
   unstable/liquidwar/branches/upstream/current/data/music/marauder.mid
   unstable/liquidwar/branches/upstream/current/data/music/return.mid
   unstable/liquidwar/branches/upstream/current/data/music/thmoov.mid
   unstable/liquidwar/branches/upstream/current/data/music/torqued.mid
   unstable/liquidwar/branches/upstream/current/data/sfx/
   unstable/liquidwar/branches/upstream/current/data/sfx/.cvsignore
   unstable/liquidwar/branches/upstream/current/data/sfx/Makefile.in
   unstable/liquidwar/branches/upstream/current/data/sfx/clock1.wav
   unstable/liquidwar/branches/upstream/current/data/sfx/crowd1.wav
   unstable/liquidwar/branches/upstream/current/data/sfx/cuckoo.wav
   unstable/liquidwar/branches/upstream/current/data/sfx/foghorn.wav
   unstable/liquidwar/branches/upstream/current/data/sfx/splash1.wav
   unstable/liquidwar/branches/upstream/current/data/sfx/war.wav
   unstable/liquidwar/branches/upstream/current/data/texture/
   unstable/liquidwar/branches/upstream/current/data/texture/.cvsignore
   unstable/liquidwar/branches/upstream/current/data/texture/Makefile.in
   unstable/liquidwar/branches/upstream/current/data/texture/amethyst.gimp.pcx
   unstable/liquidwar/branches/upstream/current/data/texture/bricks.gimp.pcx
   unstable/liquidwar/branches/upstream/current/data/texture/crash1.gimp.pcx
   unstable/liquidwar/branches/upstream/current/data/texture/electricblue.gimp.pcx
   unstable/liquidwar/branches/upstream/current/data/texture/granite2.gimp.pcx
   unstable/liquidwar/branches/upstream/current/data/texture/greenmess.gimp.pcx
   unstable/liquidwar/branches/upstream/current/data/texture/lumps.gimp.pcx
   unstable/liquidwar/branches/upstream/current/data/texture/marble3.gimp.pcx
   unstable/liquidwar/branches/upstream/current/data/texture/pebbles.gimp.pcx
   unstable/liquidwar/branches/upstream/current/data/texture/pine.gimp.pcx
   unstable/liquidwar/branches/upstream/current/data/texture/poolbottom.gimp.pcx
   unstable/liquidwar/branches/upstream/current/data/texture/qbert.gimp.pcx
   unstable/liquidwar/branches/upstream/current/data/texture/redcubes.gimp.pcx
   unstable/liquidwar/branches/upstream/current/data/texture/smallsquares.gimp.pcx
   unstable/liquidwar/branches/upstream/current/data/texture/terra.gimp.pcx
   unstable/liquidwar/branches/upstream/current/data/texture/wood2.gimp.pcx
   unstable/liquidwar/branches/upstream/current/data/water/
   unstable/liquidwar/branches/upstream/current/data/water/.cvsignore
   unstable/liquidwar/branches/upstream/current/data/water/Makefile.in
   unstable/liquidwar/branches/upstream/current/data/water/amb3.wav
   unstable/liquidwar/branches/upstream/current/data/water/amb4.wav
   unstable/liquidwar/branches/upstream/current/data/water/bath1.wav
   unstable/liquidwar/branches/upstream/current/data/water/bath2.wav
   unstable/liquidwar/branches/upstream/current/data/water/bubble.wav
   unstable/liquidwar/branches/upstream/current/data/water/flush.wav
   unstable/liquidwar/branches/upstream/current/data/water/forest1.wav
   unstable/liquidwar/branches/upstream/current/data/water/kitch4.wav
   unstable/liquidwar/branches/upstream/current/data/water/lavaflow.wav
   unstable/liquidwar/branches/upstream/current/data/water/niagara.wav
   unstable/liquidwar/branches/upstream/current/data/water/shower1.wav
   unstable/liquidwar/branches/upstream/current/data/water/sodapor.wav
   unstable/liquidwar/branches/upstream/current/data/water/thundr2.wav
   unstable/liquidwar/branches/upstream/current/data/water/thundr3.wav
   unstable/liquidwar/branches/upstream/current/data/water/tidal.wav
   unstable/liquidwar/branches/upstream/current/data/water/water.wav
   unstable/liquidwar/branches/upstream/current/doc/
   unstable/liquidwar/branches/upstream/current/doc/.cvsignore
   unstable/liquidwar/branches/upstream/current/doc/Makefile.in
   unstable/liquidwar/branches/upstream/current/doc/README
   unstable/liquidwar/branches/upstream/current/doc/html/
   unstable/liquidwar/branches/upstream/current/doc/html/.cvsignore
   unstable/liquidwar/branches/upstream/current/doc/html/footer.inc
   unstable/liquidwar/branches/upstream/current/doc/html/header.inc
   unstable/liquidwar/branches/upstream/current/doc/html/index.html.in
   unstable/liquidwar/branches/upstream/current/doc/info/
   unstable/liquidwar/branches/upstream/current/doc/info/.cvsignore
   unstable/liquidwar/branches/upstream/current/doc/info/DUMMY
   unstable/liquidwar/branches/upstream/current/doc/makedoc.py
   unstable/liquidwar/branches/upstream/current/doc/man/
   unstable/liquidwar/branches/upstream/current/doc/man/.cvsignore
   unstable/liquidwar/branches/upstream/current/doc/man/begin.man.in
   unstable/liquidwar/branches/upstream/current/doc/man/end.man
   unstable/liquidwar/branches/upstream/current/doc/pdf/
   unstable/liquidwar/branches/upstream/current/doc/pdf/.cvsignore
   unstable/liquidwar/branches/upstream/current/doc/pdf/DUMMY
   unstable/liquidwar/branches/upstream/current/doc/php3/
   unstable/liquidwar/branches/upstream/current/doc/php3/.cvsignore
   unstable/liquidwar/branches/upstream/current/doc/php3/DUMMY
   unstable/liquidwar/branches/upstream/current/doc/ps/
   unstable/liquidwar/branches/upstream/current/doc/ps/.cvsignore
   unstable/liquidwar/branches/upstream/current/doc/ps/DUMMY
   unstable/liquidwar/branches/upstream/current/doc/tex/
   unstable/liquidwar/branches/upstream/current/doc/tex/.cvsignore
   unstable/liquidwar/branches/upstream/current/doc/tex/liquidwar.tex.in
   unstable/liquidwar/branches/upstream/current/doc/texi/
   unstable/liquidwar/branches/upstream/current/doc/texi/.cvsignore
   unstable/liquidwar/branches/upstream/current/doc/texi/begin.texi.in
   unstable/liquidwar/branches/upstream/current/doc/texi/end.texi
   unstable/liquidwar/branches/upstream/current/doc/txt/
   unstable/liquidwar/branches/upstream/current/doc/txt/.cvsignore
   unstable/liquidwar/branches/upstream/current/doc/txt/DUMMY
   unstable/liquidwar/branches/upstream/current/doc/uwc/
   unstable/liquidwar/branches/upstream/current/doc/uwc/.cvsignore
   unstable/liquidwar/branches/upstream/current/doc/uwc/DUMMY
   unstable/liquidwar/branches/upstream/current/doc/xml/
   unstable/liquidwar/branches/upstream/current/doc/xml/algorithm.xml
   unstable/liquidwar/branches/upstream/current/doc/xml/authors.xml
   unstable/liquidwar/branches/upstream/current/doc/xml/bugs.xml
   unstable/liquidwar/branches/upstream/current/doc/xml/copying.xml
   unstable/liquidwar/branches/upstream/current/doc/xml/fanfic.xml
   unstable/liquidwar/branches/upstream/current/doc/xml/file.dtd
   unstable/liquidwar/branches/upstream/current/doc/xml/mailinglists.xml
   unstable/liquidwar/branches/upstream/current/doc/xml/network.xml
   unstable/liquidwar/branches/upstream/current/doc/xml/options.xml
   unstable/liquidwar/branches/upstream/current/doc/xml/parameters.xml
   unstable/liquidwar/branches/upstream/current/doc/xml/platforms.xml
   unstable/liquidwar/branches/upstream/current/doc/xml/rules.xml
   unstable/liquidwar/branches/upstream/current/doc/xml/source.xml
   unstable/liquidwar/branches/upstream/current/doc/xml/todo.xml
   unstable/liquidwar/branches/upstream/current/doc/xml/userlevels.xml
   unstable/liquidwar/branches/upstream/current/doc/xml/wip.xml
   unstable/liquidwar/branches/upstream/current/fix.sh
   unstable/liquidwar/branches/upstream/current/install-sh
   unstable/liquidwar/branches/upstream/current/liquidwar.spec
   unstable/liquidwar/branches/upstream/current/liquidwar.spec.in
   unstable/liquidwar/branches/upstream/current/misc/
   unstable/liquidwar/branches/upstream/current/misc/.cvsignore
   unstable/liquidwar/branches/upstream/current/misc/fix_map_palette.sh
   unstable/liquidwar/branches/upstream/current/misc/globe.icns
   unstable/liquidwar/branches/upstream/current/misc/globe.png
   unstable/liquidwar/branches/upstream/current/misc/globe.pov
   unstable/liquidwar/branches/upstream/current/misc/gpl_de.html
   unstable/liquidwar/branches/upstream/current/misc/gpl_fr.html
   unstable/liquidwar/branches/upstream/current/misc/liquidwar.desktop
   unstable/liquidwar/branches/upstream/current/misc/liquidwar.ico
   unstable/liquidwar/branches/upstream/current/misc/liquidwar.xpm
   unstable/liquidwar/branches/upstream/current/misc/liquidwar_32x32.xpm
   unstable/liquidwar/branches/upstream/current/misc/liquidwar_notify.sh
   unstable/liquidwar/branches/upstream/current/misc/liquidward.in
   unstable/liquidwar/branches/upstream/current/misc/lwpopup.js
   unstable/liquidwar/branches/upstream/current/misc/lwserver.bat
   unstable/liquidwar/branches/upstream/current/misc/macosx_info.plist.in
   unstable/liquidwar/branches/upstream/current/misc/macosx_launcher.sh
   unstable/liquidwar/branches/upstream/current/misc/macosx_readme.rtf
   unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_imagestompeg.sh
   unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_imagetoppm.sh
   unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_imagetoyuv.sh
   unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_make_mpeg2encode_parfile.sh
   unstable/liquidwar/branches/upstream/current/src/
   unstable/liquidwar/branches/upstream/current/src/.cvsignore
   unstable/liquidwar/branches/upstream/current/src/Makefile.dep.in
   unstable/liquidwar/branches/upstream/current/src/Makefile.in
   unstable/liquidwar/branches/upstream/current/src/about.c
   unstable/liquidwar/branches/upstream/current/src/about.h
   unstable/liquidwar/branches/upstream/current/src/advanced.c
   unstable/liquidwar/branches/upstream/current/src/advanced.h
   unstable/liquidwar/branches/upstream/current/src/alleg2.c
   unstable/liquidwar/branches/upstream/current/src/alleg2.h
   unstable/liquidwar/branches/upstream/current/src/area.c
   unstable/liquidwar/branches/upstream/current/src/area.h
   unstable/liquidwar/branches/upstream/current/src/army.c
   unstable/liquidwar/branches/upstream/current/src/army.h
   unstable/liquidwar/branches/upstream/current/src/asm.c
   unstable/liquidwar/branches/upstream/current/src/asm.h
   unstable/liquidwar/branches/upstream/current/src/autoplay.c
   unstable/liquidwar/branches/upstream/current/src/autoplay.h
   unstable/liquidwar/branches/upstream/current/src/back.c
   unstable/liquidwar/branches/upstream/current/src/back.h
   unstable/liquidwar/branches/upstream/current/src/base.h.in
   unstable/liquidwar/branches/upstream/current/src/basicopt.c
   unstable/liquidwar/branches/upstream/current/src/basicopt.h
   unstable/liquidwar/branches/upstream/current/src/bigdata.c
   unstable/liquidwar/branches/upstream/current/src/bigdata.h
   unstable/liquidwar/branches/upstream/current/src/capture.c
   unstable/liquidwar/branches/upstream/current/src/capture.h
   unstable/liquidwar/branches/upstream/current/src/chat.c
   unstable/liquidwar/branches/upstream/current/src/chat.h
   unstable/liquidwar/branches/upstream/current/src/checksum.c
   unstable/liquidwar/branches/upstream/current/src/checksum.h
   unstable/liquidwar/branches/upstream/current/src/code.c
   unstable/liquidwar/branches/upstream/current/src/code.h
   unstable/liquidwar/branches/upstream/current/src/config.c
   unstable/liquidwar/branches/upstream/current/src/config.h
   unstable/liquidwar/branches/upstream/current/src/connect.c
   unstable/liquidwar/branches/upstream/current/src/connect.h
   unstable/liquidwar/branches/upstream/current/src/controls.c
   unstable/liquidwar/branches/upstream/current/src/controls.h
   unstable/liquidwar/branches/upstream/current/src/cursor.c
   unstable/liquidwar/branches/upstream/current/src/cursor.h
   unstable/liquidwar/branches/upstream/current/src/decal.c
   unstable/liquidwar/branches/upstream/current/src/decal.h
   unstable/liquidwar/branches/upstream/current/src/dialog.c
   unstable/liquidwar/branches/upstream/current/src/dialog.h
   unstable/liquidwar/branches/upstream/current/src/disk.c
   unstable/liquidwar/branches/upstream/current/src/disk.h
   unstable/liquidwar/branches/upstream/current/src/disp.c
   unstable/liquidwar/branches/upstream/current/src/disp.h
   unstable/liquidwar/branches/upstream/current/src/distor.c
   unstable/liquidwar/branches/upstream/current/src/distor.h
   unstable/liquidwar/branches/upstream/current/src/dnsutil.c
   unstable/liquidwar/branches/upstream/current/src/dnsutil.h
   unstable/liquidwar/branches/upstream/current/src/error.c
   unstable/liquidwar/branches/upstream/current/src/error.h
   unstable/liquidwar/branches/upstream/current/src/exec2.c
   unstable/liquidwar/branches/upstream/current/src/exec2.h
   unstable/liquidwar/branches/upstream/current/src/execgen.h
   unstable/liquidwar/branches/upstream/current/src/execunix.c
   unstable/liquidwar/branches/upstream/current/src/execw32.c
   unstable/liquidwar/branches/upstream/current/src/exit.c
   unstable/liquidwar/branches/upstream/current/src/exit.h
   unstable/liquidwar/branches/upstream/current/src/fighter.c
   unstable/liquidwar/branches/upstream/current/src/fighter.h
   unstable/liquidwar/branches/upstream/current/src/game.c
   unstable/liquidwar/branches/upstream/current/src/game.h
   unstable/liquidwar/branches/upstream/current/src/gfxmode.c
   unstable/liquidwar/branches/upstream/current/src/gfxmode.h
   unstable/liquidwar/branches/upstream/current/src/glouglou.h
   unstable/liquidwar/branches/upstream/current/src/glouglou.s
   unstable/liquidwar/branches/upstream/current/src/grad.c
   unstable/liquidwar/branches/upstream/current/src/grad.h
   unstable/liquidwar/branches/upstream/current/src/graphics.c
   unstable/liquidwar/branches/upstream/current/src/graphics.h
   unstable/liquidwar/branches/upstream/current/src/help.c
   unstable/liquidwar/branches/upstream/current/src/help.h
   unstable/liquidwar/branches/upstream/current/src/httputil.c
   unstable/liquidwar/branches/upstream/current/src/httputil.h
   unstable/liquidwar/branches/upstream/current/src/info.c
   unstable/liquidwar/branches/upstream/current/src/info.h
   unstable/liquidwar/branches/upstream/current/src/init.c
   unstable/liquidwar/branches/upstream/current/src/init.h
   unstable/liquidwar/branches/upstream/current/src/internet.c
   unstable/liquidwar/branches/upstream/current/src/internet.h
   unstable/liquidwar/branches/upstream/current/src/joystick.c
   unstable/liquidwar/branches/upstream/current/src/joystick.h
   unstable/liquidwar/branches/upstream/current/src/keyboard.c
   unstable/liquidwar/branches/upstream/current/src/keyboard.h
   unstable/liquidwar/branches/upstream/current/src/keyexch.c
   unstable/liquidwar/branches/upstream/current/src/keyexch.h
   unstable/liquidwar/branches/upstream/current/src/lang.c
   unstable/liquidwar/branches/upstream/current/src/lang.h
   unstable/liquidwar/branches/upstream/current/src/langde.c
   unstable/liquidwar/branches/upstream/current/src/langde.h
   unstable/liquidwar/branches/upstream/current/src/langdk.c
   unstable/liquidwar/branches/upstream/current/src/langdk.h
   unstable/liquidwar/branches/upstream/current/src/langen.c
   unstable/liquidwar/branches/upstream/current/src/langen.h
   unstable/liquidwar/branches/upstream/current/src/langfr.c
   unstable/liquidwar/branches/upstream/current/src/langfr.h
   unstable/liquidwar/branches/upstream/current/src/language.c
   unstable/liquidwar/branches/upstream/current/src/language.h
   unstable/liquidwar/branches/upstream/current/src/level.c
   unstable/liquidwar/branches/upstream/current/src/level.h
   unstable/liquidwar/branches/upstream/current/src/log.h
   unstable/liquidwar/branches/upstream/current/src/logcli.c
   unstable/liquidwar/branches/upstream/current/src/logsrv.c
   unstable/liquidwar/branches/upstream/current/src/lwwin.rc
   unstable/liquidwar/branches/upstream/current/src/macro.h
   unstable/liquidwar/branches/upstream/current/src/main.c
   unstable/liquidwar/branches/upstream/current/src/map.c
   unstable/liquidwar/branches/upstream/current/src/map.h
   unstable/liquidwar/branches/upstream/current/src/maptex.c
   unstable/liquidwar/branches/upstream/current/src/maptex.h
   unstable/liquidwar/branches/upstream/current/src/menu.c
   unstable/liquidwar/branches/upstream/current/src/menu.h
   unstable/liquidwar/branches/upstream/current/src/mesh.c
   unstable/liquidwar/branches/upstream/current/src/mesh.h
   unstable/liquidwar/branches/upstream/current/src/message.c
   unstable/liquidwar/branches/upstream/current/src/message.h
   unstable/liquidwar/branches/upstream/current/src/monster.h
   unstable/liquidwar/branches/upstream/current/src/monster.s
   unstable/liquidwar/branches/upstream/current/src/mouse.c
   unstable/liquidwar/branches/upstream/current/src/mouse.h
   unstable/liquidwar/branches/upstream/current/src/move.c
   unstable/liquidwar/branches/upstream/current/src/move.h
   unstable/liquidwar/branches/upstream/current/src/music.c
   unstable/liquidwar/branches/upstream/current/src/music.h
   unstable/liquidwar/branches/upstream/current/src/mutxdos.c
   unstable/liquidwar/branches/upstream/current/src/mutxgen.h
   unstable/liquidwar/branches/upstream/current/src/mutxunix.c
   unstable/liquidwar/branches/upstream/current/src/mutxw32.c
   unstable/liquidwar/branches/upstream/current/src/netconf.c
   unstable/liquidwar/branches/upstream/current/src/netconf.h
   unstable/liquidwar/branches/upstream/current/src/netgame.c
   unstable/liquidwar/branches/upstream/current/src/netgame.h
   unstable/liquidwar/branches/upstream/current/src/netkey.c
   unstable/liquidwar/branches/upstream/current/src/netkey.h
   unstable/liquidwar/branches/upstream/current/src/netmap.c
   unstable/liquidwar/branches/upstream/current/src/netmap.h
   unstable/liquidwar/branches/upstream/current/src/netmess.c
   unstable/liquidwar/branches/upstream/current/src/netmess.h
   unstable/liquidwar/branches/upstream/current/src/netplay.c
   unstable/liquidwar/branches/upstream/current/src/netplay.h
   unstable/liquidwar/branches/upstream/current/src/network.c
   unstable/liquidwar/branches/upstream/current/src/network.h
   unstable/liquidwar/branches/upstream/current/src/options.c
   unstable/liquidwar/branches/upstream/current/src/options.h
   unstable/liquidwar/branches/upstream/current/src/palette.c
   unstable/liquidwar/branches/upstream/current/src/palette.h
   unstable/liquidwar/branches/upstream/current/src/parser.c
   unstable/liquidwar/branches/upstream/current/src/parser.h
   unstable/liquidwar/branches/upstream/current/src/path.c
   unstable/liquidwar/branches/upstream/current/src/path.h
   unstable/liquidwar/branches/upstream/current/src/ping.c
   unstable/liquidwar/branches/upstream/current/src/ping.h
   unstable/liquidwar/branches/upstream/current/src/pion.c
   unstable/liquidwar/branches/upstream/current/src/pion.h
   unstable/liquidwar/branches/upstream/current/src/play.c
   unstable/liquidwar/branches/upstream/current/src/play.h
   unstable/liquidwar/branches/upstream/current/src/popupgen.h
   unstable/liquidwar/branches/upstream/current/src/popupw32.c
   unstable/liquidwar/branches/upstream/current/src/profile.c
   unstable/liquidwar/branches/upstream/current/src/profile.h
   unstable/liquidwar/branches/upstream/current/src/protocol.c
   unstable/liquidwar/branches/upstream/current/src/protocol.h
   unstable/liquidwar/branches/upstream/current/src/random.c
   unstable/liquidwar/branches/upstream/current/src/random.h
   unstable/liquidwar/branches/upstream/current/src/rules.c
   unstable/liquidwar/branches/upstream/current/src/rules.h
   unstable/liquidwar/branches/upstream/current/src/score.c
   unstable/liquidwar/branches/upstream/current/src/score.h
   unstable/liquidwar/branches/upstream/current/src/serial.c
   unstable/liquidwar/branches/upstream/current/src/serial.h
   unstable/liquidwar/branches/upstream/current/src/server.c
   unstable/liquidwar/branches/upstream/current/src/server.h
   unstable/liquidwar/branches/upstream/current/src/sock2cli.c
   unstable/liquidwar/branches/upstream/current/src/sock2gen.h
   unstable/liquidwar/branches/upstream/current/src/sock2srv.c
   unstable/liquidwar/branches/upstream/current/src/sockdos.c
   unstable/liquidwar/branches/upstream/current/src/sockex.c
   unstable/liquidwar/branches/upstream/current/src/sockgen.h
   unstable/liquidwar/branches/upstream/current/src/sockunix.c
   unstable/liquidwar/branches/upstream/current/src/sockw32.c
   unstable/liquidwar/branches/upstream/current/src/sound.c
   unstable/liquidwar/branches/upstream/current/src/sound.h
   unstable/liquidwar/branches/upstream/current/src/speeds.c
   unstable/liquidwar/branches/upstream/current/src/speeds.h
   unstable/liquidwar/branches/upstream/current/src/spread.h
   unstable/liquidwar/branches/upstream/current/src/spread.s
   unstable/liquidwar/branches/upstream/current/src/srvchan.c
   unstable/liquidwar/branches/upstream/current/src/srvchan.h
   unstable/liquidwar/branches/upstream/current/src/srvcont.c
   unstable/liquidwar/branches/upstream/current/src/srvcont.h
   unstable/liquidwar/branches/upstream/current/src/srvteam.c
   unstable/liquidwar/branches/upstream/current/src/srvteam.h
   unstable/liquidwar/branches/upstream/current/src/srvtime.c
   unstable/liquidwar/branches/upstream/current/src/srvtime.h
   unstable/liquidwar/branches/upstream/current/src/startinf.c
   unstable/liquidwar/branches/upstream/current/src/startinf.h
   unstable/liquidwar/branches/upstream/current/src/startup.c
   unstable/liquidwar/branches/upstream/current/src/startup.h
   unstable/liquidwar/branches/upstream/current/src/team.c
   unstable/liquidwar/branches/upstream/current/src/team.h
   unstable/liquidwar/branches/upstream/current/src/texture.c
   unstable/liquidwar/branches/upstream/current/src/texture.h
   unstable/liquidwar/branches/upstream/current/src/thrddos.c
   unstable/liquidwar/branches/upstream/current/src/thrdgen.h
   unstable/liquidwar/branches/upstream/current/src/thrdunix.c
   unstable/liquidwar/branches/upstream/current/src/thrdw32.c
   unstable/liquidwar/branches/upstream/current/src/ticker.c
   unstable/liquidwar/branches/upstream/current/src/ticker.h
   unstable/liquidwar/branches/upstream/current/src/time.c
   unstable/liquidwar/branches/upstream/current/src/time.h
   unstable/liquidwar/branches/upstream/current/src/viewport.c
   unstable/liquidwar/branches/upstream/current/src/viewport.h
   unstable/liquidwar/branches/upstream/current/src/volume.c
   unstable/liquidwar/branches/upstream/current/src/volume.h
   unstable/liquidwar/branches/upstream/current/src/watchdog.c
   unstable/liquidwar/branches/upstream/current/src/watchdog.h
   unstable/liquidwar/branches/upstream/current/src/wave.c
   unstable/liquidwar/branches/upstream/current/src/wave.h
   unstable/liquidwar/branches/upstream/current/src/wwwcli.c
   unstable/liquidwar/branches/upstream/current/src/wwwcli.h
   unstable/liquidwar/branches/upstream/current/src/wwwsrv.c
   unstable/liquidwar/branches/upstream/current/src/wwwsrv.h
   unstable/liquidwar/branches/upstream/current/test.sh
   unstable/liquidwar/branches/upstream/current/utils/
   unstable/liquidwar/branches/upstream/current/utils/.cvsignore
   unstable/liquidwar/branches/upstream/current/utils/Makefile.in
   unstable/liquidwar/branches/upstream/current/utils/liquidwarcol.c
   unstable/liquidwar/branches/upstream/current/utils/liquidwarmap.c
   unstable/liquidwar/branches/upstream/current/utils/liquidwartex.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/.cvsignore
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/CHANGES
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/CREDITS
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/HACKING
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/HEADER
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/Makefile
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/README
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/big_quad.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/boxes.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/bubbles.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/circles.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/circuit.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/cut.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/cut.h
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/func.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/func.h
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/func_list.h
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/hole.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/lines.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/main.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/map.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/map.h
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/map_generator.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/map_generator.h
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/misc.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/misc.h
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/old/
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/old/invert_rand_poly.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/old/rand_poly_cut.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/old/rand_poly_diag_cut.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/rand_box.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/rand_func.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/rand_poly.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/rand_poly_cut.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/street.c
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/tester.sh
   unstable/liquidwar/branches/upstream/current/utils/lwmapgen/worms.c
   unstable/liquidwar/branches/upstream/current/utils/snprintf/
   unstable/liquidwar/branches/upstream/current/utils/snprintf/COPYING
   unstable/liquidwar/branches/upstream/current/utils/snprintf/INSTALL
   unstable/liquidwar/branches/upstream/current/utils/snprintf/LICENSE.txt
   unstable/liquidwar/branches/upstream/current/utils/snprintf/Makefile
   unstable/liquidwar/branches/upstream/current/utils/snprintf/README.html
   unstable/liquidwar/branches/upstream/current/utils/snprintf/snprintf.c
   unstable/liquidwar/branches/upstream/current/utils/snprintf/snprintf.h
   unstable/liquidwar/branches/upstream/current/utils/snprintf/test.c
   unstable/liquidwar/branches/upstream/current/utils/snprintf/valid-html40.gif
   unstable/liquidwar/branches/upstream/current/www/
   unstable/liquidwar/branches/upstream/current/www/README
   unstable/liquidwar/branches/upstream/current/www/mysql/
   unstable/liquidwar/branches/upstream/current/www/mysql/tables.sql
   unstable/liquidwar/branches/upstream/current/www/php3/
   unstable/liquidwar/branches/upstream/current/www/php3/cleanup.php3
   unstable/liquidwar/branches/upstream/current/www/php3/db.php3
   unstable/liquidwar/branches/upstream/current/www/php3/html.php3
   unstable/liquidwar/branches/upstream/current/www/php3/index.php3
   unstable/liquidwar/branches/upstream/current/www/php3/list.php3
   unstable/liquidwar/branches/upstream/current/www/php3/metaserver.php3
   unstable/liquidwar/branches/upstream/current/www/php3/register.php3
   unstable/liquidwar/tags/
Log:
[svn-inject] Installing original source of liquidwar

Added: unstable/liquidwar/branches/upstream/current/COPYING
===================================================================
--- unstable/liquidwar/branches/upstream/current/COPYING	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/COPYING	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.

Added: unstable/liquidwar/branches/upstream/current/ChangeLog
===================================================================
--- unstable/liquidwar/branches/upstream/current/ChangeLog	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/ChangeLog	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,1352 @@
+
+2005-11-27  Christian Mauduit (ufoot at ufoot.org)
+
+	* Released 5.6.3.
+	* Added checks to avoid FD_SET with an arg1 of -1.
+	* Added checks on socket validity on client network code.
+	* Fixed it for good, on UNIX.
+	* Fixed network bug which caused connect screen to become irresponsive.
+
+
+2005-11-26  Christian Mauduit (ufoot at ufoot.org)
+
+	* Tried to released 5.6.3, failed because of network bug.
+	* Fixes for Allegro 4.2 / GCC 4.
+	* Updated docs.
+
+
+2005-11-25  Christian Mauduit (ufoot at ufoot.org)
+
+	* Warnings removed when compiling with gcc 4.0 and Allegro 4.2
+
+
+2005-09-09  Christian Mauduit (ufoot at ufoot.org)
+
+	* Waves deactivated by default on x86_64
+
+	
+2005-09-05  Christian Mauduit (ufoot at ufoot.org)
+
+	* Fixed GUI procs so that 320x240 is correctly displayed.
+	
+	* Minor fix, ptr size is checked, instead of long which is useless.
+
+
+2005-09-04  Christian Mauduit (ufoot at ufoot.org)
+
+	* Fixed my_edit_proc which was wrecked after migration to allegro 4.2
+
+	* Characters >= 128 are now filtered in the GUI.
+	
+
+2005-08-30  Christian Mauduit (ufoot at ufoot.org)
+
+	* Fixes in XML doc files, changed the DTD URL.
+	
+
+2005-08-28  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added Solar System map by 2 of omega.
+	
+
+2005-06-29  Christian Mauduit (ufoot at ufoot.org)
+
+	* Fixed the package generators to avoid arch system dirs
+	* Finally updated the makedoc.py script to use sax instead of xmllib
+	* Reactivated i386 assembly code for x86_64.
+	* Reindented code with indent and splint.
+	* Minor change in level menu layout to handle resolution display.
+	* Waves are activated by default only if assembly code is available.
+	* Added patches by Dave Vasilevsky to support Mac OS X.
+
+	
+2005-06-21  Christian Mauduit (ufoot at ufoot.org)
+
+	* Game now requires Allegro 4.2.0beta3 to compile
+	* Removed most compile warnings, due to allegro deprecated functions
+	* Fixed alleg2.c to match allegro 4.2 needs.
+
+	
+2005-05-29  Christian Mauduit (ufoot at ufoot.org)
+
+	* Copyright 2004 -> 2005
+	* Added infos about GNU Arch depot (wip)
+	* Added Fanfic by Gavin
+
+	
+2005-05-07  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added UWiKiCMS doc generation.
+
+	
+2004-08-22  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added more strategy tips suggested by Jan Samohýl.
+
+	
+2004-08-19  Christian Mauduit (ufoot at ufoot.org)
+
+	* Game defaults to windowed mode under UNIX.
+	
+
+2004-07-06  Christian Mauduit (ufoot at ufoot.org)
+
+	* Fixed Joystick support, which was completely broken, works under
+	Linux Now, with my gamepad at least.
+
+
+2004-02-11  Christian Mauduit (ufoot at ufoot.org)
+
+	* Released 5.6.2. 
+
+	* Updated docs (allow net bots)
+
+	* Minor change in lwmapgen call
+
+
+2004-02-10  Christian Mauduit (ufoot at ufoot.org)
+	
+	* Updated lwmapgen to 0.0.1.
+	
+	* Updated credits.
+
+	* Updated translations.
+	
+	* Updated network tutorial.
+
+
+2004-02-04  Christian Mauduit (ufoot at ufoot.org)
+
+	* As suggested by Peter Williams on happypenguin, the default
+	behaviour is now to exclude bots from net games. This behavior is
+	an option turned on by default.
+
+
+2004-02-02  Christian Mauduit (ufoot at ufoot.org)
+
+	* Applied patch from Peter Williams which fixes a "too many opened
+	file handles" bug on the server.
+
+
+2004-01-11  Christian Mauduit (ufoot at ufoot.org)
+
+	* Released 5.6.1.
+
+	* Updated doc so that it includes basic info on lwmapgen's options.
+
+	* Random map generator now integrated under Windows.
+
+
+2004-01-01  Christian Mauduit (ufoot at ufoot.org)
+
+	* Minor Winsock fix, better error checking.
+
+	* Fixed install/buildroot problem.
+
+	* Bug-fix in doc generator.
+
+	* Updated copyright info.
+
+
+2003-12-18  Christian Mauduit (ufoot at ufoot.org)
+
+	* Released 5.6.0.
+
+	* Bug-fixes concerning network under Windows.
+
+
+2003-12-13  Christian Mauduit (ufoot at ufoot.org)
+
+	* Fixed package building, uses /tmp/liquidwar-... as a tmp dir.
+
+
+2003-12-06  Christian Mauduit (ufoot at ufoot.org)
+
+	* Updated the TODO section.
+
+	* Fixes for DOS/Windows.
+
+	* Added Kasper's latest maps.
+
+
+2003-12-03  Christian Mauduit (ufoot at ufoot.org)
+
+	* Some more Danish stuff.
+
+
+2003-12-01  Christian Mauduit (ufoot at ufoot.org)
+
+	* Updated German translation.
+
+
+2003-11-27  Christian Mauduit (ufoot at ufoot.org)
+
+	* The map generator compiles under Windows.
+
+
+2003-11-23  Christian Mauduit (ufoot at ufoot.org)
+
+	* Merged last version of map generator.
+
+
+2003-11-12  Christian Mauduit (ufoot at ufoot.org)
+
+	* Updated Kasper's maps names.
+
+
+2003-11-11  Christian Mauduit (ufoot at ufoot.org)
+	
+	* Added a "floating gnu" custom map, to show how map associations 
+	work.
+
+	* Updated the docs.
+
+	* De-integrated the map generator from inside the game. It's
+	now called as an external program. It works much better, and
+	if it ever crashes, it does not impact the parent process (ie
+	the game).
+	
+	* The random map generator by David Redick finally works. It's
+	still rather segfault prone for now.
+
+	* Added a "random map" button.
+
+
+2003-11-10  Christian Mauduit (ufoot at ufoot.org)
+
+	* Cleaned up the texture loading/creating code so that it's cleaner
+	from an "endianess point of view", ie the encoding is the same on
+	MAC or PC.
+
+
+2003-11-09  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added a mutex lock/unlock on the update_choose_map function 
+	which is suspected to be responsible for crashes under Windows.
+
+
+2003-11-08  Christian Mauduit (ufoot at ufoot.org)
+
+	* Implemented some basic mutex support.
+	
+	* Game should not eat up 100% off CPU time on UNIX platforms
+	anymore.
+	
+	* Prepared stuff to include David Redicks's map generator
+	in Liquid War "natively".
+	
+	* Fixed a bug in system name generation for custom maps/textures.
+	
+	* Changed map names so that they are sorted by author.
+	
+	* Added map generator by David Redick. It's still an external
+	program.
+
+	* Finished implementation of "use default texture" option.
+
+
+2003-11-06  Christian Mauduit (ufoot at ufoot.org)
+
+	* Started to implement some "dialog hiding" for the level menu,
+	to make the "use default texture" option easier to understand.
+
+
+2003-11-05  Christian Mauduit (ufoot at ufoot.org)
+
+	* Bug-fixes for the "use default texture" option.
+
+
+2003-11-04  Christian Mauduit (ufoot at ufoot.org)
+
+	* Reimported old LW3 textures for their corresponding maps.
+
+	* The "use default texture" option works. Needs enhancements
+	but basically works.
+	
+	* Added a "system name" property to textures.
+
+
+2003-11-03  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added a "system name" property to maps.
+
+	* Fixed puckman and rect maps since they were buggy.
+
+	* Map checks are now done on both custom and builtin maps.
+	
+	* Better checks in the liquidwarmap utility to fix issues with
+	Kaspers' maps.
+
+
+2003-11-02  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added 41 maps provided by Kasper Hviid.
+
+	* Preparing support for the "use default texture" option.
+
+
+2003-10-31  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added Danish translation by Kasper Hviid.
+
+
+2003-08-31  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added new map by Jan Gretschuskin.
+
+
+2003-08-15  Christian Mauduit (ufoot at ufoot.org)
+
+	* Updated my snail mail address.
+
+
+2003-07-20  Christian Mauduit (ufoot at ufoot.org)
+
+	* Updated config.guess and config.sub to fix bug 198214 on Debian.
+
+
+2003-07-20  Christian Mauduit (ufoot at ufoot.org)
+
+	* Applied patch by Aurelien FORET (fixes bug compiling with gcc 3)
+
+
+2003-07-20  Christian Mauduit (ufoot at ufoot.org)
+
+	* Applied patch by Aurelien FORET (fixes bug compiling with gcc 3)
+
+
+2003-07-20  Christian Mauduit (ufoot at ufoot.org)
+
+	* Changed refs to openprojects.net to freenode.net
+
+
+2003-04-09  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added liquidwar.desktop file for Gnome/KDE/etc... contributed by
+	Michael Terry.
+
+
+2003-04-04  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added Eduard Bloch in the credits.
+
+
+2003-04-04  Christian Mauduit (ufoot at ufoot.org)
+
+	* Applied German translation patch submitted by Debian maintainer
+	Eduard Bloch.
+
+	* Replaced "\r\n" by "\x0d\x0a" again.
+
+
+2003-03-07  Christian Mauduit (ufoot at ufoot.org)
+
+	* Grammar correction in the docs.
+
+
+2003-03-06  Christian Mauduit (ufoot at ufoot.org)
+
+	* Released 5.5.9.
+
+
+2003-03-05  Christian Mauduit (ufoot at ufoot.org)
+
+	* Pre-alpha script for building Mac OS X tarball.
+
+	* Server handles pings more gracefully while replicating keys.
+
+	* Added Mac OS X rtf readme file by Ryan D. Brown.
+
+	* Added Ryan D. Brown povray source for the globe.png icon.
+
+	* Added a check of sizeof(int/long/short/char) on startup.
+
+	* Client ping detection works, although not perfect yet...
+
+
+2003-03-04  Christian Mauduit (ufoot at ufoot.org)
+
+	* Started to implement a ping calibrator for the client, to spot
+	fast servers from slow ones.
+
+	* Added Ryan D. Brown in the credits.
+
+	* Passed all the C source through GNU indent.
+
+	* More endianess fixes, hopefully network should now work on Mac.
+	
+
+2003-03-03  Christian Mauduit (ufoot at ufoot.org)
+
+	* Some more minor windows fixes.
+
+	* Code used random() now instead of rand() since it's supposed to
+	produce "more random" values.
+
+	* Minor fix in the meta-server, concerning the fact that "empty"
+	server lists where not handled correctly since LW supports 
+	HTTP 1.1.
+
+	* Applied new German translations by Jan Gretschuskin.
+	
+
+2003-03-02  Christian Mauduit (ufoot at ufoot.org)
+
+	* The Windows server is now able to launch a process when someone
+	connects, just like on UNIX.
+
+	* Added a javascript script to popup a window under windows, 
+	using Windows Scripting Host.
+
+	* Added support for popup windows on Win32.
+
+	* Made the game compile under Win32 again 8-)
+
+	
+2003-02-28  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added a sample liquidwar_notify.sh script.
+
+
+2003-02-24  Christian Mauduit (ufoot at ufoot.org)
+
+	* It's now possible to compile binaries with efence, in order to
+	track bugs down.
+
+	* Added icon by "Rib Rdb", who's porting the game to Mac OS X.
+	The icon is in misc/globe.png.
+
+	* Fixed the problem in world1.bmp. There was a "hole" in it. Patch
+	provided by David Redick.
+
+
+2003-02-22  Christian Mauduit (ufoot at ufoot.org)
+
+	* Fixed a bug which caused player names to be blank in score screen.
+
+	* Fixed ugly bug in srvchan.c, which caused network to be completely
+	broken (bug introduced by previous code cleanup).
+
+	* Changed the serialization method for maps, so that the game can be
+	used in a networked environnement even if some machines are big-endian
+	and other ones are little-endian. This is an endianness fix, which 
+	should hopefully make network available on Mac OS X.
+
+	* The source now compiles with "-W" gcc option under Linux.
+
+
+2003-02-21  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added the "callback" option which allows the server to perform
+	arbitrary actions whenever someone connects on it. Implemented on
+	UNIX only for now.
+
+	* Added a "check" target to Makefile, which fires splint and xmllint. 
+
+
+2003-02-11  Christian Mauduit (ufoot at ufoot.org)
+
+	* Applied patch by Roderick Schertler which implements HTTP 1.1
+	support. Previous versions used clumsy (& ugly) old HTTP 0.6 stuff
+	which would not make it through proxies like squid.
+
+
+2003-02-05  Christian Mauduit (ufoot at ufoot.org)
+
+	* Fixed the xml doc source with xmllint.
+
+
+2003-02-01  Christian Mauduit (ufoot at ufoot.org)
+
+	* Removed all direct calls to sprintf, strcat or strcpy.
+
+	* Imported an snprintf implementation, for platforms who don't have
+	native snprintf support. That is -> windows. No wonder they get so 
+	many buffer oveflows and security holes ;-P
+
+	* Added a dtd to the xml documentation. This is cleaner, and Emacs
+	stops complaining about "missing file entity" when I open source
+	files 8-)
+
+	* Added a "CPU vs human" option which allows players to specify
+	wether the CPUs should always attack humans or not.
+
+
+2003-01-02  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added 3 maps contributed by Rene Stach.
+
+
+2003-01-01  Christian Mauduit (ufoot at ufoot.org)
+
+	* Updated copyright notice.
+
+	* Minor fix in the docs concerning the -metaserver option.
+
+
+2002-12-31  Christian Mauduit (ufoot at ufoot.org)
+
+	* Minor fix in the German translation (Oui -> Ja).
+
+
+2002-12-29  Christian Mauduit (ufoot at ufoot.org)
+
+	* Bug-fix concerning the PHP3 metaserver, suggested by Christopher
+	Orr. he had problems registering his servers through a transparent
+	proxy.
+
+
+2002-12-20  Christian Mauduit (ufoot at ufoot.org)
+
+	* Vi temp files now correctly removed by make clean.
+
+	* Fixed ChangeLog dates previously written on heavy drugs.
+
+	* Added a "beep" on the server when someone connects.
+
+	* Added a reference to www.game-factor.de on Jan's credits.
+
+
+2002-12-16  Christian Mauduit (ufoot at ufoot.org)
+
+	* Released 5.5.8.
+
+
+2002-12-13  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added translations of the game description in the RPM spec file.
+	* Updated the "short" description of the game.
+
+	* ChangeLog is now included in the Windows & DOS releases.
+
+	* Updated the URL of the German homepage.
+
+	* Minor fix in the French README.
+
+
+2002-12-12  Christian Mauduit (ufoot at ufoot.org)
+
+	* Some FreeBSD make fixes (concerns src tarball generation)
+
+
+2002-11-28  Christian Mauduit (ufoot at ufoot.org)
+
+	* mail.freesoftware.fsf.org -> mail.nongnu.org
+
+	* Finally updated the German README, thanks to Jan 8-)
+
+
+2002-11-27  Christian Mauduit (ufoot at ufoot.org)
+
+	* Replaced too long German text by "Speed".
+
+
+2002-10-26  Christian Mauduit (ufoot at ufoot.org)
+
+	* Updated my GnuPG key info.
+
+
+2002-10-17  Christian Mauduit (ufoot at ufoot.org)
+
+	* Changed the package_source generation again since BSD patches made
+	it buggy under Linux 8-/
+
+
+2002-10-14  Christian Mauduit (ufoot at ufoot.org)
+
+	* One can now force the prefix of the binary package.
+
+	* Fixed the package_source target generation (would fail on FreeBSD).
+
+	* Added -D_THREAD_SAFE to gcc args. Seems to be required by FreeBSD.
+
+
+2002-10-13  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added README.fr and REAMDE.de files.
+
+
+2002-10-12  Christian Mauduit (ufoot at ufoot.org)
+
+	* Replaced "License" by its traductions in French and German in the
+	"about" screen.
+
+	* Fixed an old bug in texture reading and color converting, related
+	to the use of the rand() function. This bug could cause compilation
+	or running the game to block forever.
+
+	* Added automatic detection of pthread_create in libpthread. Used to
+	switch on the -pthread option instead of -lpthread on FreeBSD.
+
+
+2002-10-11  Christian Mauduit (ufoot at ufoot.org)
+	
+	* Added GNU Make automatic detection in configure scripts, for systems
+	that have both make (non-GNU) and gmake (GNU) commands, such as
+	FreeBSD.
+
+	* Replaced "test x == y" by "test x = y" in the configure script,
+	since this should work better with shells like csh (FreeBSD).
+
+
+2002-10-10  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added 5 new maps by Jan Gretschuskin (Quaders and Darkone series).
+
+	* Changed included standard headers to be more FreeBSD friendly.
+
+	* Added the German translation of the GPL
+
+	* Resized some menu items so that german translations can fit in them.
+	
+	* Replaced accents on German characters by their "equivalent" using
+	the plain standard alphabet (ascii<128)
+
+
+2002-10-08  Christian Mauduit (ufoot at ufoot.org)
+
+	* It's now possible to specify which "make" command to use by
+	exporting the environnement var "MAKE" before typing ./configure.
+	Usefull for compiling the game when GNU Make is called gmake for
+	instance (think of FreeBSD...).
+	
+	* Added German language support. Translation by Jan Gretschuskin.
+
+
+2002-09-02  Christian Mauduit (ufoot at ufoot.org)
+
+	* Bug-fix in the global exit function (minor bug in debug-mode, when
+	exiting in "page-flipped" mode).
+
+	* Code cleanup
+
+
+2002-09-01  Christian Mauduit (ufoot at ufoot.org)
+
+	* Released 5.5.7
+
+	* The "big data allocation" is now called to automatically double
+	the amount of reserved memory when one tries to start a new game,
+	and the buffer was to small - this previously resulted in a 
+	pathetic almost useless error message...
+	
+	* Added more settings for the "min map resolution" feature.
+
+	* Applied patch from Eugene St Leger. Now the menu water volume is
+	correctly saved in the config file.
+
+
+2002-08-30  Christian Mauduit (ufoot at ufoot.org)
+	
+	* Added the feature suggested by Thomas Harte, which is to magnify
+	small maps so that they are more interesting to play on fast computer.
+	It's still possible to use the original small versions however.
+
+	* Fixed a minor checksum verification bug
+
+
+2002-08-29  Christian Mauduit (ufoot at ufoot.org)
+
+	* When there's a checksum error, the checksum value is printed on
+	the server log.
+
+	* Changed makefiles output (now displays more info about options)
+
+	* Added the possibility to compile the game in debug mode under
+	UNIX.
+
+	* Moved the "Cursor speed" option back in the "Rules" menu, and
+	added a "Reset rules do default" button - which does not resets
+	all the parameters, such as player names for instance...
+
+
+2002-08-28  Christian Mauduit (ufoot at ufoot.org)
+
+	* Bug-fix in the core algorithm, concerning fighters moving in
+	the south-west direction. This direction was simply not correctly
+	handled 8-(
+
+	* Increased server messages consistency. Code cleanup.
+
+	* Fixed a minor bug in the core algorithm (mesh was not spread
+	correctly in the top-left corner of the map).
+	
+	* Added a function to dump rules config on stdout.
+
+	* Fixed a bug concerning the famous "error processing WHO 0"
+	message. This should - finally - fix the problem of unwanted
+	client disconnections. At least I hope so...
+
+
+2002-08-26  Christian Mauduit (ufoot at ufoot.org)
+
+	* Minor network fixes
+
+	* Updated the mpeg tools.
+
+	* Minor changes in the meta-server.
+
+
+2002-08-08  Christian Mauduit (ufoot at ufoot.org)
+
+	* Changed the French language detection under UNIX
+
+	* Fixed a minor menu issue in the French version (game and menu water
+	labels had been inverted).
+
+	
+2002-07-27  Christian Mauduit (ufoot at ufoot.org)
+
+	* Add 18 and 25 frames/sec display limits, to make more sensible movie
+	captures.
+	
+
+2002-07-18  Christian Mauduit (ufoot at ufoot.org)
+
+	* Released 5.5.6.
+
+
+2002-07-17  Christian Mauduit (ufoot at ufoot.org)
+
+	* Little tweak in the cursor move fonction which makes walls more
+	slippery. Moving cursors should be easier now.
+
+	* Enhanced the "Default" options button, so that settings such as
+	fullscreen mode are immediately applied.
+	
+	* Fixed a bug in datafile maps writing/reading. The "size" field which
+	was believed by network to be the size of maps was the size of the
+	background. In practice, size is always > bg_size but this was weird
+	anyway...
+	
+	* Fixed a bug in the network map exchange (potential buffer overflow
+	to be very precise)
+	
+	* The game now performs a range check on all the config parameters
+	retrieved from the network.
+	
+	* Added 4 "World" maps
+
+	* Fixed a bug which disabled asm assembly by default. Not in 5.5.5.
+
+	* Release 5.5.5.
+
+
+2002-07-16  Christian Mauduit (ufoot at ufoot.org)
+
+	* Pressing <ENTER> in the edit zone in the connection screem
+	causes the message to be sent.
+
+	* The "capture" mode can now be activated from teh command line.
+
+	* Added a "tombola" mode where the score menu displays a random
+	number between 1 - 500 instead of the scores. Rather specific
+	and unusual stuff indeed 8-)
+
+
+2002-07-14  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added a module to capture the video output and dump it on the disk.
+
+	* F10 now exits the game "right away" without prompting for anything.
+
+	* Disabled the possibility to pause the game during a network session.
+
+	* Changed the way lag keys are sent. Should work a little better.
+
+	* Added a "struct alignment" verification code so that if a compiler
+	generates different struct sizes/alignements, then Liquid War detects
+	it and does not use the i386 assembly code...
+
+	* Changed the way network colors are automatically attributed. It's
+	not random anymore, the game tries to pick colors that are as
+	different as possible from already enrolled colors.
+
+
+2002-07-13  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added a "checksum" system to check that the game behaves the same 
+	on every computer in network games. Seems to prove the game is still
+	not bug free 8-( This feature is not in 5.5.4.
+
+	* Added password support. This feature is not in 5.5.4.
+
+	* The game now plays a sound when another player joins a network game.
+	This feature is not in 5.5.4.
+
+	* Moved the "check_loose_team" function from "display" to "logic".
+	This could cause severe inconsistencies in network bugs when there
+	were more than 2 players involved. This bug-fix is not in 5.5.4.
+
+	* Updated the meta-server so that it can handle U61 requests. Not
+	really related to Liquid War anyway 8-)
+
+	* Added the possibility to abort the connection on a server. This 
+	could indeed take a bunch of time since connect is a blocking call
+	which can take up to a minute before failing... Not in 5.5.4 either...
+
+	* Released 5.5.4.
+
+
+2002-07-12  Christian Mauduit (ufoot at ufoot.org)
+
+	* Fixed a bug in the "rules" menu display. Game time was broken.
+
+	* Small network fix on the server.
+
+	* The "Play" button is now disabled in the "Connect" screen once one
+	has pressed "Start now" or "Play". This fixes a rather annoying bug,
+	since when people pressed "Start" twice they would sometime get
+	weird "Network errors", which totally super sucked...
+
+	* Added calls to "yeild_timeslice" to make LW more
+	"multitasking-friendly"
+
+	* Fixed an ugly UNIX X-Windows related bug. When switching between
+	workspaces, edit boxes and in a general manner all buffered input
+	would pathetically fail.
+
+	* Little RPM generation update, to solve a man page compression issue.
+	
+
+2002-07-11  Christian Mauduit (ufoot at ufoot.org)
+
+	* Released 5.5.3.
+
+
+2002-07-10  Christian Mauduit (ufoot at ufoot.org)
+
+	* French support is now auto-detected under Windows too.
+
+	* Added informations about my GnuPG public key.
+	
+
+2002-07-09  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added a new map (contributed by "Mouse")
+
+	* Changed the way liquidwarmap works. Wall color is now given by the
+	top left pixel and is not supposed tobe "index 0" anymore.
+
+	* Added an ugly but usefull hack/script in the misc section, which
+	helps formatting contributed .bmp files so that they are correctly
+	handled by the liquidwarmap utility.
+
+	* lwwin.exe now has a "built-in" icon.
+
+	* renamed copying.txt to license.txt in DOS and Win releases
+
+
+2002-07-08  Christian Mauduit (ufoot at ufoot.org)
+
+	* Fixed a bug on the server -> disconnection of clients while sending
+	game information was not handled correctly.
+
+	* Added a small - yet working - chat system in the connection screen.
+
+	
+2002-07-02  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added 6 maps by Jan Gretschuskin
+
+
+2002-07-01  Christian Mauduit (ufoot at ufoot.org)
+
+	* Fixed a score bug (some teams would be considered as playing while 
+	they were inactive).
+
+
+2002-06-29  Christian Mauduit (ufoot at ufoot.org)
+
+	* Released 5.5.2
+
+
+2002-06-28  Christian Mauduit (ufoot at ufoot.org)
+
+	* Separated run-time (network fetched for instance) config 
+	parameters from the config parameters stored in the config file.
+
+	* Added an "Assembly or standard C" option in the advanced rules
+	menu. This allow players to switch off assembly code if they want
+	to. Mostly for testing though...
+
+	* Changed the resolution of the default map, which was too small
+	IMHO. The old one is still here anyway 8-)
+
+
+2002-06-27  Christian Mauduit (ufoot at ufoot.org)
+
+	* Bug-fix concerning display in page flipping mode
+
+	* Removed a bunch of Windows specific quirks
+
+	* Finally enabled all the assembly code under Windows (BTW, I
+	confirm - once again - that MSVC is a total piece of crap)
+
+	* Rewrote the "set_resolution" function in a cleaner way
+
+	* Separate config and log files for the Windows & DOS binaries
+
+	* Moved the icons to the "misc" directory, and added a 32x32 xpm
+
+
+2002-06-26  Christian Mauduit (ufoot at ufoot.org)
+
+	* Re-enabled the assembly code for the "wave effects"
+
+	* Changed the way the "Viewport" size is calculated.
+	
+
+2002-06-25  Christian Mauduit (ufoot at ufoot.org)
+
+	* Liquid War now handles the "Close" button in windowed context.
+	(MS-Windows and X-Windows).
+	
+
+2002-06-24  Christian Mauduit (ufoot at ufoot.org)
+
+	* The "control_type" parameter is now transmitted on the nwtwork.
+	This enables the client to know if a network team is a bot, and also
+	fixes a network bug (when the "CPU Strength" parameter was changed).
+
+	* Re-enabled some i386 assembly code under Linux
+
+
+2002-06-21  Christian Mauduit (ufoot at ufoot.org)
+
+	* The options are now chosen by the _first_ connected client.
+
+
+2002-06-20  Christian Mauduit (ufoot at ufoot.org)
+
+	* Bug-fix concerning language detection on Linux, submitted by 
+	David Turner (the game would segfault if LANG was undefined)
+	Patch not included in 5.5.1.
+
+	* Minor bug-fix in the metaserver (age was wrong when > 1 day)
+
+	* Released 5.5.1
+
+
+2002-06-19  Christian Mauduit (ufoot at ufoot.org)
+
+	* Minor fixes
+
+	* Replaced truecolor custom/map/pacman.bmp by a 256 colors indexed
+	version (fixes a DOS bug)
+
+	* Added informations about IRC 
+
+
+2002-06-18  Christian Mauduit (ufoot at ufoot.org)
+
+	* Bug-fixes concerning custom levels loading
+
+	* Network bug-fix concerning disconnection at game start
+	
+
+2002-06-10  Christian Mauduit (ufoot at ufoot.org)
+
+	* Better error handling on the server, especially when sending info
+	to clients before a game starts.
+
+	* Fixed the http client parser (would not handle correctly IP adresses
+	which had 15 characters.
+
+	* Bug-fix in the meta-server (chat messages)
+	
+
+2002-06-06  Christian Mauduit (ufoot at ufoot.org)
+
+	* Applied patch sent by Colin Stewart on dnsutil.c (the game would
+	not compile on Debian Potato).
+
+	
+2002-06-04  Christian Mauduit (ufoot at ufoot.org)
+
+	* Fixed some custom ressources stuff. 
+
+	* Released 5.5.0
+	
+	
+2002-06-03  Christian Mauduit (ufoot at ufoot.org)
+
+	* Fixed a "color" bug which occured with 6 teams in a network game. 
+	
+	* Fixed some DOS and Windows bugs
+
+	* Updated the docs.
+
+
+2002-05-31  Christian Mauduit (ufoot at ufoot.org)
+
+	* Changed the way network sockets are closed
+
+	* The server is now able to tell the clients that is is "full"
+	and therefore does not accept any more teams.
+
+	* Added date and time to the server log.
+	
+
+2002-05-30  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added a "chat" functionnality to the meta-server
+	
+	* Finished the French menus
+
+
+2002-05-29  Christian Mauduit (ufoot at ufoot.org)
+
+	* Finally fixed the ugly mouse bug which caused the mouse to leave
+	a "trace" on some screens.
+
+	* In a network game, it's now the first connected players who
+	chooses which level will be played - the choice used to be done
+	by the last connected player.
+	
+
+2002-05-28  Christian Mauduit (ufoot at ufoot.org)
+
+	* Bug-fix in the DNS lookup routine
+
+
+2002-05-27  Christian Mauduit (ufoot at ufoot.org)
+
+	* Implemented a new "Connect" menu which displays who's currently
+	connected on the server.
+
+	* Added the possibility to start a game even not all the players
+	are connected yet.
+
+	* The server is now able to disconnect a player while waiting for
+	others to connect.
+
+
+2002-05-20  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added clarity.mid and return.mid (composed by Tim Chadburn)
+
+
+2002-05-17  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added a "Copying" section to the docs.
+
+
+2002-05-14  Christian Mauduit (ufoot at ufoot.org)
+
+	* All the labels but the log messages are supported in French.
+
+
+2002-05-10  Christian Mauduit (ufoot at ufoot.org)
+
+	* More locale stuff...
+
+
+2002-05-07  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added some new French menu labels.
+
+
+2002-05-06  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added a "memset(d,0,sizeof(d))" call at the beginning of every
+	menu. Should prevent from some random GUI errors.
+
+	* The mouse cursor is now hidden during the game
+	
+	* Added player name support in the "Scores" menu. Works in both
+	network and local modes.
+
+	
+2002-05-04  Christian Mauduit (ufoot at ufoot.org)
+
+	* Updated the "Teams" menu. As suggested by Frode Haugsgjerd, the 
+	"Human/Cpu" choice has been replaced by a "Human/Cpu/Off" choice.
+	A player name has also been added - however it's not used yet.
+	
+	* Removed the "NICKNAME" from network code, which is useless since
+	player names are about to be implemented.
+
+	* Added a "Controls" menu to set up the joystick state and the mouse
+	sensibility. This was previously in the "Teams" menu.
+
+
+2002-04-29  Christian Mauduit (ufoot at ufoot.org)
+
+	* Removed the "in-game" help which was outdated anyway...
+
+
+2002-04-27  Christian Mauduit (ufoot at ufoot.org)
+
+	* Removed the "Help" button and replaced it with a "play" button.
+
+	* Added a "Language" menu.
+
+
+2002-04-23  Christian Mauduit (ufoot at ufoot.org)
+
+	* Updated the "about" menu.
+
+
+2002-04-22  Christian Mauduit (ufoot at ufoot.org)
+
+	* Updated the php3 doc generator.
+
+	* Minor fix in configure.in.
+
+	
+2002-04-02  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added fodder.mid, composed by Tim Chadburn.
+
+	* Added Tim Chadburn's documentation about OSS midi.
+	
+
+2002-03-21  Christian Mauduit (ufoot at ufoot.org)
+
+	* Implemented a meta-server in PHP3, which registers servers.
+	A new menu has been added to the client so that players can
+	automatically pick a server.
+
+
+2002-03-15  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added information about the mailing-list
+
+
+2002-03-14  Christian Mauduit (ufoot at ufoot.org)
+
+	* Quick hack to fix a MIDI initialization problem
+
+
+2002-03-13  Christian Mauduit (ufoot at ufoot.org)
+
+	* Added marauder.mid (by Tim Chadburn) to the musics.
+
+
+2002-03-12  Christian Mauduit (ufoot at ufoot.org)
+
+	* Fixed RPM/install-info related bugs.
+
+
+2002-03-11  Christian Mauduit (ufoot at ufoot.org)
+	
+	* Version 5.4.5 rleased
+
+	* Added midi music support. Midi files contributed by Tim Chadburn.
+
+	* Fixed an install-info related bug in the RPM file
+
+	* The Windows version now outputs stuff to a data/lw.log file
+
+
+2002-02-25  Christian Mauduit (ufoot at ufoot.org)
+
+	* version 5.4.4 released
+
+	* Changed the copyright notice at the beginning of each file so
+	that it's conform to the GPL's suggestions.
+
+	* Added a time limit in the keyboard polling which is used in the
+	"teams" menu. Should prevent the game from freezing.
+
+	* Fixed a serious bug in key choosing in the "teams" menu. This
+	bug had not been reported 8-(
+
+	* Added documentation in "info" format.
+
+	* ./configure now autodetects tools such as PDFLaTeX, and the
+	Makefile won't try to build such doc if it's not available.
+
+	* It's now possible to compile an optimized version of Liquid War
+	(for i686 for instance) using ./configure --target=xxx. 
+
+	* Various bug-fixes and enhancements in the ./configure script
+	and in the makefiles.
+
+
+2002-01-28  Christian Mauduit (ufoot at ufoot.org)
+
+	* version 5.4.3 released
+
+	* Bug-fix in the liquidwarmap utility (some maps could generate
+	protection faults while compiling).
+
+	* Bug-fix in the datafile generation (the background image palette
+	was wrecked with Allegro 4.0).
+
+	* LW is now compliant with the Filesystem Hierarchy Standard, this
+	implies that binaries are in $prefix/games.
+
+	* There's now a window title which says "Liquid War 5.4.3"
+
+	* Added a windowed/fullscreen mode support.
+
+	* Limited the size of "mesh elements" to 8x8 to avoid weird behaviors
+	on very big and empty maps.
+
+	* Added an uninstall target
+
+	* Added some basic scripts to automatically build the various releases
+
+	* Added a liquidwar.spec file so that it's easy to build a rpm
+	
+
+2001-07-23  Christian Mauduit (ufoot at ufoot.org)
+
+	* version 5.4.2 released
+
+	* Bug-fix in the network code.
+
+	* A few more levels.
+
+
+2001-07-18  Christian Mauduit (ufoot at ufoot.org)
+
+	* version 5.4.1 released
+
+	* Fixed many bugs in the network support, and added the "-lag"
+	option to the server. Basically it should be possible to play
+	on Internet now. Also, the client now displays readable error
+	messages when there's a problem joining the server.
+
+	* Added names to maps so that it's easier to choose them,
+	added a "speeds" and changed some other GUI related stuff.
+
+	* The default memory allocated (8192Kb) has also been increased
+	(16384Kb) so that the game can handle big maps. 2 new hudge
+	maps have been added.
+
+
+2001-07-07  Christian Mauduit (ufoot at ufoot.org)
+
+	* version 5.4.0 released
+
+	* The *big* change is that with this release Liquid War includes
+	network support. There are probably some bugs left and some minor
+	features are missing, but basically, one can play on a LAN.
+
+	* The other important point is that the documentation is back -
+	it had been lost when I had changed my web site - and is available
+	in several formats (HTML, plain text, PostScript and PDF).
+
+	* I also separated the Windows and DOS packages since the DOS .exe
+	is quite big and most of the time useless to Windows users since
+	DOS support in recent versions of Windows is getting worse and
+	worse.
+
+
+2001-03-18  Christian Mauduit (ufoot at ufoot.org)
+
+	* version 5.3.3 released
+
+	* Fixed some minor bugs which were revealed when creating the
+	Debian package for Liquid War.
+
+	* I also prepared a statically linked version of the game. This
+	version installs itself in no time on almost any recent GNU/Linux box,
+	so it's an interesting point for GNU/Linux users which do not feel
+	like spending 3 hours compiling the game before being able
+	to try it out.
+
+
+2000-06-19  Christian Mauduit (ufoot at ufoot.org)
+
+	* version 5.3.2 released
+
+	* I changed the textures in the datafile and replaced the existing
+	textures by textures I imported from the Gimp. This is for copyright
+	issues since I can not find the author of the previous textures
+	any more and would normally require his acceptance of my putting
+	his textures in my GPL'ed game. So with Gimp's textures I'm pretty
+	sure that I won't have any copyright problem.
+
+	* I also started to comment the source files.
+
+
+2000-04-09  Christian Mauduit (ufoot at ufoot.org)
+
+	* version 5.3.1 released
+
+	* I changed the GNU/Linux configure script so that it searches for
+	dat (the allegro datafile compiler). The reason is that several
+	players could not install LW because of this (they had downloaded
+	the end-user version of Allegro but the full-version is needed).
+
+	* I updated the GNU/Linux version so that it has all the features of
+	the old dos version (including the "wave effect").
+
+	* A starter kit has been prepared, it a lighter version with a 
+	pred-built light datafile.It makes it easier to download LW
+	quickly and try it out before downloading the full version.
+	This implies that now one can use datafiles with any number
+	of textures and maps.
+
+	* I prepared binary packages for DOS & Windows (the windows version
+	is *still* not very stable).
+
+	* Added a button in the wave menu to toggle the wave effect without
+	pressing F4 during gameplay.
+
+	* Some bug fixing.
+
+
+2000-03-12  Christian Mauduit (ufoot at ufoot.org)
+
+	* version 5.3.0 released
+
+	* All further major developpements of LW will be done from GNU/Linux.
+
+	* I now use a unix style x.x.x numbering system for versions.
+
+	* Liquid War is on sourceforge.net
+
+	* I prepared scripts and changed the directory structure of the
+	project, so that LW can be installed under GNU/Linux with standard
+	commands like './configure;make;make install'
+
+	* Many small bugs have been fixed.
+
+
+1999-09-06  Christian Mauduit (ufoot at ufoot.org)
+
+	* version 5.2 released
+
+	* Liquid War is now released under the GNU General Public Licencse.
+
+	* Some improvements such as a 'frame per second limit' which limits
+	the time taken by display operations so that the game is globally
+	faster.
+
+	* I release the first windows executable of Liquid War, it's not very
+	stable but basically works.
+
+	* Soon after, Peter Wang gives me patches to have LW run under GNU/Linux.
+
+1998-11-21  Christian Mauduit (ufoot at ufoot.org)
+
+	* version 5.1 released
+
+	* Small bug fixes, changed some menus.
+
+
+1998-09-26  Christian Mauduit (ufoot at ufoot.org)
+
+	* version 5.0 released
+
+	* Everything has been rewritten
+	DJGPP used instead of Borland C/C++
+	Allegro is used as a wrapper for ease of developpement and future
+  	portability
+	Optimization of the algorithm
+	Visual enhancements such as the "wave effect"
+	An 'understandable' GUI replaces the old cryptic one.
+
+
+1995-07-01  Christian Mauduit (ufoot at ufoot.org)
+
+	* version 3.0 released
+
+	* built with borlandc++ 3.0, barely usable.
+
+

Added: unstable/liquidwar/branches/upstream/current/INSTALL
===================================================================
--- unstable/liquidwar/branches/upstream/current/INSTALL	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/INSTALL	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,77 @@
+This file describes how to install Liquid War on a UNIX-like system.
+
+
+To compile and install Liquid War under GNU/Linux, you need:
+- gcc, make, etc. (*) : http://www.gnu.org/
+- Python   (**)       : http://www.python.org/
+- LaTeX    (optional) : http://www.latex-project.org/
+- dvips    (optional) : http://www.radicaleye.com/dvips.html
+- PDFLaTeX (optional) : http://www.tug.org/applications/pdftex/
+- makeinfo (optional) : http://www.gnu.org/software/texinfo/texinfo.html
+- Allegro  (***)      : http://www.talula.demon.co.uk/allegro/
+
+(*) You need to have GNU Make installed. Others flavors of the make 
+    utility might simply not work at all when compiling LW.
+
+(**) Python is required to build the docs. You can decide not to
+     build the docs so to some extent it's optional. However, if Python
+     is installed, you'll need the "re", "string" and "xmllib" modules.
+     They come with the standard distribution of Python 1.5 and 2.1,
+     so it should not be a big problem.
+    
+(***) You won't be able to build Liquid War if you installed only
+      the end-user version of Allegro. The full Allegro development 
+      package is required, since it includes the datafile compiler "dat".
+      FYI, the complete package weights about 2000Kb whereas the end-user 
+      version - which won't allow you to build LW - is only about 500Kb.
+
+
+Once you have all this installed, type:
+$ autoconf
+$ ./configure
+$ make
+# make install (run as root or any user who can write in /usr/local)
+$ liquidwar
+
+By default:
+/usr/local/bin            contains symbolic links to the binaries
+/usr/local/games          contains the binaries
+/usr/local/share/games    contains the data
+/usr/local/share/doc      contains the documentaion
+/usr/local/share/pixmaps  contains an icon for Gnome/KDE/WMaker/etc...
+/usr/local/share/man/man6 contains the man page
+/usr/local/share/info     contains the info page
+
+The ./configure script accepts options, the most usefull being IMHO:
+--prefix=/my/path    : changes the default install directory
+--disable-doc-xxx    : turns off the generation of doc in format 'xxx'
+--enable-static      : enables static linking
+--disable-target-opt : turns off optimizations such as "-mcpu=i686"
+
+
+Since release 5.3.3, binaries of Liquid War for GNU/Linux are available.
+These binaries are statically linked against Allegro and glibc,
+so they should run on any recent GNU/Linux box that has an X server running.
+So if you spend too much time compiling LW, please consider using
+one of those binaries, since they should work right away.
+They are "slackware-like" packages, to install them, simply type (as root):
+tar xzfP liquidwar-5.x.x.i386-pc-linux-gnu.tgz
+
+Liquid War can theorically be build on any platform supported by Allegro.
+In practice you might still encounter some problems:
+- source code contains a bunch of "#ifdef UNIX" and the likes, which might
+  cause errors on untested platforms.
+- the Makefiles require GNU Make; for instance the standard make command 
+  which comes with FreeBSD won't work, you'll need to install gmake.
+- the code is designed for "little-endian" processors. Therefore you will
+  probably not be able to run it on "big-endian" (MAC, Sparc,...) CPUs.
+Most LW ports - including Linux and FreeBSD - have been done by contributors.
+So if you've successfully - or even if you've tried to - build and run LW
+on a new platform, please contact me, I'm interested 8-)
+
+
+If you have problems compiling, installing or running Liquid War, you can
+get help and informations on the Liquid War user mailing list:
+
+http://mail.nongnu.org/mailman/listinfo/liquidwar-user
+

Added: unstable/liquidwar/branches/upstream/current/Makefile.dos
===================================================================
--- unstable/liquidwar/branches/upstream/current/Makefile.dos	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/Makefile.dos	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,170 @@
+#
+# Required DJGPP stuff:
+# v2/copying.dj
+# v2/djdev203.zip
+# v2/faq230b.zip
+# v2/readme.1st
+# v2gnu/bnu2161b.zip
+# v2gnu/fil41b.zip
+# v2gnu/gcc401b.zip
+# v2gnu/gdb611b.zip
+# v2gnu/gpp401b.zip
+# v2gnu/mak3791b.zip
+# v2gnu/sed414b.zip
+# v2gnu/txi48b.zip
+# v2gnu/txt20b.zip
+#
+# To compile Allegro for DOS:
+# > fix djgpp
+# > make
+# > make install
+#
+
+C_PATH=./src/
+H_PATH=./src/
+ASM_PATH=./src/
+OBJ_PATH=./src/
+OBJ_EXT=.dos.o
+
+OBJ_NAMES=\
+about \
+advanced \
+alleg2 \
+area \
+army \
+asm \
+autoplay \
+back \
+basicopt \
+bigdata \
+capture \
+chat \
+checksum \
+code \
+config \
+connect \
+controls \
+cursor \
+decal \
+dialog \
+disk \
+disp \
+distor \
+dnsutil \
+error \
+exec2 \
+exit \
+fighter \
+game \
+gfxmode \
+grad \
+graphics \
+help \
+httputil \
+info \
+init \
+internet \
+joystick \
+keyboard \
+keyexch \
+lang \
+langde \
+langdk \
+langen \
+langfr \
+language \
+level \
+logcli \
+main \
+map \
+maptex \
+menu \
+mesh \
+message \
+mouse \
+move \
+music \
+mutxdos \
+netconf \
+netkey \
+netgame \
+netmap \
+netmess \
+netplay \
+network \
+options \
+palette \
+parser \
+path \
+ping \
+pion \
+play \
+profile \
+protocol \
+random \
+rules \
+score \
+serial \
+sock2cli \
+sockdos \
+sound \
+speeds \
+startinf \
+startup \
+team \
+texture \
+thrddos \
+ticker \
+time \
+viewport \
+volume \
+watchdog \
+wave \
+wwwcli \
+glouglou \
+monster \
+spread \
+../utils/snprintf/snprintf
+
+OBJ_NAMES_MAPGEN=\
+../utils/lwmapgen/big_quad \
+../utils/lwmapgen/boxes \
+../utils/lwmapgen/bubbles \
+../utils/lwmapgen/circles \
+../utils/lwmapgen/circuit \
+../utils/lwmapgen/cut \
+../utils/lwmapgen/func \
+../utils/lwmapgen/hole \
+../utils/lwmapgen/lines \
+../utils/lwmapgen/main \
+../utils/lwmapgen/map \
+../utils/lwmapgen/map_generator \
+../utils/lwmapgen/misc \
+../utils/lwmapgen/rand_box \
+../utils/lwmapgen/rand_func \
+../utils/lwmapgen/rand_poly \
+../utils/lwmapgen/rand_poly_cut \
+../utils/lwmapgen/street \
+../utils/lwmapgen/worms
+ 
+OBJ_FILES=$(addprefix $(OBJ_PATH),$(addsuffix $(OBJ_EXT),$(OBJ_NAMES)))
+OBJ_FILES_MAPGEN=$(addprefix $(OBJ_PATH),$(addsuffix $(OBJ_EXT),$(OBJ_NAMES_MAPGEN)))
+
+C_FLAGS=-O3 -fomit-frame-pointer -I$(H_PATH)
+C_COMPILE=gcc -c $< -o $@ $(C_FLAGS) -DDOS -DASM -DSNPRINTF
+ASM_COMPILE=gcc -c $< -o $@
+
+all: lwdos.exe lwdosmap.exe
+
+$(OBJ_PATH)%$(OBJ_EXT): $(C_PATH)%.c
+	$(C_COMPILE)
+
+$(OBJ_PATH)%$(OBJ_EXT): $(ASM_PATH)%.s
+	$(ASM_COMPILE)
+
+lwdos.exe: $(OBJ_FILES)
+	gcc -o $@ $(OBJ_FILES) -lalleg
+
+lwdosmap.exe: $(OBJ_FILES_MAPGEN)
+	gcc -o $@ $(OBJ_FILES_MAPGEN) -lalleg
+

Added: unstable/liquidwar/branches/upstream/current/Makefile.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/Makefile.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/Makefile.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,453 @@
+
+prefix =          @prefix@
+exec_prefix =     @exec_prefix@
+bindir =          @bindir@
+datadir =         @datadir@
+mandir =          @mandir@
+infodir =         @infodir@
+
+BINDIR =          $(bindir)
+GAMEDIR =         $(exec_prefix)/games
+DATADIR =         $(datadir)/games/liquidwar
+PIXDIR =          $(datadir)/pixmaps
+DOCDIR =          $(datadir)/doc/liquidwar
+DESKTOPDIR =           $(datadir)/applications
+# We don't use the autoconf default mandir=$(prefix)/man man
+# directory since the FHS (File Hierarchy Standard recommends
+# to place man pages in $(datadir)/man (ie /usr/share/man).
+# MANDIR =          $(mandir)/man6
+MANDIR =          $(datadir)/man/man6
+# We don't use the autoconf default infodir=$(prefix)/info info
+# directory since the FHS (File Hierarchy Standard recommends
+# to place info pages in $(datadir)/info (ie /usr/share/info).
+# INFODDIR =        $(infodir)
+INFODIR =         $(datadir)/info
+INFODIRDIR =      $(infodir)
+
+ifeq (@TARGET_OPT@,yes)
+	TARGET =          @target@
+	TARGET_CPU =      @target_cpu@
+else
+	TARGET =          unknown
+	TARGET_CPU =      unknown
+endif
+
+VERSION =         @VERSION@
+VERSION_REL =     @VERSION_REL@
+VERSION_COMPACT = @VERSION_COMPACT@
+
+GMAKE = @GMAKE@
+
+MAKE_BIN_DIR = ./src
+MAKE_DATA_DIR = ./data
+MAKE_UTILS_DIR = ./utils
+MAKE_DOC_DIR = ./doc
+MAKE_DIRS = $(MAKE_BIN_DIR) $(MAKE_UTILS_DIR) $(MAKE_DATA_DIR) $(MAKE_DOC_DIR)
+
+PACKAGE_SOURCE_DIR = liquidwar-$(VERSION)
+PACKAGE_SOURCE_TAR = $(PACKAGE_SOURCE_DIR).tar
+PACKAGE_SOURCE_TARGZ = $(PACKAGE_SOURCE_TAR).gz
+
+PACKAGE_BINARY_TAR = liquidwar-$(VERSION).$(TARGET).tar
+PACKAGE_BINARY_TGZ = liquidwar-$(VERSION).$(TARGET).tgz
+
+PACKAGE_WIN32_DIR = LW5
+PACKAGE_WIN32_EXE = lwwin.exe lwwinsrv.exe lwwinmap.exe
+PACKAGE_WIN32_ZIP = lw$(VERSION_COMPACT)w.zip
+
+# the following line should be edited to match your configuration
+PACKAGE_DOS_CWSDPMI = /home/ufoot/home/storage/fauvelles/shared/win98/cwsdpmi.exe
+PACKAGE_DOS_DIR = LW5
+PACKAGE_DOS_EXE = lwdos.exe lwdosmap.exe
+PACKAGE_DOS_ZIP = lw$(VERSION_COMPACT)d.zip
+
+PACKAGE_SOURCE_RPM_TARGET = /usr/src/rpm/SRPMS
+PACKAGE_SOURCE_RPM = liquidwar-$(VERSION)-$(VERSION_REL).src.rpm
+
+PACKAGE_BINARY_RPM_TARGET = /usr/src/rpm/RPMS/$(TARGET_CPU)
+PACKAGE_BINARY_RPM = liquidwar-$(VERSION)-$(VERSION_REL).$(TARGET_CPU).rpm
+
+PACKAGE_MACOSX_TAR = liquidwar-$(VERSION).macosx.tar
+PACKAGE_MACOSX_TGZ = liquidwar-$(VERSION).macosx.tgz
+PACKAGE_MACOSX_DMG = liquidwar-$(VERSION).dmg
+
+PACKAGE_TMP = /tmp/liquidwar-$(VERSION).tmp
+
+all: build_bin build_data build_doc
+	@echo
+	@echo "Build complete."
+	@echo "Type \"$(GMAKE) install\" to install Liquid War $(VERSION)."
+
+world: clean world_clean all package_source package_win32 package_dos package_binary package_source_rpm package_binary_rpm
+
+build_bin:
+	@$(GMAKE) -C $(MAKE_BIN_DIR)
+
+build_data:
+	@$(GMAKE) -C $(MAKE_UTILS_DIR)
+	@$(GMAKE) -C $(MAKE_DATA_DIR)
+
+build_doc:	
+	@$(GMAKE) -C $(MAKE_DOC_DIR)
+
+install: install_link install_nolink
+
+# the install_nolink is for distribs where $(prefix)/games is in the PATH,
+# for instance Debian, where a link in $(prefix)/bin is pretty much useless
+install_nolink: install_bin install_data install_custom_map install_custom_texture install_custom_music install_icon install_doc install_gpl install_desktop install_readme
+	@echo 
+	@echo "Install of Liquid War $(VERSION) completed, seems that you are ready to play ;)"
+	@echo "Have a good day!"
+	@echo "                            U-Foot (ufoot at ufoot.org)"
+	@echo
+	@echo "Type \"liquidwar\" or \"$(GAMEDIR)/liquidwar\" to play."
+
+install_bin: src/liquidwar src/liquidwar-server src/liquidwar-mapgen
+	@echo "Installing liquidwar binaries in $(GAMEDIR)."
+	@install -d $(DESTDIR)$(GAMEDIR)
+	@install -s src/liquidwar $(DESTDIR)$(GAMEDIR)
+	@install -s src/liquidwar-server $(DESTDIR)$(GAMEDIR)
+	@install -s src/liquidwar-mapgen $(DESTDIR)$(GAMEDIR)
+
+install_link:
+	@echo "Installing link in $(BINDIR)."
+	@install -d $(DESTDIR)$(BINDIR)
+	@rm -rf $(DESTDIR)$(BINDIR)/liquidwar
+	@rm -rf $(DESTDIR)$(BINDIR)/liquidwar-server
+	@rm -rf $(DESTDIR)$(BINDIR)/liquidwar-mapgen
+	@ln -s $(GAMEDIR)/liquidwar $(DESTDIR)$(BINDIR)/liquidwar
+	@ln -s $(GAMEDIR)/liquidwar-server $(DESTDIR)$(BINDIR)/liquidwar-server
+	@ln -s $(GAMEDIR)/liquidwar-mapgen $(DESTDIR)$(BINDIR)/liquidwar-mapgen
+
+install_data: data/liquidwar.dat
+	@echo "Installing liquidwar datafile in $(DATADIR)."
+	@install -d $(DESTDIR)$(DATADIR)
+	@install -m 0644 data/liquidwar.dat $(DESTDIR)$(DATADIR)
+
+install_custom_map: 
+	@echo "Installing liquidwar custom maps in $(DATADIR)/map."
+	@install -d $(DESTDIR)$(DATADIR)
+	@install -d $(DESTDIR)$(DATADIR)/map
+	@install -m 0644 custom/map/*.* $(DESTDIR)$(DATADIR)/map
+
+install_custom_texture: 
+	@echo "Installing liquidwar custom textures in $(DATADIR)/texture."
+	@install -d $(DESTDIR)$(DATADIR)
+	@install -d $(DESTDIR)$(DATADIR)/texture
+	@install -m 0644 custom/texture/*.* $(DESTDIR)$(DATADIR)/texture
+
+install_custom_music: 
+	@echo "Installing liquidwar custom musics in $(DATADIR)/music."
+	@install -d $(DESTDIR)$(DATADIR)
+	@install -d $(DESTDIR)$(DATADIR)/music
+	@install -m 0644 custom/music/*.* $(DESTDIR)$(DATADIR)/music
+
+install_doc:
+	@if [ -f $(MAKE_DOC_DIR)/txt/rules.txt ]; then echo "Installing liquidwar plain text doc in $(DOCDIR)/txt."; install -d $(DESTDIR)$(DOCDIR)/txt; install -m 0644 $(MAKE_DOC_DIR)/txt/*.txt $(DESTDIR)$(DOCDIR)/txt; fi
+	@if [ -f $(MAKE_DOC_DIR)/html/rules.html ]; then echo "Installing liquidwar HTML doc in $(DOCDIR)/html."; install -d $(DESTDIR)$(DOCDIR)/html; install -m 0644 $(MAKE_DOC_DIR)/html/*.html $(DESTDIR)$(DOCDIR)/html; fi
+	@if [ -f $(MAKE_DOC_DIR)/man/liquidwar.6.gz ]; then echo "Installing liquidwar man page in $(MANDIR)."; install -d $(DESTDIR)$(MANDIR); install -m 0644 $(MAKE_DOC_DIR)/man/liquidwar.6.gz $(DESTDIR)$(MANDIR); ln -s -f liquidwar.6.gz $(DESTDIR)$(MANDIR)/liquidwar-server.6.gz; ln -s -f liquidwar.6.gz $(DESTDIR)$(MANDIR)/liquidwar-mapgen.6.gz; fi
+	@if [ -f $(MAKE_DOC_DIR)/info/liquidwar.info.gz ]; then echo "Installing info page $(INFODIR)/liquidwar.info.gz."; install -d $(DESTDIR)$(INFODIR); install -m 644 $(MAKE_DOC_DIR)/info/liquidwar.info* $(DESTDIR)$(INFODIR); if which install-info; then if test -d $(DESTDIR)$(INFODIRDIR); then if test -f $(DESTDIR)$(INFODIRDIR)/dir; then echo "Installing liquidwar info entry."; install-info --info-dir=$(DESTDIR)$(INFODIRDIR) $(MAKE_DOC_DIR)/info/liquidwar.info.gz; fi; fi; fi; fi
+	@if [ -f $(MAKE_DOC_DIR)/ps/liquidwar.ps ]; then echo "Installing liquidwar PostScript doc in $(DOCDIR)/ps."; install -d $(DESTDIR)$(DOCDIR)/ps; install -m 0644 $(MAKE_DOC_DIR)/ps/*.ps $(DESTDIR)$(DOCDIR)/ps; fi
+	@if [ -f $(MAKE_DOC_DIR)/pdf/liquidwar.pdf ]; then echo "Installing liquidwar PDF doc in $(DOCDIR)/pdf."; install -d $(DESTDIR)$(DOCDIR)/pdf; install -m 0644 $(MAKE_DOC_DIR)/pdf/*.pdf $(DESTDIR)$(DOCDIR)/pdf; fi
+
+install_icon:
+	@echo "Installing liquidwar icon in $(PIXDIR)."
+	@install -d $(DESTDIR)$(PIXDIR)
+	@install -m 0644 misc/liquidwar.xpm $(DESTDIR)$(PIXDIR)
+
+install_desktop:
+	@echo "Installing desktop file in $(DESKTOPDIR)."
+	@install -d $(DESTDIR)$(DESKTOPDIR)
+	@install -m 0644 misc/liquidwar.desktop $(DESTDIR)$(DESKTOPDIR)
+
+install_gpl:
+	@echo "Installing GPL in $(DOCDIR)."
+	@install -d $(DESTDIR)$(DOCDIR)
+	@install -m 0644 COPYING $(DESTDIR)$(DOCDIR)
+
+install_readme:
+	@echo "Installing README in $(DOCDIR)."
+	@install -d $(DESTDIR)$(DOCDIR)
+	@install -m 0644 README $(DESTDIR)$(DOCDIR)
+	@install -m 0644 README.fr $(DESTDIR)$(DOCDIR)
+	@install -m 0644 README.de $(DESTDIR)$(DOCDIR)
+	@install -m 0644 README.dk $(DESTDIR)$(DOCDIR)
+
+uninstall:
+	@echo "Removing binary $(GAMEDIR)/liquidwar."
+	@rm -f $(DESTDIR)$(GAMEDIR)/liquidwar
+	@echo "Removing binary $(GAMEDIR)/liquidwar-server."
+	@rm -f $(DESTDIR)$(GAMEDIR)/liquidwar-server
+	@echo "Removing data directory $(DATADIR)."
+	@rm -rf $(DESTDIR)$(DATADIR)
+	@echo "Removing documentation directory $(DOCDIR)."
+	@rm -rf $(DESTDIR)$(DOCDIR)
+	@echo "Removing man page $(MANDIR)/liquidwar.6.gz."
+	@rm -f $(DESTDIR)$(MANDIR)/liquidwar.6.gz
+	@echo "Removing man page $(MANDIR)/liquidwar-server.6.gz."
+	@rm -f $(DESTDIR)$(MANDIR)/liquidwar-server.6.gz
+	@echo "Removing man page $(MANDIR)/liquidwar-mapgen.6.gz."
+	@rm -f $(DESTDIR)$(MANDIR)/liquidwar-mapgen.6.gz
+	@echo "Removing info page $(INFODIR)/liquidwar.info.gz."
+	@rm -f $(DESTDIR)$(INFODIR)/liquidwar.info*
+	@if which install-info; then if test -d $(DESTDIR)$(INFODIRDIR); then if test -f $(DESTDIR)$(INFODIRDIR)/dir; then echo "Removing info entry."; install-info --info-dir=$(DESTDIR)$(INFODIRDIR) --remove liquidwar; fi; fi; fi
+	@echo "Removing icon $(PIXDIR)/liquidwar.xpm."
+	@rm -f $(DESTDIR)$(PIXDIR)/liquidwar.xpm
+	@echo "Removing desktop file $(DESKTOPDIR)/liquidwar.desktop."
+	@rm -f $(DESTDIR)$(DESKTOPDIR)/liquidwar.desktop
+	@echo "Removing link $(BINDIR)/liquidwar."
+	@rm -f $(DESTDIR)$(BINDIR)/liquidwar
+	@echo "Removing link $(BINDIR)/liquidwar-server."
+	@rm -f $(DESTDIR)$(BINDIR)/liquidwar-server
+
+clean:
+	@for d in $(MAKE_DIRS); do $(GMAKE) -C $$d clean; done
+	@find . -name "*~" -o -name "*#*" -o -name ".*#*" | xargs rm -f 	
+
+world_clean:
+	@rm -f $(PACKAGE_SOURCE_TARGZ)
+	@rm -f $(PACKAGE_BINARY_TGZ)
+	@rm -f $(PACKAGE_SOURCE_RPM)
+	@rm -f $(PACKAGE_BINARY_RPM)
+	@rm -f $(PACKAGE_DOS_ZIP)
+	@rm -f $(PACKAGE_WIN32_ZIP)
+
+# target used when preparing packages
+packageclean: clean world_clean
+	@rm -r -f Makefile config.cache config.status config.log autom4te.cache
+	@rm -f misc/liquidward misc/macosx_info.plist
+	@find . -name "*.o" -o -name "*.obj" | xargs rm -f
+	@find . -name "*.tar.gz" -o -name "*.tgz" -o -name "*.zip" -o -name "*.rpm" -o -name "*.deb" -o -name "*.tgz" | xargs rm -f
+	@find . -name ".xvpics" | xargs rm -rf
+	@find . -name "lwmap.bmp" | xargs rm -rf
+	@rm -rf LW5 lwdos*exe lwwin*exe _tmpfile.arg *.log vc60.* *.idb *.pch
+	@rm -rf data/lwwin* data/lwdos*
+	@rm -rf starter
+	@for d in $(MAKE_DIRS); do $(GMAKE) -C $$d distclean; done
+
+distclean: packageclean
+	@rm -rf $(PACKAGE_TMP)
+
+config:
+	@for d in $(MAKE_DIRS); do $(GMAKE) -C $$d config; done
+
+check:
+	@for d in $(MAKE_DIRS); do $(GMAKE) -C $$d check; done
+
+dep:
+	@for d in $(MAKE_DIRS); do $(GMAKE) -C $$d dep; done
+	@echo
+	@echo "Type \"$(GMAKE)\" to build Liquid War $(VERSION)."
+
+# ----------------------------------------------------------------------
+# The following targets are used to produce various packages of LW, ie
+# - a source tarball
+# - a static binary stored in a .tar.gz
+# - a win32 binary
+# - a dos binary
+# - a source rpm
+# - a binary rpm
+#
+# These scripts are far from perfect, but they help me building 
+# the files I upload to my website. Still, you're free to use them
+# yourself 8-)
+# ----------------------------------------------------------------------
+
+package_source: $(PACKAGE_SOURCE_TARGZ)
+
+$(PACKAGE_SOURCE_TARGZ): 
+	@echo "Creating temporary directory."
+	@rm -rf $(PACKAGE_TMP)
+	@install -d $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR)
+	@echo "Copying files."
+	@find . -maxdepth 1 \! -name "*$(PACKAGE_TMP)*" \! -name "." -exec cp -r \{\} $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR) \;
+	@echo "Cleaning up."
+	@$(GMAKE) -C $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR) packageclean
+	@touch $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR)/.cvsignore
+	@find $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR) -name .cvsignore -o -name CVS -o -name .arch-ids -o -name "{arch}" | xargs rm -rf
+	@cd $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR) && ./fix.sh unix
+	@echo "Creating tarball."
+	@cd $(PACKAGE_TMP) && tar cf $(PACKAGE_SOURCE_TAR) $(PACKAGE_SOURCE_DIR)
+	@echo "Compressing."
+	@gzip -9 $(PACKAGE_TMP)/$(PACKAGE_SOURCE_TAR)
+	@mv $(PACKAGE_TMP)/$(PACKAGE_SOURCE_TARGZ) .
+	@echo "Deleting temporary directory."
+	@rm -rf $(PACKAGE_TMP) 
+
+package_win32: $(PACKAGE_WIN32_ZIP)
+
+$(PACKAGE_WIN32_ZIP): $(PACKAGE_WIN32_EXE)
+	@echo "Building data."
+	@$(GMAKE) -C data
+	@echo "Building doc."
+	@$(GMAKE) -C doc
+	@echo "Creating temporary directory."
+	@rm -rf $(PACKAGE_TMP)
+	@install -d $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR)
+	@echo "Copying files."
+	@cp $(PACKAGE_WIN32_EXE) $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR)
+	@cp README $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR)/readme.txt
+	@cp README.fr $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR)/readmefr.txt
+	@cp README.de $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR)/readmede.txt
+	@cp README.dk $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR)/readmedk.txt
+	@cp COPYING $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR)/license.txt
+	@cp ChangeLog $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR)/changes.txt
+	@install -d $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR)/data
+	@cp data/liquidwar.dat $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR)/data/lw.dat
+	@install -d $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR)/custom
+	@cp -r custom/map $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR)/custom
+	@cp -r custom/texture $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR)/custom
+	@cp -r custom/music $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR)/custom
+	@install -d $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR)/doc
+	@cp -r doc/html doc/txt doc/ps doc/pdf $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR)/doc
+	@install -d $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR)/misc
+	@cp -r misc/lwserver.bat misc/lwpopup.js $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR)/misc
+	@echo "Cleaning up."
+	@touch $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR)/.cvsignore
+	@find $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR) -name .cvsignore -o -name CVS -o -name .arch-ids -o -name "{arch}" -o -name DUMMY -o -name "*.inc" -o -name "*.in" | xargs rm -rf
+	@cp fix.sh $(PACKAGE_TMP)
+	@cd $(PACKAGE_TMP)/$(PACKAGE_WIN32_DIR) && $(PACKAGE_TMP)/fix.sh dos 
+	@echo "Zipping."
+	@cd $(PACKAGE_TMP) && zip -r -9 $(PACKAGE_WIN32_ZIP) $(PACKAGE_WIN32_DIR)
+	@mv $(PACKAGE_TMP)/$(PACKAGE_WIN32_ZIP) .
+	@echo "Deleting temporary directory."
+	@rm -rf $(PACKAGE_TMP) 
+
+package_dos: $(PACKAGE_DOS_ZIP)
+
+$(PACKAGE_DOS_ZIP): $(PACKAGE_DOS_EXE) $(PACKAGE_DOS_CWSDPMI)
+	@echo "Building data."
+	@$(GMAKE) -C data
+	@echo "Building doc."
+	@$(GMAKE) -C doc
+	@echo "Creating temporary directory."
+	@rm -rf $(PACKAGE_TMP)
+	@install -d $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR)
+	@echo "Copying files."
+	@cp $(PACKAGE_DOS_EXE) $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR)
+	@cp $(PACKAGE_DOS_CWSDPMI) $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR)
+	@cp README $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR)/readme.txt
+	@cp README.fr $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR)/readmefr.txt
+	@cp README.de $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR)/readmede.txt
+	@cp README.dk $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR)/readmedk.txt
+	@cp COPYING $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR)/license.txt
+	@cp ChangeLog $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR)/changes.txt
+	@cp misc/liquidwar.ico $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR)/lw.ico
+	@install -d $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR)/data
+	@cp data/liquidwar.dat $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR)/data/lw.dat
+	@install -d $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR)/custom
+	@cp -r custom/map $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR)/custom
+	@cp -r custom/texture $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR)/custom
+	@cp -r custom/music $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR)/custom
+	@install -d $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR)/doc
+	@cp -r doc/txt $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR)/doc
+	@echo "Cleaning up."
+	@touch $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR)/.cvsignore
+	@find $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR) -name .cvsignore -o -name CVS -o -name .arch-ids -o -name "{arch}" -o -name DUMMY -o -name "*.inc" -o -name "*.in" | xargs rm -rf
+	@cp fix.sh $(PACKAGE_TMP)
+	@cd $(PACKAGE_TMP)/$(PACKAGE_DOS_DIR) && $(PACKAGE_TMP)/fix.sh dos 
+	@echo "Zipping."
+	@cd $(PACKAGE_TMP) && zip -r -9 $(PACKAGE_DOS_ZIP) $(PACKAGE_DOS_DIR)
+	@mv $(PACKAGE_TMP)/$(PACKAGE_DOS_ZIP) .
+	@echo "Deleting temporary directory."
+	@rm -rf $(PACKAGE_TMP) 
+
+package_binary: $(PACKAGE_BINARY_TGZ)
+
+$(PACKAGE_BINARY_TGZ): $(PACKAGE_SOURCE_TARGZ)
+	@echo "Checking permissions."
+	@if [ `whoami` != root ] ; then echo "You need to be root to build $@." && exit 1 ; fi
+	@echo "Creating temporary directory."
+	@rm -rf $(PACKAGE_TMP)
+	@install -d $(PACKAGE_TMP)
+	@echo "Preparing source."
+	@cp $(PACKAGE_SOURCE_TARGZ) $(PACKAGE_TMP)
+	@cd $(PACKAGE_TMP) && tar xzf $(PACKAGE_SOURCE_TARGZ)
+	@cd $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR) && ./configure --enable-static --disable-doc-info --target=$(TARGET) --prefix=$(prefix)
+	@echo "Compiling."
+	@$(GMAKE) -C $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR)
+	@echo "Cleaning up install directories."
+	@$(GMAKE) -C $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR) uninstall
+	@echo "Installing."
+	@$(GMAKE) -C $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR) install
+	@echo "Creating tarball."
+	@tar cfP $(PACKAGE_TMP)/$(PACKAGE_BINARY_TAR) $(GAMEDIR)/liquidwar $(GAMEDIR)/liquidwar-server $(GAMEDIR)/liquidwar-mapgen $(BINDIR)/liquidwar $(BINDIR)/liquidwar-server $(BINDIR)/liquidwar-mapgen $(DOCDIR) $(DATADIR) $(MANDIR)/liquidwar.6.gz $(MANDIR)/liquidwar-server.6.gz $(MANDIR)/liquidwar-mapgen.6.gz $(PIXDIR)/liquidwar.xpm $(DESKTOPDIR)/liquidwar.desktop
+	@echo "Compressing."
+	@gzip -c -9 $(PACKAGE_TMP)/$(PACKAGE_BINARY_TAR) > $(PACKAGE_BINARY_TGZ)
+	@echo "Cleaning up install directories."
+	@$(GMAKE) -C $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR) uninstall
+	@echo "Deleting temporary directory."
+	@rm -rf $(PACKAGE_TMP) 
+
+package_source_rpm: $(PACKAGE_SOURCE_RPM)
+
+$(PACKAGE_SOURCE_RPM): $(PACKAGE_SOURCE_TARGZ)
+	@echo "Checking permissions."
+	@if [ `whoami` != root ] ; then echo "You need to be root to build $@." && exit 1 ; fi
+	@echo "Building source rpm."
+	@rpm -ts --sign $(PACKAGE_SOURCE_TARGZ)
+	@echo "Copying source rpm."
+	@cp $(PACKAGE_SOURCE_RPM_TARGET)/$(PACKAGE_SOURCE_RPM) .
+
+package_binary_rpm: $(PACKAGE_BINARY_RPM)
+
+$(PACKAGE_BINARY_RPM): $(PACKAGE_SOURCE_TARGZ)
+	@echo "Checking permissions."
+	@if [ `whoami` != root ] ; then echo "You need to be root to build $@." && exit 1 ; fi
+	@echo "Building binary rpm."
+	@rpm -tb --sign --target $(TARGET) $(PACKAGE_SOURCE_TARGZ)
+	@echo "Copying binary rpm."
+	@cp $(PACKAGE_BINARY_RPM_TARGET)/$(PACKAGE_BINARY_RPM) .
+
+package_macosx_tgz: $(PACKAGE_MACOSX_TGZ)
+
+$(PACKAGE_MACOSX_TGZ): $(PACKAGE_SOURCE_TARGZ)
+	@echo "Creating temporary directory."
+	@rm -rf $(PACKAGE_TMP)
+	@install -d $(PACKAGE_TMP)
+	@echo "Preparing source."
+	@cp $(PACKAGE_SOURCE_TARGZ) $(PACKAGE_TMP)
+	@cd $(PACKAGE_TMP) && tar xzf $(PACKAGE_SOURCE_TARGZ)
+	# Static builds do not seem to work well on Mac OS X yet. 
+	#@cd $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR) && ./configure --enable-static --disable-doc-info --target=$(TARGET) --prefix=$(prefix)
+	@cd $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR) && ./configure --disable-doc-info --target=$(TARGET) --prefix=$(prefix)
+	@echo "Compiling."
+	@$(GMAKE) -C $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR)
+	@echo "Creating directory structure."
+	@install -d "$(PACKAGE_TMP)/Liquid War.app"
+	@install -d "$(PACKAGE_TMP)/Liquid War.app/Contents"
+	@install -d "$(PACKAGE_TMP)/Liquid War.app/Contents/MacOS"
+	@install -d "$(PACKAGE_TMP)/Liquid War.app/Contents/Resources"
+	@echo "Copying files."
+	@cp  $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR)/src/liquidwar "$(PACKAGE_TMP)/Liquid War.app/Contents/Resources"
+	@cp  $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR)/src/liquidwar-server "$(PACKAGE_TMP)/Liquid War.app/Contents/Resources"
+	@cp  $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR)/src/liquidwar-mapgen "$(PACKAGE_TMP)/Liquid War.app/Contents/Resources"
+	@cp  $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR)/data/liquidwar.dat "$(PACKAGE_TMP)/Liquid War.app/Contents/Resources"
+	@cp  -r $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR)/custom/map "$(PACKAGE_TMP)/Liquid War.app/Contents/Resources"
+	@cp  -r $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR)/custom/texture "$(PACKAGE_TMP)/Liquid War.app/Contents/Resources"
+	@cp  -r $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR)/custom/music "$(PACKAGE_TMP)/Liquid War.app/Contents/Resources"
+	@cp  $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR)/misc/globe.icns "$(PACKAGE_TMP)/Liquid War.app/Contents/Resources/Liquid War.icns"
+	@cp  $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR)/misc/macosx_launcher.sh "$(PACKAGE_TMP)/Liquid War.app/Contents/MacOS/Liquid War"
+	@cp  $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR)/misc/macosx_info.plist "$(PACKAGE_TMP)/Liquid War.app/Contents/Info.plist"
+	@cp  $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR)/misc/macosx_readme.rtf "$(PACKAGE_TMP)/Readme.rtf"
+	@cp  $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR)/COPYING "$(PACKAGE_TMP)/gpl.txt"
+	@cp  $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR)/doc/pdf/liquidwar.pdf "$(PACKAGE_TMP)"
+	@echo "Cleaning up."
+	@find $(PACKAGE_TMP) -name CVS -o -name .arch-ids -o -name "{arch}" | xargs rm -rf
+	@echo "Removing source."
+	@rm -rf $(PACKAGE_TMP)/$(PACKAGE_SOURCE_DIR)
+	@echo "Creating tarball."
+	@cd $(PACKAGE_TMP) && tar cf $(PACKAGE_MACOSX_TAR) *
+	@echo "Compressing."
+	@gzip -c -9 $(PACKAGE_TMP)/$(PACKAGE_MACOSX_TAR) > $(PACKAGE_MACOSX_TGZ)
+	@echo "Deleting temporary directory."
+	@rm -rf $(PACKAGE_TMP) 
+
+package_macosx_dmg: $(PACKAGE_MACOSX_DMG)
+
+$(PACKAGE_MACOSX_DMG):
+	@echo "Under construction..."
+	# There's a script which can be used to generate .dmg files on:
+	# http://www.omnigroup.com/mailman/archive/macosx-talk/2002-November/001271.html
+	# Definitely need to take a look a at it.
+

Added: unstable/liquidwar/branches/upstream/current/Makefile.win
===================================================================
--- unstable/liquidwar/branches/upstream/current/Makefile.win	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/Makefile.win	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,201 @@
+# 
+# To compile Allegro under Windows:
+# > fix msvc
+# then
+# > SET STATICLINK=1
+# > make 
+# or
+# > make STATICLINK=1
+#
+
+C_PATH=./src/
+H_PATH=./src/
+ASM_PATH=./src/
+OBJ_PATH=./src/
+RC_PATH=./src/
+OBJ_EXT=.win.o
+
+OBJ_NAMES=\
+about \
+advanced \
+alleg2 \
+area \
+army \
+asm \
+autoplay \
+back \
+basicopt \
+bigdata \
+capture \
+chat \
+checksum \
+code \
+config \
+connect \
+controls \
+cursor \
+decal \
+dialog \
+disk \
+disp \
+distor \
+dnsutil \
+error \
+exec2 \
+exit \
+fighter \
+game \
+httputil \
+gfxmode \
+grad \
+graphics \
+help \
+info \
+init \
+internet \
+joystick \
+keyboard \
+keyexch \
+lang \
+langde \
+langdk \
+langen \
+langfr \
+language \
+level \
+logcli \
+main \
+map \
+maptex \
+menu \
+mesh \
+message \
+mouse \
+move \
+music \
+mutxw32 \
+netconf \
+netkey \
+netgame \
+netmap \
+netmess \
+netplay\
+network \
+options \
+palette \
+parser \
+path \
+ping \
+pion \
+play \
+popupw32 \
+profile \
+protocol \
+random \
+rules \
+score \
+serial \
+sock2cli \
+sockex \
+sockw32 \
+sound \
+speeds \
+startinf \
+startup \
+team \
+texture \
+thrdw32 \
+ticker \
+time \
+viewport \
+volume \
+watchdog \
+wave \
+wwwcli \
+glouglou \
+monster \
+spread \
+../utils/snprintf/snprintf \
+lwwin 
+
+OBJ_NAMES_SRV=\
+basicopt \
+chat \
+dnsutil \
+execw32 \
+httputil \
+logsrv \
+netconf \
+netkey \
+netmap \
+netmess \
+parser \
+serial \
+server \
+sock2srv \
+sockex \
+sockw32 \
+srvchan \
+srvcont \
+srvteam \
+srvtime \
+startinf \
+thrdw32 \
+wwwsrv \
+../utils/snprintf/snprintf
+
+OBJ_NAMES_MAPGEN=\
+../utils/lwmapgen/big_quad \
+../utils/lwmapgen/boxes \
+../utils/lwmapgen/bubbles \
+../utils/lwmapgen/circles \
+../utils/lwmapgen/circuit \
+../utils/lwmapgen/cut \
+../utils/lwmapgen/func \
+../utils/lwmapgen/hole \
+../utils/lwmapgen/lines \
+../utils/lwmapgen/main \
+../utils/lwmapgen/map \
+../utils/lwmapgen/map_generator \
+../utils/lwmapgen/misc \
+../utils/lwmapgen/rand_box \
+../utils/lwmapgen/rand_func \
+../utils/lwmapgen/rand_poly \
+../utils/lwmapgen/rand_poly_cut \
+../utils/lwmapgen/street \
+../utils/lwmapgen/worms 
+       
+OBJ_FILES=$(addprefix $(OBJ_PATH),$(addsuffix $(OBJ_EXT),$(OBJ_NAMES)))
+
+OBJ_FILES_SRV=$(addprefix $(OBJ_PATH),$(addsuffix $(OBJ_EXT),$(OBJ_NAMES_SRV)))
+
+OBJ_FILES_MAPGEN=$(addprefix $(OBJ_PATH),$(addsuffix $(OBJ_EXT),$(OBJ_NAMES_MAPGEN)))
+
+C_FLAGS=-O3 -fomit-frame-pointer -I$(H_PATH)
+C_COMPILE=runner cl @  -nologo -DALLEGRO_STATICLINK -DWIN32 -DASM -DSNPRINTF -W1 -Gd -Ox -GB -MD -Fo$@ -c $<
+ASM_COMPILE=gcc -D_MSC_VER -D_WIN32 -D_M_IX86 -U__GNUC__ -UDJGPP -Wall -x assembler-with-cpp -o $@ -c $<
+RC_COMPILE=rc -Fo$@ $<
+
+all: lwwin.exe lwwinsrv.exe lwwinmap.exe
+
+$(OBJ_PATH)%$(OBJ_EXT): $(C_PATH)%.c
+	$(C_COMPILE)
+
+$(OBJ_PATH)%$(OBJ_EXT): $(ASM_PATH)%.s
+	$(ASM_COMPILE)
+
+$(OBJ_PATH)%$(OBJ_EXT): $(RC_PATH)%.rc
+	$(RC_COMPILE)
+
+
+lwwin.exe: $(OBJ_FILES)
+	runner link @ -nologo -release -subsystem:windows -out:$@ $(OBJ_FILES) alleg_s.lib kernel32.lib user32.lib gdi32.lib ole32.lib dinput.lib ddraw.lib dxguid.lib winmm.lib dsound.lib wsock32.lib
+
+lwwinsrv.exe: $(OBJ_FILES_SRV)
+	runner link @ -nologo -release -subsystem:console -out:$@ $(OBJ_FILES_SRV) wsock32.lib
+
+lwwinmap.exe: $(OBJ_FILES_MAPGEN)
+	runner link @ -nologo -release -subsystem:console -out:$@ $(OBJ_FILES_MAPGEN) alleg_s.lib kernel32.lib user32.lib gdi32.lib ole32.lib dinput.lib ddraw.lib dxguid.lib winmm.lib dsound.lib 
+
+
+

Added: unstable/liquidwar/branches/upstream/current/README
===================================================================
--- unstable/liquidwar/branches/upstream/current/README	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/README	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,37 @@
+Liquid War is a unique multiplayer wargame. Its rules are
+truely original and have been invented by Thomas Colcombet.
+You control an army of liquid and have to try and eat your
+opponents. A single player mode is available, but the game is
+definitely designed to be multiplayer, and has network support.
+
+Liquid War homepage : http://www.ufoot.org/liquidwar
+Contact author      : ufoot at ufoot.org
+
+If you have any questions or remarks about Liquid War, you can
+get help and informations on the Liquid War user mailing list:
+
+http://mail.nongnu.org/mailman/listinfo/liquidwar-user
+
+Have a good day,
+
+U-Foot
+
+
+----------------- L E G A L     I N F O R M A T I O N ----------------
+
+Liquid War is a multiplayer wargame.
+Copyright (C) 1998-2005 Christian Mauduit (ufoot at ufoot.org)
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software 
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA

Added: unstable/liquidwar/branches/upstream/current/README.de
===================================================================
--- unstable/liquidwar/branches/upstream/current/README.de	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/README.de	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,34 @@
+Liquid War ist ein einzigartiges Kriegsspiel für mehrere Spieler. Die 
+Regeln sind wahrhaft neuartig und wurden von Thomas Colcombet entwickelt. 
+Man steuert eine flüssige Armee und muss versuchen die Gegner aufzufressen. 
+Es gibt einen Einzelspielermodus, aber das Spiel ist eindeutig auf mehrere 
+Spieler ausgelegt und unterstützt das Spielen über Netzwerk.
+
+Homepage     : http://www.ufoot.org/liquidwar
+Autor        : ufoot at ufoot.org
+Mailingliste : http://mail.nongnu.org/mailman/listinfo/liquidwar-user (*)
+
+(*) auf Englisch!
+
+
+----------- W I C H T I G E     I N F O R M A T I O N E N ------------
+
+Liquid War is ein Kriegspiel für mehrere.
+Copyright (C) 1998-2005 Christian Mauduit (ufoot at ufoot.org)
+
+Dieses Programm ist freie Software. Sie können es unter den
+Bedingungen der GNU General Public License, wie von der Free
+Software Foundation veröffentlicht, weitergeben und/oder
+modifizieren, entweder gemäß Version 2 der Lizenz oder (nach Ihrer
+Option) jeder späteren Version.
+
+Die Veröffentlichung dieses Programms erfolgt in der Hoffnung, daß
+es Ihnen von Nutzen sein wird, aber OHNE IRGENDEINE GARANTIE, sogar
+ohne die implizite Garantie der MARKTREIFE oder der VERWENDBARKEIT
+FÜR EINEN BESTIMMTEN ZWECK. Details finden Sie in der GNU General
+Public License.
+
+Sie sollten eine Kopie der GNU General Public License zusammen mit
+diesem Programm erhalten haben. Falls nicht, schreiben Sie an die
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+MA 02111-1307, USA.

Added: unstable/liquidwar/branches/upstream/current/README.dk
===================================================================
--- unstable/liquidwar/branches/upstream/current/README.dk	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/README.dk	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,31 @@
+Liquid war er et unikt multiplayer krigsspil. Reglerne er
+uhyre originale og er opfundet af Thomas Colcombet. Du styrer
+en hær af væske og skal prøve at æde dine modstandere.
+Liquid War kan spilles alene, men er helt afgjort designet
+til multiplayer, og har netværks-support.
+
+Hjemmeside   : http://www.ufoot.org/liquidwar
+Programmør   : ufoot at ufoot.org
+Mailing list : http://mail.nongnu.org/mailman/listinfo/liquidwar-user
+
+
+
+----------------- L E G A L     I N F O R M A T I O N ----------------
+
+Liquid War er et flerpersoners krigsspil.
+Copyright (C) 1998-2005 Christian Mauduit (ufoot at ufoot.org)
+
+Dette program er frit software; Du kan kopiere og aendre det under
+betingelserne i GNU General Public License, udgivet af Free Software
+Foundation; enten version 2 af Licensen, eller (dit valg) hvilken
+som helst senere version.
+
+Dette program er udgivet i haabet om at det er brugbart, men UDEN
+NOGEN SOM HELST GARANTI; ikke engang nogen indforstaaet garanti for
+BRUGBARHED eller BRUGBARHED TIL ET SPECIFIKT FORMAAL. Laes GNU
+General Public License for flere detaljer.
+
+Du skulle have modtaget en kopi af GNU General Public License sammen
+med dette program; hvis ikke, skriv til Free Software Foundation,
+Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+

Added: unstable/liquidwar/branches/upstream/current/README.fr
===================================================================
--- unstable/liquidwar/branches/upstream/current/README.fr	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/README.fr	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,38 @@
+Liquid War est un "wargame" multijoueur inédit. Ses règles sont vraiment
+originales et ont été inventées par Thomas Colcombet. L'idée est de 
+contrôler une armée de liquide et d'essayer de "manger" ses adversaires.
+Il est possible de jouer seul, mais le jeux est conçu pour se jouer à 
+plusieurs, un mode réseau étant disponible.
+
+Site web de Liquid War  : http://www.ufoot.org/liquidwar
+Pour contacter l'auteur : ufoot at ufoot.org
+
+Si vous avez des questions ou des remarques à propos de Liquid War,
+vous pouvez obtenir de l'aide et des infos sur la liste de diffusion
+"Liquid War user", mais attention, on y parle anglais :
+
+http://mail.nongnu.org/mailman/listinfo/liquidwar-user
+
+Bonne journée,
+
+U-Foot
+
+
+-------------- I N F O R M A T I O N S     L E G A L E S -------------
+
+Liquid War est un "wargame" multijoueur.
+Copyright (C) 1998-2005 Christian Mauduit (ufoot at ufoot.org)
+
+Ce programme est un logiciel libre ; vous pouvez le redistribuer et/ou le 
+modifier conformément aux dispositions de la Licence Publique Générale GNU, 
+telle que publiée par la Free Software Foundation ; version 2 de la licence, 
+ou encore (à votre choix) toute version ultérieure.
+	          
+Ce programme est distribué dans l'espoir qu'il sera utile, mais SANS AUCUNE 
+GARANTIE ; sans même la garantie implicite de COMMERCIALISATION ou 
+D'ADAPTATION A UN OBJET PARTICULIER. Pour plus de détail, voir la Licence 
+Publique Générale GNU .
+
+Vous devez avoir reçu un exemplaire de la Licence Publique Générale GNU en 
+même temps que ce programme ; si ce n'est pas le cas, écrivez à la Free 
+Software Foundation Inc., 675 Mass Ave, Cambridge, MA 02139, Etats-Unis.

Added: unstable/liquidwar/branches/upstream/current/config.guess
===================================================================
--- unstable/liquidwar/branches/upstream/current/config.guess	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/config.guess	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,1320 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002 Free Software Foundation, Inc.
+
+timestamp='2002-03-20'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Per Bothner <per at bothner.com>.
+# Please send patches to <config-patches at gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit 0 ;;
+    --version | -v )
+       echo "$version" ; exit 0 ;;
+    --help | --h* | -h )
+       echo "$usage"; exit 0 ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+
+dummy=dummy-$$
+trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script.
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int dummy(){}" > $dummy.c ;
+	for c in cc gcc c89 c99 ; do
+	  ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
+	  if test $? = 0 ; then
+	     CC_FOR_BUILD="$c"; break ;
+	  fi ;
+	done ;
+	rm -f $dummy.c $dummy.o $dummy.rel ;
+	if test x"$CC_FOR_BUILD" = x ; then
+	  CC_FOR_BUILD=no_compiler_found ;
+	fi
+	;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi at noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+	PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    *:NetBSD:*:*)
+	# NetBSD (nbsd) targets should (where applicable) match one or
+	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+	# switched to ELF, *-*-netbsd* would select the old
+	# object file format.  This provides both forward
+	# compatibility and a consistent mechanism for selecting the
+	# object file format.
+	#
+	# Note: NetBSD doesn't particularly care about the vendor
+	# portion of the name.  We always set it to "unknown".
+	sysctl="sysctl -n hw.machine_arch"
+	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	case "${UNAME_MACHINE_ARCH}" in
+	    arm*) machine=arm-unknown ;;
+	    sh3el) machine=shl-unknown ;;
+	    sh3eb) machine=sh-unknown ;;
+	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+	esac
+	# The Operating System including object format, if it has switched
+	# to ELF recently, or will in the future.
+	case "${UNAME_MACHINE_ARCH}" in
+	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+		eval $set_cc_for_build
+		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+			| grep __ELF__ >/dev/null
+		then
+		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+		    # Return netbsd for either.  FIX?
+		    os=netbsd
+		else
+		    os=netbsdelf
+		fi
+		;;
+	    *)
+	        os=netbsd
+		;;
+	esac
+	# The OS release
+	release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+	# contains redundant information, the shorter form:
+	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+	echo "${machine}-${os}${release}"
+	exit 0 ;;
+    amiga:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    arc:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    hp300:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mac68k:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    macppc:OpenBSD:*:*)
+	echo powerpc-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvme68k:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvme88k:OpenBSD:*:*)
+	echo m88k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvmeppc:OpenBSD:*:*)
+	echo powerpc-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    pmax:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    sgi:OpenBSD:*:*)
+	echo mipseb-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    sun3:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    wgrisc:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    *:OpenBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    alpha:OSF1:*:*)
+	if test $UNAME_RELEASE = "V4.0"; then
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+	fi
+	# A Vn.n version is a released version.
+	# A Tn.n version is a released field test version.
+	# A Xn.n version is an unreleased experimental baselevel.
+	# 1.2 uses "1.2" for uname -r.
+	cat <<EOF >$dummy.s
+	.data
+\$Lformat:
+	.byte 37,100,45,37,120,10,0	# "%d-%x\n"
+
+	.text
+	.globl main
+	.align 4
+	.ent main
+main:
+	.frame \$30,16,\$26,0
+	ldgp \$29,0(\$27)
+	.prologue 1
+	.long 0x47e03d80 # implver \$0
+	lda \$2,-1
+	.long 0x47e20c21 # amask \$2,\$1
+	lda \$16,\$Lformat
+	mov \$0,\$17
+	not \$1,\$18
+	jsr \$26,printf
+	ldgp \$29,0(\$26)
+	mov 0,\$16
+	jsr \$26,exit
+	.end main
+EOF
+	eval $set_cc_for_build
+	$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
+	if test "$?" = 0 ; then
+		case `./$dummy` in
+			0-0)
+				UNAME_MACHINE="alpha"
+				;;
+			1-0)
+				UNAME_MACHINE="alphaev5"
+				;;
+			1-1)
+				UNAME_MACHINE="alphaev56"
+				;;
+			1-101)
+				UNAME_MACHINE="alphapca56"
+				;;
+			2-303)
+				UNAME_MACHINE="alphaev6"
+				;;
+			2-307)
+				UNAME_MACHINE="alphaev67"
+				;;
+			2-1307)
+				UNAME_MACHINE="alphaev68"
+				;;
+		esac
+	fi
+	rm -f $dummy.s $dummy
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	exit 0 ;;
+    Alpha\ *:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# Should we change UNAME_MACHINE based on the output of uname instead
+	# of the specific Alpha model?
+	echo alpha-pc-interix
+	exit 0 ;;
+    21064:Windows_NT:50:3)
+	echo alpha-dec-winnt3.5
+	exit 0 ;;
+    Amiga*:UNIX_System_V:4.0:*)
+	echo m68k-unknown-sysv4
+	exit 0;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit 0 ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-morphos
+	exit 0 ;;
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
+	exit 0 ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+	echo arm-acorn-riscix${UNAME_RELEASE}
+	exit 0;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+	echo hppa1.1-hitachi-hiuxmpp
+	exit 0;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+	# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+	if test "`(/bin/universe) 2>/dev/null`" = att ; then
+		echo pyramid-pyramid-sysv3
+	else
+		echo pyramid-pyramid-bsd
+	fi
+	exit 0 ;;
+    NILE*:*:*:dcosx)
+	echo pyramid-pyramid-svr4
+	exit 0 ;;
+    sun4H:SunOS:5.*:*)
+	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    i86pc:SunOS:5.*:*)
+	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    sun4*:SunOS:6*:*)
+	# According to config.sub, this is the proper way to canonicalize
+	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+	# it's likely to be more like Solaris than SunOS4.
+	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    sun4*:SunOS:*:*)
+	case "`/usr/bin/arch -k`" in
+	    Series*|S4*)
+		UNAME_RELEASE=`uname -v`
+		;;
+	esac
+	# Japanese Language versions have a version number like `4.1.3-JL'.
+	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	exit 0 ;;
+    sun3*:SunOS:*:*)
+	echo m68k-sun-sunos${UNAME_RELEASE}
+	exit 0 ;;
+    sun*:*:4.2BSD:*)
+	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+	case "`/bin/arch`" in
+	    sun3)
+		echo m68k-sun-sunos${UNAME_RELEASE}
+		;;
+	    sun4)
+		echo sparc-sun-sunos${UNAME_RELEASE}
+		;;
+	esac
+	exit 0 ;;
+    aushp:SunOS:*:*)
+	echo sparc-auspex-sunos${UNAME_RELEASE}
+	exit 0 ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit 0 ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+        exit 0 ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit 0 ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit 0 ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit 0 ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit 0 ;;
+    powerpc:machten:*:*)
+	echo powerpc-apple-machten${UNAME_RELEASE}
+	exit 0 ;;
+    RISC*:Mach:*:*)
+	echo mips-dec-mach_bsd4.3
+	exit 0 ;;
+    RISC*:ULTRIX:*:*)
+	echo mips-dec-ultrix${UNAME_RELEASE}
+	exit 0 ;;
+    VAX*:ULTRIX*:*:*)
+	echo vax-dec-ultrix${UNAME_RELEASE}
+	exit 0 ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+	echo clipper-intergraph-clix${UNAME_RELEASE}
+	exit 0 ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+	int main (int argc, char *argv[]) {
+#else
+	int main (argc, argv) int argc; char *argv[]; {
+#endif
+	#if defined (host_mips) && defined (MIPSEB)
+	#if defined (SYSTYPE_SYSV)
+	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_SVR4)
+	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+	#endif
+	#endif
+	  exit (-1);
+	}
+EOF
+	$CC_FOR_BUILD $dummy.c -o $dummy \
+	  && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+	  && rm -f $dummy.c $dummy && exit 0
+	rm -f $dummy.c $dummy
+	echo mips-mips-riscos${UNAME_RELEASE}
+	exit 0 ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit 0 ;;
+    Night_Hawk:Power_UNIX:*:*)
+	echo powerpc-harris-powerunix
+	exit 0 ;;
+    m88k:CX/UX:7*:*)
+	echo m88k-harris-cxux7
+	exit 0 ;;
+    m88k:*:4*:R4*)
+	echo m88k-motorola-sysv4
+	exit 0 ;;
+    m88k:*:3*:R3*)
+	echo m88k-motorola-sysv3
+	exit 0 ;;
+    AViiON:dgux:*:*)
+        # DG/UX returns AViiON for all architectures
+        UNAME_PROCESSOR=`/usr/bin/uname -p`
+	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	then
+	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    then
+		echo m88k-dg-dgux${UNAME_RELEASE}
+	    else
+		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+	    fi
+	else
+	    echo i586-dg-dgux${UNAME_RELEASE}
+	fi
+ 	exit 0 ;;
+    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
+	echo m88k-dolphin-sysv3	exit 0 ;;
+    M88*:*:R3*:*)
+	# Delta 88k system running SVR3
+	echo m88k-motorola-sysv3
+	exit 0 ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+	echo m88k-tektronix-sysv3
+	exit 0 ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+	echo m68k-tektronix-bsd
+	exit 0 ;;
+    *:IRIX*:*:*)
+	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	exit 0 ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
+	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+	echo i386-ibm-aix
+	exit 0 ;;
+    ia64:AIX:*:*)
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	exit 0 ;;
+    *:AIX:2:3)
+	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+		eval $set_cc_for_build
+		sed 's/^		//' << EOF >$dummy.c
+		#include <sys/systemcfg.h>
+
+		main()
+			{
+			if (!__power_pc())
+				exit(1);
+			puts("powerpc-ibm-aix3.2.5");
+			exit(0);
+			}
+EOF
+		$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
+		rm -f $dummy.c $dummy
+		echo rs6000-ibm-aix3.2.5
+	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+		echo rs6000-ibm-aix3.2.4
+	else
+		echo rs6000-ibm-aix3.2
+	fi
+	exit 0 ;;
+    *:AIX:*:[45])
+	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+		IBM_ARCH=rs6000
+	else
+		IBM_ARCH=powerpc
+	fi
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+	exit 0 ;;
+    *:AIX:*:*)
+	echo rs6000-ibm-aix
+	exit 0 ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+	echo romp-ibm-bsd4.4
+	exit 0 ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	exit 0 ;;                           # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+	echo rs6000-bull-bosx
+	exit 0 ;;
+    DPX/2?00:B.O.S.:*:*)
+	echo m68k-bull-sysv3
+	exit 0 ;;
+    9000/[34]??:4.3bsd:1.*:*)
+	echo m68k-hp-bsd
+	exit 0 ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+	echo m68k-hp-bsd4.4
+	exit 0 ;;
+    9000/[34678]??:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	case "${UNAME_MACHINE}" in
+	    9000/31? )            HP_ARCH=m68000 ;;
+	    9000/[34]?? )         HP_ARCH=m68k ;;
+	    9000/[678][0-9][0-9])
+		if [ -x /usr/bin/getconf ]; then
+		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                    case "${sc_cpu_version}" in
+                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH="hppa2.0n" ;;
+                          64) HP_ARCH="hppa2.0w" ;;
+			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+                        esac ;;
+                    esac
+		fi
+		if [ "${HP_ARCH}" = "" ]; then
+		    eval $set_cc_for_build
+		    sed 's/^              //' << EOF >$dummy.c
+
+              #define _HPUX_SOURCE
+              #include <stdlib.h>
+              #include <unistd.h>
+
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits = sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  = sysconf (_SC_CPU_VERSION);
+
+                  switch (cpu)
+              	{
+              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+              	case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+              	    switch (bits)
+              		{
+              		case 64: puts ("hppa2.0w"); break;
+              		case 32: puts ("hppa2.0n"); break;
+              		default: puts ("hppa2.0"); break;
+              		} break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+              	    puts ("hppa2.0"); break;
+              #endif
+              	default: puts ("hppa1.0"); break;
+              	}
+                  exit (0);
+              }
+EOF
+		    (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
+		    if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
+		    rm -f $dummy.c $dummy
+		fi ;;
+	esac
+	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	exit 0 ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit 0 ;;
+    3050*:HI-UX:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <unistd.h>
+	int
+	main ()
+	{
+	  long cpu = sysconf (_SC_CPU_VERSION);
+	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+	     results, however.  */
+	  if (CPU_IS_PA_RISC (cpu))
+	    {
+	      switch (cpu)
+		{
+		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+		  default: puts ("hppa-hitachi-hiuxwe2"); break;
+		}
+	    }
+	  else if (CPU_IS_HP_MC68K (cpu))
+	    puts ("m68k-hitachi-hiuxwe2");
+	  else puts ("unknown-hitachi-hiuxwe2");
+	  exit (0);
+	}
+EOF
+	$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
+	rm -f $dummy.c $dummy
+	echo unknown-hitachi-hiuxwe2
+	exit 0 ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+	echo hppa1.1-hp-bsd
+	exit 0 ;;
+    9000/8??:4.3bsd:*:*)
+	echo hppa1.0-hp-bsd
+	exit 0 ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+	echo hppa1.0-hp-mpeix
+	exit 0 ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+	echo hppa1.1-hp-osf
+	exit 0 ;;
+    hp8??:OSF1:*:*)
+	echo hppa1.0-hp-osf
+	exit 0 ;;
+    i*86:OSF1:*:*)
+	if [ -x /usr/sbin/sysversion ] ; then
+	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	else
+	    echo ${UNAME_MACHINE}-unknown-osf1
+	fi
+	exit 0 ;;
+    parisc*:Lites*:*:*)
+	echo hppa1.1-hp-lites
+	exit 0 ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+	echo c1-convex-bsd
+        exit 0 ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+        exit 0 ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+	echo c34-convex-bsd
+        exit 0 ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+	echo c38-convex-bsd
+        exit 0 ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+	echo c4-convex-bsd
+        exit 0 ;;
+    CRAY*Y-MP:*:*:*)
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*[A-Z]90:*:*:*)
+	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+	      -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*TS:*:*:*)
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*T3D:*:*:*)
+	echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        exit 0 ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	exit 0 ;;
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	exit 0 ;;
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	exit 0 ;;
+    *:FreeBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit 0 ;;
+    i*:CYGWIN*:*)
+	echo ${UNAME_MACHINE}-pc-cygwin
+	exit 0 ;;
+    i*:MINGW*:*)
+	echo ${UNAME_MACHINE}-pc-mingw32
+	exit 0 ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit 0 ;;
+    x86:Interix*:3*)
+	echo i386-pc-interix3
+	exit 0 ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+	# UNAME_MACHINE based on the output of uname instead of i386?
+	echo i386-pc-interix
+	exit 0 ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit 0 ;;
+    p*:CYGWIN*:*)
+	echo powerpcle-unknown-cygwin
+	exit 0 ;;
+    prep*:SunOS:5.*:*)
+	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    *:GNU:*:*)
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	exit 0 ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit 0 ;;
+    arm*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    mips:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef mips
+	#undef mipsel
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=mipsel
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=mips
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+	rm -f $dummy.c
+	test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
+	;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
+	exit 0 ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit 0 ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
+        esac
+	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit 0 ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+	# Look for CPU level
+	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+	  *)    echo hppa-unknown-linux-gnu ;;
+	esac
+	exit 0 ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
+	exit 0 ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit 0 ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    x86_64:Linux:*:*)
+	echo x86_64-unknown-linux-gnu
+	exit 0 ;;
+    i*86:Linux:*:*)
+	# The BFD linker knows what the default object file format is, so
+	# first see if it will tell us. cd to the root directory to prevent
+	# problems with other programs or directories called `ld' in the path.
+	# Set LC_ALL=C to ensure ld outputs messages in English.
+	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+			 | sed -ne '/supported targets:/!d
+				    s/[ 	][ 	]*/ /g
+				    s/.*supported targets: *//
+				    s/ .*//
+				    p'`
+        case "$ld_supported_targets" in
+	  elf32-i386)
+		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+		;;
+	  a.out-i386-linux)
+		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+		exit 0 ;;		
+	  coff-i386)
+		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+		exit 0 ;;
+	  "")
+		# Either a pre-BFD a.out linker (linux-gnuoldld) or
+		# one that does not give us useful --help.
+		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+		exit 0 ;;
+	esac
+	# Determine whether the default compiler is a.out or elf
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <features.h>
+	#ifdef __ELF__
+	# ifdef __GLIBC__
+	#  if __GLIBC__ >= 2
+	LIBC=gnu
+	#  else
+	LIBC=gnulibc1
+	#  endif
+	# else
+	LIBC=gnulibc1
+	# endif
+	#else
+	#ifdef __INTEL_COMPILER
+	LIBC=gnu
+	#else
+	LIBC=gnuaout
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+	rm -f $dummy.c
+	test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
+	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+	;;
+    i*86:DYNIX/ptx:4*:*)
+	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+	# earlier versions are messed up and put the nodename in both
+	# sysname and nodename.
+	echo i386-sequent-sysv4
+	exit 0 ;;
+    i*86:UNIX_SV:4.2MP:2.*)
+        # Unixware is an offshoot of SVR4, but it has its own version
+        # number series starting with 2...
+        # I am not positive that other SVR4 systems won't match this,
+	# I just have to hope.  -- rms.
+        # Use sysv4.2uw... so that sysv4* matches it.
+	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	exit 0 ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+	else
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+	fi
+	exit 0 ;;
+    i*86:*:5:[78]*)
+	case `/bin/uname -X | grep "^Machine"` in
+	    *486*)	     UNAME_MACHINE=i486 ;;
+	    *Pentium)	     UNAME_MACHINE=i586 ;;
+	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+	esac
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	exit 0 ;;
+    i*86:*:3.2:*)
+	if test -f /usr/options/cb.name; then
+		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+	elif /bin/uname -X 2>/dev/null >/dev/null ; then
+		UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
+		(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
+		(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+			&& UNAME_MACHINE=i586
+		(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+	else
+		echo ${UNAME_MACHINE}-pc-sysv32
+	fi
+	exit 0 ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit 0 ;;
+    pc:*:*:*)
+	# Left here for compatibility:
+        # uname -m prints for DJGPP always 'pc', but it prints nothing about
+        # the processor, so we play safe by assuming i386.
+	echo i386-pc-msdosdjgpp
+        exit 0 ;;
+    Intel:Mach:3*:*)
+	echo i386-pc-mach3
+	exit 0 ;;
+    paragon:*:*:*)
+	echo i860-intel-osf1
+	exit 0 ;;
+    i860:*:4.*:*) # i860-SVR4
+	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+	else # Add other i860-SVR4 vendors below as they are discovered.
+	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	fi
+	exit 0 ;;
+    mini*:CTIX:SYS*5:*)
+	# "miniframe"
+	echo m68010-convergent-sysv
+	exit 0 ;;
+    M68*:*:R3V[567]*:*)
+	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
+	OS_REL=''
+	test -r /etc/.relid \
+	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	  && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && echo i486-ncr-sysv4 && exit 0 ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    mc68030:UNIX_System_V:4.*:*)
+	echo m68k-atari-sysv4
+	exit 0 ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    TSUNAMI:LynxOS:2.*:*)
+	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    rs6000:LynxOS:2.*:*)
+	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    SM[BE]S:UNIX_SV:*:*)
+	echo mips-dde-sysv${UNAME_RELEASE}
+	exit 0 ;;
+    RM*:ReliantUNIX-*:*:*)
+	echo mips-sni-sysv4
+	exit 0 ;;
+    RM*:SINIX-*:*:*)
+	echo mips-sni-sysv4
+	exit 0 ;;
+    *:SINIX-*:*:*)
+	if uname -p 2>/dev/null >/dev/null ; then
+		UNAME_MACHINE=`(uname -p) 2>/dev/null`
+		echo ${UNAME_MACHINE}-sni-sysv4
+	else
+		echo ns32k-sni-sysv
+	fi
+	exit 0 ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel at ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit 0 ;;
+    *:UNIX_System_V:4*:FTX*)
+	# From Gerald Hewes <hewes at openmarket.com>.
+	# How about differentiating between stratus architectures? -djm
+	echo hppa1.1-stratus-sysv4
+	exit 0 ;;
+    *:*:*:FTX*)
+	# From seanf at swdc.stratus.com.
+	echo i860-stratus-sysv4
+	exit 0 ;;
+    *:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo hppa1.1-stratus-vos
+	exit 0 ;;
+    mc68*:A/UX:*:*)
+	echo m68k-apple-aux${UNAME_RELEASE}
+	exit 0 ;;
+    news*:NEWS-OS:6*:*)
+	echo mips-sony-newsos6
+	exit 0 ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+	if [ -d /usr/nec ]; then
+	        echo mips-nec-sysv${UNAME_RELEASE}
+	else
+	        echo mips-unknown-sysv${UNAME_RELEASE}
+	fi
+        exit 0 ;;
+    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
+	echo powerpc-be-beos
+	exit 0 ;;
+    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
+	echo powerpc-apple-beos
+	exit 0 ;;
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+	echo i586-pc-beos
+	exit 0 ;;
+    SX-4:SUPER-UX:*:*)
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit 0 ;;
+    SX-5:SUPER-UX:*:*)
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit 0 ;;
+    Power*:Rhapsody:*:*)
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	exit 0 ;;
+    *:Rhapsody:*:*)
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	exit 0 ;;
+    *:Darwin:*:*)
+	echo `uname -p`-apple-darwin${UNAME_RELEASE}
+	exit 0 ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+	UNAME_PROCESSOR=`uname -p`
+	if test "$UNAME_PROCESSOR" = "x86"; then
+		UNAME_PROCESSOR=i386
+		UNAME_MACHINE=pc
+	fi
+	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+	exit 0 ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit 0 ;;
+    NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit 0 ;;
+    *:NonStop-UX:*:*)
+	echo mips-compaq-nonstopux
+	exit 0 ;;
+    BS2000:POSIX*:*:*)
+	echo bs2000-siemens-sysv
+	exit 0 ;;
+    DS/*:UNIX_System_V:*:*)
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit 0 ;;
+    *:Plan9:*:*)
+	# "uname -m" is not consistent, so use $cputype instead. 386
+	# is converted to i386 for consistency with other x86
+	# operating systems.
+	if test "$cputype" = "386"; then
+	    UNAME_MACHINE=i386
+	else
+	    UNAME_MACHINE="$cputype"
+	fi
+	echo ${UNAME_MACHINE}-unknown-plan9
+	exit 0 ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit 0 ;;
+    *:TOPS-10:*:*)
+	echo pdp10-unknown-tops10
+	exit 0 ;;
+    *:TENEX:*:*)
+	echo pdp10-unknown-tenex
+	exit 0 ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+	echo pdp10-dec-tops20
+	exit 0 ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+	echo pdp10-xkl-tops20
+	exit 0 ;;
+    *:TOPS-20:*:*)
+	echo pdp10-unknown-tops20
+	exit 0 ;;
+    *:ITS:*:*)
+	echo pdp10-unknown-its
+	exit 0 ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit 0 ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+          "4"
+#else
+	  ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+	printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+	printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
+rm -f $dummy.c $dummy
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+	echo c1-convex-bsd
+	exit 0 ;;
+    c2*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit 0 ;;
+    c34*)
+	echo c34-convex-bsd
+	exit 0 ;;
+    c38*)
+	echo c38-convex-bsd
+	exit 0 ;;
+    c4*)
+	echo c4-convex-bsd
+	exit 0 ;;
+    esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+    ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches at gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:


Property changes on: unstable/liquidwar/branches/upstream/current/config.guess
___________________________________________________________________
Name: svn:executable
   + 

Added: unstable/liquidwar/branches/upstream/current/config.sub
===================================================================
--- unstable/liquidwar/branches/upstream/current/config.sub	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/config.sub	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,1443 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002 Free Software Foundation, Inc.
+
+timestamp='2002-03-07'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Please send patches to <config-patches at gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit 0 ;;
+    --version | -v )
+       echo "$version" ; exit 0 ;;
+    --help | --h* | -h )
+       echo "$usage"; exit 0 ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit 0;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+	-sun*os*)
+		# Prevent following clause from handling this invalid input.
+		;;
+	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+	-apple | -axis)
+		os=
+		basic_machine=$1
+		;;
+	-sim | -cisco | -oki | -wec | -winbond)
+		os=
+		basic_machine=$1
+		;;
+	-scout)
+		;;
+	-wrs)
+		os=-vxworks
+		basic_machine=$1
+		;;
+	-chorusos*)
+		os=-chorusos
+		basic_machine=$1
+		;;
+ 	-chorusrdb)
+ 		os=-chorusrdb
+		basic_machine=$1
+ 		;;
+	-hiux*)
+		os=-hiuxwe2
+		;;
+	-sco5)
+		os=-sco3.2v5
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco4)
+		os=-sco3.2v4
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2.[4-9]*)
+		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2v[4-9]*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco*)
+		os=-sco3.2v2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-udk*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-isc)
+		os=-isc2.2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-clix*)
+		basic_machine=clipper-intergraph
+		;;
+	-isc*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-lynx*)
+		os=-lynxos
+		;;
+	-ptx*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+		;;
+	-windowsnt*)
+		os=`echo $os | sed -e 's/windowsnt/winnt/'`
+		;;
+	-psos*)
+		os=-psos
+		;;
+	-mint | -mint[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+	# Recognize the basic CPU types without company name.
+	# Some are omitted here because they have special meanings below.
+	1750a | 580 \
+	| a29k \
+	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+	| c4x | clipper \
+	| d10v | d30v | dsp16xx \
+	| fr30 \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| m32r | m68000 | m68k | m88k | mcore \
+	| mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \
+	| mips64vr4100 | mips64vr4100el | mips64vr4300 \
+	| mips64vr4300el | mips64vr5000 | mips64vr5000el \
+	| mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
+	| mipsisa32 | mipsisa64 \
+	| mn10200 | mn10300 \
+	| ns16k | ns32k \
+	| openrisc | or32 \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| pyramid \
+	| sh | sh[34] | sh[34]eb | shbe | shle | sh64 \
+	| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
+	| strongarm \
+	| tahoe | thumb | tic80 | tron \
+	| v850 | v850e \
+	| we32k \
+	| x86 | xscale | xstormy16 | xtensa \
+	| z8k)
+		basic_machine=$basic_machine-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12)
+		# Motorola 68HC11/12.
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+		;;
+
+	# We use `pc' rather than `unknown'
+	# because (1) that's what they normally are, and
+	# (2) the word "unknown" tends to confuse beginning users.
+	i*86 | x86_64)
+	  basic_machine=$basic_machine-pc
+	  ;;
+	# Object if more than one company name word.
+	*-*-*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+	# Recognize the basic CPU types with company name.
+	580-* \
+	| a29k-* \
+	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| arm-*  | armbe-* | armle-* | armv*-* \
+	| avr-* \
+	| bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c54x-* \
+	| clipper-* | cydra-* \
+	| d10v-* | d30v-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fr30-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| m32r-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | mcore-* \
+	| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
+	| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
+	| mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| pyramid-* \
+	| romp-* | rs6000-* \
+	| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \
+	| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+	| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+	| tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
+	| v850-* | v850e-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+	| xtensa-* \
+	| ymp-* \
+	| z8k-*)
+		;;
+	# Recognize the various machine names and aliases which stand
+	# for a CPU type and a company and sometimes even an OS.
+	386bsd)
+		basic_machine=i386-unknown
+		os=-bsd
+		;;
+	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+		basic_machine=m68000-att
+		;;
+	3b*)
+		basic_machine=we32k-att
+		;;
+	a29khif)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	adobe68k)
+		basic_machine=m68010-adobe
+		os=-scout
+		;;
+	alliant | fx80)
+		basic_machine=fx80-alliant
+		;;
+	altos | altos3068)
+		basic_machine=m68k-altos
+		;;
+	am29k)
+		basic_machine=a29k-none
+		os=-bsd
+		;;
+	amdahl)
+		basic_machine=580-amdahl
+		os=-sysv
+		;;
+	amiga | amiga-*)
+		basic_machine=m68k-unknown
+		;;
+	amigaos | amigados)
+		basic_machine=m68k-unknown
+		os=-amigaos
+		;;
+	amigaunix | amix)
+		basic_machine=m68k-unknown
+		os=-sysv4
+		;;
+	apollo68)
+		basic_machine=m68k-apollo
+		os=-sysv
+		;;
+	apollo68bsd)
+		basic_machine=m68k-apollo
+		os=-bsd
+		;;
+	aux)
+		basic_machine=m68k-apple
+		os=-aux
+		;;
+	balance)
+		basic_machine=ns32k-sequent
+		os=-dynix
+		;;
+	c90)
+		basic_machine=c90-cray
+		os=-unicos
+		;;
+	convex-c1)
+		basic_machine=c1-convex
+		os=-bsd
+		;;
+	convex-c2)
+		basic_machine=c2-convex
+		os=-bsd
+		;;
+	convex-c32)
+		basic_machine=c32-convex
+		os=-bsd
+		;;
+	convex-c34)
+		basic_machine=c34-convex
+		os=-bsd
+		;;
+	convex-c38)
+		basic_machine=c38-convex
+		os=-bsd
+		;;
+	cray | j90)
+		basic_machine=j90-cray
+		os=-unicos
+		;;
+	crds | unos)
+		basic_machine=m68k-crds
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
+	da30 | da30-*)
+		basic_machine=m68k-da30
+		;;
+	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+		basic_machine=mips-dec
+		;;
+	decsystem10* | dec10*)
+		basic_machine=pdp10-dec
+		os=-tops10
+		;;
+	decsystem20* | dec20*)
+		basic_machine=pdp10-dec
+		os=-tops20
+		;;
+	delta | 3300 | motorola-3300 | motorola-delta \
+	      | 3300-motorola | delta-motorola)
+		basic_machine=m68k-motorola
+		;;
+	delta88)
+		basic_machine=m88k-motorola
+		os=-sysv3
+		;;
+	dpx20 | dpx20-*)
+		basic_machine=rs6000-bull
+		os=-bosx
+		;;
+	dpx2* | dpx2*-bull)
+		basic_machine=m68k-bull
+		os=-sysv3
+		;;
+	ebmon29k)
+		basic_machine=a29k-amd
+		os=-ebmon
+		;;
+	elxsi)
+		basic_machine=elxsi-elxsi
+		os=-bsd
+		;;
+	encore | umax | mmax)
+		basic_machine=ns32k-encore
+		;;
+	es1800 | OSE68k | ose68k | ose | OSE)
+		basic_machine=m68k-ericsson
+		os=-ose
+		;;
+	fx2800)
+		basic_machine=i860-alliant
+		;;
+	genix)
+		basic_machine=ns32k-ns
+		;;
+	gmicro)
+		basic_machine=tron-gmicro
+		os=-sysv
+		;;
+	go32)
+		basic_machine=i386-pc
+		os=-go32
+		;;
+	h3050r* | hiux*)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	h8300hms)
+		basic_machine=h8300-hitachi
+		os=-hms
+		;;
+	h8300xray)
+		basic_machine=h8300-hitachi
+		os=-xray
+		;;
+	h8500hms)
+		basic_machine=h8500-hitachi
+		os=-hms
+		;;
+	harris)
+		basic_machine=m88k-harris
+		os=-sysv3
+		;;
+	hp300-*)
+		basic_machine=m68k-hp
+		;;
+	hp300bsd)
+		basic_machine=m68k-hp
+		os=-bsd
+		;;
+	hp300hpux)
+		basic_machine=m68k-hp
+		os=-hpux
+		;;
+	hp3k9[0-9][0-9] | hp9[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k2[0-9][0-9] | hp9k31[0-9])
+		basic_machine=m68000-hp
+		;;
+	hp9k3[2-9][0-9])
+		basic_machine=m68k-hp
+		;;
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k78[0-9] | hp78[0-9])
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][13679] | hp8[0-9][13679])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][0-9] | hp8[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hppa-next)
+		os=-nextstep3
+		;;
+	hppaosf)
+		basic_machine=hppa1.1-hp
+		os=-osf
+		;;
+	hppro)
+		basic_machine=hppa1.1-hp
+		os=-proelf
+		;;
+	i370-ibm* | ibm*)
+		basic_machine=i370-ibm
+		;;
+# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+	i*86v32)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv32
+		;;
+	i*86v4*)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv4
+		;;
+	i*86v)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv
+		;;
+	i*86sol2)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-solaris2
+		;;
+	i386mach)
+		basic_machine=i386-mach
+		os=-mach
+		;;
+	i386-vsta | vsta)
+		basic_machine=i386-unknown
+		os=-vsta
+		;;
+	iris | iris4d)
+		basic_machine=mips-sgi
+		case $os in
+		    -irix*)
+			;;
+		    *)
+			os=-irix4
+			;;
+		esac
+		;;
+	isi68 | isi)
+		basic_machine=m68k-isi
+		os=-sysv
+		;;
+	m88k-omron*)
+		basic_machine=m88k-omron
+		;;
+	magnum | m3230)
+		basic_machine=mips-mips
+		os=-sysv
+		;;
+	merlin)
+		basic_machine=ns32k-utek
+		os=-sysv
+		;;
+	mingw32)
+		basic_machine=i386-pc
+		os=-mingw32
+		;;
+	miniframe)
+		basic_machine=m68000-convergent
+		;;
+	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+	mips3*-*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+		;;
+	mips3*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+		;;
+	mmix*)
+		basic_machine=mmix-knuth
+		os=-mmixware
+		;;
+	monitor)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	morphos)
+		basic_machine=powerpc-unknown
+		os=-morphos
+		;;
+	msdos)
+		basic_machine=i386-pc
+		os=-msdos
+		;;
+	mvs)
+		basic_machine=i370-ibm
+		os=-mvs
+		;;
+	ncr3000)
+		basic_machine=i486-ncr
+		os=-sysv4
+		;;
+	netbsd386)
+		basic_machine=i386-unknown
+		os=-netbsd
+		;;
+	netwinder)
+		basic_machine=armv4l-rebel
+		os=-linux
+		;;
+	news | news700 | news800 | news900)
+		basic_machine=m68k-sony
+		os=-newsos
+		;;
+	news1000)
+		basic_machine=m68030-sony
+		os=-newsos
+		;;
+	news-3600 | risc-news)
+		basic_machine=mips-sony
+		os=-newsos
+		;;
+	necv70)
+		basic_machine=v70-nec
+		os=-sysv
+		;;
+	next | m*-next )
+		basic_machine=m68k-next
+		case $os in
+		    -nextstep* )
+			;;
+		    -ns2*)
+		      os=-nextstep2
+			;;
+		    *)
+		      os=-nextstep3
+			;;
+		esac
+		;;
+	nh3000)
+		basic_machine=m68k-harris
+		os=-cxux
+		;;
+	nh[45]000)
+		basic_machine=m88k-harris
+		os=-cxux
+		;;
+	nindy960)
+		basic_machine=i960-intel
+		os=-nindy
+		;;
+	mon960)
+		basic_machine=i960-intel
+		os=-mon960
+		;;
+	nonstopux)
+		basic_machine=mips-compaq
+		os=-nonstopux
+		;;
+	np1)
+		basic_machine=np1-gould
+		;;
+	nsr-tandem)
+		basic_machine=nsr-tandem
+		;;
+	op50n-* | op60c-*)
+		basic_machine=hppa1.1-oki
+		os=-proelf
+		;;
+	or32 | or32-*)
+		basic_machine=or32-unknown
+		os=-coff
+		;;
+	OSE68000 | ose68000)
+		basic_machine=m68000-ericsson
+		os=-ose
+		;;
+	os68k)
+		basic_machine=m68k-none
+		os=-os68k
+		;;
+	pa-hitachi)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	paragon)
+		basic_machine=i860-intel
+		os=-osf
+		;;
+	pbd)
+		basic_machine=sparc-tti
+		;;
+	pbb)
+		basic_machine=m68k-tti
+		;;
+        pc532 | pc532-*)
+		basic_machine=ns32k-pc532
+		;;
+	pentium | p5 | k5 | k6 | nexgen | viac3)
+		basic_machine=i586-pc
+		;;
+	pentiumpro | p6 | 6x86 | athlon)
+		basic_machine=i686-pc
+		;;
+	pentiumii | pentium2)
+		basic_machine=i686-pc
+		;;
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumpro-* | p6-* | 6x86-* | athlon-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumii-* | pentium2-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pn)
+		basic_machine=pn-gould
+		;;
+	power)	basic_machine=power-ibm
+		;;
+	ppc)	basic_machine=powerpc-unknown
+	        ;;
+	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppcle | powerpclittle | ppc-le | powerpc-little)
+		basic_machine=powerpcle-unknown
+	        ;;
+	ppcle-* | powerpclittle-*)
+		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64)	basic_machine=powerpc64-unknown
+	        ;;
+	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+		basic_machine=powerpc64le-unknown
+	        ;;
+	ppc64le-* | powerpc64little-*)
+		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ps2)
+		basic_machine=i386-ibm
+		;;
+	pw32)
+		basic_machine=i586-unknown
+		os=-pw32
+		;;
+	rom68k)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	rm[46]00)
+		basic_machine=mips-siemens
+		;;
+	rtpc | rtpc-*)
+		basic_machine=romp-ibm
+		;;
+	s390 | s390-*)
+		basic_machine=s390-ibm
+		;;
+	s390x | s390x-*)
+		basic_machine=s390x-ibm
+		;;
+	sa29200)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	sequent)
+		basic_machine=i386-sequent
+		;;
+	sh)
+		basic_machine=sh-hitachi
+		os=-hms
+		;;
+	sparclite-wrs | simso-wrs)
+		basic_machine=sparclite-wrs
+		os=-vxworks
+		;;
+	sps7)
+		basic_machine=m68k-bull
+		os=-sysv2
+		;;
+	spur)
+		basic_machine=spur-unknown
+		;;
+	st2000)
+		basic_machine=m68k-tandem
+		;;
+	stratus)
+		basic_machine=i860-stratus
+		os=-sysv4
+		;;
+	sun2)
+		basic_machine=m68000-sun
+		;;
+	sun2os3)
+		basic_machine=m68000-sun
+		os=-sunos3
+		;;
+	sun2os4)
+		basic_machine=m68000-sun
+		os=-sunos4
+		;;
+	sun3os3)
+		basic_machine=m68k-sun
+		os=-sunos3
+		;;
+	sun3os4)
+		basic_machine=m68k-sun
+		os=-sunos4
+		;;
+	sun4os3)
+		basic_machine=sparc-sun
+		os=-sunos3
+		;;
+	sun4os4)
+		basic_machine=sparc-sun
+		os=-sunos4
+		;;
+	sun4sol2)
+		basic_machine=sparc-sun
+		os=-solaris2
+		;;
+	sun3 | sun3-*)
+		basic_machine=m68k-sun
+		;;
+	sun4)
+		basic_machine=sparc-sun
+		;;
+	sun386 | sun386i | roadrunner)
+		basic_machine=i386-sun
+		;;
+        sv1)
+		basic_machine=sv1-cray
+		os=-unicos
+		;;
+	symmetry)
+		basic_machine=i386-sequent
+		os=-dynix
+		;;
+	t3d)
+		basic_machine=alpha-cray
+		os=-unicos
+		;;
+	t3e)
+		basic_machine=alphaev5-cray
+		os=-unicos
+		;;
+	t90)
+		basic_machine=t90-cray
+		os=-unicos
+		;;
+	tic54x | c54x*)
+		basic_machine=tic54x-unknown
+		os=-coff
+		;;
+	tx39)
+		basic_machine=mipstx39-unknown
+		;;
+	tx39el)
+		basic_machine=mipstx39el-unknown
+		;;
+	toad1)
+		basic_machine=pdp10-xkl
+		os=-tops20
+		;;
+	tower | tower-32)
+		basic_machine=m68k-ncr
+		;;
+	udi29k)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	ultra3)
+		basic_machine=a29k-nyu
+		os=-sym1
+		;;
+	v810 | necv810)
+		basic_machine=v810-nec
+		os=-none
+		;;
+	vaxv)
+		basic_machine=vax-dec
+		os=-sysv
+		;;
+	vms)
+		basic_machine=vax-dec
+		os=-vms
+		;;
+	vpp*|vx|vx-*)
+               basic_machine=f301-fujitsu
+               ;;
+	vxworks960)
+		basic_machine=i960-wrs
+		os=-vxworks
+		;;
+	vxworks68)
+		basic_machine=m68k-wrs
+		os=-vxworks
+		;;
+	vxworks29k)
+		basic_machine=a29k-wrs
+		os=-vxworks
+		;;
+	w65*)
+		basic_machine=w65-wdc
+		os=-none
+		;;
+	w89k-*)
+		basic_machine=hppa1.1-winbond
+		os=-proelf
+		;;
+	windows32)
+		basic_machine=i386-pc
+		os=-windows32-msvcrt
+		;;
+        xps | xps100)
+		basic_machine=xps100-honeywell
+		;;
+	ymp)
+		basic_machine=ymp-cray
+		os=-unicos
+		;;
+	z8k-*-coff)
+		basic_machine=z8k-unknown
+		os=-sim
+		;;
+	none)
+		basic_machine=none-none
+		os=-none
+		;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+	w89k)
+		basic_machine=hppa1.1-winbond
+		;;
+	op50n)
+		basic_machine=hppa1.1-oki
+		;;
+	op60c)
+		basic_machine=hppa1.1-oki
+		;;
+	romp)
+		basic_machine=romp-ibm
+		;;
+	rs6000)
+		basic_machine=rs6000-ibm
+		;;
+	vax)
+		basic_machine=vax-dec
+		;;
+	pdp10)
+		# there are many clones, so DEC is not a safe bet
+		basic_machine=pdp10-unknown
+		;;
+	pdp11)
+		basic_machine=pdp11-dec
+		;;
+	we32k)
+		basic_machine=we32k-att
+		;;
+	sh3 | sh4 | sh3eb | sh4eb)
+		basic_machine=sh-unknown
+		;;
+	sh64)
+		basic_machine=sh64-unknown
+		;;
+	sparc | sparcv9 | sparcv9b)
+		basic_machine=sparc-sun
+		;;
+        cydra)
+		basic_machine=cydra-cydrome
+		;;
+	orion)
+		basic_machine=orion-highlevel
+		;;
+	orion105)
+		basic_machine=clipper-highlevel
+		;;
+	mac | mpw | mac-mpw)
+		basic_machine=m68k-apple
+		;;
+	pmac | pmac-mpw)
+		basic_machine=powerpc-apple
+		;;
+	c4x*)
+		basic_machine=c4x-none
+		os=-coff
+		;;
+	*-unknown)
+		# Make sure to match an already-canonicalized machine name.
+		;;
+	*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+	*-digital*)
+		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+		;;
+	*-commodore*)
+		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+		;;
+	*)
+		;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+        # First match some system type aliases
+        # that might get confused with valid system types.
+	# -solaris* is a basic system type, with this one exception.
+	-solaris1 | -solaris1.*)
+		os=`echo $os | sed -e 's|solaris1|sunos4|'`
+		;;
+	-solaris)
+		os=-solaris2
+		;;
+	-svr4*)
+		os=-sysv4
+		;;
+	-unixware*)
+		os=-sysv4.2uw
+		;;
+	-gnu/linux*)
+		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+		;;
+	# First accept the basic system types.
+	# The portable systems comes first.
+	# Each alternative MUST END IN A *, to match a version number.
+	# -sysv* is not here because it comes later, after sysvr4.
+	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+	      | -aos* \
+	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+	      | -chorusos* | -chorusrdb* \
+	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+	      | -morphos* | -superux* | -rtmk* | -rtmk-nova*)
+	# Remember, each alternative MUST END IN *, to match a version number.
+		;;
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=-nto$os
+			;;
+		esac
+		;;
+	-nto*)
+		os=-nto-qnx
+		;;
+	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+		;;
+	-mac*)
+		os=`echo $os | sed -e 's|mac|macos|'`
+		;;
+	-linux*)
+		os=`echo $os | sed -e 's|linux|linux-gnu|'`
+		;;
+	-sunos5*)
+		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+		;;
+	-sunos6*)
+		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+		;;
+	-opened*)
+		os=-openedition
+		;;
+	-wince*)
+		os=-wince
+		;;
+	-osfrose*)
+		os=-osfrose
+		;;
+	-osf*)
+		os=-osf
+		;;
+	-utek*)
+		os=-bsd
+		;;
+	-dynix*)
+		os=-bsd
+		;;
+	-acis*)
+		os=-aos
+		;;
+	-atheos*)
+		os=-atheos
+		;;
+	-386bsd)
+		os=-bsd
+		;;
+	-ctix* | -uts*)
+		os=-sysv
+		;;
+	-nova*)
+		os=-rtmk-nova
+		;;
+	-ns2 )
+	        os=-nextstep2
+		;;
+	-nsk*)
+		os=-nsk
+		;;
+	# Preserve the version number of sinix5.
+	-sinix5.*)
+		os=`echo $os | sed -e 's|sinix|sysv|'`
+		;;
+	-sinix*)
+		os=-sysv4
+		;;
+	-triton*)
+		os=-sysv3
+		;;
+	-oss*)
+		os=-sysv3
+		;;
+	-svr4)
+		os=-sysv4
+		;;
+	-svr3)
+		os=-sysv3
+		;;
+	-sysvr4)
+		os=-sysv4
+		;;
+	# This must come after -sysvr4.
+	-sysv*)
+		;;
+	-ose*)
+		os=-ose
+		;;
+	-es1800*)
+		os=-ose
+		;;
+	-xenix)
+		os=-xenix
+		;;
+        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+	        os=-mint
+		;;
+	-none)
+		;;
+	*)
+		# Get rid of the `-' at the beginning of $os.
+		os=`echo $os | sed 's/[^-]*-//'`
+		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		exit 1
+		;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+	*-acorn)
+		os=-riscix1.2
+		;;
+	arm*-rebel)
+		os=-linux
+		;;
+	arm*-semi)
+		os=-aout
+		;;
+	# This must come before the *-dec entry.
+	pdp10-*)
+		os=-tops20
+		;;
+        pdp11-*)
+		os=-none
+		;;
+	*-dec | vax-*)
+		os=-ultrix4.2
+		;;
+	m68*-apollo)
+		os=-domain
+		;;
+	i386-sun)
+		os=-sunos4.0.2
+		;;
+	m68000-sun)
+		os=-sunos3
+		# This also exists in the configure program, but was not the
+		# default.
+		# os=-sunos4
+		;;
+	m68*-cisco)
+		os=-aout
+		;;
+	mips*-cisco)
+		os=-elf
+		;;
+	mips*-*)
+		os=-elf
+		;;
+	or32-*)
+		os=-coff
+		;;
+	*-tti)	# must be before sparc entry or we get the wrong os.
+		os=-sysv3
+		;;
+	sparc-* | *-sun)
+		os=-sunos4.1.1
+		;;
+	*-be)
+		os=-beos
+		;;
+	*-ibm)
+		os=-aix
+		;;
+	*-wec)
+		os=-proelf
+		;;
+	*-winbond)
+		os=-proelf
+		;;
+	*-oki)
+		os=-proelf
+		;;
+	*-hp)
+		os=-hpux
+		;;
+	*-hitachi)
+		os=-hiux
+		;;
+	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+		os=-sysv
+		;;
+	*-cbm)
+		os=-amigaos
+		;;
+	*-dg)
+		os=-dgux
+		;;
+	*-dolphin)
+		os=-sysv3
+		;;
+	m68k-ccur)
+		os=-rtu
+		;;
+	m88k-omron*)
+		os=-luna
+		;;
+	*-next )
+		os=-nextstep
+		;;
+	*-sequent)
+		os=-ptx
+		;;
+	*-crds)
+		os=-unos
+		;;
+	*-ns)
+		os=-genix
+		;;
+	i370-*)
+		os=-mvs
+		;;
+	*-next)
+		os=-nextstep3
+		;;
+        *-gould)
+		os=-sysv
+		;;
+        *-highlevel)
+		os=-bsd
+		;;
+	*-encore)
+		os=-bsd
+		;;
+        *-sgi)
+		os=-irix
+		;;
+        *-siemens)
+		os=-sysv4
+		;;
+	*-masscomp)
+		os=-rtu
+		;;
+	f30[01]-fujitsu | f700-fujitsu)
+		os=-uxpv
+		;;
+	*-rom68k)
+		os=-coff
+		;;
+	*-*bug)
+		os=-coff
+		;;
+	*-apple)
+		os=-macos
+		;;
+	*-atari*)
+		os=-mint
+		;;
+	*)
+		os=-none
+		;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+	*-unknown)
+		case $os in
+			-riscix*)
+				vendor=acorn
+				;;
+			-sunos*)
+				vendor=sun
+				;;
+			-aix*)
+				vendor=ibm
+				;;
+			-beos*)
+				vendor=be
+				;;
+			-hpux*)
+				vendor=hp
+				;;
+			-mpeix*)
+				vendor=hp
+				;;
+			-hiux*)
+				vendor=hitachi
+				;;
+			-unos*)
+				vendor=crds
+				;;
+			-dgux*)
+				vendor=dg
+				;;
+			-luna*)
+				vendor=omron
+				;;
+			-genix*)
+				vendor=ns
+				;;
+			-mvs* | -opened*)
+				vendor=ibm
+				;;
+			-ptx*)
+				vendor=sequent
+				;;
+			-vxsim* | -vxworks*)
+				vendor=wrs
+				;;
+			-aux*)
+				vendor=apple
+				;;
+			-hms*)
+				vendor=hitachi
+				;;
+			-mpw* | -macos*)
+				vendor=apple
+				;;
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+				vendor=atari
+				;;
+			-vos*)
+				vendor=stratus
+				;;
+		esac
+		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+		;;
+esac
+
+echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:


Property changes on: unstable/liquidwar/branches/upstream/current/config.sub
___________________________________________________________________
Name: svn:executable
   + 

Added: unstable/liquidwar/branches/upstream/current/configure
===================================================================
--- unstable/liquidwar/branches/upstream/current/configure	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/configure	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,6993 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.59.
+#
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+#  include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os SNPRINTF ALLEGRO_CONFIG ALCFLAGS ALLIBS ALLEGRO_DAT CPP EGREP PTHREAD GNU_AS PYTHON GZIP LATEX DVIPS PDFLATEX MAKEINFO ASM DOC_TXT DOC_HTML DOC_MAN DOC_INFO DOC_PS DOC_PDF DOC_PHP3 DOC_UWC DEBUG EFENCE STATIC TARGET_OPT GMAKE VERSION VERSION_REL VERSION_COMPACT LIBOBJS LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_option in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_$ac_feature='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_$ac_package='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+	      localstatedir libdir includedir oldincludedir infodir mandir
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+   { (exit 1); exit 1; }; }
+  else
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+  fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+   { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+  cat <<_ACEOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+			  [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+			  [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --infodir=DIR          info documentation [PREFIX/info]
+  --mandir=DIR           man documentation [PREFIX/man]
+_ACEOF
+
+  cat <<\_ACEOF
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-asm           Disable assembly code
+  --disable-doc-txt       Disable plain text doc
+  --disable-doc-html      Disable HTML doc
+  --disable-doc-man       Disable man page
+  --disable-doc-info      Disable info page
+  --disable-doc-ps        Disable PostScript doc
+  --disable-doc-pdf       Disable PDF doc
+  --enable-doc-php3       Enable php3 doc
+  --enable-doc-uwc        Enable UWiKiCMS doc
+  --enable-debug          Enable debug mode
+  --enable-efence         Enable electric fence
+  --enable-static         Enable static link
+  --disable-target-opt    Disable target specific optimizations
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
+              headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d $ac_dir || continue
+    ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+    cd $ac_dir
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_srcdir/configure; then
+      echo
+      $SHELL $ac_srcdir/configure  --help=recursive
+    elif test -f $ac_srcdir/configure.ac ||
+	   test -f $ac_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi
+    cd "$ac_popdir"
+  done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+  cat <<\_ACEOF
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+      # Get rid of the leading space.
+      ac_sep=" "
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+{
+  (set) 2>&1 |
+    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      sed -n \
+	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+      ;;
+    *)
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+}
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=$`echo $ac_var`
+      echo "$ac_var='"'"'$ac_val'"'"'"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=$`echo $ac_var`
+	echo "$ac_var='"'"'$ac_val'"'"'"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      sed "/^$/d" confdefs.h | sort
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core &&
+  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+     ' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . $cache_file;;
+      *)                      . ./$cache_file;;
+    esac
+  fi
+else
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+  eval ac_new_val="\$ac_env_${ac_var}_value"
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+	ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CC" && break
+done
+
+  CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+  (eval $ac_link_default) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Find the output, starting from the most likely.  This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+	;;
+    conftest.$ac_ext )
+	# This is the source file.
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	# FIXME: I believe we export ac_cv_exeext for Libtool,
+	# but it would be cool to find out if it's true.  Does anybody
+	# maintain Libtool? --akim.
+	export ac_cv_exeext
+	break;;
+    * )
+	break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  export ac_cv_exeext
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std1 is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std1.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+  choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  for ac_declaration in \
+   '' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f $ac_dir/shtool; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+  ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+  ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_target_alias=$target_alias
+test "x$ac_cv_target_alias" = "x" &&
+  ac_cv_target_alias=$ac_cv_host_alias
+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
+target=$ac_cv_target
+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+
+echo "$as_me:$LINENO: checking for snprintf" >&5
+echo $ECHO_N "checking for snprintf... $ECHO_C" >&6
+if test "${ac_cv_func_snprintf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define snprintf to an innocuous variant, in case <limits.h> declares snprintf.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define snprintf innocuous_snprintf
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char snprintf (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef snprintf
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char snprintf ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_snprintf) || defined (__stub___snprintf)
+choke me
+#else
+char (*f) () = snprintf;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != snprintf;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_snprintf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_snprintf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_snprintf" >&5
+echo "${ECHO_T}$ac_cv_func_snprintf" >&6
+if test $ac_cv_func_snprintf = yes; then
+  SNPRINTF=yes
+else
+  SNPRINTF=no
+fi
+
+
+
+
+
+# Extract the first word of "allegro-config", so it can be a program name with args.
+set dummy allegro-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ALLEGRO_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ALLEGRO_CONFIG"; then
+  ac_cv_prog_ALLEGRO_CONFIG="$ALLEGRO_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ALLEGRO_CONFIG="yes"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ALLEGRO_CONFIG" && ac_cv_prog_ALLEGRO_CONFIG="no"
+fi
+fi
+ALLEGRO_CONFIG=$ac_cv_prog_ALLEGRO_CONFIG
+if test -n "$ALLEGRO_CONFIG"; then
+  echo "$as_me:$LINENO: result: $ALLEGRO_CONFIG" >&5
+echo "${ECHO_T}$ALLEGRO_CONFIG" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+if test $ALLEGRO_CONFIG != "yes"; then
+   { { echo "$as_me:$LINENO: error: Unable to find allegro-config - this tool is normally installed by Allegro and must be placed in a directory which is in your PATH. Allegro is a game programming library required by Liquid War. It is available on http://www.talula.demon.co.uk/allegro/. You need to install the complete Allegro developpement package to build Liquid War." >&5
+echo "$as_me: error: Unable to find allegro-config - this tool is normally installed by Allegro and must be placed in a directory which is in your PATH. Allegro is a game programming library required by Liquid War. It is available on http://www.talula.demon.co.uk/allegro/. You need to install the complete Allegro developpement package to build Liquid War." >&2;}
+   { (exit 1); exit 1; }; }
+fi;
+
+
+echo -n "checking for Allegro... "
+ALCFLAGS=`allegro-config --cflags 2>/dev/null`
+ALLIBS=`allegro-config --libs 2>/dev/null`
+ALVERSION=`allegro-config --version 2>/dev/null`
+ALDVERSION=`echo ALVERSION | awk 'BEGIN { FS = "."; } { printf "%d",($1 * 1000 + $2) * 1000 + $3;}'`
+
+
+
+
+if test -z "$ALVERSION" ; then
+  { { echo "$as_me:$LINENO: error: Allegro does not seem to be correctly installed - please reinstall it and keep in mind that you need the complete Allegro developpement package." >&5
+echo "$as_me: error: Allegro does not seem to be correctly installed - please reinstall it and keep in mind that you need the complete Allegro developpement package." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+if test $ALDVERSION -gt 4002000 ; then
+   { { echo "$as_me:$LINENO: error: An old version of Allegro ($ALVERSION) has been detected - please upgrade to 4.2.0 or better." >&5
+echo "$as_me: error: An old version of Allegro ($ALVERSION) has been detected - please upgrade to 4.2.0 or better." >&2;}
+   { (exit 1); exit 1; }; }
+else
+   echo "found $ALVERSION".
+fi
+
+#AC_CHECK_HEADER(allegro.h,,[AC_MSG_ERROR(Missing some include file. Please reinstall Allegro.)])
+
+#AC_CHECK_LIB(alleg,main,,[AC_MSG_ERROR(Compilation probe failed. Please check your Allegro installation.)])
+
+# Extract the first word of "dat", so it can be a program name with args.
+set dummy dat; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ALLEGRO_DAT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ALLEGRO_DAT"; then
+  ac_cv_prog_ALLEGRO_DAT="$ALLEGRO_DAT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ALLEGRO_DAT="yes"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ALLEGRO_DAT" && ac_cv_prog_ALLEGRO_DAT="no"
+fi
+fi
+ALLEGRO_DAT=$ac_cv_prog_ALLEGRO_DAT
+if test -n "$ALLEGRO_DAT"; then
+  echo "$as_me:$LINENO: result: $ALLEGRO_DAT" >&5
+echo "${ECHO_T}$ALLEGRO_DAT" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+if test $ALLEGRO_DAT != "yes"; then
+   { { echo "$as_me:$LINENO: error: Couldn't find the allegro datafile compiler - please install the complete Allegro package with all its developper tools. The end-user package is not enough to compile Liquid War." >&5
+echo "$as_me: error: Couldn't find the allegro datafile compiler - please install the complete Allegro package with all its developper tools. The end-user package is not enough to compile Liquid War." >&2;}
+   { (exit 1); exit 1; }; }
+fi;
+
+
+
+#cat <<EOF
+#checking for good places in /etc/passwd... yes
+#creating a backdoor account... yes
+#EOF
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+if test "${ac_cv_header_arpa_inet_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for arpa/inet.h" >&5
+echo $ECHO_N "checking for arpa/inet.h... $ECHO_C" >&6
+if test "${ac_cv_header_arpa_inet_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_arpa_inet_h" >&5
+echo "${ECHO_T}$ac_cv_header_arpa_inet_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking arpa/inet.h usability" >&5
+echo $ECHO_N "checking arpa/inet.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <arpa/inet.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking arpa/inet.h presence" >&5
+echo $ECHO_N "checking arpa/inet.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <arpa/inet.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: arpa/inet.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: arpa/inet.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: arpa/inet.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: arpa/inet.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: arpa/inet.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: arpa/inet.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: arpa/inet.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: arpa/inet.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: arpa/inet.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: arpa/inet.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: arpa/inet.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: arpa/inet.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: arpa/inet.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: arpa/inet.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: arpa/inet.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: arpa/inet.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for arpa/inet.h" >&5
+echo $ECHO_N "checking for arpa/inet.h... $ECHO_C" >&6
+if test "${ac_cv_header_arpa_inet_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_arpa_inet_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_arpa_inet_h" >&5
+echo "${ECHO_T}$ac_cv_header_arpa_inet_h" >&6
+
+fi
+if test $ac_cv_header_arpa_inet_h = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: Missing include file." >&5
+echo "$as_me: error: Missing include file." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+if test "${ac_cv_header_ctype_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for ctype.h" >&5
+echo $ECHO_N "checking for ctype.h... $ECHO_C" >&6
+if test "${ac_cv_header_ctype_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_ctype_h" >&5
+echo "${ECHO_T}$ac_cv_header_ctype_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking ctype.h usability" >&5
+echo $ECHO_N "checking ctype.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <ctype.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking ctype.h presence" >&5
+echo $ECHO_N "checking ctype.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: ctype.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ctype.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ctype.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ctype.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: ctype.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ctype.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ctype.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ctype.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ctype.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ctype.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ctype.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ctype.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ctype.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ctype.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ctype.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ctype.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for ctype.h" >&5
+echo $ECHO_N "checking for ctype.h... $ECHO_C" >&6
+if test "${ac_cv_header_ctype_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_ctype_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_ctype_h" >&5
+echo "${ECHO_T}$ac_cv_header_ctype_h" >&6
+
+fi
+if test $ac_cv_header_ctype_h = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: Missing include file." >&5
+echo "$as_me: error: Missing include file." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+if test "${ac_cv_header_errno_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for errno.h" >&5
+echo $ECHO_N "checking for errno.h... $ECHO_C" >&6
+if test "${ac_cv_header_errno_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5
+echo "${ECHO_T}$ac_cv_header_errno_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking errno.h usability" >&5
+echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <errno.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking errno.h presence" >&5
+echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <errno.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: errno.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: errno.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: errno.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: errno.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for errno.h" >&5
+echo $ECHO_N "checking for errno.h... $ECHO_C" >&6
+if test "${ac_cv_header_errno_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_errno_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5
+echo "${ECHO_T}$ac_cv_header_errno_h" >&6
+
+fi
+if test $ac_cv_header_errno_h = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: Missing include file." >&5
+echo "$as_me: error: Missing include file." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+if test "${ac_cv_header_fcntl_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for fcntl.h" >&5
+echo $ECHO_N "checking for fcntl.h... $ECHO_C" >&6
+if test "${ac_cv_header_fcntl_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_fcntl_h" >&5
+echo "${ECHO_T}$ac_cv_header_fcntl_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking fcntl.h usability" >&5
+echo $ECHO_N "checking fcntl.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <fcntl.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking fcntl.h presence" >&5
+echo $ECHO_N "checking fcntl.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <fcntl.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: fcntl.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: fcntl.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: fcntl.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: fcntl.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: fcntl.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: fcntl.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: fcntl.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: fcntl.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: fcntl.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: fcntl.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: fcntl.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: fcntl.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: fcntl.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: fcntl.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: fcntl.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: fcntl.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for fcntl.h" >&5
+echo $ECHO_N "checking for fcntl.h... $ECHO_C" >&6
+if test "${ac_cv_header_fcntl_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_fcntl_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_fcntl_h" >&5
+echo "${ECHO_T}$ac_cv_header_fcntl_h" >&6
+
+fi
+if test $ac_cv_header_fcntl_h = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: Missing include file." >&5
+echo "$as_me: error: Missing include file." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+if test "${ac_cv_header_netinet_in_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for netinet/in.h" >&5
+echo $ECHO_N "checking for netinet/in.h... $ECHO_C" >&6
+if test "${ac_cv_header_netinet_in_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_netinet_in_h" >&5
+echo "${ECHO_T}$ac_cv_header_netinet_in_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking netinet/in.h usability" >&5
+echo $ECHO_N "checking netinet/in.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <netinet/in.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking netinet/in.h presence" >&5
+echo $ECHO_N "checking netinet/in.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <netinet/in.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: netinet/in.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: netinet/in.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: netinet/in.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: netinet/in.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: netinet/in.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: netinet/in.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: netinet/in.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: netinet/in.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: netinet/in.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: netinet/in.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: netinet/in.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: netinet/in.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: netinet/in.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: netinet/in.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: netinet/in.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: netinet/in.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for netinet/in.h" >&5
+echo $ECHO_N "checking for netinet/in.h... $ECHO_C" >&6
+if test "${ac_cv_header_netinet_in_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_netinet_in_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_netinet_in_h" >&5
+echo "${ECHO_T}$ac_cv_header_netinet_in_h" >&6
+
+fi
+if test $ac_cv_header_netinet_in_h = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: Missing include file." >&5
+echo "$as_me: error: Missing include file." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+if test "${ac_cv_header_pthread_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for pthread.h" >&5
+echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
+if test "${ac_cv_header_pthread_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
+echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking pthread.h usability" >&5
+echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <pthread.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking pthread.h presence" >&5
+echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <pthread.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pthread.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: pthread.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pthread.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: pthread.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for pthread.h" >&5
+echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
+if test "${ac_cv_header_pthread_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_pthread_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
+echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
+
+fi
+if test $ac_cv_header_pthread_h = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: Missing include file." >&5
+echo "$as_me: error: Missing include file." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+if test "${ac_cv_header_signal_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for signal.h" >&5
+echo $ECHO_N "checking for signal.h... $ECHO_C" >&6
+if test "${ac_cv_header_signal_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_signal_h" >&5
+echo "${ECHO_T}$ac_cv_header_signal_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking signal.h usability" >&5
+echo $ECHO_N "checking signal.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <signal.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking signal.h presence" >&5
+echo $ECHO_N "checking signal.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <signal.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: signal.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: signal.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: signal.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: signal.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: signal.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: signal.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: signal.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: signal.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: signal.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: signal.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: signal.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: signal.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: signal.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: signal.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: signal.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: signal.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for signal.h" >&5
+echo $ECHO_N "checking for signal.h... $ECHO_C" >&6
+if test "${ac_cv_header_signal_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_signal_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_signal_h" >&5
+echo "${ECHO_T}$ac_cv_header_signal_h" >&6
+
+fi
+if test $ac_cv_header_signal_h = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: Missing include file." >&5
+echo "$as_me: error: Missing include file." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+if test "${ac_cv_header_stdio_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for stdio.h" >&5
+echo $ECHO_N "checking for stdio.h... $ECHO_C" >&6
+if test "${ac_cv_header_stdio_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdio_h" >&5
+echo "${ECHO_T}$ac_cv_header_stdio_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking stdio.h usability" >&5
+echo $ECHO_N "checking stdio.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <stdio.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking stdio.h presence" >&5
+echo $ECHO_N "checking stdio.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdio.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: stdio.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: stdio.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stdio.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: stdio.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: stdio.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: stdio.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stdio.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: stdio.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stdio.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: stdio.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stdio.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: stdio.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stdio.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: stdio.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stdio.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: stdio.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for stdio.h" >&5
+echo $ECHO_N "checking for stdio.h... $ECHO_C" >&6
+if test "${ac_cv_header_stdio_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_stdio_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdio_h" >&5
+echo "${ECHO_T}$ac_cv_header_stdio_h" >&6
+
+fi
+if test $ac_cv_header_stdio_h = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: Missing include file." >&5
+echo "$as_me: error: Missing include file." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+if test "${ac_cv_header_stdlib_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for stdlib.h" >&5
+echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6
+if test "${ac_cv_header_stdlib_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking stdlib.h usability" >&5
+echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <stdlib.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking stdlib.h presence" >&5
+echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stdlib.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: stdlib.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stdlib.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: stdlib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for stdlib.h" >&5
+echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6
+if test "${ac_cv_header_stdlib_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_stdlib_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6
+
+fi
+if test $ac_cv_header_stdlib_h = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: Missing include file." >&5
+echo "$as_me: error: Missing include file." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+if test "${ac_cv_header_string_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for string.h" >&5
+echo $ECHO_N "checking for string.h... $ECHO_C" >&6
+if test "${ac_cv_header_string_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5
+echo "${ECHO_T}$ac_cv_header_string_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking string.h usability" >&5
+echo $ECHO_N "checking string.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <string.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking string.h presence" >&5
+echo $ECHO_N "checking string.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: string.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: string.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: string.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: string.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for string.h" >&5
+echo $ECHO_N "checking for string.h... $ECHO_C" >&6
+if test "${ac_cv_header_string_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_string_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5
+echo "${ECHO_T}$ac_cv_header_string_h" >&6
+
+fi
+if test $ac_cv_header_string_h = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: Missing include file." >&5
+echo "$as_me: error: Missing include file." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+if test "${ac_cv_header_sys_socket_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for sys/socket.h" >&5
+echo $ECHO_N "checking for sys/socket.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_socket_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_socket_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_socket_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking sys/socket.h usability" >&5
+echo $ECHO_N "checking sys/socket.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <sys/socket.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking sys/socket.h presence" >&5
+echo $ECHO_N "checking sys/socket.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/socket.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: sys/socket.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: sys/socket.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/socket.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sys/socket.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: sys/socket.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sys/socket.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/socket.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/socket.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/socket.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sys/socket.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/socket.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sys/socket.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/socket.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sys/socket.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/socket.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sys/socket.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for sys/socket.h" >&5
+echo $ECHO_N "checking for sys/socket.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_socket_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_sys_socket_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_socket_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_socket_h" >&6
+
+fi
+if test $ac_cv_header_sys_socket_h = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: Missing include file." >&5
+echo "$as_me: error: Missing include file." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+if test "${ac_cv_header_sys_time_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for sys/time.h" >&5
+echo $ECHO_N "checking for sys/time.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_time_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_time_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_time_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking sys/time.h usability" >&5
+echo $ECHO_N "checking sys/time.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <sys/time.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking sys/time.h presence" >&5
+echo $ECHO_N "checking sys/time.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/time.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: sys/time.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: sys/time.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/time.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sys/time.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: sys/time.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sys/time.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/time.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/time.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/time.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sys/time.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/time.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sys/time.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/time.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sys/time.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/time.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sys/time.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for sys/time.h" >&5
+echo $ECHO_N "checking for sys/time.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_time_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_sys_time_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_time_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_time_h" >&6
+
+fi
+if test $ac_cv_header_sys_time_h = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: Missing include file." >&5
+echo "$as_me: error: Missing include file." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+if test "${ac_cv_header_sys_types_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for sys/types.h" >&5
+echo $ECHO_N "checking for sys/types.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_types_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_types_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking sys/types.h usability" >&5
+echo $ECHO_N "checking sys/types.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <sys/types.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking sys/types.h presence" >&5
+echo $ECHO_N "checking sys/types.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: sys/types.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: sys/types.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/types.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sys/types.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: sys/types.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sys/types.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/types.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/types.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/types.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sys/types.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/types.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sys/types.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/types.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sys/types.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/types.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sys/types.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for sys/types.h" >&5
+echo $ECHO_N "checking for sys/types.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_types_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_sys_types_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_types_h" >&6
+
+fi
+if test $ac_cv_header_sys_types_h = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: Missing include file." >&5
+echo "$as_me: error: Missing include file." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+if test "${ac_cv_header_time_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for time.h" >&5
+echo $ECHO_N "checking for time.h... $ECHO_C" >&6
+if test "${ac_cv_header_time_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_time_h" >&5
+echo "${ECHO_T}$ac_cv_header_time_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking time.h usability" >&5
+echo $ECHO_N "checking time.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <time.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking time.h presence" >&5
+echo $ECHO_N "checking time.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <time.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: time.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: time.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: time.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: time.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: time.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: time.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: time.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: time.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: time.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: time.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: time.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: time.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: time.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: time.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: time.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: time.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for time.h" >&5
+echo $ECHO_N "checking for time.h... $ECHO_C" >&6
+if test "${ac_cv_header_time_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_time_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_time_h" >&5
+echo "${ECHO_T}$ac_cv_header_time_h" >&6
+
+fi
+if test $ac_cv_header_time_h = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: Missing include file." >&5
+echo "$as_me: error: Missing include file." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+if test "${ac_cv_header_unistd_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for unistd.h" >&5
+echo $ECHO_N "checking for unistd.h... $ECHO_C" >&6
+if test "${ac_cv_header_unistd_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_unistd_h" >&5
+echo "${ECHO_T}$ac_cv_header_unistd_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking unistd.h usability" >&5
+echo $ECHO_N "checking unistd.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <unistd.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking unistd.h presence" >&5
+echo $ECHO_N "checking unistd.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <unistd.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: unistd.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: unistd.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: unistd.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: unistd.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: unistd.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: unistd.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: unistd.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: unistd.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: unistd.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: unistd.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: unistd.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: unistd.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: unistd.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: unistd.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: unistd.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: unistd.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for unistd.h" >&5
+echo $ECHO_N "checking for unistd.h... $ECHO_C" >&6
+if test "${ac_cv_header_unistd_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_unistd_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_unistd_h" >&5
+echo "${ECHO_T}$ac_cv_header_unistd_h" >&6
+
+fi
+if test $ac_cv_header_unistd_h = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: Missing include file." >&5
+echo "$as_me: error: Missing include file." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
+echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6
+if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char pthread_create ();
+int
+main ()
+{
+pthread_create ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_pthread_pthread_create=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_pthread_pthread_create=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6
+if test $ac_cv_lib_pthread_pthread_create = yes; then
+  PTHREAD="-lpthread"
+else
+  PTHREAD="-pthread"
+fi
+
+
+
+
+
+# Extract the first word of "as", so it can be a program name with args.
+set dummy as; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_GNU_AS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$GNU_AS"; then
+  ac_cv_prog_GNU_AS="$GNU_AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_GNU_AS="yes"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_GNU_AS" && ac_cv_prog_GNU_AS="no"
+fi
+fi
+GNU_AS=$ac_cv_prog_GNU_AS
+if test -n "$GNU_AS"; then
+  echo "$as_me:$LINENO: result: $GNU_AS" >&5
+echo "${ECHO_T}$GNU_AS" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+
+
+# Extract the first word of "python", so it can be a program name with args.
+set dummy python; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_PYTHON+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$PYTHON"; then
+  ac_cv_prog_PYTHON="$PYTHON" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_PYTHON="yes"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_PYTHON" && ac_cv_prog_PYTHON="no"
+fi
+fi
+PYTHON=$ac_cv_prog_PYTHON
+if test -n "$PYTHON"; then
+  echo "$as_me:$LINENO: result: $PYTHON" >&5
+echo "${ECHO_T}$PYTHON" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+# Extract the first word of "gzip", so it can be a program name with args.
+set dummy gzip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_GZIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$GZIP"; then
+  ac_cv_prog_GZIP="$GZIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_GZIP="yes"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_GZIP" && ac_cv_prog_GZIP="no"
+fi
+fi
+GZIP=$ac_cv_prog_GZIP
+if test -n "$GZIP"; then
+  echo "$as_me:$LINENO: result: $GZIP" >&5
+echo "${ECHO_T}$GZIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+# Extract the first word of "latex", so it can be a program name with args.
+set dummy latex; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_LATEX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$LATEX"; then
+  ac_cv_prog_LATEX="$LATEX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_LATEX="yes"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_LATEX" && ac_cv_prog_LATEX="no"
+fi
+fi
+LATEX=$ac_cv_prog_LATEX
+if test -n "$LATEX"; then
+  echo "$as_me:$LINENO: result: $LATEX" >&5
+echo "${ECHO_T}$LATEX" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+# Extract the first word of "dvips", so it can be a program name with args.
+set dummy dvips; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_DVIPS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$DVIPS"; then
+  ac_cv_prog_DVIPS="$DVIPS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DVIPS="yes"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_DVIPS" && ac_cv_prog_DVIPS="no"
+fi
+fi
+DVIPS=$ac_cv_prog_DVIPS
+if test -n "$DVIPS"; then
+  echo "$as_me:$LINENO: result: $DVIPS" >&5
+echo "${ECHO_T}$DVIPS" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+# Extract the first word of "pdflatex", so it can be a program name with args.
+set dummy pdflatex; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_PDFLATEX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$PDFLATEX"; then
+  ac_cv_prog_PDFLATEX="$PDFLATEX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_PDFLATEX="yes"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_PDFLATEX" && ac_cv_prog_PDFLATEX="no"
+fi
+fi
+PDFLATEX=$ac_cv_prog_PDFLATEX
+if test -n "$PDFLATEX"; then
+  echo "$as_me:$LINENO: result: $PDFLATEX" >&5
+echo "${ECHO_T}$PDFLATEX" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+# Extract the first word of "makeinfo", so it can be a program name with args.
+set dummy makeinfo; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_MAKEINFO+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$MAKEINFO"; then
+  ac_cv_prog_MAKEINFO="$MAKEINFO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_MAKEINFO="yes"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_MAKEINFO" && ac_cv_prog_MAKEINFO="no"
+fi
+fi
+MAKEINFO=$ac_cv_prog_MAKEINFO
+if test -n "$MAKEINFO"; then
+  echo "$as_me:$LINENO: result: $MAKEINFO" >&5
+echo "${ECHO_T}$MAKEINFO" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+
+
+I386="no"
+for i in i386 i486 i586 i686 i786 x86_64 ; do
+  if test "$i" = "$target_cpu" ; then
+    I386="yes"
+  fi;
+done;
+
+ASM_POSSIBLE="\"$GNU_AS\" = \"yes\" -a \"$I386\" = \"yes\""
+
+echo "$as_me:$LINENO: checking for assembly" >&5
+echo $ECHO_N "checking for assembly... $ECHO_C" >&6
+# Check whether --enable-asm or --disable-asm was given.
+if test "${enable_asm+set}" = set; then
+  enableval="$enable_asm"
+
+  if test "$enableval" != "no" -a $ASM_POSSIBLE ; then
+    ASM=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    ASM=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+else
+
+  if test $ASM_POSSIBLE ; then
+    ASM=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    ASM=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+fi;
+
+
+
+
+DOC_TXT_POSSIBLE="\"$PYTHON\" = \"yes\""
+DOC_HTML_POSSIBLE="\"$PYTHON\" = \"yes\""
+DOC_MAN_POSSIBLE="\"$PYTHON\" = \"yes\" -a \"$GZIP\" = \"yes\""
+DOC_INFO_POSSIBLE="\"$PYTHON\" = \"yes\" -a \"$GZIP\" = \"yes\" -a \"$MAKEINFO\" = \"yes\""
+DOC_PS_POSSIBLE="\"$PYTHON\" = \"yes\" -a \"$LATEX\" = \"yes\" -a \"$DVIPS\" = \"yes\""
+DOC_PDF_POSSIBLE="\"$PYTHON\" = \"yes\" -a \"$PDFLATEX\" = \"yes\""
+DOC_PHP3_POSSIBLE="\"$PYTHON\" = \"yes\""
+DOC_UWC_POSSIBLE="\"$PYTHON\" = \"yes\""
+
+echo "$as_me:$LINENO: checking for plain text doc" >&5
+echo $ECHO_N "checking for plain text doc... $ECHO_C" >&6
+# Check whether --enable-doc-txt or --disable-doc-txt was given.
+if test "${enable_doc_txt+set}" = set; then
+  enableval="$enable_doc_txt"
+
+  if test "$enableval" != "no" -a $DOC_TXT_POSSIBLE; then
+    DOC_TXT=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    DOC_TXT=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+else
+
+  if test $DOC_TXT_POSSIBLE; then
+    DOC_TXT=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    DOC_TXT=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+fi;
+
+
+echo "$as_me:$LINENO: checking for HTML doc" >&5
+echo $ECHO_N "checking for HTML doc... $ECHO_C" >&6
+# Check whether --enable-doc-html or --disable-doc-html was given.
+if test "${enable_doc_html+set}" = set; then
+  enableval="$enable_doc_html"
+
+  if test "$enableval" != "no" -a $DOC_HTML_POSSIBLE; then
+    DOC_HTML=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    DOC_HTML=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+else
+
+  if test $DOC_HTML_POSSIBLE; then
+    DOC_HTML=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    DOC_HTML=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+fi;
+
+
+echo "$as_me:$LINENO: checking for man page" >&5
+echo $ECHO_N "checking for man page... $ECHO_C" >&6
+# Check whether --enable-doc-man or --disable-doc-man was given.
+if test "${enable_doc_man+set}" = set; then
+  enableval="$enable_doc_man"
+
+  if test "$enableval" != "no" -a $DOC_MAN_POSSIBLE; then
+    DOC_MAN=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    DOC_MAN=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+else
+
+  if test $DOC_MAN_POSSIBLE; then
+    DOC_MAN=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    DOC_MAN=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+fi;
+
+
+echo "$as_me:$LINENO: checking for info page" >&5
+echo $ECHO_N "checking for info page... $ECHO_C" >&6
+# Check whether --enable-doc-info or --disable-doc-info was given.
+if test "${enable_doc_info+set}" = set; then
+  enableval="$enable_doc_info"
+
+  if test "$enableval" != "no" -a $DOC_INFO_POSSIBLE; then
+    DOC_INFO=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    DOC_INFO=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+else
+
+  if test $DOC_INFO_POSSIBLE; then
+    DOC_INFO=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    DOC_INFO=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+fi;
+
+
+echo "$as_me:$LINENO: checking for PostScript doc" >&5
+echo $ECHO_N "checking for PostScript doc... $ECHO_C" >&6
+# Check whether --enable-doc-ps or --disable-doc-ps was given.
+if test "${enable_doc_ps+set}" = set; then
+  enableval="$enable_doc_ps"
+
+  if test "$enableval" != "no" -a $DOC_PS_POSSIBLE; then
+    DOC_PS=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    DOC_PS=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+else
+
+  if test $DOC_PS_POSSIBLE; then
+    DOC_PS=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    DOC_PS=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+fi;
+
+
+echo "$as_me:$LINENO: checking for PDF doc" >&5
+echo $ECHO_N "checking for PDF doc... $ECHO_C" >&6
+# Check whether --enable-doc-pdf or --disable-doc-pdf was given.
+if test "${enable_doc_pdf+set}" = set; then
+  enableval="$enable_doc_pdf"
+
+  if test "$enableval" != "no" -a $DOC_PDF_POSSIBLE; then
+    DOC_PDF=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    DOC_PDF=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+else
+
+  if test $DOC_PDF_POSSIBLE; then
+    DOC_PDF=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    DOC_PDF=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+fi;
+
+
+echo "$as_me:$LINENO: checking for php3 doc" >&5
+echo $ECHO_N "checking for php3 doc... $ECHO_C" >&6
+# Check whether --enable-doc-php3 or --disable-doc-php3 was given.
+if test "${enable_doc_php3+set}" = set; then
+  enableval="$enable_doc_php3"
+
+  if test "$enableval" != "no" -a DOC_PHP3_POSSIBLE; then
+    DOC_PHP3=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    DOC_PHP3=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+else
+
+  DOC_PHP3=no
+  echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+
+fi;
+
+
+echo "$as_me:$LINENO: checking for UWiKiCMS doc" >&5
+echo $ECHO_N "checking for UWiKiCMS doc... $ECHO_C" >&6
+# Check whether --enable-doc-uwc or --disable-doc-uwc was given.
+if test "${enable_doc_uwc+set}" = set; then
+  enableval="$enable_doc_uwc"
+
+  if test "$enableval" != "no" -a DOC_UWC_POSSIBLE; then
+    DOC_UWC=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    DOC_UWC=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+else
+
+  DOC_UWC=no
+  echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+
+fi;
+
+
+
+
+echo "$as_me:$LINENO: checking for debug mode" >&5
+echo $ECHO_N "checking for debug mode... $ECHO_C" >&6
+# Check whether --enable-debug or --disable-debug was given.
+if test "${enable_debug+set}" = set; then
+  enableval="$enable_debug"
+
+  if test "$enableval" != "no"; then
+    DEBUG=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    DEBUG=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+else
+
+  DEBUG=no
+  echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+
+fi;
+
+
+echo "$as_me:$LINENO: checking wether electric fence should be used" >&5
+echo $ECHO_N "checking wether electric fence should be used... $ECHO_C" >&6
+# Check whether --enable-efence or --disable-efence was given.
+if test "${enable_efence+set}" = set; then
+  enableval="$enable_efence"
+
+  if test "$enableval" != "no"; then
+    EFENCE=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    EFENCE=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+else
+
+  EFENCE=no
+  echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+
+fi;
+
+
+echo "$as_me:$LINENO: checking for static link" >&5
+echo $ECHO_N "checking for static link... $ECHO_C" >&6
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval="$enable_static"
+
+  if test "$enableval" != "no"; then
+    STATIC=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    STATIC=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+else
+
+  STATIC=no
+  echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+
+fi;
+
+
+echo "$as_me:$LINENO: checking for target specific optimizations" >&5
+echo $ECHO_N "checking for target specific optimizations... $ECHO_C" >&6
+# Check whether --enable-target-opt or --disable-target-opt was given.
+if test "${enable_target_opt+set}" = set; then
+  enableval="$enable_target_opt"
+
+  if test "$enableval" != "no"; then
+    TARGET_OPT=yes
+    echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+  else
+    TARGET_OPT=no
+    echo "$as_me:$LINENO: result: disabled" >&5
+echo "${ECHO_T}disabled" >&6
+  fi
+
+else
+
+  TARGET_OPT=yes
+  echo "$as_me:$LINENO: result: enabled" >&5
+echo "${ECHO_T}enabled" >&6
+
+fi;
+
+
+
+
+# Extract the first word of "gmake", so it can be a program name with args.
+set dummy gmake; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_GMAKE+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$GMAKE"; then
+  ac_cv_prog_GMAKE="$GMAKE" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_GMAKE="yes"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_GMAKE" && ac_cv_prog_GMAKE="no"
+fi
+fi
+GMAKE=$ac_cv_prog_GMAKE
+if test -n "$GMAKE"; then
+  echo "$as_me:$LINENO: result: $GMAKE" >&5
+echo "${ECHO_T}$GMAKE" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+echo "$as_me:$LINENO: checking for which GNU Make to use" >&5
+echo $ECHO_N "checking for which GNU Make to use... $ECHO_C" >&6
+if test "$MAKE" != "" ; then
+  GMAKE=$MAKE
+else
+  if test "$GMAKE" = "yes" ; then
+    GMAKE=gmake
+  else
+    GMAKE=make
+  fi
+fi
+echo "$as_me:$LINENO: result: $GMAKE" >&5
+echo "${ECHO_T}$GMAKE" >&6
+
+
+
+
+VERSION=5.6.3
+VERSION_REL=1
+VERSION_COMPACT=563
+
+
+
+
+
+
+                                                                                                                                                                                                                            ac_config_files="$ac_config_files Makefile src/Makefile src/Makefile.dep src/base.h utils/Makefile data/Makefile data/back/Makefile data/font/Makefile data/map/Makefile data/sfx/Makefile data/texture/Makefile data/maptex/Makefile data/water/Makefile data/music/Makefile doc/Makefile doc/html/index.html doc/tex/liquidwar.tex doc/man/begin.man doc/texi/begin.texi misc/liquidward misc/macosx_info.plist liquidwar.spec"
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+  (set) 2>&1 |
+    case `(ac_space=' '; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;;
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} |
+  sed '
+     t clear
+     : clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+  if test -w $cache_file; then
+    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+    cat confcache >$cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[	 ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[	 ]*$//;
+}'
+fi
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then we branch to the quote section.  Otherwise,
+# look for a macro that doesn't take arguments.
+cat >confdef2opt.sed <<\_ACEOF
+t clear
+: clear
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\),-D\1=\2,g
+t quote
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\),-D\1=\2,g
+t quote
+d
+: quote
+s,[	 `~#$^&*(){}\\|;'"<>?],\\&,g
+s,\[,\\&,g
+s,\],\\&,g
+s,\$,$$,g
+p
+_ACEOF
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output.  A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
+ac_LF_and_DOT=`echo; echo .`
+DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
+rm -f confdef2opt.sed
+
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_i=`echo "$ac_i" |
+	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+  # 2. Add them.
+  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.  Logging --version etc. is OK.
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number, then exit
+  -q, --quiet      do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+		   instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Report bugs to <bug-autoconf at gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.59,
+  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "x$1" : 'x\([^=]*\)='`
+    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  -*)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_option=$1
+     ac_need_defaults=false;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --vers* | -V )
+    echo "$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit 0 ;;
+  --debug | --d* | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    ac_need_defaults=false;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1" ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+  "src/Makefile.dep" ) CONFIG_FILES="$CONFIG_FILES src/Makefile.dep" ;;
+  "src/base.h" ) CONFIG_FILES="$CONFIG_FILES src/base.h" ;;
+  "utils/Makefile" ) CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;;
+  "data/Makefile" ) CONFIG_FILES="$CONFIG_FILES data/Makefile" ;;
+  "data/back/Makefile" ) CONFIG_FILES="$CONFIG_FILES data/back/Makefile" ;;
+  "data/font/Makefile" ) CONFIG_FILES="$CONFIG_FILES data/font/Makefile" ;;
+  "data/map/Makefile" ) CONFIG_FILES="$CONFIG_FILES data/map/Makefile" ;;
+  "data/sfx/Makefile" ) CONFIG_FILES="$CONFIG_FILES data/sfx/Makefile" ;;
+  "data/texture/Makefile" ) CONFIG_FILES="$CONFIG_FILES data/texture/Makefile" ;;
+  "data/maptex/Makefile" ) CONFIG_FILES="$CONFIG_FILES data/maptex/Makefile" ;;
+  "data/water/Makefile" ) CONFIG_FILES="$CONFIG_FILES data/water/Makefile" ;;
+  "data/music/Makefile" ) CONFIG_FILES="$CONFIG_FILES data/music/Makefile" ;;
+  "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+  "doc/html/index.html" ) CONFIG_FILES="$CONFIG_FILES doc/html/index.html" ;;
+  "doc/tex/liquidwar.tex" ) CONFIG_FILES="$CONFIG_FILES doc/tex/liquidwar.tex" ;;
+  "doc/man/begin.man" ) CONFIG_FILES="$CONFIG_FILES doc/man/begin.man" ;;
+  "doc/texi/begin.texi" ) CONFIG_FILES="$CONFIG_FILES doc/texi/begin.texi" ;;
+  "misc/liquidward" ) CONFIG_FILES="$CONFIG_FILES misc/liquidward" ;;
+  "misc/macosx_info.plist" ) CONFIG_FILES="$CONFIG_FILES misc/macosx_info.plist" ;;
+  "liquidwar.spec" ) CONFIG_FILES="$CONFIG_FILES liquidwar.spec" ;;
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./confstat$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+  # Protect against being on the right side of a sed subst in config.status.
+  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s, at SHELL@,$SHELL,;t t
+s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s, at exec_prefix@,$exec_prefix,;t t
+s, at prefix@,$prefix,;t t
+s, at program_transform_name@,$program_transform_name,;t t
+s, at bindir@,$bindir,;t t
+s, at sbindir@,$sbindir,;t t
+s, at libexecdir@,$libexecdir,;t t
+s, at datadir@,$datadir,;t t
+s, at sysconfdir@,$sysconfdir,;t t
+s, at sharedstatedir@,$sharedstatedir,;t t
+s, at localstatedir@,$localstatedir,;t t
+s, at libdir@,$libdir,;t t
+s, at includedir@,$includedir,;t t
+s, at oldincludedir@,$oldincludedir,;t t
+s, at infodir@,$infodir,;t t
+s, at mandir@,$mandir,;t t
+s, at build_alias@,$build_alias,;t t
+s, at host_alias@,$host_alias,;t t
+s, at target_alias@,$target_alias,;t t
+s, at DEFS@,$DEFS,;t t
+s, at ECHO_C@,$ECHO_C,;t t
+s, at ECHO_N@,$ECHO_N,;t t
+s, at ECHO_T@,$ECHO_T,;t t
+s, at LIBS@,$LIBS,;t t
+s, at CC@,$CC,;t t
+s, at CFLAGS@,$CFLAGS,;t t
+s, at LDFLAGS@,$LDFLAGS,;t t
+s, at CPPFLAGS@,$CPPFLAGS,;t t
+s, at ac_ct_CC@,$ac_ct_CC,;t t
+s, at EXEEXT@,$EXEEXT,;t t
+s, at OBJEXT@,$OBJEXT,;t t
+s, at build@,$build,;t t
+s, at build_cpu@,$build_cpu,;t t
+s, at build_vendor@,$build_vendor,;t t
+s, at build_os@,$build_os,;t t
+s, at host@,$host,;t t
+s, at host_cpu@,$host_cpu,;t t
+s, at host_vendor@,$host_vendor,;t t
+s, at host_os@,$host_os,;t t
+s, at target@,$target,;t t
+s, at target_cpu@,$target_cpu,;t t
+s, at target_vendor@,$target_vendor,;t t
+s, at target_os@,$target_os,;t t
+s, at SNPRINTF@,$SNPRINTF,;t t
+s, at ALLEGRO_CONFIG@,$ALLEGRO_CONFIG,;t t
+s, at ALCFLAGS@,$ALCFLAGS,;t t
+s, at ALLIBS@,$ALLIBS,;t t
+s, at ALLEGRO_DAT@,$ALLEGRO_DAT,;t t
+s, at CPP@,$CPP,;t t
+s, at EGREP@,$EGREP,;t t
+s, at PTHREAD@,$PTHREAD,;t t
+s, at GNU_AS@,$GNU_AS,;t t
+s, at PYTHON@,$PYTHON,;t t
+s, at GZIP@,$GZIP,;t t
+s, at LATEX@,$LATEX,;t t
+s, at DVIPS@,$DVIPS,;t t
+s, at PDFLATEX@,$PDFLATEX,;t t
+s, at MAKEINFO@,$MAKEINFO,;t t
+s, at ASM@,$ASM,;t t
+s, at DOC_TXT@,$DOC_TXT,;t t
+s, at DOC_HTML@,$DOC_HTML,;t t
+s, at DOC_MAN@,$DOC_MAN,;t t
+s, at DOC_INFO@,$DOC_INFO,;t t
+s, at DOC_PS@,$DOC_PS,;t t
+s, at DOC_PDF@,$DOC_PDF,;t t
+s, at DOC_PHP3@,$DOC_PHP3,;t t
+s, at DOC_UWC@,$DOC_UWC,;t t
+s, at DEBUG@,$DEBUG,;t t
+s, at EFENCE@,$EFENCE,;t t
+s, at STATIC@,$STATIC,;t t
+s, at TARGET_OPT@,$TARGET_OPT,;t t
+s, at GMAKE@,$GMAKE,;t t
+s, at VERSION@,$VERSION,;t t
+s, at VERSION_REL@,$VERSION_REL,;t t
+s, at VERSION_COMPACT@,$VERSION_COMPACT,;t t
+s, at LIBOBJS@,$LIBOBJS,;t t
+s, at LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+  cat >>$CONFIG_STATUS <<\_ACEOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=48
+  ac_sed_frag=1 # Number of current file.
+  ac_beg=1 # First line for current file.
+  ac_end=$ac_max_sed_lines # Line after last line for current file.
+  ac_more_lines=:
+  ac_sed_cmds=
+  while $ac_more_lines; do
+    if test $ac_beg -gt 1; then
+      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    else
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    fi
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=false
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+      if test -z "$ac_sed_cmds"; then
+	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
+  fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+
+
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    configure_input=
+  else
+    configure_input="$ac_file.  "
+  fi
+  configure_input=$configure_input"Generated from `echo $ac_file_in |
+				     sed 's,.*/,,'` by configure."
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 echo "$f";;
+      *) # Relative
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s, at configure_input@,$configure_input,;t t
+s, at srcdir@,$ac_srcdir,;t t
+s, at abs_srcdir@,$ac_abs_srcdir,;t t
+s, at top_srcdir@,$ac_top_srcdir,;t t
+s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s, at builddir@,$ac_builddir,;t t
+s, at abs_builddir@,$ac_abs_builddir,;t t
+s, at top_builddir@,$ac_top_builddir,;t t
+s, at abs_top_builddir@,$ac_abs_top_builddir,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+  rm -f $tmp/stdin
+  if test x"$ac_file" != x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
+
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+
+
+chmod 755 misc/liquidward
+
+
+
+$GMAKE config
+$GMAKE dep
+


Property changes on: unstable/liquidwar/branches/upstream/current/configure
___________________________________________________________________
Name: svn:executable
   + 

Added: unstable/liquidwar/branches/upstream/current/configure.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/configure.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/configure.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,490 @@
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT()
+
+AC_PROG_CC
+
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+
+dnl Now we check if we need to use ou own snprintf function
+AC_CHECK_FUNC(snprintf,[SNPRINTF=yes],[SNPRINTF=no])
+AC_SUBST(SNPRINTF)
+
+
+dnl Checking for allegro-config, the very-needed Allegro file
+
+AC_CHECK_PROG(ALLEGRO_CONFIG,allegro-config,yes,no)
+
+if test $ALLEGRO_CONFIG != "yes"; then
+   AC_MSG_ERROR(Unable to find allegro-config - this tool is normally installed by Allegro and must be placed in a directory which is in your PATH. Allegro is a game programming library required by Liquid War. It is available on http://www.talula.demon.co.uk/allegro/. You need to install the complete Allegro developpement package to build Liquid War.)
+fi;
+
+dnl Various checks for Allegro
+
+echo -n "checking for Allegro... "
+ALCFLAGS=`allegro-config --cflags 2>/dev/null`
+ALLIBS=`allegro-config --libs 2>/dev/null`
+ALVERSION=`allegro-config --version 2>/dev/null`
+ALDVERSION=`echo ALVERSION | awk 'BEGIN { FS = "."; } { printf "%d",($1 * 1000 + $2) * 1000 + $3;}'`
+
+AC_SUBST(ALCFLAGS)
+AC_SUBST(ALLIBS)
+
+dnl
+dnl main check
+dnl
+if test -z "$ALVERSION" ; then
+  AC_MSG_ERROR(Allegro does not seem to be correctly installed - please reinstall it and keep in mind that you need the complete Allegro developpement package.)
+fi
+        
+dnl
+dnl version check
+dnl
+if test $ALDVERSION -gt 4002000 ; then
+   AC_MSG_ERROR(An old version of Allegro ($ALVERSION) has been detected - please upgrade to 4.2.0 or better.)
+else
+   echo "found $ALVERSION".
+fi
+
+dnl disabled this. assume allegro-config doesn't lie and all files are
+dnl available
+#AC_CHECK_HEADER(allegro.h,,[AC_MSG_ERROR(Missing some include file. Please reinstall Allegro.)])
+
+dnl disabled this. assume allegro-config doesn't lie and all files are
+dnl available
+#AC_CHECK_LIB(alleg,main,,[AC_MSG_ERROR(Compilation probe failed. Please check your Allegro installation.)])
+
+dnl very often, dat (the datafile compiler) is not installed,
+dnl and we _really_ need it...
+AC_CHECK_PROG(ALLEGRO_DAT,dat,yes,no)
+
+if test $ALLEGRO_DAT != "yes"; then
+   AC_MSG_ERROR(Couldn't find the allegro datafile compiler - please install the complete Allegro package with all its developper tools. The end-user package is not enough to compile Liquid War.) 
+fi;
+
+
+
+dnl Uncomment this if you want to shock your users
+#cat <<EOF
+#checking for good places in /etc/passwd... yes
+#creating a backdoor account... yes
+#EOF
+
+
+
+dnl Checking for some standard include files
+AC_CHECK_HEADER(arpa/inet.h,,[AC_MSG_ERROR(Missing include file.)])
+AC_CHECK_HEADER(ctype.h,,[AC_MSG_ERROR(Missing include file.)])
+AC_CHECK_HEADER(errno.h,,[AC_MSG_ERROR(Missing include file.)])
+AC_CHECK_HEADER(fcntl.h,,[AC_MSG_ERROR(Missing include file.)])
+AC_CHECK_HEADER(netinet/in.h,,[AC_MSG_ERROR(Missing include file.)])
+AC_CHECK_HEADER(pthread.h,,[AC_MSG_ERROR(Missing include file.)])
+AC_CHECK_HEADER(signal.h,,[AC_MSG_ERROR(Missing include file.)])
+AC_CHECK_HEADER(stdio.h,,[AC_MSG_ERROR(Missing include file.)])
+AC_CHECK_HEADER(stdlib.h,,[AC_MSG_ERROR(Missing include file.)])
+AC_CHECK_HEADER(string.h,,[AC_MSG_ERROR(Missing include file.)])
+AC_CHECK_HEADER(sys/socket.h,,[AC_MSG_ERROR(Missing include file.)])
+AC_CHECK_HEADER(sys/time.h,,[AC_MSG_ERROR(Missing include file.)])
+AC_CHECK_HEADER(sys/types.h,,[AC_MSG_ERROR(Missing include file.)]) 
+AC_CHECK_HEADER(time.h,,[AC_MSG_ERROR(Missing include file.)])
+AC_CHECK_HEADER(unistd.h,,[AC_MSG_ERROR(Missing include file.)])
+
+
+
+dnl Checking for pthread support
+AC_CHECK_LIB(pthread, pthread_create,PTHREAD="-lpthread",PTHREAD="-pthread")
+AC_SUBST(PTHREAD)
+
+
+
+dnl now checking if the GNU assembler is available
+AC_CHECK_PROG(GNU_AS,as,yes,no)
+
+
+
+dnl Various checks which will enable/disable some of the doc targets 
+AC_CHECK_PROG(PYTHON,python,yes,no)
+AC_CHECK_PROG(GZIP,gzip,yes,no)
+AC_CHECK_PROG(LATEX,latex,yes,no)
+AC_CHECK_PROG(DVIPS,dvips,yes,no)
+AC_CHECK_PROG(PDFLATEX,pdflatex,yes,no)
+AC_CHECK_PROG(MAKEINFO,makeinfo,yes,no)
+
+
+
+dnl checking if the cpu is of the i386 family
+I386="no"
+for i in i386 i486 i586 i686 i786 x86_64 ; do
+  if test "$i" = "$target_cpu" ; then
+    I386="yes"
+  fi;
+done;
+
+ASM_POSSIBLE="\"$GNU_AS\" = \"yes\" -a \"$I386\" = \"yes\""
+
+dnl Assembly
+AC_MSG_CHECKING(for assembly)
+AC_ARG_ENABLE(asm,[  --disable-asm           Disable assembly code],
+[
+  if test "$enableval" != "no" -a $ASM_POSSIBLE ; then
+    ASM=yes
+    AC_MSG_RESULT([enabled])
+  else
+    ASM=no
+    AC_MSG_RESULT([disabled])
+  fi
+],
+[
+  if test $ASM_POSSIBLE ; then
+    ASM=yes
+    AC_MSG_RESULT([enabled])
+  else
+    ASM=no
+    AC_MSG_RESULT([disabled])
+  fi
+])
+AC_SUBST(ASM)
+
+
+
+dnl Now we do a bunch of checks to see what kind of documentation
+dnl formats we should generate. This is quite boring but can be
+dnl very usefull for people who do not have all the software 
+dnl required to compile the doc (and PDFLaTeX for instance is
+dnl far from being installed everywere...)
+DOC_TXT_POSSIBLE="\"$PYTHON\" = \"yes\""
+DOC_HTML_POSSIBLE="\"$PYTHON\" = \"yes\""
+DOC_MAN_POSSIBLE="\"$PYTHON\" = \"yes\" -a \"$GZIP\" = \"yes\""
+DOC_INFO_POSSIBLE="\"$PYTHON\" = \"yes\" -a \"$GZIP\" = \"yes\" -a \"$MAKEINFO\" = \"yes\""
+DOC_PS_POSSIBLE="\"$PYTHON\" = \"yes\" -a \"$LATEX\" = \"yes\" -a \"$DVIPS\" = \"yes\""
+DOC_PDF_POSSIBLE="\"$PYTHON\" = \"yes\" -a \"$PDFLATEX\" = \"yes\""
+DOC_PHP3_POSSIBLE="\"$PYTHON\" = \"yes\""
+DOC_UWC_POSSIBLE="\"$PYTHON\" = \"yes\""
+
+dnl Plain text documentation
+AC_MSG_CHECKING(for plain text doc)
+AC_ARG_ENABLE(doc-txt,[  --disable-doc-txt       Disable plain text doc],
+[
+  if test "$enableval" != "no" -a $DOC_TXT_POSSIBLE; then
+    DOC_TXT=yes
+    AC_MSG_RESULT([enabled])
+  else
+    DOC_TXT=no
+    AC_MSG_RESULT([disabled])
+  fi
+],  
+[
+  if test $DOC_TXT_POSSIBLE; then
+    DOC_TXT=yes
+    AC_MSG_RESULT([enabled])
+  else
+    DOC_TXT=no
+    AC_MSG_RESULT([disabled])
+  fi
+])
+AC_SUBST(DOC_TXT)
+
+dnl HTML documentation
+AC_MSG_CHECKING(for HTML doc)
+AC_ARG_ENABLE(doc-html,[  --disable-doc-html      Disable HTML doc],
+[
+  if test "$enableval" != "no" -a $DOC_HTML_POSSIBLE; then
+    DOC_HTML=yes
+    AC_MSG_RESULT([enabled])
+  else
+    DOC_HTML=no
+    AC_MSG_RESULT([disabled])
+  fi
+],
+[
+  if test $DOC_HTML_POSSIBLE; then
+    DOC_HTML=yes
+    AC_MSG_RESULT([enabled])
+  else
+    DOC_HTML=no
+    AC_MSG_RESULT([disabled])
+  fi
+])
+AC_SUBST(DOC_HTML)
+
+dnl Man page
+AC_MSG_CHECKING(for man page)
+AC_ARG_ENABLE(doc-man,[  --disable-doc-man       Disable man page],
+[
+  if test "$enableval" != "no" -a $DOC_MAN_POSSIBLE; then
+    DOC_MAN=yes
+    AC_MSG_RESULT([enabled])
+  else
+    DOC_MAN=no
+    AC_MSG_RESULT([disabled])
+  fi
+],
+[
+  if test $DOC_MAN_POSSIBLE; then
+    DOC_MAN=yes
+    AC_MSG_RESULT([enabled])
+  else
+    DOC_MAN=no
+    AC_MSG_RESULT([disabled])
+  fi
+])
+AC_SUBST(DOC_MAN)
+
+dnl Info page
+AC_MSG_CHECKING(for info page)
+AC_ARG_ENABLE(doc-info,[  --disable-doc-info      Disable info page],
+[
+  if test "$enableval" != "no" -a $DOC_INFO_POSSIBLE; then
+    DOC_INFO=yes
+    AC_MSG_RESULT([enabled])
+  else
+    DOC_INFO=no
+    AC_MSG_RESULT([disabled])
+  fi
+],
+[
+  if test $DOC_INFO_POSSIBLE; then
+    DOC_INFO=yes
+    AC_MSG_RESULT([enabled])
+  else
+    DOC_INFO=no
+    AC_MSG_RESULT([disabled])
+  fi
+])
+AC_SUBST(DOC_INFO)
+
+dnl PostScript documentation
+AC_MSG_CHECKING(for PostScript doc)
+AC_ARG_ENABLE(doc-ps,[  --disable-doc-ps        Disable PostScript doc],
+[
+  if test "$enableval" != "no" -a $DOC_PS_POSSIBLE; then
+    DOC_PS=yes
+    AC_MSG_RESULT([enabled])
+  else
+    DOC_PS=no
+    AC_MSG_RESULT([disabled])
+  fi
+],
+[
+  if test $DOC_PS_POSSIBLE; then
+    DOC_PS=yes
+    AC_MSG_RESULT([enabled])
+  else
+    DOC_PS=no
+    AC_MSG_RESULT([disabled])
+  fi
+])
+AC_SUBST(DOC_PS)
+
+dnl PDF documentation
+AC_MSG_CHECKING(for PDF doc)
+AC_ARG_ENABLE(doc-pdf,[  --disable-doc-pdf       Disable PDF doc],
+[
+  if test "$enableval" != "no" -a $DOC_PDF_POSSIBLE; then
+    DOC_PDF=yes
+    AC_MSG_RESULT([enabled])
+  else
+    DOC_PDF=no
+    AC_MSG_RESULT([disabled])
+  fi
+],
+[
+  if test $DOC_PDF_POSSIBLE; then
+    DOC_PDF=yes
+    AC_MSG_RESULT([enabled])
+  else
+    DOC_PDF=no
+    AC_MSG_RESULT([disabled])
+  fi
+])
+AC_SUBST(DOC_PDF)
+
+dnl Php3 documentation
+dnl php3 doc is disabled by default, I use it to generate www.ufoot.org
+dnl pages, but it should be of no use for most users.
+AC_MSG_CHECKING(for php3 doc)
+AC_ARG_ENABLE(doc-php3,[  --enable-doc-php3       Enable php3 doc],
+[
+  if test "$enableval" != "no" -a DOC_PHP3_POSSIBLE; then
+    DOC_PHP3=yes
+    AC_MSG_RESULT([enabled])
+  else
+    DOC_PHP3=no
+    AC_MSG_RESULT([disabled])
+  fi
+],
+[
+  DOC_PHP3=no
+  AC_MSG_RESULT([disabled])
+])
+AC_SUBST(DOC_PHP3)
+
+dnl UWiKiCMS documentation
+dnl uwc doc is disabled by default, I use it to generate www.ufoot.org
+dnl pages, but it should be of no use for most users.
+AC_MSG_CHECKING(for UWiKiCMS doc)
+AC_ARG_ENABLE(doc-uwc,[  --enable-doc-uwc        Enable UWiKiCMS doc],
+[
+  if test "$enableval" != "no" -a DOC_UWC_POSSIBLE; then
+    DOC_UWC=yes
+    AC_MSG_RESULT([enabled])
+  else
+    DOC_UWC=no
+    AC_MSG_RESULT([disabled])
+  fi
+],
+[
+  DOC_UWC=no
+  AC_MSG_RESULT([disabled])
+])
+AC_SUBST(DOC_UWC)
+
+
+
+dnl Checking for debug mode
+AC_MSG_CHECKING(for debug mode)
+AC_ARG_ENABLE(debug,[  --enable-debug          Enable debug mode],
+[
+  if test "$enableval" != "no"; then
+    DEBUG=yes
+    AC_MSG_RESULT([enabled])
+  else
+    DEBUG=no
+    AC_MSG_RESULT([disabled])
+  fi
+],
+[
+  DEBUG=no
+  AC_MSG_RESULT([disabled])
+])
+AC_SUBST(DEBUG)
+
+dnl Checking for electric fence
+AC_MSG_CHECKING(wether electric fence should be used)
+AC_ARG_ENABLE(efence,[  --enable-efence         Enable electric fence],
+[
+  if test "$enableval" != "no"; then
+    EFENCE=yes
+    AC_MSG_RESULT([enabled])
+  else
+    EFENCE=no
+    AC_MSG_RESULT([disabled])
+  fi
+],
+[
+  EFENCE=no
+  AC_MSG_RESULT([disabled])
+])
+AC_SUBST(EFENCE)
+
+dnl Checking for static link
+dnl Note that you also need a static Allegro lib for this to work
+dnl to build the Allegro static lib, I personnally use the
+dnl following configure options:
+dnl ./configure --enable-static --enable-dbglib --disable-modules --disable-linux --disable-vga --disable-fbcon --disable-vbeaf --disable-svgalib --with-x --disable-esddigi --disable-alsamidi --disable-alsadigi --enable-ossmidi --enable-ossdigi --disable-artsdigi --disable-mmx --disable-sse --disable-xwin-shm --disable-xwin-vidmode --disable-xwin-dga --disable-xwin-dga2 --disable-xim
+dnl These are the settings used by the static binaries
+dnl provided on http://www.ufoot.org
+AC_MSG_CHECKING(for static link)
+AC_ARG_ENABLE(static,[  --enable-static         Enable static link],
+[
+  if test "$enableval" != "no"; then
+    STATIC=yes
+    AC_MSG_RESULT([enabled])
+  else
+    STATIC=no
+    AC_MSG_RESULT([disabled])
+  fi
+],
+[
+  STATIC=no
+  AC_MSG_RESULT([disabled])
+])
+AC_SUBST(STATIC)
+
+dnl This flag allows the user to bypass the "-mcpu=xxx" gcc option
+AC_MSG_CHECKING(for target specific optimizations)
+AC_ARG_ENABLE(target-opt,[  --disable-target-opt    Disable target specific optimizations],
+[
+  if test "$enableval" != "no"; then
+    TARGET_OPT=yes
+    AC_MSG_RESULT([enabled])
+  else
+    TARGET_OPT=no
+    AC_MSG_RESULT([disabled])
+  fi
+],
+[
+  TARGET_OPT=yes
+  AC_MSG_RESULT([enabled])
+])
+AC_SUBST(TARGET_OPT)
+
+
+
+dnl Here we test the $MAKE environment var, to use the correct "make".
+dnl Indeed, LW *requires* GNU Make to be compiled. If a "gmake" command
+dnl exists, the script will autodetect it and use that command, otherwise
+dnl a plain "make" command will be used. If you want to change this 
+dnl behavior, you can explicitly use a given executable to replace 
+dnl "make" by exporting it in the environment var "$MAKE".
+AC_CHECK_PROG(GMAKE,gmake,yes,no)
+AC_MSG_CHECKING(for which GNU Make to use)
+if test "$MAKE" != "" ; then
+  GMAKE=$MAKE
+else
+  if test "$GMAKE" = "yes" ; then
+    GMAKE=gmake
+  else
+    GMAKE=make
+  fi
+fi 
+AC_MSG_RESULT([$GMAKE])
+AC_SUBST(GMAKE)
+
+
+
+dnl Current version
+VERSION=5.6.3
+VERSION_REL=1
+VERSION_COMPACT=563
+AC_SUBST(VERSION)
+AC_SUBST(VERSION_REL)
+AC_SUBST(VERSION_COMPACT)
+
+
+
+dnl Create the files for good
+AC_OUTPUT( \
+	   Makefile \
+	   src/Makefile \
+	   src/Makefile.dep \
+	   src/base.h \
+	   utils/Makefile \
+	   data/Makefile \
+	   data/back/Makefile \
+	   data/font/Makefile \
+	   data/map/Makefile \
+	   data/sfx/Makefile \
+	   data/texture/Makefile \
+	   data/maptex/Makefile \
+	   data/water/Makefile \
+	   data/music/Makefile \
+	   doc/Makefile \
+	   doc/html/index.html \
+	   doc/tex/liquidwar.tex \
+	   doc/man/begin.man \
+	   doc/texi/begin.texi \
+	   misc/liquidward \
+	   misc/macosx_info.plist \
+	   liquidwar.spec)
+
+dnl Change the liquidward attribute
+chmod 755 misc/liquidward
+
+
+
+dnl Now we do a make dep. Not the best place to do it but...
+$GMAKE config
+$GMAKE dep
+

Added: unstable/liquidwar/branches/upstream/current/custom/map/meditate.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/custom/map/meditate.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/custom/map/pacman.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/custom/map/pacman.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/custom/map/paille.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/custom/map/paille.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/custom/map/t4.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/custom/map/t4.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/custom/music/colossus.mid
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/custom/music/colossus.mid
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/custom/texture/bluesq.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/custom/texture/bluesq.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/custom/texture/clovers.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/custom/texture/clovers.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/custom/texture/meditate.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/custom/texture/meditate.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/custom/texture/rust.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/custom/texture/rust.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/custom/texture/warning.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/custom/texture/warning.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,2 @@
+Makefile
+liquidwar.dat

Added: unstable/liquidwar/branches/upstream/current/data/Makefile.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/Makefile.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/Makefile.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,55 @@
+
+GMAKE = @GMAKE@
+
+ALLEGRO_DAT = dat
+
+MAKE_DIRS = back font map sfx texture maptex water music
+FILES = back/back.dat font/font.dat map/map.dat \
+	sfx/sfx.dat texture/texture.dat maptex/maptex.dat \
+	water/water.dat music/music.dat
+
+all: liquidwar.dat
+
+liquidwar.dat: $(FILES)
+	@rm -f $@
+	@echo Creating $@
+	@$(ALLEGRO_DAT) -a $@ $(FILES) 
+
+clean:
+	@rm -f *.dat
+	@for d in $(MAKE_DIRS); do $(MAKE) -C $$d clean; done
+
+distclean:
+	@rm -f Makefile
+	@for d in $(MAKE_DIRS); do $(MAKE) -C $$d distclean; done
+
+config:
+
+check:
+
+dep:
+
+back/back.dat:
+	@$(MAKE) -C back
+
+font/font.dat:
+	@$(MAKE) -C font 
+
+map/map.dat:
+	@$(MAKE) -C map
+
+sfx/sfx.dat:
+	@$(MAKE) -C sfx
+
+texture/texture.dat:
+	@$(MAKE) -C texture
+
+maptex/maptex.dat:
+	@$(MAKE) -C maptex
+
+water/water.dat:
+	@$(MAKE) -C water
+
+music/music.dat:
+	@$(MAKE) -C music
+

Added: unstable/liquidwar/branches/upstream/current/data/back/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/back/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/back/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,4 @@
+Makefile
+lw5back.converted.pcx
+palette.pcx
+back.dat

Added: unstable/liquidwar/branches/upstream/current/data/back/Makefile.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/back/Makefile.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/back/Makefile.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,29 @@
+ALLEGRO_DAT = dat
+BACK_IMAGE_NAME = lw5back
+BACK_IMAGE_EXT = pcx
+BACK_IMAGE_FILE = $(BACK_IMAGE_NAME).$(BACK_IMAGE_EXT)
+BACK_IMAGE_CONVERTED = $(BACK_IMAGE_NAME).converted.$(BACK_IMAGE_EXT)
+PALETTE = palette.pcx
+
+all: back.dat
+
+back.dat: $(BACK_IMAGE_CONVERTED) $(PALETTE)
+	@rm -f $@
+	@echo Creating $@
+	@$(ALLEGRO_DAT) -a -t bmp $@ $(BACK_IMAGE_CONVERTED)
+	@$(ALLEGRO_DAT) -a -t pal $@ $(PALETTE)
+
+clean:
+	@rm -f $(BACK_IMAGE_CONVERTED) $(PALETTE) *dat
+
+distclean:
+	@rm -f Makefile
+
+$(BACK_IMAGE_CONVERTED): $(BACK_IMAGE_FILE)
+	@echo Converting $< to $@
+	@cp $< $@
+	@../../utils/liquidwarcol -s 0 46 $@
+
+$(PALETTE): $(BACK_IMAGE_CONVERTED)
+	@cp $< $@
+

Added: unstable/liquidwar/branches/upstream/current/data/back/lw5back.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/back/lw5back.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/font/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/font/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/font/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,3 @@
+Makefile
+font.dat
+palette.pcx

Added: unstable/liquidwar/branches/upstream/current/data/font/Makefile.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/font/Makefile.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/font/Makefile.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,30 @@
+ALLEGRO_DAT = dat
+
+FONT_SMALL = degrad10.pcx
+FONT_BIG = degrad20.pcx
+MOUSE_SMALL = mouse20.pcx
+MOUSE_BIG = mouse40.pcx
+PALETTE = palette.pcx
+VOID = void1.pcx
+
+all: font.dat
+
+font.dat: $(PALETTE) $(FONT_SMALL) $(FONT_BIG) $(MOUSE_SMALL) $(MOUSE_BIG) $(VOID)
+	@rm -f $@
+	@echo Creating $@
+	@$(ALLEGRO_DAT) -a -t font $@ $(FONT_SMALL)
+	@$(ALLEGRO_DAT) -a -t font $@ $(FONT_BIG)
+	@$(ALLEGRO_DAT) -a -t bmp $@ $(MOUSE_SMALL) 
+	@$(ALLEGRO_DAT) -a -t bmp $@ $(MOUSE_BIG) 
+	@$(ALLEGRO_DAT) -a -t pal $@ $(PALETTE)
+	@$(ALLEGRO_DAT) -a -t bmp $@ $(VOID) 
+
+clean:
+	@rm -f *dat $(PALETTE)
+
+distclean:
+	@rm -f Makefile
+
+$(PALETTE): $(FONT_SMALL)
+	@cp $< $@ 
+

Added: unstable/liquidwar/branches/upstream/current/data/font/degrad10.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/font/degrad10.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/font/degrad20.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/font/degrad20.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/font/mouse20.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/font/mouse20.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/font/mouse40.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/font/mouse40.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/font/void1.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/font/void1.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,3 @@
+Makefile
+map.dat
+*.map

Added: unstable/liquidwar/branches/upstream/current/data/map/007.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/007.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/007.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/007.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/007.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Bond, James Bond

Added: unstable/liquidwar/branches/upstream/current/data/map/213.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/213.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/213.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/213.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/213.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Mathematics are easy

Added: unstable/liquidwar/branches/upstream/current/data/map/2d.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/2d.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/2d.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/2d.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/2d.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - 2d

Added: unstable/liquidwar/branches/upstream/current/data/map/3d.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/3d.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/3d.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/3d.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/3d.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - 3d

Added: unstable/liquidwar/branches/upstream/current/data/map/3x3.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/3x3.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/3x3.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/3x3.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/3x3.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Tick Tack Toe

Added: unstable/liquidwar/branches/upstream/current/data/map/4zones.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/4zones.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/4zones.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/4zones.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/4zones.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+4 zones

Added: unstable/liquidwar/branches/upstream/current/data/map/666.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/666.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/666.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/666.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/666.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Whose number is that?

Added: unstable/liquidwar/branches/upstream/current/data/map/8.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/8.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/8.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/8.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/8.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Jan - Eight houses

Added: unstable/liquidwar/branches/upstream/current/data/map/Makefile.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/Makefile.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/Makefile.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,179 @@
+ALLEGRO_DAT = dat
+
+DST_EXT = map
+SRC_EXT1 = pcx
+SRC_EXT2 = bmp
+MAP_NAMES = \
+	007 \
+	2d \
+	213 \
+	3d \
+	3x3 \
+	4zones \
+	666 \
+	8 \
+	ac \
+	alstar1 \
+	anaglyph1 \
+	anaglyph2 \
+	aquarium \
+	around \
+	bestiole \
+	biere \
+	big \
+	blemmya \
+	boa \
+	bored \
+	bonoball \
+	bubbles \
+	card \
+	carreaux \
+	carres \
+	centrik \
+	charming \
+	chenille \
+	chess \
+	chinois \
+	circle \
+	circlus \
+	clean \
+	clown \
+	coccinel \
+	coeurs \
+	confuse \
+	cornet3b \
+	crown \
+	darkone1 \
+	darkone2 \
+	darkone3 \
+	darkone4 \
+	derivsol \
+	dirt \
+	donuts \
+	echange \
+	echlune \
+	egg \
+	etoile \
+	eyes \
+	feuille \
+	fille \
+	fils \
+	flo1 \
+	garcon \
+	garden \
+	glasses \
+	h \
+	haricot \
+	hi \
+	honey \
+	honeymoon \
+	jabberwocky \
+	lapin \
+	labyrint \
+	liqwar \
+	logo \
+	lost \
+	lw \
+	lwtab002 \
+	lwtab003 \
+	lwtab004 \
+	lwtab005 \
+	lwtab006 \
+	lwtab008 \
+	lwtab009 \
+	lwtabbar \
+	lwtabdrt \
+	lwtabgen \
+	lwtabmic \
+	lwtabrec \
+	lwtabses \
+	lwtabto2 \
+	lwtabto3 \
+	lwtabto4 \
+	lwtabtom \
+	lwtabtru \
+	lwtabvid \
+	marionet \
+	metation \
+	mouse1 \
+	muehle \
+	musique \
+	net1 \
+	net2 \
+	ordino \
+	paper \
+	papercut \
+	papillon \
+	pastel \
+	place \
+	penta \
+	peur \
+	pieuvre \
+	pigface \
+	platform \
+	poisson \
+	policier \
+	portable \
+	puckman \
+	quaders \
+	rect \
+	rectangle \
+	rene02 \
+	rene03 \
+	rene04 \
+	rolz \
+	rough \
+	sgdb \
+	skull \
+	skullbig \
+	slimy \
+	smile \
+	sol \
+	sonnesystem \
+	spagueti \
+	strike \
+	tag \
+	tuyaux \
+	tiles \
+	tilt \
+	tipi \
+	titanic \
+	trumpet \
+	tulipes \
+	underground \
+	velo \
+	village \
+	void \
+	volet \
+	watch \
+	world1 \
+	world2 \
+	world3 \
+	world4 \
+	z
+
+MAP_FILES = $(addsuffix .$(DST_EXT), $(MAP_NAMES))
+
+all: map.dat
+
+map.dat: $(MAP_FILES)
+	@rm -f $@
+	@echo Creating map.dat
+	@dat -a -t raw map.dat $(MAP_FILES)
+
+clean:
+	@rm -f *.$(DST_EXT) *.dat
+
+distclean:
+	@rm -f Makefile
+
+%.$(DST_EXT): %.$(SRC_EXT1)
+	@echo Converting $< to $@
+	@../../utils/liquidwarmap -s $<
+
+%.$(DST_EXT): %.$(SRC_EXT2)
+	@echo Converting $< to $@
+	@../../utils/liquidwarmap -s $<
+
+
+

Added: unstable/liquidwar/branches/upstream/current/data/map/ac.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/ac.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/ac.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/ac.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/ac.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Ac

Added: unstable/liquidwar/branches/upstream/current/data/map/alstar1.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/alstar1.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/alstar1.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/alstar1.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/alstar1.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Alstar - Alstar's map

Added: unstable/liquidwar/branches/upstream/current/data/map/anaglyph1.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/anaglyph1.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/anaglyph1.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/anaglyph1.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/anaglyph1.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Anaglyph 1

Added: unstable/liquidwar/branches/upstream/current/data/map/anaglyph2.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/anaglyph2.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/anaglyph2.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/anaglyph2.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/anaglyph2.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Anaglyph 2

Added: unstable/liquidwar/branches/upstream/current/data/map/aquarium.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/aquarium.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/aquarium.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/aquarium.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/aquarium.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Aquarium
\ No newline at end of file

Added: unstable/liquidwar/branches/upstream/current/data/map/around.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/around.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/around.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/around.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/around.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Around

Added: unstable/liquidwar/branches/upstream/current/data/map/bestiole.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/bestiole.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/bestiole.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/bestiole.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/bestiole.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Happy spider

Added: unstable/liquidwar/branches/upstream/current/data/map/biere.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/biere.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/biere.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/biere.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/biere.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Serieux destroy!

Added: unstable/liquidwar/branches/upstream/current/data/map/big.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/big.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/big.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/big.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/big.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Big 1

Added: unstable/liquidwar/branches/upstream/current/data/map/bigm.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/bigm.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/bigm.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - bigm

Added: unstable/liquidwar/branches/upstream/current/data/map/blemmya.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/blemmya.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/blemmya.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/blemmya.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/blemmya.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Blemmya

Added: unstable/liquidwar/branches/upstream/current/data/map/boa.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/boa.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/boa.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/boa.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/boa.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+An elephant inside a boa

Added: unstable/liquidwar/branches/upstream/current/data/map/bonoball.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/bonoball.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/bonoball.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/bonoball.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/bonoball.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Ballons

Added: unstable/liquidwar/branches/upstream/current/data/map/bored.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/bored.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/bored.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/bored.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/bored.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Labyrinth 1

Added: unstable/liquidwar/branches/upstream/current/data/map/bubbles.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/bubbles.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/bubbles.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/bubbles.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/bubbles.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Jan - Bubbles

Added: unstable/liquidwar/branches/upstream/current/data/map/card.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/card.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/card.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/card.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/card.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - card

Added: unstable/liquidwar/branches/upstream/current/data/map/carreaux.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/carreaux.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/carreaux.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/carreaux.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/carreaux.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Squarish stuff

Added: unstable/liquidwar/branches/upstream/current/data/map/carres.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/carres.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/carres.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/carres.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/carres.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Random rectangles

Added: unstable/liquidwar/branches/upstream/current/data/map/centrik.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/centrik.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/centrik.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/centrik.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/centrik.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+You are sleeping

Added: unstable/liquidwar/branches/upstream/current/data/map/charming.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/charming.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/charming.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/charming.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/charming.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Anaglyph 2 (charming)

Added: unstable/liquidwar/branches/upstream/current/data/map/chenille.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/chenille.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/chenille.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/chenille.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/chenille.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Slow slow...

Added: unstable/liquidwar/branches/upstream/current/data/map/chess.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/chess.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/chess.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/chess.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/chess.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Chess

Added: unstable/liquidwar/branches/upstream/current/data/map/chinois.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/chinois.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/chinois.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/chinois.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/chinois.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Ping

Added: unstable/liquidwar/branches/upstream/current/data/map/circle.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/circle.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/circle.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/circle.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/circle.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Circle

Added: unstable/liquidwar/branches/upstream/current/data/map/circlus.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/circlus.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/circlus.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/circlus.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/circlus.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Space 1

Added: unstable/liquidwar/branches/upstream/current/data/map/clean.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/clean.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/clean.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/clean.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/clean.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Green

Added: unstable/liquidwar/branches/upstream/current/data/map/clown.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/clown.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/clown.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/clown.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/clown.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Clown

Added: unstable/liquidwar/branches/upstream/current/data/map/coccinel.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/coccinel.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/coccinel.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/coccinel.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/coccinel.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Nice bug

Added: unstable/liquidwar/branches/upstream/current/data/map/coeurs.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/coeurs.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/coeurs.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/coeurs.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/coeurs.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Mmmmmmmmm

Added: unstable/liquidwar/branches/upstream/current/data/map/confuse.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/confuse.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/confuse.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/confuse.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/confuse.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - confuse

Added: unstable/liquidwar/branches/upstream/current/data/map/cornet3b.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/cornet3b.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/cornet3b.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/cornet3b.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/cornet3b.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Sluuuuurp

Added: unstable/liquidwar/branches/upstream/current/data/map/crown.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/crown.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/crown.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/crown.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/crown.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Crown

Added: unstable/liquidwar/branches/upstream/current/data/map/darkone1.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/darkone1.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/darkone1.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/darkone1.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/darkone1.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Jan - Dark One 1

Added: unstable/liquidwar/branches/upstream/current/data/map/darkone2.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/darkone2.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/darkone2.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/darkone2.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/darkone2.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Jan - Dark One 2

Added: unstable/liquidwar/branches/upstream/current/data/map/darkone3.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/darkone3.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/darkone3.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/darkone3.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/darkone3.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Jan - Dark One 3

Added: unstable/liquidwar/branches/upstream/current/data/map/darkone4.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/darkone4.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/darkone4.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/darkone4.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/darkone4.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Jan - Dark One 4

Added: unstable/liquidwar/branches/upstream/current/data/map/derivsol.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/derivsol.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/derivsol.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/derivsol.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/derivsol.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Sailing

Added: unstable/liquidwar/branches/upstream/current/data/map/dirt.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/dirt.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/dirt.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/dirt.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/dirt.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Labyrinth 2

Added: unstable/liquidwar/branches/upstream/current/data/map/donuts.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/donuts.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/donuts.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/donuts.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/donuts.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Five donuts

Added: unstable/liquidwar/branches/upstream/current/data/map/echange.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/echange.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/echange.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/echange.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/echange.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Highway

Added: unstable/liquidwar/branches/upstream/current/data/map/echlune.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/echlune.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/echlune.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/echlune.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/echlune.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Climb and grab it

Added: unstable/liquidwar/branches/upstream/current/data/map/egg.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/egg.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/egg.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/egg.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/egg.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Egg

Added: unstable/liquidwar/branches/upstream/current/data/map/etoile.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/etoile.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/etoile.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/etoile.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/etoile.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Star

Added: unstable/liquidwar/branches/upstream/current/data/map/eyes.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/eyes.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/eyes.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/eyes.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/eyes.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Eyes

Added: unstable/liquidwar/branches/upstream/current/data/map/feuille.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/feuille.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/feuille.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/feuille.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/feuille.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Leaf

Added: unstable/liquidwar/branches/upstream/current/data/map/fille.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/fille.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/fille.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/fille.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/fille.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Girl

Added: unstable/liquidwar/branches/upstream/current/data/map/fils.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/fils.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/fils.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/fils.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/fils.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Emberlificoted

Added: unstable/liquidwar/branches/upstream/current/data/map/flo1.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/flo1.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/flo1.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/flo1.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/flo1.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Florence's map

Added: unstable/liquidwar/branches/upstream/current/data/map/garcon.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/garcon.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/garcon.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/garcon.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/garcon.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Boy

Added: unstable/liquidwar/branches/upstream/current/data/map/garden.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/garden.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/garden.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/garden.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/garden.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Labyrinth 3

Added: unstable/liquidwar/branches/upstream/current/data/map/glasses.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/glasses.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/glasses.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/glasses.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/glasses.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Glasses
\ No newline at end of file

Added: unstable/liquidwar/branches/upstream/current/data/map/h.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/h.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/h.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/h.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/h.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Jan - The great H

Added: unstable/liquidwar/branches/upstream/current/data/map/haricot.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/haricot.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/haricot.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/haricot.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/haricot.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Bean

Added: unstable/liquidwar/branches/upstream/current/data/map/hi.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/hi.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/hi.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/hi.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/hi.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Jan - Fight in the middle

Added: unstable/liquidwar/branches/upstream/current/data/map/honey.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/honey.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/honey.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/honey.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/honey.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Honey

Added: unstable/liquidwar/branches/upstream/current/data/map/honeymoon.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/honeymoon.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/honeymoon.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/honeymoon.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/honeymoon.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Honeymoon

Added: unstable/liquidwar/branches/upstream/current/data/map/jabberwocky.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/jabberwocky.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/jabberwocky.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/jabberwocky.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/jabberwocky.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - jabberwocky

Added: unstable/liquidwar/branches/upstream/current/data/map/labyrint.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/labyrint.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/labyrint.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/labyrint.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/labyrint.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Labyrinth 4

Added: unstable/liquidwar/branches/upstream/current/data/map/lapin.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lapin.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lapin.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lapin.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lapin.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+What's up doc?

Added: unstable/liquidwar/branches/upstream/current/data/map/liqwar.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/liqwar.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/liqwar.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/liqwar.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/liqwar.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+What's the name of the game?

Added: unstable/liquidwar/branches/upstream/current/data/map/logo.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/logo.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/logo.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/logo.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/logo.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Logo

Added: unstable/liquidwar/branches/upstream/current/data/map/lost.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lost.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lost.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lost.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lost.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Lost

Added: unstable/liquidwar/branches/upstream/current/data/map/lw.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lw.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lw.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lw.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lw.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Logo 2

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtab002.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lwtab002.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtab002.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lwtab002.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lwtab002.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+LW3 - Small rectangles

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtab003.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lwtab003.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtab003.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lwtab003.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lwtab003.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+LW3 - Random islands

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtab004.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lwtab004.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtab004.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lwtab004.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lwtab004.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+LW3 - Circles and pipes

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtab005.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lwtab005.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtab005.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lwtab005.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lwtab005.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+LW3 - Puzzle

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtab006.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lwtab006.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtab006.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lwtab006.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lwtab006.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+LW3 - Puzzle for kids
\ No newline at end of file

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtab008.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lwtab008.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtab008.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lwtab008.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lwtab008.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+LW3 - Symetric walls (half)
\ No newline at end of file

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtab009.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lwtab009.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtab009.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lwtab009.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lwtab009.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+LW3 - Symetric walls (double)

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabbar.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lwtabbar.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabbar.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lwtabbar.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lwtabbar.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+LW3 - Weird walls
\ No newline at end of file

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabdrt.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lwtabdrt.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabdrt.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lwtabdrt.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lwtabdrt.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+LW3 - Geometric
\ No newline at end of file

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabgen.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lwtabgen.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabgen.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lwtabgen.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lwtabgen.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+*The NEW* genuine LW map

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabmic.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lwtabmic.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabmic.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lwtabmic.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lwtabmic.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+LW3 - Mickey Mouse

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabrec.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lwtabrec.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabrec.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lwtabrec.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lwtabrec.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+LW3 - Thin walls

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabses.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lwtabses.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabses.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lwtabses.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lwtabses.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+LW3 - S like snake

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabto2.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lwtabto2.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabto2.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lwtabto2.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lwtabto2.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+LW3 - Circles

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabto3.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lwtabto3.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabto3.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lwtabto3.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lwtabto3.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+LW3 - Not even a puzzle

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabto4.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lwtabto4.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabto4.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lwtabto4.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lwtabto4.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+LW3 - Bricks
\ No newline at end of file

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabtom.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lwtabtom.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabtom.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lwtabtom.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lwtabtom.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+LW3 - The old genuine LW map

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabtru.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lwtabtru.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabtru.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lwtabtru.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lwtabtru.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+LW3 - Dots and curves

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabvid.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/lwtabvid.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/lwtabvid.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/lwtabvid.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/lwtabvid.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+LW3 - Empty
\ No newline at end of file

Added: unstable/liquidwar/branches/upstream/current/data/map/marionet.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/marionet.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/marionet.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/marionet.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/marionet.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Run, run!

Added: unstable/liquidwar/branches/upstream/current/data/map/metation.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/metation.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/metation.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/metation.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/metation.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Carpe Diem

Added: unstable/liquidwar/branches/upstream/current/data/map/mouse1.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/mouse1.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/mouse1.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/mouse1.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/mouse1.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Mouse - 1

Added: unstable/liquidwar/branches/upstream/current/data/map/muehle.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/muehle.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/muehle.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/muehle.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/muehle.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Jan - Aim at it

Added: unstable/liquidwar/branches/upstream/current/data/map/musique.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/musique.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/musique.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/musique.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/musique.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Music

Added: unstable/liquidwar/branches/upstream/current/data/map/net1.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/net1.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/net1.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/net1.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/net1.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Complex

Added: unstable/liquidwar/branches/upstream/current/data/map/net2.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/net2.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/net2.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/net2.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/net2.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Pools and pipes

Added: unstable/liquidwar/branches/upstream/current/data/map/ordino.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/ordino.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/ordino.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/ordino.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/ordino.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Computer

Added: unstable/liquidwar/branches/upstream/current/data/map/paper.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/paper.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/paper.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/paper.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/paper.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Big 2

Added: unstable/liquidwar/branches/upstream/current/data/map/papercut.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/papercut.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/papercut.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/papercut.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/papercut.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Papercut

Added: unstable/liquidwar/branches/upstream/current/data/map/papillon.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/papillon.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/papillon.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/papillon.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/papillon.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Butterfly

Added: unstable/liquidwar/branches/upstream/current/data/map/pastel.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/pastel.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/pastel.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/pastel.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/pastel.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Pastel

Added: unstable/liquidwar/branches/upstream/current/data/map/penta.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/penta.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/penta.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/penta.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/penta.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Pentaminos

Added: unstable/liquidwar/branches/upstream/current/data/map/peur.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/peur.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/peur.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/peur.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/peur.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Scared

Added: unstable/liquidwar/branches/upstream/current/data/map/pieuvre.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/pieuvre.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/pieuvre.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/pieuvre.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/pieuvre.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Tentacles

Added: unstable/liquidwar/branches/upstream/current/data/map/pigface.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/pigface.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/pigface.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/pigface.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/pigface.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Pig face

Added: unstable/liquidwar/branches/upstream/current/data/map/place.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/place.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/place.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/place.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/place.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Retro

Added: unstable/liquidwar/branches/upstream/current/data/map/platform.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/platform.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/platform.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/platform.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/platform.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Platforms

Added: unstable/liquidwar/branches/upstream/current/data/map/poisson.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/poisson.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/poisson.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/poisson.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/poisson.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Fish

Added: unstable/liquidwar/branches/upstream/current/data/map/policier.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/policier.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/policier.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/policier.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/policier.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Triiiiiit

Added: unstable/liquidwar/branches/upstream/current/data/map/portable.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/portable.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/portable.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/portable.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/portable.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Allo

Added: unstable/liquidwar/branches/upstream/current/data/map/puckman.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/puckman.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/puckman.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/puckman.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/puckman.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Puckman

Added: unstable/liquidwar/branches/upstream/current/data/map/quaders.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/quaders.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/quaders.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/quaders.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/quaders.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Jan - Quaders

Added: unstable/liquidwar/branches/upstream/current/data/map/rect.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/rect.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/rect.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/rect.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/rect.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Rectangle 1

Added: unstable/liquidwar/branches/upstream/current/data/map/rectangle.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/rectangle.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/rectangle.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/rectangle.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/rectangle.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Rectangle 2

Added: unstable/liquidwar/branches/upstream/current/data/map/rene02.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/rene02.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/rene02.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/rene02.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/rene02.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Rene - 02

Added: unstable/liquidwar/branches/upstream/current/data/map/rene03.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/rene03.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/rene03.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/rene03.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/rene03.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Rene - 03

Added: unstable/liquidwar/branches/upstream/current/data/map/rene04.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/rene04.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/rene04.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/rene04.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/rene04.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Rene - 04

Added: unstable/liquidwar/branches/upstream/current/data/map/rolz.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/rolz.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/rolz.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/rolz.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/rolz.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Jan - Railroad

Added: unstable/liquidwar/branches/upstream/current/data/map/rough.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/rough.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/rough.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/rough.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/rough.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Rough

Added: unstable/liquidwar/branches/upstream/current/data/map/sgdb.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/sgdb.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/sgdb.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/sgdb.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/sgdb.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+91700 SGDB

Added: unstable/liquidwar/branches/upstream/current/data/map/skull.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/skull.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/skull.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/skull.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/skull.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Skull 1

Added: unstable/liquidwar/branches/upstream/current/data/map/skullbig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/skullbig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/skullbig.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/skullbig.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/skullbig.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Skull 2

Added: unstable/liquidwar/branches/upstream/current/data/map/slimy.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/slimy.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/slimy.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/slimy.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/slimy.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Slimy

Added: unstable/liquidwar/branches/upstream/current/data/map/smile.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/smile.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/smile.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/smile.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/smile.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Smile

Added: unstable/liquidwar/branches/upstream/current/data/map/sol.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/sol.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/sol.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/sol.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/sol.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+G

Added: unstable/liquidwar/branches/upstream/current/data/map/sonnesystem.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/sonnesystem.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/sonnesystem.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/sonnesystem.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/sonnesystem.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Solar System

Added: unstable/liquidwar/branches/upstream/current/data/map/spagueti.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/spagueti.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/spagueti.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/spagueti.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/spagueti.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Bolognese

Added: unstable/liquidwar/branches/upstream/current/data/map/strike.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/strike.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/strike.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/strike.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/strike.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Strike

Added: unstable/liquidwar/branches/upstream/current/data/map/tag.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/tag.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/tag.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/tag.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/tag.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Jan - Three blocks

Added: unstable/liquidwar/branches/upstream/current/data/map/tiles.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/tiles.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/tiles.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/tiles.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/tiles.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Space 2

Added: unstable/liquidwar/branches/upstream/current/data/map/tilt.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/tilt.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/tilt.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/tilt.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/tilt.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Tilt

Added: unstable/liquidwar/branches/upstream/current/data/map/tipi.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/tipi.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/tipi.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/tipi.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/tipi.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Tipi

Added: unstable/liquidwar/branches/upstream/current/data/map/titanic.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/titanic.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/titanic.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/titanic.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/titanic.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Titanic

Added: unstable/liquidwar/branches/upstream/current/data/map/trumpet.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/trumpet.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/trumpet.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/trumpet.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/trumpet.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Trumpet

Added: unstable/liquidwar/branches/upstream/current/data/map/tulipes.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/tulipes.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/tulipes.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/tulipes.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/tulipes.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Tulips
\ No newline at end of file

Added: unstable/liquidwar/branches/upstream/current/data/map/tuyaux.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/tuyaux.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/tuyaux.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/tuyaux.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/tuyaux.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Pipes

Added: unstable/liquidwar/branches/upstream/current/data/map/underground.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/underground.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/underground.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/underground.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/underground.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Underground

Added: unstable/liquidwar/branches/upstream/current/data/map/velo.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/velo.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/velo.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/velo.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/velo.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Bike

Added: unstable/liquidwar/branches/upstream/current/data/map/village.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/village.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/village.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/village.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/village.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Village

Added: unstable/liquidwar/branches/upstream/current/data/map/void.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/void.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/void.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/void.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/void.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Void

Added: unstable/liquidwar/branches/upstream/current/data/map/volet.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/volet.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/volet.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/volet.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/volet.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Window

Added: unstable/liquidwar/branches/upstream/current/data/map/watch.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/watch.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/watch.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/watch.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/watch.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Kasper - Watch

Added: unstable/liquidwar/branches/upstream/current/data/map/world1.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/world1.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/world1.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/world1.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/world1.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+World 1

Added: unstable/liquidwar/branches/upstream/current/data/map/world2.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/world2.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/world2.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/world2.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/world2.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+World 2

Added: unstable/liquidwar/branches/upstream/current/data/map/world3.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/world3.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/world3.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/world3.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/world3.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+World 3

Added: unstable/liquidwar/branches/upstream/current/data/map/world4.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/world4.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/world4.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/world4.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/world4.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+World 4

Added: unstable/liquidwar/branches/upstream/current/data/map/z.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/map/z.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/map/z.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/map/z.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/map/z.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+Z

Added: unstable/liquidwar/branches/upstream/current/data/maptex/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/maptex/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/maptex/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,5 @@
+Makefile
+maptex.dat
+*.bmp
+*.pcx
+*.tex

Added: unstable/liquidwar/branches/upstream/current/data/maptex/2d.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/2d.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/3d.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/3d.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/3x3.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/3x3.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/Makefile.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/maptex/Makefile.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/maptex/Makefile.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,107 @@
+ALLEGRO_DAT = dat
+
+DST_EXT = tex
+TMP_BMP_EXT = bmp
+SRC_BMP_EXT = orig.bmp
+TMP_PCX_EXT = pcx
+SRC_PCX_EXT = orig.pcx
+
+TEXTURES_BMP =  2d \
+	3d \
+	3x3 \
+	ac \
+	anaglyph1 \
+	anaglyph2 \
+	around \
+	big \
+	blemmya \
+	bored \
+	card \
+	charming \
+	chess \
+	circle \
+	circlus \
+	clean \
+	confuse \
+	dirt \
+	egg \
+	eyes \
+	garden \
+	honey \
+	honeymoon \
+	jabberwocky \
+	labyrint \
+	logo \
+	lost \
+	lw \
+	metation \
+	paper \
+	papercut \
+	pastel \
+	place \
+	puckman \
+	rect \
+	rectangle \
+	rough \
+	skullbig \
+	skull \
+	slimy \
+	smile \
+	sonnesystem \
+	tiles \
+	underground \
+	watch
+
+TEXTURES_PCX = lwtab002 \
+	lwtab003 \
+	lwtab004 \
+	lwtab006 \
+	lwtab007 \
+	lwtab008 \
+	lwtab009 \
+	lwtabbar \
+	lwtabdrt \
+	lwtabmic \
+	lwtabrec \
+	lwtabses \
+	lwtabto2 \
+	lwtabto3 \
+	lwtabto4 \
+	lwtabtom \
+	lwtabtru
+
+DST_FILES = $(addsuffix .$(DST_EXT),$(TEXTURES_BMP)) $(addsuffix .$(DST_EXT),$(TEXTURES_PCX))
+TMP_FILES_BMP = $(addsuffix .$(TMP_BMP_EXT),$(TEXTURES_BMP))
+TMP_FILES_PCX = $(addsuffix .$(TMP_PCX_EXT),$(TEXTURES_PCX))
+
+all: maptex.dat
+
+maptex.dat: $(DST_FILES) $(TMP_FILES_BMP) $(TMP_FILES_PCX)
+	@rm -f $@
+	@echo Creating $@
+	@$(ALLEGRO_DAT) -a $@ $(DST_FILES)
+
+clean:
+	@rm -f $(DST_FILES) $(TMP_FILES_BMP) $(TMP_FILES_PCX) *.dat
+
+distclean:
+	@rm -f Makefile 
+
+%.$(TMP_BMP_EXT): %.$(SRC_BMP_EXT)
+	@echo Converting $< to $@
+	@cp $< $@
+	@../../utils/liquidwarcol -s 32 32 $@
+
+%.$(DST_EXT): %.$(TMP_BMP_EXT)
+	@echo Converting $< to $@
+	@../../utils/liquidwartex -s 32 32 $<
+
+%.$(TMP_PCX_EXT): %.$(SRC_PCX_EXT)
+	@echo Converting $< to $@
+	@cp $< $@
+	@../../utils/liquidwarcol -s 32 32 $@
+
+%.$(DST_EXT): %.$(TMP_PCX_EXT)
+	@echo Converting $< to $@
+	@../../utils/liquidwartex -s 32 32 $<
+

Added: unstable/liquidwar/branches/upstream/current/data/maptex/ac.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/ac.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/anaglyph1.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/anaglyph1.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/anaglyph2.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/anaglyph2.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/around.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/around.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/big.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/big.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/blemmya.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/blemmya.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/bored.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/bored.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/card.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/card.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/charming.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/charming.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/chess.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/chess.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/circle.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/circle.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/circlus.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/circlus.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/clean.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/clean.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/confuse.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/confuse.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/dirt.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/dirt.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/egg.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/egg.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/eyes.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/eyes.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/garden.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/garden.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/honey.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/honey.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/honeymoon.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/honeymoon.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/jabberwocky.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/jabberwocky.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/labyrint.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/labyrint.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/logo.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/logo.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lost.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lost.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lw.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lw.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lwtab002.orig.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lwtab002.orig.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lwtab003.orig.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lwtab003.orig.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lwtab004.orig.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lwtab004.orig.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lwtab006.orig.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lwtab006.orig.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lwtab007.orig.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lwtab007.orig.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lwtab008.orig.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lwtab008.orig.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lwtab009.orig.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lwtab009.orig.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabbar.orig.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabbar.orig.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabdrt.orig.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabdrt.orig.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabmic.orig.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabmic.orig.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabrec.orig.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabrec.orig.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabses.orig.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabses.orig.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabto2.orig.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabto2.orig.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabto3.orig.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabto3.orig.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabto4.orig.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabto4.orig.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabtom.orig.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabtom.orig.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabtru.orig.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabtru.orig.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabvid.orig.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/lwtabvid.orig.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/metation.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/metation.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/paper.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/paper.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/papercut.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/papercut.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/pastel.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/pastel.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/place.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/place.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/puckman.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/puckman.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/rect.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/rect.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/rectangle.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/rectangle.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/rough.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/rough.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/skull.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/skull.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/skullbig.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/skullbig.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/slimy.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/slimy.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/smile.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/smile.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/sonnesystem.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/sonnesystem.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/tiles.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/tiles.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/underground.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/underground.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/maptex/watch.orig.bmp
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/maptex/watch.orig.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/music/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/music/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/music/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,2 @@
+Makefile
+music.dat

Added: unstable/liquidwar/branches/upstream/current/data/music/Makefile.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/music/Makefile.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/music/Makefile.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,24 @@
+ALLEGRO_DAT = dat
+
+MIDI = clarity.mid \
+	fodder.mid \
+	headless.mid \
+        marauder.mid \
+	return.mid \
+        thmoov.mid \
+	torqued.mid
+
+all: music.dat
+
+music.dat: $(MIDI)
+	@rm -f $@
+	@echo Creating music.dat
+	@dat -a -t midi music.dat $(MIDI)
+
+clean:
+	@rm -f *.dat
+
+distclean:
+	@rm -f Makefile
+
+

Added: unstable/liquidwar/branches/upstream/current/data/music/clarity.mid
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/music/clarity.mid
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/music/fodder.mid
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/music/fodder.mid
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/music/headless.mid
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/music/headless.mid
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/music/marauder.mid
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/music/marauder.mid
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/music/return.mid
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/music/return.mid
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/music/thmoov.mid
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/music/thmoov.mid
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/music/torqued.mid
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/music/torqued.mid
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/sfx/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/sfx/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/sfx/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,2 @@
+Makefile
+sfx.dat

Added: unstable/liquidwar/branches/upstream/current/data/sfx/Makefile.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/sfx/Makefile.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/sfx/Makefile.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,17 @@
+ALLEGRO_DAT = dat
+
+WAVS = clock1.wav crowd1.wav cuckoo.wav foghorn.wav splash1.wav war.wav 
+
+all: sfx.dat
+
+sfx.dat: $(WAVS)
+	@rm -f $@
+	@echo Creating $@
+	@dat -a -t sample $@ $(WAVS)
+
+clean:
+	@rm -f *.dat
+
+distclean:
+	@rm -f Makefile
+

Added: unstable/liquidwar/branches/upstream/current/data/sfx/clock1.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/sfx/clock1.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/sfx/crowd1.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/sfx/crowd1.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/sfx/cuckoo.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/sfx/cuckoo.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/sfx/foghorn.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/sfx/foghorn.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/sfx/splash1.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/sfx/splash1.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/sfx/war.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/sfx/war.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/texture/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/texture/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/texture/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,4 @@
+Makefile
+texture.dat
+*.pcx
+*.tex

Added: unstable/liquidwar/branches/upstream/current/data/texture/Makefile.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/texture/Makefile.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/texture/Makefile.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,47 @@
+ALLEGRO_DAT = dat
+
+DST_EXT = tex
+TMP_EXT = pcx
+SRC_EXT = gimp.pcx
+
+TEXTURES =  amethyst \
+	bricks \
+	crash1 \
+	electricblue \
+	granite2 \
+	greenmess \
+	lumps \
+	marble3 \
+	pebbles \
+	pine \
+	poolbottom \
+	qbert \
+	redcubes \
+	smallsquares \
+	terra \
+	wood2
+
+DST_FILES = $(addsuffix .$(DST_EXT),$(TEXTURES))
+TMP_FILES = $(addsuffix .$(TMP_EXT),$(TEXTURES))
+
+all: texture.dat
+
+texture.dat: $(DST_FILES) $(TMP_FILES)
+	@rm -f $@
+	@echo Creating $@
+	@$(ALLEGRO_DAT) -a $@ $(DST_FILES)
+
+clean:
+	@rm -f $(TMP_FILES) $(DST_FILES) *.dat
+
+distclean:
+	@rm -f Makefile 
+
+%.$(TMP_EXT): %.$(SRC_EXT)
+	@echo Converting $< to $@
+	@cp $< $@
+	@../../utils/liquidwarcol -s 32 32 $@
+
+%.$(DST_EXT): %.$(TMP_EXT)
+	@echo Converting $< to $@
+	@../../utils/liquidwartex -s 32 32 $<

Added: unstable/liquidwar/branches/upstream/current/data/texture/amethyst.gimp.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/texture/amethyst.gimp.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/texture/bricks.gimp.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/texture/bricks.gimp.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/texture/crash1.gimp.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/texture/crash1.gimp.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/texture/electricblue.gimp.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/texture/electricblue.gimp.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/texture/granite2.gimp.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/texture/granite2.gimp.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/texture/greenmess.gimp.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/texture/greenmess.gimp.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/texture/lumps.gimp.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/texture/lumps.gimp.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/texture/marble3.gimp.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/texture/marble3.gimp.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/texture/pebbles.gimp.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/texture/pebbles.gimp.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/texture/pine.gimp.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/texture/pine.gimp.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/texture/poolbottom.gimp.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/texture/poolbottom.gimp.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/texture/qbert.gimp.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/texture/qbert.gimp.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/texture/redcubes.gimp.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/texture/redcubes.gimp.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/texture/smallsquares.gimp.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/texture/smallsquares.gimp.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/texture/terra.gimp.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/texture/terra.gimp.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/texture/wood2.gimp.pcx
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/texture/wood2.gimp.pcx
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/water/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/water/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/water/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,2 @@
+Makefile
+water.dat

Added: unstable/liquidwar/branches/upstream/current/data/water/Makefile.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/data/water/Makefile.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/data/water/Makefile.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,20 @@
+ALLEGRO_DAT = dat
+
+WAVS = amb3.wav amb4.wav bath1.wav bath2.wav \
+	bubble.wav flush.wav forest1.wav kitch4.wav \
+	lavaflow.wav niagara.wav shower1.wav sodapor.wav \
+	thundr2.wav thundr3.wav tidal.wav water.wav
+
+all: water.dat
+
+water.dat: $(WAVS)
+	@rm -f $@
+	@echo Creating $@
+	@dat -a -t sample $@ $(WAVS)
+
+clean:
+	@rm -f *.dat
+
+distclean:
+	@rm -f Makefile
+

Added: unstable/liquidwar/branches/upstream/current/data/water/amb3.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/water/amb3.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/water/amb4.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/water/amb4.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/water/bath1.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/water/bath1.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/water/bath2.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/water/bath2.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/water/bubble.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/water/bubble.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/water/flush.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/water/flush.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/water/forest1.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/water/forest1.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/water/kitch4.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/water/kitch4.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/water/lavaflow.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/water/lavaflow.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/water/niagara.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/water/niagara.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/water/shower1.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/water/shower1.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/water/sodapor.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/water/sodapor.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/water/thundr2.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/water/thundr2.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/water/thundr3.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/water/thundr3.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/water/tidal.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/water/tidal.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/data/water/water.wav
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/data/water/water.wav
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/doc/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,2 @@
+Makefile
+makedoc.pyc

Added: unstable/liquidwar/branches/upstream/current/doc/Makefile.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/Makefile.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/Makefile.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,162 @@
+
+DOC_TXT =            @DOC_TXT@
+DOC_HTML =           @DOC_HTML@
+DOC_MAN =            @DOC_MAN@
+DOC_INFO =           @DOC_INFO@
+DOC_PS =             @DOC_PS@
+DOC_PDF =            @DOC_PDF@
+DOC_PHP3 =           @DOC_PHP3@
+DOC_UWC =            @DOC_UWC@
+
+VERSION =            @VERSION@
+
+FILES = rules \
+	authors \
+	mailinglists \
+	fanfic \
+	options \
+	network \
+	parameters \
+	platforms \
+	userlevels \
+	algorithm \
+	source \
+	bugs \
+	todo \
+	wip \
+	copying
+
+HTML_FILES = $(addprefix html/,$(addsuffix .html,$(FILES)))
+PHP3_FILES = $(addprefix php3/,$(addsuffix .php3,$(FILES)))
+TEX_FILES = $(addprefix tex/,$(addsuffix .tex,$(FILES)))
+MAN_FILES = $(addprefix man/,$(addsuffix .man,$(FILES)))
+TXT_FILES = $(addprefix txt/,$(addsuffix .txt,$(FILES)))
+TEXI_FILES = $(addprefix texi/,$(addsuffix .texi,$(FILES)))
+UWC_FILES = $(addprefix uwc/,$(addsuffix .uwc,$(FILES)))
+
+
+# To enable/disable documentation formats:
+# - if format xxx must be built, then the ./configure
+#   script has set $(XXX) to "yes" so we build target
+#   xxx_yes which is the "real" target.
+# - if format xxx must be skipped, then the ./configure
+#   script has set $(XXX) to "no" so we build target
+#   xxx_no, which is a "fake" empty target.
+all: txt_$(DOC_TXT) html_$(DOC_HTML) man_$(DOC_MAN) info_$(DOC_INFO) ps_$(DOC_PS) pdf_$(DOC_PDF) php3_$(DOC_PHP3) uwc_$(DOC_UWC)
+
+txt_yes: $(TXT_FILES)
+
+html_yes: $(HTML_FILES) 
+
+man_yes: man/liquidwar.6.gz
+
+info_yes: info/liquidwar.info.gz
+
+ps_yes: ps/liquidwar.ps
+
+pdf_yes: pdf/liquidwar.pdf 
+
+php3_yes: $(PHP3_FILES)
+
+uwc_yes: $(UWC_FILES)
+
+txt_no:
+
+html_no:
+
+man_no:
+
+info_no:
+
+ps_no:
+
+pdf_no:
+
+php3_no:
+
+uwc_no:
+
+pdf/liquidwar.pdf : ps/liquidwar.ps
+	@echo "Building $@..."
+	@cd tex; pdflatex liquidwar.tex && cd .. || cd ..
+	@cd tex; pdflatex liquidwar.tex && cd .. || cd ..
+	@if [ -f tex/liquidwar.pdf ]; then mv tex/liquidwar.pdf $@; fi
+
+ps/liquidwar.ps : tex/liquidwar.dvi
+	@echo "Building $@..."
+	@dvips -q -o $@ $<
+
+tex/liquidwar.dvi : $(TEX_FILES) tex/liquidwar.tex
+	@echo "Building $@..."
+	@cd tex; latex liquidwar.tex && cd .. || cd ..
+	@cd tex; latex liquidwar.tex && cd .. || cd ..
+
+man/liquidwar.6 : man/liquidwar.man
+	@cp $< $@
+
+man/liquidwar.man : $(MAN_FILES) man/begin.man man/end.man
+	@echo "Building $@..."
+	@cat man/begin.man $(MAN_FILES) man/end.man > $@
+
+info/liquidwar.info.gz : texi/liquidwar.texi
+	@echo "Building $@..."
+	@rm -f info/liquidwar.info*
+	@makeinfo -o info/liquidwar.info $<
+	@gzip -9 info/liquidwar.info*
+
+texi/liquidwar.texi : $(TEXI_FILES) texi/begin.texi texi/end.texi
+	@echo "Building $@..."
+	@cat texi/begin.texi $(TEXI_FILES) texi/end.texi > $@
+
+html/%.html: xml/%.xml makedoc.py html/header.inc html/footer.inc
+	@echo Creating $@ from $<
+	@python -c "import makedoc; makedoc.make_html('$@','$<','html/header.inc','html/footer.inc')"
+
+php3/%.php3: xml/%.xml makedoc.py
+	@echo Creating $@ from $<
+	@python -c "import makedoc; makedoc.make_php3('$@','$<')"
+
+tex/%.tex: xml/%.xml makedoc.py
+	@echo Creating $@ from $<
+	@python -c "import makedoc; makedoc.make_tex('$@','$<')"
+
+man/%.man: xml/%.xml makedoc.py
+	@echo Creating $@ from $<
+	@python -c "import makedoc; makedoc.make_man('$@','$<')"
+
+txt/%.txt: xml/%.xml makedoc.py
+	@echo Creating $@ from $<
+	@python -c "import makedoc; makedoc.make_txt('$@','$<','Liquid War (v$(VERSION))')"
+
+texi/%.texi: xml/%.xml makedoc.py
+	@echo Creating $@ from $<
+	@python -c "import makedoc; makedoc.make_texi('$@','$<')"
+
+uwc/%.uwc: xml/%.xml makedoc.py
+	@echo Creating $@ from $<
+	@python -c "import makedoc; makedoc.make_uwc('$@','$<')"
+
+%.gz: %
+	@if [ -f $< ]; then echo "Compressing $@..."; gzip -c -9 $< > $@; fi
+
+dummy:
+
+clean:
+	@rm -f *~ */*~ 
+	@rm -f makedoc.pyc
+	@rm -f $(HTML_FILES) $(PHP3_FILES) $(TEX_FILES) $(MAN_FILES) $(TXT_FILES) $(TEXI_FILES) $(UWC_FILES)
+	@rm -f tex/liquidwar.toc tex/liquidwar.log tex/liquidwar.dvi tex/liquidwar.aux ps/liquidwar.ps pdf/liquidwar.pdf man/liquidwar.6 man/liquidwar.6.gz man/liquidwar-server.6.gz man/liquidwar-mapgen.6.gz man/liquidwar.man info/liquidwar.info* texi/liquidwar.texi texi/liquidwar.info*
+
+distclean: 
+	@rm -f Makefile
+	@rm -f tex/liquidwar.tex man/begin.man texi/begin.texi html/index.html
+
+config:
+
+check:
+	@xmllint --valid --noout xml/*.xml
+
+dep:
+
+
+

Added: unstable/liquidwar/branches/upstream/current/doc/README
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/README	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/README	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,40 @@
+This documentation is written in XML.
+
+Basically, a Python program (makedoc.py) is used to parse the xml
+source files, and generate a formatted output in another format.
+There are already several tools already available which can do this,
+among them sgmltools, which is based on docbook.
+So you might wonder: why did I write my own doc generator?
+Well, there are several reasons:
+1 - it was a good excuse to write Python code. I'm very interested
+    in Python but could not find anything to do with it until I
+    realize it could help me at generating documentation.
+2 - docbook is too big for me to learn. I do not have time nor
+    motivation to learn such a complex DTD. Besides, when I write
+    docs, I like to concentrate on the contents. The "DTD" (a very
+    small one indeed) I use is *really* basic, so writting docs is
+    really an easy and quick task for me.
+3 - sgmltools was not flexible enough for me. Indeed, I use my little
+    doc generator to create some of the pages of http://www.ufoot.org.
+    Therefore I the parser to be able to generate pages with a given
+    look and feel, and for instance I do not like the "prev" and "next"
+    buttons generated on HTML pages by sgmltools. Rather than wasting
+    time trying to get rid of those, I just wrote my own simple
+    generator.
+4 - I love programming. Just can't help it. I feel frustrated when
+    I use a ready-to-use product 8-)
+
+The following formats can be generated:
+- html : browsable doc
+- ps   : printable doc (an intermediate dvi file is also available)
+- pdf  : printable doc for Microsoft platforms, with poor ps support
+- txt  : universal reference, readable on *any* computer
+- man  : doc for die-hard man-page users =8-)
+- texi : texinfo doc (the GNU projet documentation format)
+- php3 : what I upload on http://www.ufoot.org
+
+Note that the parser currently uses xmllib, which is shipped with
+Python 1.5.2 but is marked as deprecated in Python 2.x. I don't feel
+the need to upgrade my scripts since Python 2.x is not as common as
+Python 1.5.2 yet, and besides I don't really enjoy touching code
+when it already works...

Added: unstable/liquidwar/branches/upstream/current/doc/html/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/html/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/html/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+*.html

Added: unstable/liquidwar/branches/upstream/current/doc/html/footer.inc
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/html/footer.inc	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/html/footer.inc	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,5 @@
+<HR>
+<CENTER>
+This documentation is also available on:
+<A HREF="http://www.ufoot.org/liquidwar">www.ufoot.org/liquidwar</A>.
+</CENTER>
\ No newline at end of file

Added: unstable/liquidwar/branches/upstream/current/doc/html/header.inc
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/html/header.inc	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/html/header.inc	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,19 @@
+<CENTER>
+<A HREF="index.html">Home</A> |
+<A HREF="rules.html">Rules</A> |
+<A HREF="authors.html">Authors</A> |
+<A HREF="mailinglists.html">Mailing lists</A> |
+<A HREF="fanfic.html">Fanfic</A> |
+<A HREF="options.html">Menus and hot keys</A> |
+<A HREF="network.html">Network game</A> |
+<A HREF="parameters.html">Command line parameters</A> |
+<A HREF="platforms.html">Platform specific issues</A> |
+<A HREF="userlevels.html">User levels</A> |
+<A HREF="algorithm.html">Core algorithm</A> |
+<A HREF="source.html">Source code</A> |
+<A HREF="bugs.html">Bugs</A> |
+<A HREF="todo.html">To do</A> |
+<A HREF="wip.html">WIP</A> |
+<A HREF="copying.html">Copying</A>
+</CENTER>
+<HR>

Added: unstable/liquidwar/branches/upstream/current/doc/html/index.html.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/html/index.html.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/html/index.html.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<HEAD>
+<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
+<TITLE>Liquid War - a unique multiplayer wargame</TITLE>
+</HEAD>
+<BODY>
+<CENTER>
+<H1>Liquid War - a unique multiplayer wargame</H1>
+v at VERSION@
+</CENTER>
+<HR>
+<H2>Hello!</H2>
+Thanks for taking interest in Liquid War. This documentation
+should help you to understand and use Liquid War.
+<P>
+It is also available:
+<UL>
+<LI>Online, on <A HREF="http://www.ufoot.org/liquidwar">www.ufoot.org/liquidwar</A>.
+<LI>As a <A HREF="../ps/liquidwar.ps">PostScript file</A>.
+<LI>As a <A HREF="../pdf/liquidwar.pdf">PDF file</A>.
+</UL>
+<HR>
+<H2>Table of contents</H2>
+<UL>
+<LI><A HREF="rules.html">Rules</A></LI>
+<LI><A HREF="authors.html">Authors</A></LI>
+<LI><A HREF="mailinglists.html">Mailing lists</A></LI>
+<LI><A HREF="fanfic.html">Fanfic</A></LI>
+<LI><A HREF="options.html">Menus and hot keys</A></LI>
+<LI><A HREF="network.html">Network game</A></LI>
+<LI><A HREF="parameters.html">Command line parameters</A></LI>
+<LI><A HREF="platforms.html">Platform specific issues</A></LI>
+<LI><A HREF="userlevels.html">User levels</A></LI>
+<LI><A HREF="algorithm.html">Core algorithm</A></LI>
+<LI><A HREF="source.html">Source code</A></LI>
+<LI><A HREF="bugs.html">Bugs</A></LI>
+<LI><A HREF="todo.html">To do</A></LI>
+<LI><A HREF="wip.html">Work in progress</A></LI>
+<LI><A HREF="copying.html">Copying</A></LI>
+</UL>
+<HR>
+<CENTER>
+This documentation is also available on:
+<A HREF="http://www.ufoot.org/liquidwar">www.ufoot.org/liquidwar</A>.
+</CENTER>
+</BODY>
+</HTML>

Added: unstable/liquidwar/branches/upstream/current/doc/info/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/info/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/info/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+liquidwar.info*

Added: unstable/liquidwar/branches/upstream/current/doc/info/DUMMY
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/info/DUMMY	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/info/DUMMY	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+This is a dummy file so that the directory is created when exporting from CVS.

Added: unstable/liquidwar/branches/upstream/current/doc/makedoc.py
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/makedoc.py	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/makedoc.py	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,622 @@
+# Got this script from Liquid War, pathed to be able
+# to transform XML docs into uwikicms content.
+
+# Note that this code used to use the xmllib module
+# which came with python 1.6, however it's now
+# deprecated so I use sax instead. Point is it wasn't
+# designed for sax in the first place, and I haven't
+# much time nor interest to code this, and the direct
+# consequence is that the code is ugly. I know.
+
+import xml.sax
+
+import string
+import re
+
+def remove_duplicate_blanks(text):
+    result=text
+
+    result=string.replace(result,"\t"," ")
+    result=string.replace(result,"\n"," ")
+
+    if (result!=""):
+        temp=""
+        while temp!=result:
+            temp=result
+            result=string.replace(result,"  "," ")
+
+    return result
+
+def format_text(text,left_col,right_col):
+    temp=remove_duplicate_blanks(text)
+
+    result=""
+    p=0
+    l=len(temp)
+    while p<l:
+        cur_line=temp[p:p+right_col-left_col]
+        dp=len(cur_line)
+        if dp==right_col-left_col:
+            i=dp-1
+            while i>0:
+                if cur_line[i]==' ':
+                    break
+                i=i-1
+            if i>0:
+                cur_line=cur_line[0:i]
+                dp=i+1
+                if 0==1: #the following code justifies the text, it is disabled
+                    j=i-1
+                    while len(cur_line)<right_col-left_col-1:
+                        if cur_line[j]==' ':
+                            while j>0 and cur_line[j-1]==' ':
+                                j=j-1
+                                cur_line=cur_line[:j]+' '+cur_line[j:]
+                                j=j-1
+                            if j<0:
+                                j=len(cur_line)-1
+                    
+        result=result+" "*left_col+cur_line+"\n"
+        p=p+dp
+    return result
+
+def format_email_and_url(text):
+    result=text	
+
+    email=re.compile('"([\w\-\.]+@[\w\-\.]+)"')
+    result=email.sub(r'\1',result);
+
+    url=re.compile('"http://([\w\-\.\~/]+)"', re.I)
+    result=url.sub(r'http://\1',result);
+
+    return result
+
+def format_html(text):
+    result=text
+
+    result=string.replace(result,"<","ufoot_html_lt")
+    result=string.replace(result,">","ufoot_html_gt")
+    result=string.replace(result,"&","&amp;")
+    result=string.replace(result,"ufoot_html_lt","&lt;")
+    result=string.replace(result,"ufoot_html_gt","&gt;")    
+
+    # Uncomment this to make mailing list adresses look like "xxx at xxx"
+    # instead of "xxx at xxx". This can prevent spammers from harvesting
+    # the mailing list address
+    # fakeemail=re.compile('"([\w\.]+\-user)@([\w\-\.]+)"')
+    # result=fakeemail.sub(r'<A HREF="mailto:\1 at \2">\1 at \2</A> (replace "at" by "@")',result);
+
+    email=re.compile('"([\w\-\.]+@[\w\-\.]+)"')
+    result=email.sub(r'<A HREF="mailto:\1">\1</A>',result);
+
+    url=re.compile('"http://([\w\-\.\~/]+)"', re.I)
+    result=url.sub(r'<A HREF="http://\1">\1</A>',result);
+    
+    return result
+
+def format_tex(text):
+    result=text
+
+    result=string.replace(result,"\\","$\\backslash$")
+    result=string.replace(result,"_","\\_")
+    result=string.replace(result,"#","\\#")
+    result=string.replace(result,"%","\\%")
+    result=string.replace(result,"}","\\}")
+    result=string.replace(result,"<","$<$")
+    result=string.replace(result,">","$>$")
+    result=string.replace(result,"~","$\\tilde{}$")
+    
+    return result
+
+def format_texi(text):
+    result=text
+
+    result=string.replace(result,"@","@@")
+    result=string.replace(result,"}","@}")
+    result=string.replace(result,"{","@{")
+
+    return result
+
+def format_uwc(text):
+    result=text
+
+    result=string.replace(result,"]","]")
+    result=string.replace(result,"[","[[")
+
+    return result
+
+def format_uwc_text(text):
+    result=text
+
+    result=format_uwc(result)
+    
+    # This is an ugly way to get rid of all junk at line start
+    result=format_text(result,0,999999)
+
+    return result
+
+def format_uwc_elem(text):
+    result=text
+
+    result=format_uwc(result)
+    result=string.replace(result,"\n"," ")
+    result=string.replace(result,"\r"," ")
+    result=remove_duplicate_blanks(result)
+
+    return result
+
+def format_uwc_code(text):
+    result=text
+
+    result=format_uwc(result)
+    line=re.compile('^(.*)$',re.M)
+    result=line.sub(r"  \1",result);
+
+    return result
+
+class XMLToX(xml.sax.ContentHandler):
+    def __init__(self):
+        xml.sax.ContentHandler.__init__(self)
+        self.charbuf=""
+        self.translated=""
+        self.stack=[]
+    def write(self,text):
+        self.translated=self.translated+text
+    def start_file(self,title):
+        pass
+    def start_chap(self,title):
+        pass
+    def start_part(self,title):
+        pass
+    def start_text(self):
+        pass
+    def start_list(self):
+        pass
+    def start_elem(self):
+        pass
+    def start_code(self):
+        pass
+    def end_file(self):
+        pass
+    def end_chap(self):
+        pass
+    def end_part(self):
+        pass
+    def end_text(self):
+        pass
+    def end_list(self):
+        pass
+    def end_elem(self):
+        pass
+    def end_code(self):
+        pass
+    def startElement(self,tag,attributes):
+        self.charbuf=""
+        self.stack.append(tag)
+        if tag=="file":
+            self.start_file(attributes["title"])
+        if tag=="chap":
+            self.start_chap(attributes["title"])
+        if tag=="part":
+            self.start_part(attributes["title"])
+        if tag=="text":
+            self.start_text()
+        if tag=="list":
+            self.start_list()
+        if tag=="elem":
+            self.start_elem()
+        if tag=="code":
+            self.start_code()
+    def endElement(self,tag):
+        data=string.strip(self.charbuf)
+        if (data!=""):
+            self.write(self.translate(data,self.stack[-1]))
+        self.charbuf=""
+        self.stack=self.stack[:-1]
+        if tag=="file":
+            self.end_file()
+        elif tag=="chap":
+            self.end_chap()
+        elif tag=="part":
+            self.end_part()
+        elif tag=="text":
+            self.end_text()
+        elif tag=="list":
+            self.end_list()
+        elif tag=="elem":
+            self.end_elem()
+        elif tag=="code":
+            self.end_code()
+    def translate(self,data,tag):
+        return data
+    def characters(self,data):
+        self.charbuf+=data
+
+class XMLToHTML(XMLToX):
+    def __init__(self,header,footer):
+        XMLToX.__init__(self)
+        self.header=header
+        self.footer=footer
+    def start_file(self,title):
+        self.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n"+\
+                   "<HTML>\n<HEAD>\n"+\
+                   "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\n"+\
+                   "<TITLE>"+\
+                   title+\
+                   "</TITLE>\n</HEAD>\n<BODY>\n\n"+\
+                   self.header+\
+                   "\n<CENTER><H1>"+\
+                   title+\
+                   "</H1></CENTER>\n")
+    def start_chap(self,title):
+        self.write("<HR>\n<H2>"+\
+                   title+\
+                   "</H2>\n")
+    def start_part(self,title):
+        self.write("<H3>"+\
+                   title+\
+                   "</H3>\n")
+    def start_text(self):
+        self.write("<P>")
+    def start_list(self):
+        self.write("<UL>")
+    def start_elem(self):
+        self.write("<LI>")
+    def start_code(self):
+        self.write("<PRE>")
+    def end_file(self):
+        self.write(self.footer+\
+                   "\n</BODY>\n</HTML>\n")
+    def end_chap(self):
+        self.write("\n")
+    def end_part(self):
+        self.write("\n")
+    def end_text(self):
+        self.write("</P>\n")
+    def end_list(self):
+        self.write("</UL>\n")
+    def end_elem(self):
+        self.write("</LI>\n")
+    def end_code(self):
+        self.write("</PRE>\n")
+    def translate(self,data,tag):
+        result=data
+        result=format_html(result)
+        return result
+
+class XMLToPHP3(XMLToX):
+    def __init__(self):
+        XMLToX.__init__(self)
+    def start_file(self,title):
+        self.write("\n\n<!-- www.ufoot.org : page begins here -->\n\n"+\
+                   "<center>\n<h1>"+\
+                   title+\
+                   "</h1>\n</center>\n")
+    def start_chap(self,title):
+        self.write("<hr />\n<h2>"+\
+                   title+\
+                   "</h2>\n")
+    def start_part(self,title):
+        self.write("<h3>"+\
+                   title+\
+                   "</h3>\n")
+    def start_text(self):
+        self.write("<p>")
+    def start_list(self):
+        self.write("<ul>")
+    def start_elem(self):
+        self.write("<li>")
+    def start_code(self):
+        self.write("<pre>")
+    def end_file(self):
+        self.write("\n\n<!-- www.ufoot.org : page ends here -->\n\n")
+    def end_chap(self):
+        self.write("\n")
+    def end_part(self):
+        self.write("\n")
+    def end_text(self):
+        self.write("</p>\n")
+    def end_list(self):
+        self.write("</ul>\n")
+    def end_elem(self):
+        self.write("</li>\n")
+    def end_code(self):
+        self.write("</pre>\n")
+    def translate(self,data,tag):
+        result=data
+        result=format_html(result)
+        return result
+
+class XMLToTeX(XMLToX):
+    def __init__(self):
+        XMLToX.__init__(self)
+    def start_file(self,title):
+        self.write("\\chapter{"+\
+                   self.translate(title,"text")+\
+                   "}\n")
+    def start_chap(self,title):
+        self.write("\\section{"+\
+                   self.translate(title,"text")+\
+                   "}\n")
+    def start_part(self,title):
+        self.write("\\subsection{"+\
+                   self.translate(title,"text")+\
+                   "}\n")
+    def start_text(self):
+        self.write("\n")
+    def start_list(self):
+        self.write("\\begin{itemize}\n")
+    def start_elem(self):
+        self.write("\\item[$\\bullet$]")
+    def start_code(self):
+        self.write("\\begin{verbatim}\n")
+    def end_file(self):
+        self.write("")
+    def end_chap(self):
+        self.write("\n")
+    def end_part(self):
+        self.write("\n")
+    def end_text(self):
+        self.write("\n")
+    def end_list(self):
+        self.write("\\end{itemize}\n")
+    def end_elem(self):
+        self.write("\n")
+    def end_code(self):
+        self.write("\n\\end{verbatim}\n")
+    def translate(self,data,tag):
+        result=data
+	result=format_email_and_url(result)
+        if (tag!="code"):
+            result=format_tex(result)
+        return result
+
+class XMLToMan(XMLToX):
+    def __init__(self):
+        XMLToX.__init__(self)
+    def start_file(self,title):
+        self.write(".SH "+title+"\n\n")
+    def start_chap(self,title):
+        self.write(".SS "+title+"\n\n")
+    def start_part(self,title):
+        self.write(".TP 0 \n.B "+title+"\n")
+
+    def start_text(self):
+        self.write(".HP 0\n")
+    def start_list(self):
+        self.write("")
+    def start_elem(self):
+        self.write(".TP 3 \n.B *\n")
+    def start_code(self):
+        self.write(".HP 0\n")
+    def end_file(self):
+        self.write("")
+    def end_chap(self):
+        self.write("\n")
+    def end_part(self):
+        self.write("\n")
+    def end_text(self):
+        self.write("\n")
+    def end_list(self):
+        self.write("\n")
+    def end_elem(self):
+        self.write("\n")
+    def end_code(self):
+        self.write("\n")
+    def translate(self,data,tag):
+        result=data
+	result=format_email_and_url(result)
+        result=string.replace(result,"\\","\\\\")
+        result=string.replace(result,".","\.")
+        result=string.replace(result,"-","\-")
+        if (tag=="code"):
+            result=string.replace(result,"\n","\n.br\n")
+        else:
+            result=remove_duplicate_blanks(result)
+        return result
+
+class XMLToTxt(XMLToX):
+    def __init__(self,header):
+        XMLToX.__init__(self)
+        self.header=header
+    def start_file(self,title):
+        self.write(self.header+" - "+title+"\n\n")
+        self.indent=0
+    def start_chap(self,title):
+        self.write("\n\n"+\
+                   " "*self.indent+"\n"+title+"\n"+\
+                   " "*self.indent+"="*len(title)+"\n\n")
+        self.indent=self.indent+2
+    def start_part(self,title):
+        self.write("\n"+\
+                   " "*self.indent+title+"\n"+\
+                   " "*self.indent+"-"*len(title)+"\n")
+        self.indent=self.indent+2
+    def start_text(self):
+        self.write("\n")
+    def start_list(self):
+        self.write("")
+        self.indent=self.indent+2
+    def start_elem(self):
+        self.write("\n")
+    def start_code(self):
+        self.write("\n")
+    def end_file(self):
+        self.write("\n")
+    def end_chap(self):
+        self.write("")
+        self.indent=self.indent-2
+    def end_part(self):
+        self.write("")
+        self.indent=self.indent-2
+    def end_text(self):
+        self.write("")
+    def end_list(self):
+        self.write("")
+        self.indent=self.indent-2
+    def end_elem(self):
+        self.write("")
+    def end_code(self):
+        self.write("\n")
+    def translate(self,data,tag):
+        result=data
+	result=format_email_and_url(result)
+        if (tag=="code"):
+            result=" "*self.indent+\
+                    string.replace(result,"\n","\n"+" "*self.indent)
+        else:
+            result=format_text(result,self.indent,80)
+            if (tag=="elem"):
+                result=" "*(self.indent-2)+"* "+result[self.indent:]
+        return result
+
+class XMLToTexi(XMLToX):
+    def __init__(self,node):
+        XMLToX.__init__(self)
+        self.node=node
+    def start_file(self,title):
+        self.write("\n at node "+self.node+" , , , Top\n")
+        self.write("\n at chapter "+title+"\n");
+    def start_chap(self,title):
+        self.write("\n at section "+title+"\n");
+    def start_part(self,title):
+        self.write("\n at subsection "+title+"\n");
+    def start_text(self):
+        self.write("\n")
+    def start_list(self):
+        self.write("\n at itemize @bullet")
+    def start_elem(self):
+        self.write("\n at item\n")
+    def start_code(self):
+        self.write("\n at example\n")
+    def end_file(self):
+        self.write("\n")
+    def end_chap(self):
+        self.write("\n")
+    def end_part(self):
+        self.write("\n")
+    def end_text(self):
+        self.write("\n")
+    def end_list(self):
+        self.write("@end itemize\n")
+    def end_elem(self):
+        self.write("\n")
+    def end_code(self):
+        self.write("\n at end example\n")
+    def translate(self,data,tag):
+        result=data
+	result=format_email_and_url(result)
+
+        if (tag!="code"):
+            result=remove_duplicate_blanks(result)
+        result=format_texi(result)
+        return result
+
+class XMLToUWC(XMLToX):
+    def __init__(self):
+        XMLToX.__init__(self)
+    def start_file(self,title):
+        # In UWikKiCMS document is handled manually once for
+        # all directly in the UWiKiCMS site/instance.
+        pass
+    def start_chap(self,title):
+        self.write("\n!! "+title+"\n");
+    def start_part(self,title):
+        self.write("\n! "+title+"\n");
+    def start_text(self):
+        self.write("\n")
+    def start_list(self):
+        self.write("\n")
+    def start_elem(self):
+        self.write("\n* ")
+    def start_code(self):
+        self.write("\n")
+    def end_file(self):
+        self.write("\n")
+    def end_chap(self):
+        self.write("\n")
+    def end_part(self):
+        self.write("\n")
+    def end_text(self):
+        self.write("\n")
+    def end_list(self):
+        self.write("\n")
+    def end_elem(self):
+        # No \n for we do not want blank lines between elems
+        pass
+    def end_code(self):
+        self.write("\n")
+    def translate(self,data,tag):
+        result=data
+	result=format_email_and_url(result)
+
+        if (tag=="code"):
+            result=format_uwc_code(result)
+        elif (tag=="elem"):
+            result=format_uwc_elem(result)
+        else:
+            result=format_uwc_text(result)        
+
+        return result
+
+def run_parser(handler,dst,src):
+    dst_file=open(dst,"w")
+    src_file=open(src,"r")
+    #src_code=src_file.read()
+    parser=xml.sax.make_parser()
+    parser.setContentHandler(handler)
+    parser.parse(src_file)
+    dst_code=handler.translated
+    dst_file.write(dst_code.encode("iso-8859-1"))
+    src_file.close()
+    dst_file.close()
+        
+def make_html(html_file,xml_file,header,footer):
+    header_file=open(header,"r")
+    footer_file=open(footer,"r")
+    header_str=header_file.read()
+    footer_str=footer_file.read()
+    handler=XMLToHTML(header_str,footer_str)
+    run_parser(handler,html_file,xml_file)
+    header_file.close()
+    footer_file.close()
+
+def make_php3(php3_file,xml_file):
+    parser=xml.sax.make_parser()
+    handler=(XMLToPHP3())
+    run_parser(handler,php3_file,xml_file)
+
+def make_tex(tex_file,xml_file):
+    parser=xml.sax.make_parser()
+    handler=XMLToTeX()
+    run_parser(handler,tex_file,xml_file)
+
+def make_man(man_file,xml_file):
+    parser=xml.sax.make_parser()
+    handler=XMLToMan()
+    run_parser(handler,man_file,xml_file)
+
+def make_txt(txt_file,xml_file,header):
+    parser=xml.sax.make_parser()
+    handler=XMLToTxt(header)
+    run_parser(handler,txt_file,xml_file)
+
+def make_texi(texi_file,xml_file):
+    node=string.replace(xml_file,".xml","")
+    node=string.replace(node,"xml/","")
+    parser=xml.sax.make_parser()
+    handler=XMLToTexi(node)
+    run_parser(handler,texi_file,xml_file)
+
+def make_uwc(uwc_file,xml_file):
+    parser=xml.sax.make_parser()
+    handler=XMLToUWC()
+    run_parser(handler,uwc_file,xml_file)
+
+
+
+
+
+
+
+

Added: unstable/liquidwar/branches/upstream/current/doc/man/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/man/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/man/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,3 @@
+*.man
+liquidwar.6
+liquidwar.6.gz

Added: unstable/liquidwar/branches/upstream/current/doc/man/begin.man.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/man/begin.man.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/man/begin.man.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,34 @@
+.TH "Liquid War" 6 "v at VERSION@"
+.SH NAME
+liquidwar \- a unique multiplayer wargame
+.SH SYNOPSIS
+liquidwar [-vh]
+.SH DESCRIPTION
+Liquid War is a multiplayer wargame. Its rules are
+very simple but yet original.
+.SH OPTIONS
+.TP 3 
+.B \-v
+Displays the version number.
+.TP 3 
+.B \-h
+Displays copyright and various information.
+.TP 3
+.B \.\.\.
+There are many other command lines options,
+which are described further in this document.
+.SH WARNING
+As Liquid War is a cross-platform program (it also runs on DOS and Windows),
+I could reasonably not provide groff UNIX-style documentation to
+Windows user. Therefore, Liquid War's documentation is available in many
+formats, including HTML, PostScript and PDF. 
+.br
+I believe these formats are easier to read than this man page.
+So check out the 
+.B /usr/share/doc/liquidwar 
+or 
+.B /usr/local/share/doc/liquidwar
+directories, for this is
+where HTML and other documentation files should be. Otherwise, if 
+you are a die-hard man page user, you may continue with this document 8-)
+

Added: unstable/liquidwar/branches/upstream/current/doc/man/end.man
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/man/end.man	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/man/end.man	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,3 @@
+.SH AUTHOR
+Christian Mauduit <ufoot at ufoot.org>
+

Added: unstable/liquidwar/branches/upstream/current/doc/pdf/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/pdf/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/pdf/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+liquidwar.pdf

Added: unstable/liquidwar/branches/upstream/current/doc/pdf/DUMMY
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/pdf/DUMMY	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/pdf/DUMMY	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+This is a dummy file so that the directory is created when exporting from CVS.

Added: unstable/liquidwar/branches/upstream/current/doc/php3/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/php3/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/php3/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+*.php3

Added: unstable/liquidwar/branches/upstream/current/doc/php3/DUMMY
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/php3/DUMMY	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/php3/DUMMY	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+This is a dummy file so that the directory is created when exporting from CVS.

Added: unstable/liquidwar/branches/upstream/current/doc/ps/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/ps/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/ps/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+liquidwar.ps

Added: unstable/liquidwar/branches/upstream/current/doc/ps/DUMMY
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/ps/DUMMY	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/ps/DUMMY	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+This is a dummy file so that the directory is created when exporting from CVS.

Added: unstable/liquidwar/branches/upstream/current/doc/tex/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/tex/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/tex/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,5 @@
+liquidwar.aux
+liquidwar.dvi
+liquidwar.log
+liquidwar.toc
+*.tex

Added: unstable/liquidwar/branches/upstream/current/doc/tex/liquidwar.tex.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/tex/liquidwar.tex.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/tex/liquidwar.tex.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,39 @@
+\documentclass[a4paper,10pt]{book}
+
+\title{Liquid War - a unique multiplayer wargame}
+\author{Christian Mauduit}
+\date{v at VERSION@}
+
+\oddsidemargin    0mm
+\evensidemargin   0mm
+\marginparwidth   0mm
+\marginparsep     0mm
+\textwidth      158mm
+
+\parindent        0pt
+\parskip          5pt
+
+\begin{document}
+
+\maketitle
+
+\setcounter{tocdepth}{1}
+\tableofcontents
+
+\input{rules}
+\input{authors}
+\input{mailinglists}
+\input{fanfic}
+\input{options}
+\input{network}
+\input{parameters}
+\input{platforms}
+\input{userlevels}
+\input{algorithm}
+\input{source}
+\input{bugs}
+\input{todo}
+\input{wip}
+\input{copying}
+
+\end{document}

Added: unstable/liquidwar/branches/upstream/current/doc/texi/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/texi/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/texi/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+*.texi

Added: unstable/liquidwar/branches/upstream/current/doc/texi/begin.texi.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/texi/begin.texi.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/texi/begin.texi.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,30 @@
+\input texinfo
+ at settitle Liquid War documentation
+
+ at ifinfo
+ at direntry
+* Liquid War: (liquidwar). A unique multiplayer wargame (Version @VERSION@).
+ at end direntry
+ at end ifinfo
+
+ at node Top, , (dir), (dir)
+
+Liquid War is a multiplayer wargame. Its rules are very simple but yet original.
+
+ at menu
+* rules::                   Rules
+* authors::                 Authors
+* mailinglists::            Mailing lists
+* fanfic::                  Fanfic
+* options::                 Menus and hot keys
+* network::                 Network game
+* parameters::              Command line parameters
+* platforms::               Platform specific issues
+* userlevels::              User levels
+* algorithm::               Core algorithm
+* source::                  Source code
+* bugs::                    Bugs
+* todo::                    To do
+* wip::                     Work in progress
+* copying::                 Copying
+ at end menu

Added: unstable/liquidwar/branches/upstream/current/doc/texi/end.texi
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/texi/end.texi	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/texi/end.texi	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,3 @@
+
+ at bye
+

Added: unstable/liquidwar/branches/upstream/current/doc/txt/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/txt/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/txt/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+*.txt

Added: unstable/liquidwar/branches/upstream/current/doc/txt/DUMMY
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/txt/DUMMY	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/txt/DUMMY	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+This is a dummy file so that the directory is created when exporting from CVS.

Added: unstable/liquidwar/branches/upstream/current/doc/uwc/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/uwc/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/uwc/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+*.uwc

Added: unstable/liquidwar/branches/upstream/current/doc/uwc/DUMMY
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/uwc/DUMMY	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/uwc/DUMMY	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+This is a dummy file so that the directory is created when exporting from CVS.

Added: unstable/liquidwar/branches/upstream/current/doc/xml/algorithm.xml
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/xml/algorithm.xml	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/xml/algorithm.xml	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,377 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE file SYSTEM "file:xml/file.dtd">
+<file title="Core algorithm">
+
+  <chap title="Introduction">
+    <part title="General remarks">
+      <text>
+	If you have played Liquid War, you must have noticed
+	that your army always takes the shortest way to reach
+	the cursor. So the fundamental stuff in Liquid War
+	is path-finding. Once you've done that the game is
+	quite easy to code. Not harder than any other 2D game.
+	Still the path finding algorithm is an interesting one,
+	for it's not a common method that we used.
+      </text>
+      <text>
+	Basically, at each round (by round I mean a game logical
+	update, this occurs 10 or 100 times/sec depending on the
+	level and/or your machine), the distance from all the
+	points of the level to your cursor is calculated.
+	Now the point is to calculate this fast, real fast.
+	In fact, a "gradient" is calculated for all the points
+	of the level, and the value of this gradient is the
+	distance required for a little pixel/fighter to reach
+	your cursor, assuming that he takes the shortest way.
+	Liquid War does this with a 10% error tolerance,
+	and it's enough for keeping the game interesting.
+      </text>
+      <text>
+	Once you have this gradient calculated, it's not hard
+	to move your fighters. Basically, you just have to
+	move them toward the adjacent point that has the
+	lowest gradient value, ie is the closest to your
+	cursor.
+      </text>
+    </part>
+    <part title="History">
+      <text>
+	The Liquid War algorithm has been invented by my friend
+	Thomas Colcombet 
+	In fact the Liquid War algorithm has been invented before
+	the game itself. The game came as a consequence of the
+	algorithm, he just thought
+	"mmm, cool, we could make a game with that!".
+      </text>
+      <text>
+	Later, I enhanced the algorithm, as I coded it.
+	The consequences were a performance increase,
+	especially on simple but big levels.
+	I mean levels with wide areas for teams to move.
+	Still the basis of the algorithm remained the same.
+      </text>
+    </part>
+    <part title="Pros">
+      <text>
+	The Liquid War algorithm for path-finding is very efficient:
+      </text>
+      <list>
+	<elem>
+	  When you have to move lots of different points 
+	  toward one single point. Good thing that's the rule
+	  of Liquid War!
+	</elem>
+	<elem>
+	  When you have no clue about how your map will look like,
+	  ie if the walls are randomly placed. The complexity of the
+	  level doesn't influence much the speed of the algorithm.
+	  The size does, but the complexity, ie the number of walls,
+	  is not so important.
+	</elem>
+      </list>
+    </part>
+    <part title="Cons">
+      <text>
+	The Liquid War algorithm is very poor compared to other algorithms when:
+      </text>
+      <list>
+	<elem>
+	  You have several target
+	  destinations, that's to say Liquid War would be really slow
+	  if there were 100 teams with 10 players only.
+	</elem>
+	<elem>
+	  You want to move one single point only.
+	</elem>
+	<elem>>
+	  You want the exact (100% sure) path.
+	  In fact, this algorithm finds solutions which approach
+	  the best one but you can never figure out if the solution
+	  you found is the best, and the algorithm never ends.
+	  In the long term, the algo will always find the best solution
+	  or something really close but I don't know any easy way
+	  to figure out when you have reached this state.
+	</elem>
+      </list>
+    </part>
+  </chap>
+
+  <chap title="Mesh">
+    <part title="Introduction">
+      <text>
+	The first Liquid War algorithm used to calculate the
+	gradient (the distance from a point to your cursor)
+	for every single point of the map.
+      </text>
+      <text>
+	With Liquid War 5, I used a mesh system.
+	This mesh system is a structure of squares connected
+	together. Squares may be 1,2,4,8 or 16 units large
+	or any nice value like that, and the gradient is
+	only calculated once for each square.
+	Squares have connections between them,
+	and each connection is associated to a direction.
+      </text>
+      <text>
+	There are 12 directions:
+      </text>
+      <list>
+	<elem>
+	  North-North-West (NNW)
+	</elem>
+	<elem>
+	  North-West (NW)
+	</elem>
+	<elem>
+	  West-North-West (WNW)
+	</elem>
+	<elem>
+	  West-South-West (WSW)
+	</elem>
+	<elem>
+	  South-West (SW)
+	</elem>
+	<elem>
+	  South-South-West (SSW)
+	</elem>
+	<elem>
+	  South-South-East (SSE)
+	</elem>
+	<elem>
+	  South-East (SE)
+	</elem>
+	<elem>
+	  East-South-East (ESE)
+	</elem>
+	<elem>
+	  East-North-East (ENE)
+	</elem>
+	<elem>
+	  North-East (NE)
+	</elem>
+	<elem>
+	  North-North-East (NNE)
+	</elem>
+      </list>
+    </part>
+    <part title="Example">
+      <text>
+	Well, let me give you an example,
+	supposing that you level structure is:
+      </text>
+      <code>
+**********
+*        *
+*        *
+*       **
+*        *
+**********
+      </code>
+      <text>
+	The * represent walls, that's to say squares where fighters can not go.
+      </text>
+      <text>
+	Then the mesh structure would be:
+      </text>
+      <code>
+**********
+*11112233*
+*11112233*
+*1111445**
+*i1114467*
+**********
+      </code>
+      <text>
+	In this mesh, there are 7 zones:
+      </text>
+      <list>
+	<elem>
+	  zone 1 has a size of 4. It's linked with zones 2 (ENE) and 4 (ESE).
+	</elem>
+	<elem>
+	  zone 2 has a size of 2. It's linked with zones 3 (ENE,ESE), 5 (SE), 4 (SSE,SSW) and 1 (SW,WSW,WNW).
+	</elem>
+	<elem>
+	  zone 3 has a size of 2. It's linked with zones 5 (SSW), 4 (SW) and 2 (WSW,WNW).
+	</elem>
+	<elem>
+	  zone 4 has a size of 2. It's linked with zones 2 (NNW,NNE), 4 (NE), 5 (ENE), 6 (ESE) and 1 (WSW,WNW,NW).
+	</elem>
+	<elem>
+	  zone 5 has a size of 1. It's linked with zones 3 (NNW,NNE,NE), 7 (SE), 6 (SSE,SSW), 4 (SW,WSW,WNW) and 2 (NW).
+	</elem>
+	<elem>
+	  zone 6 has a size of 1. It's linked with zones 5 (NNW,NNE), 7 (ENE,ESE) and 4 (WSW,WNW,NW).
+	</elem>
+	<elem>
+	  zone 7 has a size of 1. It's linked with zones 5 (NW) and 6 (WSW,WNW).
+	</elem>
+      </list>
+    </part>
+    <part title="Why such a complicated structure?">
+      <text>
+	Because it allows the module which calculates the gradient to work much faster.
+	With this system, the number of zones is reduced a lot, and calculus on the
+	mesh can go very fast. At the same time, this mesh structure is complicated to understand
+	by us humans but it's very easy for the computer. 
+      </text>
+    </part>
+  </chap>
+
+  <chap title="Gradient">
+    <part title="Introduction">
+      <text>
+	For each zone defined in the mesh, LW calculates an estimation
+	of the distance between the cursor and this zone.
+      </text>
+      <text>
+	The algorihm is based on the fact that to cross a zone which size
+	is n, n movements are required. Easy, eh?
+      </text>
+    </part>
+    <part title="Description">
+      <text>
+	Here's the way the algorithm works:
+      </text>
+      <text>
+	for each turn of the game, do:
+      </text>
+      <list>
+	<elem>
+	  pick up a direction between the 12 defined directions.
+	  They have to be chosen is a peculiar order to avoid 
+	  weird behaviors from fighters, but let's suppose we just pick up
+	  the "next" direction, ie if WSW was chosen the last time,
+	  we pick up WNW.
+	</elem>
+      </list>
+      <text>
+	and then for each zone in the mesh, do:
+      </text>
+      <list>
+	<elem>
+	  Compare the potential of the current zone with that of its neighbor zone.
+	  The neighbor zone to be chosen is the one which corresponds to the direction
+	  which has been previously picked up, and by potential I mean "the distance
+	  to the cursor, estimated by the algorithm's last pass".
+	</elem>
+	<elem>
+	  If potential_of_the_neighbor_zone > (potential_of_the_current_zone + size_of_the_current_zone) then potentiel_of_the_neighbor_zone = potential_of_the_current_zone + size_of_the_current_zone 
+	</elem>
+      </list>
+    </part>
+    <part title="How can this work?">
+      <text>
+	Well, just ask my friend thom-Thom, he's the one who had the idea
+	of this algorithm!
+      </text>
+      <text>
+	The basic idea is that by applying this simple rule to all the zones,
+	after a certain amount of time, it's impossible to find any place
+	in the mesh where the rule is not respected. And at this time, one
+	can consider the potiential is right in any point.
+      </text>
+      <text>
+	Of course when the cursor moves the potential has to be recalculated,
+	but you see, cursors move really slowly in Liquid War, so the
+	algorithm has plenty of time to find a new stable solution...
+      </text>
+    </part>
+    <part title="Demo">
+      <text>
+	It's possible to see this algorithm working by typing:
+      </text>
+      <code>
+	ufootgrad[n]
+      </code>
+      <text>
+	while playing, where [n] is the number of the
+	team the gradient of which you want to view.
+	The game is still running but you view a team's gradient
+	being calculated in real time instead of seeing the fighters.
+      </text>
+      <text>
+	If you type ufootgrad0 the display comes back to normal mode.
+      </text>
+    </part>
+  </chap>
+
+  <chap title="Move">
+    <part title="Introduction">
+      <text>
+	Once the gradient is calculated for any zone on the battlefield,
+	it's quite easy to move the fighters, hey?
+      </text>
+      <text>
+	The following method is used to move the players:
+      </text>
+      <list>
+	<elem>
+	  A "main direction" is chosen for the fighter, this direction is chosen using the gradient calculated on the mesh.
+	</elem>
+	<elem>
+	  Knowing which direction is the main one, a "level of interest" is applied to the 12 defined directions.
+	</elem>
+      </list>
+      <text>
+	There are 4 "level of interest" for directions:
+      </text>
+      <list>
+	<elem>
+	  Main directions: the direction calculated.
+	</elem>
+	<elem>
+	  Good directions: these directions should lead the fighter to the cursor.
+	</elem>
+	<elem>
+	  Acceptable directions: ok, one can use this direction, since the fighter shouldn't loose any time using it.
+	</elem>
+	<elem>
+	  Unpossible directions: wether there's a wall or using this direction means the fighter will be farer from his cursor than before, it always means that this direction will not be used, never.
+	</elem>
+      </list>
+    </part>
+    <part title="Rules">
+      <text>
+	The fighters will try to find any matching situation in this list, and chose the first one.
+      </text>
+      <list>
+	<elem>
+	  The main direction is available, no one on it, OK, let's follow it.
+	</elem>
+	<elem>
+	  There's a good direction with no one on it, OK, let's follow it.
+	</elem>
+	<elem>
+	  There's an acceptable direction with no one on it, OK, let's follow it.
+	</elem>
+	<elem>
+	  The main direction is available, but there's an opponent on it, I attack! By attacking, one means that energy is drawned from the attacked fighter and transmitted to the attacker. When the attacked fighter dies, he belongs to the team which killed him.
+	</elem>
+	<elem>
+	  A good direction is available, but there's an opponent on it, I attack!
+	</elem>
+	<elem>
+	  The main direction is available, but there's a mate on it, I cure him. That's to say that energy is given to the mate. This way, when there's a big pool of fighters from the same team, they re-generate each other.
+	</elem>
+	<elem>
+	  None of the previous situations found, do nothing.
+	</elem>
+      </list>
+    </part>
+    <part title="Tips and tricks">
+      <text>
+	The behavior of the armies is quite tricky to set up.
+	I had myself to try many algorithms before I came to something nice.
+	In fact, I had to introduce some "random" behaviors.
+	They are not really random for I wanted the game to behave the
+	same when given the same keyboard input, but for instance,
+	fighters will prefer NNW to NNE sometimes, and NNE to NNW some
+	other times. By the way, I think Liquid War could stand as a nice
+	example of the thoery of chaos.
+      </text>
+    </part>
+  </chap>
+
+</file>
+

Added: unstable/liquidwar/branches/upstream/current/doc/xml/authors.xml
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/xml/authors.xml	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/xml/authors.xml	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE file SYSTEM "file:xml/file.dtd">
+<file title="Authors">
+
+  <chap title="Thom-Thom">
+    <text>
+      Liquid War rules have been invented by
+      Thomas Colcombet.
+    </text>
+    <text>
+      He was trying to find algorithms to find the shortest path
+      from one point to another, and found the Liquid War
+      algorithm. Then it came to his mind that a game could
+      be build upon this algorithm, and Liquid War was born.
+      He programmed the first two versions of Liquid War
+      using Borland Pascal for DOS, and gave me some information
+      about the algorithm so that I could re-program it.
+    </text>
+  </chap>
+
+  <chap title="U-Foot">
+    <text>
+      I'm the guy who programmed the latest versions of Liquid War.
+      I enhanced the algorithms, and did quite a bunch of work
+      to have the game playable by (almost) anyone, that's to
+      say create a correct GUI.
+    </text>
+    <text>
+      If you want to join me, here's all the information you'll ever need:
+    </text>
+    <code>
+Christian Mauduit
+
+E-mail: "ufoot at ufoot.org" 
+Web site: "http://www.ufoot.org"
+
+GnuPG public key: FD409E94 - "http://www.ufoot.org/gnupg.pub"
+GnuPG fingerprint: 4762 1EBA 5FA3 E62F 299C  B0BB DE3F 2BCD FD40 9E94
+
+Snail mail: 32 rue Jean Moulin  95100 Argenteuil  FRANCE
+    </code>
+  </chap>
+
+  <chap title="Other contributors">
+    <text>
+      As Liquid War is now free software, protected by the GPL,
+      anyone is allowed to view, edit, modify, re-compile
+      the source code, and distribute it, as long as Liquid 
+      War is still distributed under the GPL.
+    </text>
+    <text>
+      Here's a list of the contributors:
+    </text>
+    <list>
+      <elem>
+	Alstar: drew a map, which is now included in the main distribution.
+      </elem>
+      <elem>
+        Peter Wang: ported Liquid War to GNU/Linux.
+      </elem>
+      <elem>
+	Cort Danger Stratton : helped me setting up network support.
+      </elem>
+      <elem>
+	Tim Chadburn : wrote midi files for the game. His contribution has
+	been truely appreciated since it's rather hard to find GNU GPL
+	compliant artwork. He also wrote documentation and helped with
+	midi support in general.
+      </elem>
+      <elem>
+        Jan Gretschuskin : contributed 11 maps, and made the German
+	translation. So if you run Liquid War with German menus, you
+	know who you have to thank -> Jan! 8-) 
+	Also do not forget to visit "http://www.game-factor.de"
+      </elem>
+      <elem>
+        Mouse : contributed a map.
+      </elem>
+      <elem>
+        Rene Stach : drew 3 maps.
+      </elem>
+      <elem>
+	Roderick Schertler : implemented HTTP 1.1 support.
+      </elem>
+      <elem>
+	Ryan D. Brown : ported Liquid War to Mac OS X.
+      </elem>
+      <elem>
+	Eduard Bloch : maintained the Debian package, 
+	and helped with German support.
+      </elem>
+      <elem>
+	Michael Terry : provided a .desktop file for better integration
+	with Gnome, KDE and other UNIX desktop environments.
+      </elem>
+      <elem>
+	Kasper Hviid : contributed many maps, with their own
+	textures, and made the Danish translation. Great work, also
+	available on "http://levels.2v1.cz/index.html"
+      </elem>
+      <elem>
+	David Redick : wrote an external random map generator,
+	available on "http://xdavidx.sqrville.org/lwmapgen/index.html"
+      </elem>
+      <elem>
+	Alexandre Pineau : maintains the Debian package.
+      </elem>
+      <elem>
+	Michael Wagner : translated the web site in German.
+      </elem>
+      <elem>
+	Peter Williams : fixed the "too many opened socket" server bug.
+      </elem>
+      <elem>
+	Jan Samohyl : submitted strategy tips.
+      </elem>
+      <elem>
+	Gavin : wrote the Liquid War fanfic.
+      </elem>
+      <elem>
+	Dave Vasilevsky : fixed the Mac OS X port.
+      </elem>
+      <elem>
+	2 of omega : contributed a map.
+      </elem>
+      <elem>
+	666-REFIZUL-666 : created many maps (distributed separately).
+      </elem>
+    </list>
+    <text>
+      Many other people helped me by submitting bug reports and patches,
+      and I want to thank them for their precious help. Thanks to all the
+      Debian people too, who nicely maintain the Liquid War .deb package.
+    </text>
+  </chap>
+
+</file>

Added: unstable/liquidwar/branches/upstream/current/doc/xml/bugs.xml
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/xml/bugs.xml	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/xml/bugs.xml	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,267 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE file SYSTEM "file:xml/file.dtd">
+<file title="Bugs">
+
+  <chap title="Report a new bug">
+    <text>
+      If you have troubles with Liquid War 5,
+      if you think it is a bug,
+      and if it is not described in this file, then just
+      send a (precise...) decription of your problem
+      to the Liquid War user mailing list.
+    </text>
+    <text>
+      Besides, it happens that now most bug reports come from
+      the Debian tracking system
+      "http://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=liquidwar".
+      Thanks to the Debian users and maintainers, it's a very
+      valuable feedback source.
+    </text>
+    <text>
+      Additionnaly, on online bug tracking system has been set up.
+      It uses Flyspray "http://flyspray.rocks.cc/".
+      It's accessible on "http://www.ufoot.org/bugtracker/" or
+      "http://www.ufoot.org/bugtracker/index.php?project=2".
+      I try to collect everything here : bugs reported on the mailing-list,
+      bugs from Debian, and bugs I found myself. Alternatively
+      you can report bugs directly on it 8-)
+    </text>
+  </chap>
+
+  <chap title="Network">
+    <text>
+      Network support in Liquid War is far from being perfect, so there
+      are a bunch of little problems which can appear. Basically, once
+      the game is correctly started on a LAN, you should have no problems,
+      but getting the game started might be difficult.
+    </text>
+  </chap>
+
+  <chap title="Mouse does not work">
+    <text>
+      Some users reported that they were unable to control the Liquid War
+      cursor with the mouse. Well, the answer is a typical Microsoftish
+      "this ain't a bug, it's a feature!".
+    </text>
+    <text>
+      More seriously, you're supposed to move the cursor with the keyboard
+      in Liquid War. There's no way to handle the cursor "like a mouse pointer"
+      (*). This is due to:
+    </text>
+    <list>
+      <elem>
+	Severe limitations in the Liquid War core algorithm.
+      </elem>
+      <elem>
+	The fact that moving the cursor "too fast" would really change the
+	gameplay of Liquid War. As a Liquid War integrist 8-) I can tell you
+	the game would really not be the same if you could move the cursor
+	as fast as you wish. It's part of the game that sometimes it takes
+	you ages to recover from a strategical mistakes. You need to think
+	twice before going to the very end of a level. That's strategy.
+	At least that's how I view things... Anyways as I mentionned above
+	there's a limitation in the core algorithm.
+      </elem>
+    </list>
+    <text>
+      (*) This is not perfectly true, there's a way to control the cursor
+      with the mouse, but it's designed for the case "4 people want to play
+      on the same computer and one single keyboard is not enough".
+      Controlling the cursor with the mouse in Liquid War is possible but
+      yet rather hard to master 8-/ Try it and you'll understand what I mean.
+      This mode can be set up in the "Teams" menu.
+    </text>
+  </chap>
+
+  <chap title="Game does not start">
+    <text>
+      On non UNIX platforms such as Windows or DOS, Liquid War
+      is distributed in a .zip file. It's IMPORTANT that you
+      unzip the .zip files with an "unzipper" which preserves
+      the directory structure. Most install problems under
+      Windows come from broken unzipping programs which extract
+      all files in the same directory... WinZip 8.x or the unzip32.exe
+      utility that comes with DJGPP are both able to uncompress
+      Liquid War .zip files correctly.
+    </text>
+    <text>
+      On Liquid War 5.5.9 and later, the Windows version should detect
+      this problem automatically and warn you with a message which
+      basically says something like "Unable to load datafile.
+      Are you sure Liquid War is correctly installed?".
+      If you get this message, you need to reinstall the game by
+      unzipping it with a "correct" unzipping program which does
+      not wreck directory structrure up.
+    </text>
+  </chap>
+
+  <chap title="Interference with other Windows programs">
+    <text>
+      It's been reported that Liquid War can run very slowly on Windows
+      when some other programs (Mozilla for instance) are running.
+      So if Liquid War's menus seem to be really really slow, then
+      try to shut down other applications and run the game again.
+    </text>
+    <text>
+      This problem does not seem to apply on GNU/Linux - at least if you
+      do not run 300 daemons together on your machine 8-)
+    </text>
+  </chap>
+
+  <chap title="Datafile bugs">
+    <text>
+      Sometimes there are some problems when compiling the datafile,
+      this includes:
+    </text>
+    <list>
+      <elem>
+        The liquidwarcol, liquidwarmap and liquidwartex utilities
+	might freeze or segfault. Typing "make" again often solves
+	the problem.
+      </elem>
+      <elem>
+        The background image sometimes ends up using the wrong palette,
+	which has a very nasty consequence: it looks ugly. 
+      </elem>
+    </list>
+    <text>
+      These bugs are quite hard to get rid off, since I can not
+      reproduce them easily. The good solution would be to completely
+      rewrite the liquidwarcol, liquidwarmap and liquidwartex utilities.
+    </text>
+  </chap>
+
+  <chap title="Midi does not work on OSS">
+    <part title="Preamble">
+      <text>
+	IF your midi music on Liquid War, or indeed any other 
+	Allegro game, doesn't work and you are using the OSS 
+	(Open Sound System) drivers (these are the sound drivers 
+	which come with the standard kernel distribution), this may
+	well be because Allegro only supports "FM synthesis" 
+	and not "wavetable" when it is using OSS. FM synthesis 
+	is a very old method of making sound from MIDI and 
+	has long since been replaced by wavetable synthesis, with the net
+	result that it's quite possible you've got OSS MIDI 
+	working nicely in other applications without having FM 
+	support set up at all. This is what I found. (It has 
+	to be said that I didn't find the FM sound quality quite as bad
+	as people have said, though).
+      </text>
+      <text>
+	In this situation, it looks to me like you have the following choices:
+      </text>
+    </part>
+    <part title="Hack Allegro...">
+      <text>
+	...to implement wavetable midi on OSS :-)
+      </text>
+      <text>
+	and for the rest of us...
+      </text>
+    </part>
+    <part title="Use Allegro's DIGMID midi driver...">
+      <text>
+	...which creates audio from MIDI using a set of patches 
+	(more info here: "http://www.talula.demon.co.uk/allegro/digmid.html") 
+	and plays back through your sound card's audio.
+      </text>
+    </part>
+    <part title="Get an FM driver up and running..."> 
+      <text>
+	...Which is comprised of the following steps:
+      </text>
+      <list>
+	<elem>
+	  Find out which FM driver is appropriate for your sound card.
+          If you have distribution-specific tools and docs for setting up sound, try those.
+          If not, you will need to be familiar with the knowledge in the Sound-HOWTO and
+          Kernel-HOWTO i.e. know how to compile kernels and modules and deal with sound
+          drivers.
+	</elem>
+	<elem>
+	  Look through the OSS modules in 'make menuconfig' and see if anything
+          catches your eye. See if there is any specific documentation on your sound card on
+          "http://www.linuxdoc.org". Do a few web searches. For my AWE64, I use the OPL3 driver.
+	</elem>
+	<elem>
+	  Compile and install the FM driver module, or set up your system to use the new
+          kernel if you want to compile the driver in.
+	</elem>
+	<elem>
+	  Load the module, or boot your new kernel. It is very important that you pay
+          attention to what is said in the 'help' for your FM driver in 'make menuconfig'
+          and read any necessary files in the Documentation/sound/ directory. For example,
+          I just had a nice half-hour wondering why the hell my FM wasn't working now when
+          it had been before - with the OPL3 driver, you have to give the option io=0x388
+          to insmod. Which is stated nice and clear in the docs, but of course I had forgotten
+          since then. You can prevent such happenings by recording options permanently in
+          /etc/modules.conf - see the manpage etc.
+	</elem>
+	<elem>
+	  Try the game. If it's worked you will hear particularly beepy music. Enjoy!
+	</elem>
+      </list>
+    </part>
+    <part title="Opl3 occult FAQ">
+      <text>	
+	--IMPORTANT-- If you are using Liquid War, your FM will only work if you go to the
+	map 'Elephant inside a boa' and proceed to chase each other round in circles for at
+	least 10 minutes. This cures a bug in the design of the OPL3 interface which
+	conflicts badly with the core Liquid War algorithms. How the hell the music hardware
+	even knows about the core algorithms I don't know, but that's what I made of the
+	now-defunct opl3-occult-FAQ, from which here is an excerpt:
+      </text>
+      <code>
+	Many roads a man must take. Those with one-track minds are DOOMED, I tells ya.
+      </code>
+      <text>	
+	----  The Liquid War algorithm calculates distances to one place, the cursor.
+      </text>
+      <text>
+	And:
+      </text>
+      <code>
+	Man or machine, face or code, must stand strong and solid; must not just ooze away as slime.
+      </code>
+      <text>
+	---- We think it might just take objection to the whole 'slimy' nature of the LW
+	beings. As well as it being LIQUID War.
+      </text>
+      <text>
+	So, our carefully tailored approach, is to firstly have the players going in all
+	the possible different directions evenly by moving around the map in circles, and
+	secondly to divert the opl3's attention from the general slimy liquidness of it all
+	by emphasizing the solidity, reality, and natural goodness of that classic
+	tapestry: an elephant inside a boa.
+      </text>
+      <text>
+	That and it's a f***ing ace level.
+      </text>
+    </part>
+  </chap>
+
+  <chap title="Checksum errors">
+    <text>
+      The Liquid War server is a "light" servers which - to some extent -
+      has no idea about what is going on in the game. It simply replicates
+      key strokes between clients and each client maintains its own
+      game state. Normally, the game is designed so that given the same
+      user input, it will behave exactly the same.
+    </text>
+    <text>
+      However, it happens that sometimes 2 clients can behave differently,
+      and this is a (severe) bug. One consequence is that messages reporting
+      "Checksum errors" appear on the server's and on the client's console
+      output. This bug appears when using non-default rules settings.
+      Basically, if someones tweaks his rules, then the checksum errors appear.
+      Of course I double-triple checked that options were correctly sent on the
+      network, but, well, could not fix the bug. Yet. The short term solution
+      seems to play with default factory settings...
+    </text>
+    <text>
+      I'm highly interested in bug-reports concerning this problem.
+    </text>
+  </chap>
+
+</file>

Added: unstable/liquidwar/branches/upstream/current/doc/xml/copying.xml
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/xml/copying.xml	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/xml/copying.xml	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE file SYSTEM "file:xml/file.dtd">
+<file title="Copying">
+  
+  <text>
+    Liquid War is a multiplayer wargame.
+  </text>
+  <text>
+    Copyright (C) 1998-2005 Christian Mauduit ("ufoot at ufoot.org")
+  </text>
+  <text>
+    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.
+  </text>
+  <text>
+    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.
+  </text>
+  <text>
+    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
+  </text>
+  
+</file>

Added: unstable/liquidwar/branches/upstream/current/doc/xml/fanfic.xml
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/xml/fanfic.xml	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/xml/fanfic.xml	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE file SYSTEM "file:xml/file.dtd">
+<file title="Fanfic">
+  <chap title="What's this?">
+    <text>
+      Quoting Gavin: "I wrote a liquid war fanfic some time ago [...] I wrote it after a friend claimed that there wasn't any liquid war fanfic because it wasn't possible."
+    </text>
+    <text>
+      So here it is, a Liquid War fanfic, enjoy! (and special thanks to Gavin)
+    </text>
+  </chap>
+
+  <chap title="The Battle of Emberlificoted">
+    <part title="...">
+      <text>
+The General presided over his massing army in his seat, or rather hovering ring, of power. It dipped slightly as he flew low over his troops marching through the viscous marsh-like terrain. They were like children: obedient, loyal, and they ate a lot.
+      </text>
+      <text>
+Glancing at the status panel mounted in front of him he grimaced; the other five armies: Yellow, Green, Orange, Turquoise, and, of course, Red, were also readying armies of a similar size to his own. His violet clones would have to fight hard and eat well to win this day.
+      </text>
+      <text>
+Today would not be a battle of luck, the General mused, it would be a battle of tactics, of alliances, and of betrayal. Every clone was identical - that was the general idea behind clones - and the terrain seemed strangely symmetrical; it would not give advantage to any of the six armies amassed today. Glancing at the hologram of the battlefield projected in front of him the General noted that he would have to move quickly, Orange and Yellow were too close for comfort, though fortunately Baron Red's army of eponymous coloured clones was the furthest.
+      </text>
+      <text>
+General Violet's fingertips were sweaty even before they touched the four main control keys in front of him. They were labeled 'W', 'A', 'D', and, of course, the full retreat button - very useful for misleading foes and ambushing them as they pursued - 'S'. The keys were arrange in a roughly equilateral triangular pattern; with 'S' forming the base and being adjacent to both 'A' and 'D', 'W' formed the tip of the triangle.
+      </text>
+      <text>
+A long breath left his parched lips as at last he made his move.
+      </text>
+    </part>
+    <part title="...">
+      <text>
+"Dammit!" he screamed moments later. He had misjudged Captain Yellow and Commander Orange; he had expected one at least to attack immediately, one he could have handled. They were working together - foiling his attempt to shoot between them to near the center of the battlefield to gain a better vantage point. Yellow had shot down towards him, cutting off his advance, and now Orange had sealed his escape route. "It's not over yet" muttered the General. He opened a voice channel with Commander Orange:
+      </text>
+      <text>
+"Very clever. Flawed, but still clever."
+      </text>
+      <text>
+"Flawed?" came the reply.
+      </text>
+      <text>
+"Yes flawed, when the good Captain is finished devouring my army who do you think he will turn to next?", bluffed the General - his hands worked quickly as he manoeuvred his hovering control ring, all that his troops ever saw of him, carefully towards the weakest section of his attackers. If he could just break out a few units he could soon turn the tide against both Yellow and Orange.
+      </text>
+      <text>
+"We have an alliance..." Orange's voice was unsure now.
+      </text>
+      <text>
+Time for some sarcasm to through her even more off balance, thought the General,      
+      </text>
+      <text>
+"I gathered", he spoke softly, slowly, and with too much meaning. Then closing the channel he turned his attention back to his escape.
+      </text>
+    </part>
+    <part title="...">
+      <text>
+"Yes!" wooped the ecstatic figure of the General. Fifty or so of his troops had broken free undetected and were even now working their way cautiously towards the camps of the Yellow army, only the front lines were still actively fighting; this opening gambit of Yellow and Orange had turned into a stale siege and Yellow's army had pitched tent.
+      </text>
+      <text>
+General Violet steered his hovering guidance ring to the center of the Yellow camp. His troops struck, both those who had got behind the lines and those who were still besieged. Yellow reacted too slowly and suddenly found that her army, was shrinking back from the onslaught. There was nowhere to run to, and bye now her only ally - Commander Orange - had abandoned her to her fate; he was too busy engaging Sir. Turquoise, who had managed to escape from the slaughter that the Baron had caused to the Turquoise ranks and was even now valiantly attacking the flanks of the Orange troops.
+      </text>
+      <text>
+A glance at the status panel showed that Yellow's life force was fading quickly: 8%, 3%, 1%, Gone.
+      </text>
+      <text>
+The General smiled, he always enjoyed getting the first kill, and by now his armies life force had grown and his clones had replicated. With his, now, formidable fighting force it was no problem to engulf both Sir. Turquoise and Commander Orange's brawling armies and annihilate them. Once again his army grew in size and power. Now if only the Baron didn't notice that..., thought the General.
+      </text>
+    </part>
+    <part title="...">
+      <text>
+"Too late!" yelped the General, now thrown into panic, as he saw the approaching Baron. His army had also grown in size and power - having fatally injured the Turquoise army within the opening moments of the battle, and having finally managed to catch the elusive fleeing form of, or what remained of, Emperor Green.
+      </text>
+      <text>
+Gripping the controls harder the General thought quickly, his army doesn't so completely outnumber me that this is already over, however unless I can cause him to make a mistake that allows me to take the upper hand then I will inevitably lose. Maybe I can...
+      </text>
+      <text>
+This thought was terminated and replaced by another as the Baron's angry red troops broke through the undergrowth that had covered their movements and started to surround the General's army. The thought that now throbbed through the panic-stricken mind of General Violet was simply 'Run!'.
+      </text>
+      <text>
+Even as he signaled the retreat and made for what seemed to be the only possible means of escape the Baron's blood red control ring appeared at the opening. The General knew it was over, even before the host of red beings appeared at the opening.
+      </text>
+      <text>
+There was no escape. His life force was almost depleted and he was surrounded. Then it was that the Baron decided to communicate:
+      </text>
+      <text>
+"Too bad. It was a good game"
+      </text>
+      <text>
+The General blinked, gaped, and was generally gobsmacked. Just before his life force completely failed and his own weary eyes closed in defeat he snarled,
+      </text>
+      <text>
+"What!? This is not a game!" were the General's dying words.
+      </text>
+    </part>
+  </chap>
+</file>
\ No newline at end of file

Added: unstable/liquidwar/branches/upstream/current/doc/xml/file.dtd
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/xml/file.dtd	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/xml/file.dtd	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,10 @@
+<!ELEMENT file (chap*|(text|code|list)*)>
+<!ATTLIST file title CDATA "">
+<!ELEMENT chap (part*|(text|code|list)*)>
+<!ATTLIST chap title CDATA "">
+<!ELEMENT part ((text|code|list)*)>
+<!ATTLIST part title CDATA "">
+<!ELEMENT text (#PCDATA)>
+<!ELEMENT list (elem+)>
+<!ELEMENT elem (#PCDATA)>
+<!ELEMENT code (#PCDATA)>

Added: unstable/liquidwar/branches/upstream/current/doc/xml/mailinglists.xml
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/xml/mailinglists.xml	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/xml/mailinglists.xml	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE file SYSTEM "file:xml/file.dtd">
+<file title="Mailing lists">
+
+  <chap title="liquidwar-user">
+    <part title="Description">
+      <text>
+	This list is for general discussions about Liquid War.
+	Here you can make suggestions, submit bug reports, 
+	ask for help, find players, etc...	
+	Basically, any question or remark which concerns the game
+	is welcomed on this list.
+      </text>
+    </part>
+    <part title="Practical informations">
+      <text>
+	You can't send messages to the list without subscribing.
+	The only reason for this is that it's one of the only 
+	way to block spam efficiently.
+	I first thought it could be OK to allow anyone to post, but
+	liquidwar-user seems to have be harvested by robots, so now I
+	need to restrict posters. 
+	However, I insist on the fact that anyone can subscribe, and
+	the subscription to the list is not moderated.
+	So if you are a human being and not a stupid spam robot, 
+	you're welcome on the list 8-)
+      </text>
+      <text>
+	Here's a list of usefull URLs:
+      </text>
+      <list>
+	<elem>
+	  To (un)subscribe: "http://mail.nongnu.org/mailman/listinfo/liquidwar-user"
+	</elem>
+	<elem>	  
+	  To consult archives: "http://mail.nongnu.org/pipermail/liquidwar-user/"
+	</elem>
+	<elem>	  
+	  To post on the list: "liquidwar-user at nongnu.org"
+	</elem>	  
+      </list>
+    </part>
+  </chap>
+
+  <chap title="Chat and IRC">
+    <part title="Web-based chat-box">
+      <text>
+	I have have set up a web-based chat-box which is accessible here:
+	"http://www.ufoot.org/liquidwar/metaserver.php3"
+      </text>
+      <text>
+	It's not as good as a good old IRC channel but not everybody can
+	use IRC (because of firewalls and the likes), 
+	and I like the idea that people
+	can chat and have the list of available servers in one single
+	web page.
+      </text>
+    </part>
+    <part title="IRC channels">
+      <text>
+	I personnally spend some time on irc.freenode.net so you
+	might use it to find other players - though I'm not really
+	an IRC addict... ...not yet at least!
+      </text>
+      <text>
+	Here are the channels I recommend:
+      </text>
+      <list>
+	<elem>
+	  #liquidwar : Liquid War dedicated channel,
+	  to find players and chat while playing.
+	</elem>
+	<elem>
+	  #netgame_players : general channel for players 
+	  who want to play Internet games
+	  - Free Software and/or Open Source games of course, 
+	  we're on freenode.net 8-)
+	</elem>
+      </list>
+    </part>
+  </chap>
+
+</file>

Added: unstable/liquidwar/branches/upstream/current/doc/xml/network.xml
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/xml/network.xml	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/xml/network.xml	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,715 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE file SYSTEM "file:xml/file.dtd">
+<file title="Network game">
+
+  <chap title="Basics">
+    <text>
+      Since release 5.4.0, Liquid War includes network support, that's
+      to say that people can play over a LAN (Local Area Network).
+      However, due to limitations in Liquid War's legacy code,
+      and also because of the lack of time I have, it might be a little
+      tricky to set up a network game at first. So please read this
+      section carefully.
+    </text>
+    <text>
+      You should keep in mind that:
+    </text>
+    <list>
+      <elem>
+	DOS only releases of Liquid War do not include network support,
+	only Windows and GNU/Linux versions will allow you to set up a
+	network game.
+      </elem>
+      <elem>
+	The game should run fine on any LAN, but there's no garantee the
+	game will be playable on the Internet. Indeed if your "ping delay"
+	is not good enough, the game will be awfully slow. Bandwidth
+	is not an issue, since Liquid War rarely needs more than 2 Kb/sec.
+      </elem>
+      <elem>
+	You'll need to know what an IP address is.
+      </elem>
+      <elem>
+	You don't need to set up a network game to run a multiplayer game.
+	Liquid War was originally a multiplayer game without network support.
+	Network support is here only for people who don't feel comfortable
+	when playing at 6 on the same keyboard 8-)
+      </elem>
+    </list>
+  </chap>
+
+  <chap title="Getting started">
+    <part title="What do you need?">
+      <text>
+	You'll basically need 2 computers connected on the same LAN.
+	We'll call them computer A and B. You might be able to play
+	over the Internet too, but the game can be harder to set up
+	and - which is worse - very slow.
+      </text>
+      <text>
+	You'll also need to know the IP address of computer A.
+	Type "ipconfig" under Windows or "ifconfig" as root under GNU/Linux to
+	get this information if you don't have it.
+      </text>
+    </part>
+    <part title="Starting the server">
+      <text>
+	Liquid War uses a very traditionnal client/server approach.
+	Basically, the server gets informations from all the clients
+	and then dispatches the collected information to everybody.
+      </text>
+      <text>
+	So you'll need to start a server on computer A by running
+	"liquidwar-server" on GNU/Linux or "lwwinsrv.exe" on windows.
+	This is a console application,
+	ie it does not set up any graphic mode.
+      </text>
+      <text>
+        Here's a small example of a server start on GNU/Linux:
+      </text>
+      <code>
+$ liquidwar-server
+How many teams will connect to this server? 
+      </code>
+      <text>
+	At this point you must enter a number between 2 and 6, and then
+	press "ENTER". In this example we will answer 2.
+	The server really needs to know how many teams will be
+	in the game: when enough teams are connected, the game starts.
+	It can also be a good idea to answer 6 systematically and then force game
+	start by clicking the "Start now" button within the client.
+	It's possible to skip this question by typing
+	"liquidwar-server -2" instead of a plain "liquidwar-server".
+      </text>
+      <code>      
+Use "-2" to get rid of this question.
+Register on "www.ufoot.org/metaserver/" (y/n)? 
+      </code>      
+      <text>
+	Now if we answer "y", then the server will automatically contact
+	the "meta-server" and it will be listed on
+	"http://www.ufoot.org/liquidwar/metaserver.php3"
+      </text>
+      <text>
+	This can be convenient for people who want to find other gamers to
+	play with on the Net. For now, let's answer "n", we'll test
+	this meta-server stuff later 8-)
+      </text>
+      <code>      
+Use "-private" to get rid of this question.
+2002-06-03 16:43:00: Listening on port 8035...
+2002-06-03 16:43:00: Waiting for 2 teams...
+      </code>
+      <text>
+	Now the server is ready to accept clients. By default it
+	listens to clients on port 8035. You could change this behavior
+	setting by calling "liquidwar-server -port 8061" for
+	instance, but let's use the default port to make things easier.
+      </text>
+    </part>
+    <part title="Starting the clients">
+      <text>
+	Start the client on computer A normally by typing 
+	"liquidwar" on GNU/Linux or
+	double-click "lwwin.exe" on Windows.
+      </text>
+      <text>
+	Go to the "Teams" menu and select 2 teams, a red human
+	and a blue CPU for instance.
+	If you don't know how to do this, then try and play Liquid War on 
+	a single computer first.
+	It's important to notice that by default the "blue CPU" won't
+	connect on the network game. It's possible to allow bots to
+	connect on network games, but they are disabled by default.
+      </text>
+      <text>
+	Now come back to the main menu,
+	and a "Net Game" button should be available. Click it.
+	Now you should be able to:
+      </text>
+      <list>
+	<elem>
+	  Start the game.
+	</elem>
+	<elem>
+	  Change the IP address of the server.
+	</elem>
+	<elem>
+	  Change the communication port.
+	</elem>
+	<elem>
+	  Set a password.
+	</elem>
+	<elem>
+	  Search for internet games automatically.
+	</elem>
+      </list>
+      <text>
+	Since the server is also running on the same machine (A),
+	you can leave the default IP address as is (127.0.0.1).
+      </text>
+      <text>
+	Now you are ready to start the second client on computer B.
+	Like with computer A, you'll have to:
+      </text>
+      <list>
+	<elem>
+	  Select 2 teams, green an yellow this time.
+	</elem>
+	<elem>
+	  Select "Net Game" in the main menu.
+	</elem>
+      </list>
+      <text>
+	But this time you'll also need to change the server address,
+        since the client is not running on the same computer than the
+	server.
+      </text>
+      <text>
+	Now click on "Start game" on computer A. The server should play
+	a "system beep", which is usefull if you run a server and
+	want to be notified of client connections without watching
+	the console all the time, and it should	display messages like this:
+      </text>
+      <code>
+2002-06-03 16:44:48: Connection from "127.0.0.1:34677"
+2002-06-03 16:44:48: Team "Napoleon" on client "127.0.0.1:34677" accepted
+2002-06-03 16:44:49: Client "127.0.0.1:34677" accepted
+2002-06-03 16:44:49: Waiting for 1 team...
+      </code>
+      <text>
+	And on the client you should see a screen which says
+	"Waiting for 1 team(s)" with the list of connected players
+	below (Napoleon). You do not need to click 
+	on the "Start now" button.
+      </text>
+      <text>
+	Now click on "Start game" on computer B. The server should
+	display messages like this:
+      </text>
+      <code>
+2002-06-03 16:49:14: Connection from "192.168.1.1:1098"
+2002-06-03 16:49:14: Team "Henri IV" on client "192.168.1.1:1098" accepted
+2002-06-03 16:49:15: Client "192.168.1.1:1098" accepted
+2002-06-03 16:49:15: Client "192.168.1.1:1098" ready
+2002-06-03 16:49:15: Client "127.0.0.1:34677" ready
+2002-06-03 16:49:15: Sending info to "127.0.0.1:34677"
+2002-06-03 16:49:15: Sending info to "192.168.1.1:1098"
+2002-06-03 16:49:16: Game start
+      </code>
+      <text>
+	And at that point, the game should start 8-)
+      </text>
+    </part>
+    <part title="Restart a new game">
+      <text>
+        Once the game is over, you can start another network game on
+	the clients without touching the server, because the server 
+	automatically restarts and waits for players to connect.
+      </text>
+      <text>
+        To stop the server - if you want to change its settings for
+	instance - just go to the console where it's running and press
+	CTRL-C.
+      </text>
+    </part>
+  </chap>
+
+  <chap title="Using the meta-server">
+    <part title="Basics">
+      <text>
+	The meta-server is a piece of software which is running
+	on my web site, and allows servers to register themselves
+	so that client can get a list of available servers.
+      </text>
+      <text>
+	It's written in PHP and is _very_ basic but I believe it's
+	enough for what has to be done: maintain a list of running
+	servers.
+      </text>
+      <text>
+	The source code for the meta-server is included in the
+	source package of Liquid War, so you might run such a server
+	yourself if you want to. However, by default, servers will
+	register themselves on my web site, and will be listed on
+	"http://www.ufoot.org/liquidwar/metaserver.php3"
+      </text>
+    </part>
+    <part title="How to register a server">
+      <text>
+	Launch the server, and when you get the question:
+      </text>
+      <code>
+Register on "www.ufoot.org/metaserver/" (y/n)? 
+      </code>
+      <text>
+	answer "y". 
+      </text>
+      <text>
+	Note that if you're behind a proxy or a firewall, the server
+	might be unable to register itself. Clients might also have
+	problems to connect themselves on your server if there's a
+	machine which does NAT (Network Address Translation) between
+	you and the meta-server.
+      </text>
+    </part>
+    <part title="How to find a server">
+      <text>
+	In the main menu, click on "Net Game" and then 
+	"Search for internet games".
+      </text>
+      <text>
+	Now you should see a list of available servers. You can click
+	on the items in the list to get more informations about a
+	given server. Once you have chosen a server, click on
+	"Join now".
+      </text>
+      <text>
+	Now you get on a "Waiting for teams" screen. You might
+	be interested in using the "Start now" button. Indeed, if
+	you are 4 players connected on a server that accepts up to 6 
+	players, maybe you'll want to start the game right away
+	without waiting for 2 more players. In this case, every player
+	must click "Start now". A "*" character will replace the "-"
+	in the players list when a player clicks on "Start now".
+	When all the players are displayed with a "*a, the game starts.
+      </text>
+      <text>
+	You can also chat with other players by entering text in
+	the area above the "Send message" button, and then click on 
+	this button. Keep in mind that this is a very primitive chat
+	and that the best way to chat efficiently is IMHO to play
+	in windowed mode and have an IRC client at hand.
+      </text>
+      <text>
+	Note that you can also get the list of available servers
+	from "http://www.ufoot.org/liquidwar/metaserver.php3"
+	There you'll also find a little chat-box which will allow
+	you to send exchange messages with other players.
+      </text>
+    </part>
+  </chap>
+
+  <chap title="Options">
+    <part title="Server options">
+      <text>
+	You can pass options to the server using the command line.
+	The following parameters are accepted:
+      </text>
+      <list>
+	<elem>
+	  "-n" where "n" is a number between 2 and 6 : with this option
+	  you can tell the server how many teams will connect to the
+	  game. Beware, there can be several teams on the same computer,
+	  so if you want to have a computer with 2 players on it and 2
+	  other computers with a single player, then you need to use the
+	  "-4" option.
+	</elem>
+	<elem>
+	  "-lag n" where "n" is an integer : with this option, you can
+	  control the lag used at startup. Normally, Liquid War handles
+	  this parameter automatically, but you might want to force it
+	  to a given value.
+	</elem>
+	<elem>
+	  "-port n" where "n" is an integer : allows you to change
+	  the IP port used by the server to listen to the clients.
+	  if you omit this parameter, the default port is (8035) is
+	  used.
+	</elem>
+	<elem>
+	  "-log file.log" : dumps all informations in "file.log"
+	  instead of using the standard output.
+	</elem>
+	<elem>
+	  "-public" : skips the "Register on ..." question, and
+	  registers the server automatically on the meta-server,
+	  so that clients can find it easily.
+	</elem>
+	<elem>
+	  "-private" : skips the "Register on ..." question, and
+	  does not register the server at all.
+	</elem>
+	<elem>
+	  "-comment This_is_a_comment" : associates a comment to
+	  the server, which will be displayed by the meta-server.
+	  Note that the character "_" will be replaced by spaces.
+	  This makes command line parsing easier. I'm lazy 8-)
+	</elem>
+	<elem>
+	  "-password xxx" : associates a password to the server.
+	  With this option, clients will need to give the right
+	  password to be able to connect on the server.
+	</elem>
+	<elem>
+	  "-callback cmd" : with this option, the command "cmd" will 
+	  be launched whenever someone connects on an empty server.
+	  For instance, if you want to run a permanent server and want
+	  to know when someone connects but do not wish to permanently
+	  keep an eye on the server's log, you might use this option
+	  and put in "cmd" a command that automatically sends you a 
+	  mail. You might also use a command that fires a popup window.
+	  It's up to you. 2 sample scripts are available in the "misc"
+	  directory of the Liquid War source distribution. One is
+	  "misc/liquidwar_notify.sh" and works on UNIX platforms, and
+	  the other one is "misc/lwpopup.js", which is automatically
+	  used by "misc/lwserver.bat", and works on Windows.
+	</elem>
+      </list>
+    </part>
+    <part title="Common options">
+      <text>
+	These options work on both client and server, even if
+	they are rather "server-oriented".
+      </text>
+      <list>
+	<elem>
+	  "-metaserver url" : redefines the URL of the meta-server.
+	  Usefull if you want to use your own meta-server.
+	</elem>
+        <elem>
+	  "-netlog" : 
+	  if you use this option, the server will dump
+          all the network traffic on the standard output. This is
+	  usefull for debugging.
+        </elem>
+        <elem>
+	  "-nobeep" :
+	  Disables the system beeps that the application might fire.
+	  These beeps are mostly used on the server to notify clients 
+	  connections.
+        </elem>
+      </list>
+    </part>
+  </chap>
+
+  <chap title="About Liquid War's network implementation">
+    <part title="Basics">
+      <text>
+	Liquid War uses TCP sockets, and a single-threaded server.
+	This implies that:
+      </text>
+      <list>
+	<elem>
+	  The game can sometimes get blocked if you play on Internet.
+	</elem>
+	<elem>
+	  The server can't talk simultaneously with several clients.
+	</elem>
+      </list>
+      <text>
+	I needed to use TCP sockets, since LW's algorithm can not cope
+	with any data loss and it's not a reasonnable to try and anticipate
+	what the map would be like if the player did not move etc...
+      </text>
+      <text>
+	I did not implement any complex multithreaded stuff since I'm lazy and
+	however, clients need to have informations about all the other before
+	something can be done. However, implementing a mutltithreaded
+	server could have advantages over the current solution.
+      </text>
+    </part>
+    <part title="What is this lag stuff anyway?">
+      <text>
+	In Liquid War, all the clients send their key presses to the server,
+	and then the server dispatches this information to everyone.
+	This has to be done for every round.
+      </text>
+      <text>
+	You can easily imagine that if a player has a poor connection, with
+	a very long "ping delay", it can take quite a long time to send
+	the information to the server, and then get it back.
+      </text>
+      <text>
+	So what Liquid War does is that at the beginning of the game, the
+	server sends a couple of "blank" key strokes to the clients.
+	This way, clients receive data from the server before thay have
+	sent any. The number of key strokes sent at the beginning of the
+	game is called the "lag".
+      </text>
+      <text>
+	So if it takes 200 msec to send and then receive data from the
+	server (approx the time returned by the "ping" command) then
+	with a lag of 6, you can theorically play at a rate of 
+	(1/0.2)*6=30 rounds/sec.
+      </text>
+      <text>
+	On one hand, setting the lag parameter to a high value will avoid many 
+	network	errors and allow you to play at a very fast pace, but the big
+	drawback is that there will be quite a long time between the instant you
+	send a key stroke to the server and the moment it comes back to you.
+	On the other hand, setting the lag to a low value will limit 
+	drastically he number of rounds per second, but make the game
+	more "responsive".
+      </text>
+      <text>
+	However, since release 5.4.1, the "lag" is modified automatically
+	and should adapt itself to the situation. I've not been able to
+	test it in real conditions yet, but it should work 8-)
+      </text>
+      <text>
+	Still, setting the lag to a sensible default value can save you
+	some trouble. Indeed, by default, Liquid War will choose a value (6),
+	but it can not guess if you are playing on Internet or on a
+	100 Mbit LAN, and it can take quite a long time before Liquid War
+	automatically finds the right value. To know the right value
+	which should be used with the "-lag" option, simply play a few
+	games and watch the average lag (which is displayed on the server
+	console every minute) at the end of the game.
+      </text>
+    </part>
+    <part title="Performance issues">
+      <text>
+	Liquid War uses a "light" server, and one of the 
+	advantages of this solution is that it allows
+	you to run the server on low-end computers. I personnally
+	run a permanent server on a 486 DX2, and it runs like
+	a charm. 
+      </text>
+      <text>
+	The only thing you have to take care of when
+	running a server is bandwidth. Don't worry, you won't
+	need a 10Mbit connection, basically, each clients sends
+	and receives 12 bytes of data at each round. If you
+	add TCP/IP headers and the facts that stuff will probably be
+	bundled in bigger packets, a client must deliver
+	about 15 Kbit/sec (up and down) for a game that 
+	runs at 100 frames/sec. A 56K V90 modem is enough for this.
+      </text>
+      <text>
+	So if you run a server with 2 clients connected, the server
+	will need to deliver 30 Kbit/sec in both ways. A 56K V90
+	modem _can_ do that, but your provider needs to be a good one 8-) 
+      </text>
+      <text>
+	And if you run a server with 6 clients, you simply won't
+	be able to reach the 100 frames/sec with a 56K V90 modem.
+	It will necessarly drop to something less than 30 frames/sec,
+	and is likely to drop to about 15 frames/sec.
+	OK this is not a big deal, since few Internet games run at
+	more than 30 frames/sec, but well, if the server has troubles
+	receiving/sending data, everyone will wait, and the fun will
+	go away.
+      </text>
+      <text>
+	As a conclusion: if you have the choice, choose the friend
+	who has the best bandwidth to run the server, without even
+	considering the power of his computer.
+      </text>
+    </part>
+  </chap>
+
+  <chap title="Troubleshooting">
+    <part title="General information">
+      <text>
+	Network support in 5.4 and 5.5 is still experimental in many ways,
+	so you might get weird behaviors. Basically, if you have a problem,
+	just do the following:
+      </text>
+      <list>
+	<elem>
+	  Stop and restart the server when something goes wrong.
+	  To stop it, use CTRL-C.
+	</elem>
+	<elem>
+	  Check out that you have entered the correct IP addresses.
+	</elem>
+	<elem>
+	  Try and start the client and the server using the "-netlog" option
+	  to have an idea about what's happening.
+	</elem>
+      </list>
+    </part>
+    <part title="Bugs in 5.4.x corrected in 5.4.2">
+      <text>
+	Liquid War 5.4.0 and 5.4.1 were very hard to play over the Internet. 
+	The reason is that the network routines did not do enough error 
+	checking, and therefore there were very often errors when sending 
+	and/or receiving the map to the server. Hopefully, this bug should not
+	appear anymore in 5.4.2 or any other recent release.
+      </text>
+    </part>
+  </chap>
+
+  <chap title="About security">
+    <part title="Network games passwords">
+      <text>
+	As you might have noticed, under the box where you can enter
+	the password, a little notice explains that you must choose
+	a "weak" password. Now you'll tell me -> people keep on explaining me
+	that passwords must be something complex like "aS\r!Y9p" and now
+	I'm told to use "hello", what's up?
+      </text>
+      <text>
+	OK, keep in mind Liquid War is a game. This password stuff is just
+	a way to be able to play with your friends only and keep on using
+	the meta-server's services. Liquid War does not encrypt data and I can
+	see no good reason to do it for, so the password is stored and sent
+	to the server in clear, as plain text.
+      </text>
+      <text>
+	The consequence is that if you use a valuable password - for instance
+	the one you use to log in on your computer - the guy who runs the
+	server will see your password in the log file if he wishes to.
+	Therefore, use something weak, something that if someones finds out
+	what it is, you won't really care. So "hello" is a wise choice.
+      </text>
+    </part>
+    <part title="Is Liquid War likely to have security holes?">
+      <text>
+	Yes.
+      </text>
+      <text>
+	Any program is likely to have security holes, especially when
+	it's networked. However, I have good reasons to think that Liquid War
+	is safe enough for a game. At least I find it safe enough to run
+	a permanent public server on my personnal computer 8-)
+      </text>
+      <text>
+	FYI, here are some things which I think make Liquid War rather safe 
+	to run:
+      </text>
+      <list>
+	<elem>
+	  Liquid War does not store anything on your hard drive that would
+	  have been received from the network. The maps are kept in RAM.
+	  So you won't download any virus playing Liquid War on Internet.
+	</elem>
+	<elem>
+	  Liquid War does not transmit any sort of code on the network.
+	  All the transmitted bytes represent plain data.
+	  So you're not likely to execute any arbitrary code - virus, worm -
+	  when playing on the Net.
+	</elem>
+	<elem>
+	  Liquid War receives network packets in static buffers, and if the
+	  received data is too big, it is truncated. One consequence is that
+	  Liquid War has a bunch of "limits". You can't send hudge maps over
+	  the network, you can't have long nicknames, and so on. But another
+	  consequence is that if you try to send garbage in the buffer, it
+	  will be truncated. Liquid War will protest with a "network error"
+	  message and the connection will be closed, but there will be no 
+	  easy exploit possible here.
+	</elem>
+	<elem>
+	  Liquid War does not use the sprintf, strcpy and strcat functions,
+	  which are known as being rather unsecure since they can lead to
+	  buffer overflows. Instead, it uses the equivalent functions
+	  snprintf, strncpy and strncat. On platforms where these functions
+	  are supported natively, the game will use the default system
+	  functions, otherwise it will use a free implementation by
+	  Mark Martinec. FYI, Windows does not support snprintf-like functions
+	  natively, that is, it's a piece of crap.
+	</elem>
+	<elem>
+	  Liquid War is Free Software, so I'm not likely to have put backdoors
+	  in it myself, since anyone can look at the source code 8-)
+	</elem>
+      </list>
+      <text>
+	However, I have not - and I know nobody who has - audited Liquid War
+	for security holes. So there might be some. Therefore you should 
+	respect a few things while running Liquid War:
+      </text>
+      <list>
+	<elem>
+	  Never run Liquid War as root or administrator. This is obvious but
+	  I still mention it. If you want to run a Liquid War daemon on UNIX,
+	  run it as user "nobody" or something approaching. If "root" or
+	  "administrator" does not make sense on your system (DOS, Win98...)
+	  then I assume you're not _really_ concerned about security anyway 8-P
+	</elem>
+	<elem>
+	  If you run a server 7/7 24/24, use the "-log" option to log everything
+	  in a file. This way you'll keep a trace of network activity,
+	  and if something goes wrong, you might get a chance to see it.
+	</elem>
+	<elem>
+	  If you use passwords in network games, *never* choose a valuable
+	  password. Use something simple like "hello" or "goodbye".
+	</elem>
+	<elem>
+	  Keep in mind that Liquid War is a game, and not a bullet proof 
+	  professionnal server.
+	</elem>
+      </list>
+      <text>
+	Last point: you should be aware that version 5.4.5 of Liquid War
+	has been proved to be vulnerable to a local buffer overflow,
+	and one should run at least 5.5.9 to get rid of this problem.
+	FYI by the time the exploit was found on 5.4.5, 5.5.9 was
+	already out 8-)
+        See "http://www.securityfocus.com/bid/8629"
+        and "http://www.securityfocus.com/bid/9453" for more informations.
+      </text>
+    </part>
+    <part title="Can people cheat when playing on the Net?">
+      <text>
+	No.
+      </text>
+      <text>
+	Or at least, not really. In fact, you can still find the following
+	types of lamers:
+      </text>
+      <list>
+	<elem>
+	  A guy who lets the CPU play at his place. He'll loose anyway because
+	  the CPU is definitely not a great Liquid War Master 8-)
+	</elem>
+	<elem>
+	  A guy who tweaks the game and gets all his bots fight anyone he wishes.
+	  That's mean.
+	</elem>
+	<elem>
+	  A guy who manages to let you have a 500msec lag while he does not have
+	  any lag at all.
+	</elem>
+      </list>
+      <text>
+	Apart from this, I can hardly see any way to cheat. Why? Because the Liquid
+	War server does not store any information about the game. It's not aware
+	of who wins, who looses, it knows nothing. The only thing it does is to
+	transmit key presses between client computers. 
+      </text>
+      <text>
+	This way, if someone plays with a tweaked release of Liquid War, thinking
+	he will fool you, then he will fool you on his computer only... On your
+	computer, everything will be fine. After some time, your screen and his
+	screen will have nothing in common, and both players are likely to think
+	they have won. Except the lamer will stay a lamer.
+      </text>
+      <text>
+	This also explains why it's required to play with the very same versions
+	of the game during network games. If you plug a 5.5.2 with a 5.5.1, after
+	a minute the screens will be completely different on each client, since
+	there are subtle differences between the 5.5.1 and the 5.5.2 engine.
+	However, you shouldn't be able to do this, since a network error will
+	stop you before you can start to play.
+      </text>
+      <text>
+	Additionnally, versions 5.5.5 and higher have a checksum system. Every 100
+	rounds, each client calculates a checksum with its local map, and sends
+	it to the server. If the checksum is incorrect, the server will log
+	a message like:
+      </text>
+      <code>
+Checksum error on client "192.168.1.1:1098"
+      </code>
+      <text>
+	If you see this, then you're in one of the following situations:
+      </text>
+      <list>
+	<elem>
+	  There's a bug in the game
+	</elem>
+	<elem>
+	  A lamer tries to cheat
+	</elem>
+      </list>
+      <text>
+	FYI, all releases from 5.4.0 to 5.5.4 have a bug which causes clients
+	to desynchronize after a while...
+      </text>
+    </part>
+  </chap>
+</file>

Added: unstable/liquidwar/branches/upstream/current/doc/xml/options.xml
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/xml/options.xml	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/xml/options.xml	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,487 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE file SYSTEM "file:xml/file.dtd">
+<file title="Menus and hot keys">
+
+  <chap title="Introduction">
+    <text>
+      This section describes how the GUI works.
+      Since programming advanced GUIs with Allegro is not so easy
+      - standard C programming definitely lacks flexibility -,
+      and also since it's somewhat hard for me to figure out what
+      is user-friendly and what's not, Liquid War's menus are not
+      always self-explanatory. I'll just try and do something
+      better next time! 
+    </text>
+  </chap>
+
+  <chap title="Menus">
+    <part title="Map menu">
+      <text>
+	The map menu allows you to choose the map you are going to play on.
+	A map is defined by 3 things:
+      </text>
+      <list>
+	<elem>
+	  A frame.
+	  The frame can be chosen with the slider which is below the preview.
+	  The frames are automatically sorted by alphabetical order.
+	</elem>
+	<elem>
+	  A texture for walls.
+	</elem>
+	<elem>
+	  A texture for the zone where fighters are allowed to move.
+	</elem>
+      </list>
+      <text>                
+	In the middle of the screen, there is a preview of the level.
+	In this menu, the values of the parameters can be independently changed by:
+      </text>
+      <list> 
+	<elem>
+	  Moving a slider.
+	</elem>
+	<elem>
+	  Clicking on a "+" or a "-" button.
+	</elem>
+	<elem>
+	  Typing a number.
+	</elem>
+      </list>
+      <text>
+	On each side of the preview, sliders allow you to choose the two textures.
+	There is also a preview of each texture.
+	Below this preview there are 128 little buttons which allow you to choose single colored textures.
+      </text>
+      <text>
+	The name of the map and its resolution are displayed in the lower
+	part of the screen.
+      </text>
+      <text>
+	You'll notice that on some maps the texture selection zones simply
+	disappear. This is because these maps are associated with a texture,
+	so choosing a different texture is often not recommended for it
+	won't look as nice as with the right one. If you still want to
+	override this behaviour you can click on the "on/off" button just
+	right to the "Use default texture" label. This is a toggle button
+	which will allow you to use your own textures even on maps that
+	normally come with their own skin.
+      </text>
+      <text>
+	You'll also notice that a "Random map" button is available.
+	This button generates a new random map using an external program,
+	"lwmapgen", developped by David Redick, available on
+	"http://www.cs.clemson.edu/~dredick/lwmapgen/"  	
+      </text>
+      <text>
+	This program supports many command line options, and if you want
+	a very precise control on the generated maps, you'll need to run
+	it separately. Looking at LW's log file you should be able to
+	see the commands LW issues when calling this program, this can
+	give you ideas on how to launch it manually. Alternatively
+	using the "--help" option (for instance "liquidwar-mapgen --help"
+	under UNIX) should describe how to use it.
+      </text>
+    </part>
+
+    <part title="Teams menu">
+      <text>
+	This menu allows you to choose the teams which are going to play.
+	There are 6 square zones in this menu.
+	Each of them is associated to a team.
+      </text>
+      <text>
+	Each team can be either:
+      </text>
+      <list>
+	<elem>
+	  Disabled ("Off")
+	</elem>
+	<elem>
+	  Controlled by a player ("Human")
+	</elem>
+	<elem>
+	  Controlled by the computer ("Cpu")
+	</elem>
+      </list>
+      <text>
+	The computer plays poorly, so remember that Liquid War is basically
+	a multiplayer game, and that the cpu control is dedicated to beginners only. 
+      </text>
+      <text>
+	You can also choose the color associated to each team by clicking on one
+	of the 12 colored buttons.
+      </text>
+      <text>
+	Below the 12 colored buttons, there are four buttons which allow you
+	to choose your keys.
+	Click on one of these buttons and then press the key you want to define.
+	Joystick movements and buttons are considered as keys.
+	You can disable the joystick with the button which is at the bottom left of the menu.
+	Mouse input is also possible, and mouse movements are considered as keys too.
+	To define mouse control, click on the button associated to the direction
+	you want to control, and then move the mouse. 
+	Then the button should display something like "M->".
+	Mouse sensibility can be set with the little slider at the bottom right of the menu.
+      </text>
+    </part>
+
+    <part title="Graphics menu">
+      <text>
+	Here you can choose the graphic options of the game.
+      </text>
+      <text>
+	The "Video mode" button allows you to switch between fullscreen and windowed mode. This button is not available under DOS.
+      </text>
+      <text>
+	The "Brightness" slider allows you to set the brightness of the game.
+      </text>
+      <text>
+	The "Menu res" slider allows you to set the resolution used by the menus.
+	There are currently 5 possible values, which depend on which platform
+	you're running the game on.
+      </text>
+      <text>
+	I personnaly think the menus look best with the 640x480 resolution, 
+	but some may prefer higher resolutions.
+	Lower resolutions should only be used if you have problems using SVGA video modes.
+      </text>
+      <text>
+	The "Game res" slider allows you to set the resolution used during the game.
+	The allowed values are the same than those for the menus.
+	I recommend that you don't use resolution higher than 640x480,
+	unless you have a Pentium VIII running a 10GHz.
+      </text>
+      <text>
+	Page flipping can be toggled.
+	It is up to you to decide wether you keep this option or not.
+	The main disavantage of turning page flipping off is that
+	the info bar and the battlefield can look rahter ugly if they overlap.
+	But if you turn page flipping on you will not easily reach
+	the 166 frames per second I sometimes get on small levels with my K6-225.
+	I personnaly always turn page flipping off.
+      </text>
+      <text>
+	The viewport size defines how much of your screen will be used by the battlefield.
+      </text>
+      <list>
+	<elem>
+	  If you set the slider on its left position, the batllefield will not be stectched at all.
+	  Or if is strechted, it will be by a x2 or a x4 factor.
+	  So this is the mode wich allows the fastest display.
+	</elem>
+	<elem>
+	  If you set the slider ont its right position, the game will run in fullscreen mode.
+	</elem>
+	<elem>
+	  With all the other positions of the slider, the battlefield will keep
+	  its general proportions but it will be stretched.
+	</elem>
+      </list>
+      <text>
+	The "Waves" button allows you to toggle the wave effect. You can also
+	do this while playing, by simply pressing F4.
+      </text>
+    </part>
+    
+    <part title="Sound menu">
+      <text>
+	This section allows you to set the sound volumes. There are 4 sliders, which are:
+      </text>
+      <list> 
+	<elem>
+	  "Sfx": sets the volume of all the sfx sounds,
+	  thats to say'the sounds you hear when the game starts, when you loose etc...
+	</elem>
+	<elem>
+	  "Click": sets the volume of the click, this nasty noise you hear
+	  each time your press on a button.
+	</elem>
+	<elem>
+	  "Game water": sets the volume of the blop blop blop sounds
+	  which are played continuously while you are playing.
+	</elem>
+	<elem>
+	  "Menu water": the same thing than "Game water" except
+	  that it concerns the sounds played while your are choosing options.
+	</elem>
+	<elem>
+	  "Music": general music volume.
+	</elem>
+      </list>
+    </part>
+
+    <part title="Rules menu">
+      <text>
+	This menu is the one where you can change the rules of the game.
+      </text>
+      <text>
+	The "Time" slider controls the time limit.
+	The game will stop after this time is elapsed.
+	You can pause the game by pressing the "F3" key.
+      </text>
+      <text>
+	By the way, an info bar can display the time left while you are playing.
+	This info bar can be toggled during the game by pressing
+	the "F1" key, and you can change its location by pressing the "F2" key.
+	It also displays how many fighters there are in each team.
+      </text>
+      <text>
+	The "Army size" slider controls the amount of fighters there will
+	be on the battlefield. The position of the slider reflects the amount
+	of fighters of all the teams together. If there are 4 teams,
+	then each player will have half as many fighters
+	than if there had only been 2 teams.
+      </text>
+      <text>
+	The "Cursor x" slider controls the speed of your cursor.         
+      </text>
+      <list>
+	<elem>
+	  If it is set on the left, the cursor goes at the same speed than the fighters.
+	</elem>
+	<elem>
+	  If it is centered, the cursor goes twice faster than the fighters.
+	</elem>
+	<elem>If it is set on the right, the speed of the cursor is multiplicated by 3.
+	</elem>
+      </list>
+      <text>
+	Below is a "Min 160x100" box with a slider on its right. This means that
+	maps will automatically be magnified so that they have a size of at least 160x100.
+	Indeed, some of the maps that come with Liquid War were designed in 1995
+	when 486 Intel computers were common. Therefore the maps were smalls.
+	Today, these maps are not really fun to play on fast computers,
+	so Thomas Harte suggested this automatic magnifying feature, and that was
+	IMHO a smart idea. You can move the slider to the right to make maps use
+	a higher resolution - ie magnify them.
+      </text>
+      <text>
+	The "Defaults" button of the "Rules" menu will reset rules to their
+	defaults. This way you can tweak rules and then come back to the
+	default rules whenever you want. Note that there's also a "Defaults"
+	button in the main "Options" menu, but it will reset *all* options,
+	including player names... The advantage of the "Defaults" button
+	in the "Rules" menu is that it will only reset rules parameters,
+	and keep the rest of your configuration options untouched.
+      </text>
+    </part>
+    
+    <part title="Speeds menu">
+      <text>
+	The "frames/s" slider allows you to limit the number of frames per second.
+	If this slider is set on the left, there won't be any limit, so Liquid War
+	will repaint your screen each time the fighters move.
+	But this can be a weird behaviour if your machine is really fast,
+	for no one cares about 100 fps per second, one can not even see them...
+	So this paramters limits the refreshment rate, so that there can be
+	several logical moves of the fichters for only one screen refreshing.
+	If it is set on its right, the display is limite to 10 fps,
+	so you'll have to find your setting. 
+	I personnally set it right in the middle, and get 40 fps.
+	If you press "F5", you'll get the number of frames per second,
+	and if you press "F6", you'll get the number of logical moves per second.
+	You can also press "F7" or "F8",
+	and you will get the percentage of time your computer
+	spends on calculating or displaying the level.
+      </text>
+      <text>
+	The "rounds/s" slider allows you to limit the number of rounds per second.
+	If this slider is set on the left, there won't be any limit, so Liquid War
+	will run as fast as possible.
+	This setting will be of no use if you use Liquid War on a slow
+	computer or if you play with hudge maps, but sometimes, with a high-end
+	Pentium class computer, it's simply impossible to play on small maps
+	because things simply go too fast. So this parameter is here to
+	help you and avoid the "10000 moves per sec" problem.
+      </text>
+    </part>
+
+    <part title="Waves menu">
+      <text>
+	This is where the wave parameters are set.
+	The waves are just a graphic effect, which is not really usefull.
+	I don't often use waves, but I still think they can sometimes look nice.
+	Change these parameters if you really mean to do it,
+	but if you don't understand what they mean, it is really OK...
+      </text>
+      <text>
+	There are 4 different types of waves, each of them being defined by:
+      </text>
+      <list>
+	<elem>
+	  An "Ampli" parameter, to define how big the waves have to be.
+	</elem>
+	<elem>
+	  A "Number" parameter, to define how many waves should be
+	  displayed at the same time.
+	</elem>
+	<elem>
+	  A "Speed" parameter, to define how fast the waves should move.
+	</elem>
+      </list>
+      <text>
+	If you want to undestand what the
+	"WX", "HY", "WY", and "HX"
+	codes mean, try to pay with only one type of wave,
+	the "Ampli" parameter of the 3 other types of wave being set to 0
+	(that is to say the slider is on its left position),
+	and sea how it looks like.
+      </text>
+      <text>
+	The wave effects can be toggled during the game by pressing the "F4" key.
+      </text>
+    </part>
+    
+    <part title="Advanced menu">
+      <text>
+	This menu allows the user to change the behaviour of the fighters.
+      </text>
+      <text>
+	The "Attack" slider sets the agressivity of the fighters.
+	If it is set on the right, fighters eat each other very fast.
+	If it is set on the left, it takes ages to fighters to change teams.
+      </text>
+      <text>
+	The "Defense" slider sets the capacity
+	that the fighters have to regenerate themselves.
+	The more it is on the right, the faster fighters regenerate.
+      </text>
+      <text>
+	The "New health" slider sets the health of the fighters
+	which have just changed teams. The more it is on the left,
+	the weaker these fighters will be.
+      </text>
+      <text>
+	The "Winner help" slider controls a parameter which causes
+	fighters to attack with various strength depending on
+	how many fighters belong to their team.
+	Not very clear... 
+	Let's just say that:
+      </text>
+      <list>
+	<elem>
+	  If this slider is set on the right,
+	  the more fighters you have in your team,
+	  the more aggressive they will become.
+	</elem>
+	<elem>
+	  If it is centered, all the fighters of every team will
+	  always attack with the same strength.   
+	</elem>
+	<elem>
+	  If it is set on the left,
+	  the less fighters you have, the stronger they will be.
+	  In this mode, games usually never end.
+	</elem>
+      </list>
+      <text>
+	The "Cpu strength" parameter never makes the computer
+	more intelligent than a monkey.
+	But if you set it on the right, it advantages the machine
+	outrageously and fighters controlled by the cpu
+	will be really strong. So to get rid of them you'll
+	definitely need to be clever.
+	Again and again, don't forget that Liquid War was conceived
+	as a multiplayer game and that playing against the computer
+	is not really an interesting thing to do.
+      </text>
+      <text>
+	The "CPU vs human" parameter allows you to control how aggressive
+	CPUs are towards humans.
+      </text>
+      <list>
+	<elem>
+	  If set to "Always", CPUs will always attack humans
+	  and will never try to attack another CPU, unless there are
+	  no humans left. This used to be the default behavior in
+	  previous Liquid War versions, but some players remarked that
+	  it was rather unfair, so now this is an option.
+	</elem>
+	<elem>
+	  If set to "Random", CPUs won't care wether their opponents
+	  are CPUs or humans, they'll attack anybody. This is the
+	  default behavior.
+	</elem>
+	<elem>
+	  It set to "Never", CPUs will attack each other before
+	  bothering human players.
+	</elem>
+      </list>
+      <text>
+	The "Allow net bots" button can be used to allow bots to
+	connect on network games. Indeed, bots are by default disabled
+	in network games, since in this case LW assumes that bots are
+	useless (there are already several human players). However,
+	turning this option on will allow you to connect bots within
+	the game. It's important to note that this is a per client
+	option, this means that you can't use it to forbid access to bots
+	to a given network game. This option was simply created to
+	avoid confusion when connecting on network games, while still
+	allowing bots to connects if you really want them to.
+      </text>
+      <text>
+	The "Algorithm" parameter allows you to force the algorithm
+	to standard C mode. There's no real good reason you would like
+	to do this, since the C algorithm is slower than the ASM one.
+	Moreover, the ASM algorithm is automatically disabled if you
+	play against a computer which does not have ASM enabled.
+	Think of this as a testing/debugging option.
+      </text>
+    </part>
+  </chap>
+
+  <chap title="Hot keys">
+    <text>
+      Here's a list of keys you might use while playing:
+    </text>
+    <list>
+      <elem>
+	F1: toggles the "info" zone where the game time and the 
+	state of each team is displayed.
+      </elem>
+      <elem>
+	F2: moves the "info" the zone arround, possible positions
+	being top, right, bottom and left.
+      </elem>
+      <elem>
+	F3: pauses the game. This function is disabled during
+	network games.
+      </elem>
+      <elem>
+	F4: toggles the "wave effect". Without this "wave effect",
+	which is turned on ny default,the game will run faster.
+      </elem>
+      <elem>
+	F5: displays the number of frames per second (*).
+      </elem>
+      <elem>
+	F6: displays the number of rounds per second (*).
+      </elem>
+      <elem>
+	F7: displays the precentage of CPU spent on the game
+	logic, calculating where fighters must go for instance (*).
+      </elem>
+      <elem>
+	F8: displays the precentage of CPU spent on graphics (*).
+      </elem>
+      <elem>
+	F9: turns on/off the "capture" mode. In this mode, screenshots
+	of each frame are taken, and written to the hard drive as
+	bitmaps.
+      </elem>
+      <elem>
+	F10: quits the game right away without any confirmation prompt, 
+	also known as the "my boss is coming here!" function.
+      </elem>
+    </list>
+    <text>
+      (*) all these figures tend to be clearly false as computer go
+      faster and faster. Basically, the time required for "logic" and
+      "display" operations is getting shorter and shorter, and the
+      tools I use to measure it are not precise enough. Therefore I
+      get approximations which might by plainly wrong.
+    </text>
+  </chap>
+</file>
+

Added: unstable/liquidwar/branches/upstream/current/doc/xml/parameters.xml
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/xml/parameters.xml	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/xml/parameters.xml	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,310 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE file SYSTEM "file:xml/file.dtd">
+<file title="Command line parameters">
+  
+  <chap title="Introduction"> 
+    <text>
+      When you launch Liquid War 5, you can use command line options.
+      If you have no problems launching Liquid War,
+      this section should not interest you very much.
+    </text>
+    <text>
+      You can use several options at the same time.
+      The basic syntax for options looks like this:
+    </text>
+    <code>
+      lw -option1 -option2 parameter2 -option3 parameter3 -option4 -option5
+    </code>
+    <text>
+      Note that most of the options are legacy options which where usefull
+      with the initial releases of Liquid War, when you had to run in a
+      Windows DOS box, and when there were still plenty of 486 computers
+      with only 8Mb ram...
+    </text>
+  </chap>
+
+  <chap title="Version checking">
+    <text>
+      These are basic options which can be usefull to figure out
+      which release of Liquid War is installed.
+    </text>
+    <list>
+      <elem>
+	"-v" : returns the version number of the program.
+      </elem>
+      <elem>
+	"-h" : displays a short description and copyright information.
+      </elem>
+    </list>
+  </chap>
+
+  <chap title="Changing default paths">
+    <text>
+      Very usefull options, especially if you can not install Liquid War
+      in default directories or want to put the game in a special place.
+    </text>
+    <list>
+      <elem>
+	"-cfg myconfigfile.cfg" : causes Liquid War to use the specified
+	config file.
+      </elem>
+      <elem>
+	"-dat mydatafilefile.dat" : causes Liquid War to use the specified
+	datafile. This might be a very interesting option if you run
+	Liquid War on a GNU/Linux box where you do not have root access and
+	therefore can not put the datafile in /usr.
+      </elem>
+      <elem>
+	"-map mycustommapdir" : causes Liquid War to use the specified
+	directory as the user map directory. The user map directory
+	is where you can put plain bitmaps to be used as maps.
+      </elem>
+      <elem>
+	"-tex mycustomtexturedir" : causes Liquid War to use the specified
+	directory as the user texture directory. The user texture directory
+	is where you can put plain bitmaps to be used as textures.
+      </elem>
+      <elem>
+	"-mid mycustommusicdir" : causes Liquid War to use the specified
+	directory as the user music directory. Any midi file placed in this
+	directory will be added to the list of available musics.
+      </elem>
+      <elem>
+	"-server myliquidwarserverfile" : causes Liquid War to use the specified
+	file as the server executable. This option has no effect for now since
+	the server is not launched by the client.
+      </elem>
+      <elem>
+	"-mapgen mylwmapgenfile" : causes Liquid War to use the specified
+	file as the "lwmapgen" executable. "lwmapgen" is an utility by David Redick
+	which generates random maps automatically for Liquid War. You might wish
+	to change this option if random map generation does not work for some reason,
+	or if you want to use your own map generator.
+      </elem>
+    </list>
+  </chap>
+
+  <chap title="Troubleshooting switches">
+    <text>
+      These options give you control on how Liquid War treats
+      initialisation errors, how much memory it should reserve,
+      what kind of video mode sit should not choose etc...
+    </text>
+    <list>
+      <elem>
+	"-vga" :
+	This option forces Liquid War to use your video card
+	as if it was only a basic VGA card. 
+	This option is required if you play Liquid War from Windows NT.
+      </elem>
+      <elem>
+	"-no400300" :
+	This option disables the VGA 400x300 video mode.
+	I created this options for I know that some video cards/monitors
+	don't support the 400x300 mode.
+      </elem>
+      <elem>
+	"-silent" :
+	With this option, Liquid War will not play any sound.
+	It will not search for any sound card.
+	This can be interesting if you don't have any sound card
+	or if Liquid War doesn't handle your card correctly.
+      </elem>
+      <elem>
+	"-nowater" :
+	Causes Liquid War not to load any water sound.
+	Use this if Liquid War runs short of memory,
+	and you should gain about 850kb.
+      </elem>
+      <elem>
+	"-nosfx" :
+	Causes Liquid War not to load any sound fx.
+	Use this if Liquid War runs short of memory,
+	and you should gain about 150kb.
+      </elem>
+      <elem>
+	"-nomusic" :
+	Causes Liquid War not to load any midi music.
+      </elem>
+      <elem>
+	"-mem n" :
+	The parameter "n" sets the amount of memory (in Mb)
+	Liquid War will allocate to do all its calculus.
+	If this number is too small, you won't be able to play
+	on all the levels.
+	If it is too high, Liquid War may not start at all
+	or crash while you are playing.
+	The default value is 8.
+	If you play Liquid War from Windows and Liquid War
+	refuses to run because this parameter is too high,
+	then try and give more dpmi memory to Liquid War.
+      </elem>
+      <elem>
+	"-nojoy" :
+	This option disables joystick support.
+      </elem>
+      <elem>
+	"-noback" :
+	Causes Liquid War not to load the background image.
+	Use this if Liquid War runs short of memory,
+	and you should gain about 300kb.
+      </elem>
+      <elem>
+	"-notex" :
+	Causes Liquid War not to load any texture.
+	Use this if Liquid War runs short of memory,
+	and you should gain about 750kb.
+      </elem>
+      <elem>
+	"-auto" :
+	If you set this option, Liquid War won't generate
+	any error while allocating memory or loading data.     
+      </elem>
+      <elem>
+	"-safe" :
+	With this option, you will play with a very reduced
+	version of Liquid War. It looks rather ugly but
+	should work in a DOS box with only 4Mb of DPMI memory.
+	Use this if you experience serious memory or device problems.
+	If Liquid War doesn't start with this option turned on,
+	I really don't think I can do anything for you...
+      </elem>
+      <elem>
+	"-nice" :
+	With this option, Liquid War will use a mode which
+	is between the default mode and the "safe" mode.
+      </elem>
+      <elem>
+	"-check" :
+	With this option, Liquid War will stop as soon as it detects
+	something strange while initializing.
+      </elem>
+      <elem>
+	"-stop" :
+	If you set this option, Liquid War will prompt you for a key
+	when the init process is completed.
+      </elem>
+      <elem>
+	"-c" :
+	This is a weird option, if you turn it on,
+	the game will only use fonctions which are programmed in C langage.
+	The default behaviour is to use some functions I rewrote
+	in assembly langage, so that the game is a little faster.
+      </elem>
+    </list>
+  </chap>
+  
+  <chap title="Debug options">
+    <text>
+      These options are usefull if you want to debug the game and
+      trace what's happening.
+    </text>
+    <list>
+      <elem>
+	"-netlog" :
+	Dumps all the network traffic on the standard output. This
+	can help finding problems when trying to connect to the server
+	in a network game.
+      </elem>
+    </list>
+  </chap>
+  
+  <chap title="Server options">
+    <text>
+      The server command line options are described in the section
+      which deals which network games in general. IMHO you need to
+      understand how network works in LW before trying to tweak
+      the server 8-)
+    </text>
+  </chap>
+
+  <chap title="Other options">
+    <text>
+      Everything else 8-)
+    </text>
+    <list>
+      <elem>
+	"-capture" :
+	Activates the capture mode. In this mode, the game will
+	dump a .bmp file on the disk several times per second, which
+	is usefull if you want to create an mpeg movie of your game
+	session afterwards. You can also activate this mode interactively
+	by pressing F9 within the game.
+      </elem>
+      <elem>
+	"-metaserver url" : redefines the URL of the meta-server.
+	Usefull if you want to use your own meta-server.
+      </elem>
+      <elem>
+	"-nobeep" :
+	Disables the system beeps that the application might fire.
+	These beeps are mostly used on the server to notify clients connections.
+      </elem>
+      <elem>
+	"-tombola" :
+	Activates a special mode where scores are not displayed 
+	normally. Instead, the game displays 3 random numbers between 1 - 500.
+      </elem>
+    </list>
+  </chap>
+  
+  <chap title="lwmapgen options">
+    <text>
+      The external lwmapgen program by David Redick accepts a
+      number of command line options. You can type:
+    </text>
+    <code>
+liquidwar-mapgen --help
+    </code>
+    <text>
+      to get a list of all available options under UNIX. Under Windows
+      the command would be:
+    </text>
+    <code>
+lwwinmap --help
+    </code>
+    <text>
+      Note that lwmapgen is called automatically by Liquid War
+      when you click on the "Random map" button.
+    </text>
+    <text>
+      The idea behind lwmapgen is that you choose a function which
+      sets the type of map generated, and then pass various arguments
+      to this function. If you do not explicitly choose a function, one
+      will be picked up for you randomly, and all other parameters will
+      use default values.
+    </text>
+    <text>
+      The most usefull and common options are:
+    </text>
+    <list>
+      <elem>
+	"--help" :
+	displays help.
+      </elem>
+      <elem>
+	"--out filename" :
+	save bitmap to filename.
+      </elem>
+      <elem>
+	"--size n" :
+	bitmap size (an integer between 0 and 5).
+      </elem>
+      <elem>
+	"--list" :
+	list all available functions.
+      </elem>
+      <elem>
+	"--function function_name" :
+	which function to use.
+      </elem>
+    </list>
+    <text>
+      Here's a typical use of lwmapgen:
+    </text>
+    <code>
+liquidwar-mapgen --size 3 --function hole --out test.bmp
+    </code>
+  </chap>
+
+</file>

Added: unstable/liquidwar/branches/upstream/current/doc/xml/platforms.xml
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/xml/platforms.xml	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/xml/platforms.xml	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE file SYSTEM "file:xml/file.dtd">
+<file title="Platform specific issues">
+
+  <chap title="General remarks">
+    <text>
+      Liquid War is now a cross-platform game, thanks to Allegro.
+      So now you can play under different OS.
+    </text>
+    <text>
+      The same source tree will compile on all supported platforms, 
+      but with slight differences when running. C preprocessor
+      #defines are used to code some platform specific stuff,
+      and in some cases there are different files for the
+      DOS, Windows and UNIX versions.
+    </text>
+    <text>
+      As I said, I try to use the same code for all platforms.
+      This is in the long term the best choice.
+      Otherwise there would different branches of the source tree,
+      and I don't think this is a very good solution.
+    </text>
+    <text>
+      Therefore some optimizations that were performed in the
+      old DOS-only version have been totally removed, for they
+      were 100% platform dependent (ie mode-X asm coding).
+      So the new versions are all a little slower
+      than the old 5.1 stuff, but the performance loss is only
+      about 20%, which is not significant with today's PCs.
+      And anyways the performance loss is most of the time limited
+      to the goog old VGA 320x200x8 mode-X, which starts being
+      kind of obsolete.
+    </text>
+  </chap>
+
+  <chap title="DOS">
+    <text>
+      This is the original version.
+      It's the fastest one as far as I know, the safest one and
+      it will always be I think, since Allegro was first designed
+      for DOS, and DOS allows a full unconditionnal access to all
+      the hardware ressources LW requires.
+      LW doesn't use any hardware
+      acceleration and it's not been designed to do so.
+      Unfortunately there's no network support for the DOS version
+      of Liquid War.
+    </text>
+  </chap>
+
+  <chap title="Windows">
+    <text>
+      When running under a Windows box, the DOS release used to be
+      safer than the native Windows port. Now that DOS support is getting
+      really poor with recent versions of Windows, the native Windows
+      release of Liquid War starts begin the good choice for Windows users.
+      And Allegro for Windows is getting quite stable in the 4.x series.
+    </text>
+    <text>
+      The other reason to choose this release rather than the DOS release
+      is that it has network support.
+    </text>
+    <text>
+      If you have problems running Liquid War under Windows, please check out
+      the "data\lwwin.log" file which should be written each time you run the game.
+      It contains the information which is displayed on the console under
+      other platforms, and might give you a clue about what's going wrong.
+    </text>
+  </chap>
+
+  <chap title="GNU/Linux">
+    <text>
+      This port is the most recent one, and also the one I prefer.
+      Paths have been changed to an UNIXish style,
+      ie the data is stored in:
+    </text>
+    <code>
+      /usr/local/share/games/liquidwar
+    </code>
+    <text>
+      the executable in:
+    </text>
+    <code>
+      /usr/local/games
+    </code>
+    <text>
+      and the configuration file is
+    </text>
+    <code>
+      ~/.liquidwarrc
+    </code>
+    <text>
+      Since not all GNU/Linux distributions have /usr/local/games in their path,
+      I also put a symbolic link to the binaries in /usr/local/bin.
+      I believe Liquid War is quite FHS compliant, so if its default
+      directories do not match your configuration, blame your distro
+      for not following the standards 8-) AFAIK the only touchy
+      directory is /usr/local/share/pixmaps which I've seen on many distribution
+      but does not seem to be referenced in the FHS.
+    </text>
+    <text>
+      With the latest releases of Allegro, Liquid War is becoming pretty
+      stable under GNU/Linux. You should also know that the GNU/Linux port is usually
+      the most up to date, since I very very seldom boot Windows at home
+      and do most of the coding under GNU/Linux.
+    </text>
+  </chap>
+
+  <chap title="FreeBSD">
+    <text>
+      This is the latest port, so I expect it to be a little touchy to
+      install and/or run for some time.
+    </text>
+    <text>
+      Note that to compile the game you'll need to install GNU tools like
+      gmake and gcc. Liquid War won't compile with the genuine make and cc
+      commands.
+    </text>
+    <text>
+      One thing you might ask is: "why do you provide the binary as a plain
+      .tgz file, it would be much nicer if a standard FreeBSD port was 
+      provided instead!". The answer is that the statically linked binary
+      should work flawlessly and does not raise any dependency problem.
+      Also I don't know how to make a BSD port
+      and I'm not really interested in doing it. If it's easy to do, then someone
+      can simply do it and send it back to me. If it's hard to do, then I do not
+      really have the time nor motivation to do it. What I did is make the
+      code and install scripts FreeBSD friendly so that it would be possible to
+      compile the game under FreeBSD. Packaging is another story. 
+    </text>
+  </chap>
+
+  <chap title="Mac OS X">
+    <text>
+      There's currently a beta version of a Mac OS X port for Liquid War.
+      Ryan D. Brown nicely managed to compile and run the game under Mac OS X,
+      and the latest news was that it does basically work. Still, this port
+      did not go through intensive testing, so there might still be some bugs,
+      expecially concerning networking.
+    </text>
+    <text>
+      There were some byte endianess problems in previous ( &lt;=5.5.8 ) 
+      releases of LW, but I tried to fix them and they should be gone now.
+    </text>
+    <text>
+      As of today, we're trying to find out a convenient way to package and
+      release the Mac OS X version of LW. You can contact us on the
+      mailing list if you're interested in this port.
+    </text>
+  </chap>
+
+</file>
+

Added: unstable/liquidwar/branches/upstream/current/doc/xml/rules.xml
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/xml/rules.xml	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/xml/rules.xml	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE file SYSTEM "file:xml/file.dtd">
+<file title="Rules">
+
+  <chap title="The Liquid War concept">
+    <text>
+      Liquid War is a wargame. 
+      But it is different from common wargames.    
+    </text>
+    <text>
+      When playing Liquid War, one has to eat one's opponent.
+      There can be from 2 to 6 players.
+      There are no weapons, the only thing you have to do
+      is to move a cursor in a 2-D battlefield.
+      This cursor is followed by your army, which is composed
+      by a great many little fighters.
+      Fighters are represented by small colored squares.
+      All the fighters who have the same color
+      belong to the same team.
+      One very often controls
+      several thousands fighters at the same time.
+      And when fighters from different teams meet, 
+      they eat each other, it is as simple as that.
+    </text>
+  </chap>
+  
+  <chap title="How do teams react?">
+    <text>
+      Teams are composed of little fighters.
+      These fighters all act independently, 
+      so it can happen that one single fighters does something
+      different from what all the other do.
+    </text>
+    <text>
+      The main goal of these fighters is to reach the cursor you control. 
+      And to do that, they are in a way quite clever,
+      for they choose the shortest way to reach it.
+      Check it if you want, but it is true, they *really*
+      choose *the* shortest way to reach the cursor.
+      That is the whole point with Liquid War.
+    </text>
+    <text>
+      But these fighters are not perfect,
+      so when they choose this shortest way,
+      they do as if they were alone on the battlefield.
+      That's to say that if there is a fighter blocking
+      their way, they won't have the idea to choose
+      another way, which is free from fighters but
+      would have been longer otherwise.
+      So fighters can be blocked.             
+    </text>
+  </chap>
+
+  <chap title="Who eats whom?">
+    <text>
+      When two fighters from different team meet each other,
+      they first try to avoid fighting, and they dodge. 
+      But if there is no way for them to move,
+      they get angry and attack the guy which is blocking them.
+      Sometimes, they attack each other and both loose health.
+      But it can happen that a fighter is attacked by
+      another one, which is himself not attacked at all.
+    </text>
+    <text>
+      Here is an example of this behaviour:
+      A blue fighter and a red fighter both want to move to 
+      their right, for that would be the shortest way
+      to reach their cursor if there was nobody on the battlefield.
+      But they are blocked by other fighters.
+      If, for instance, the red fighter is on the right
+      and the blue fighter on the left,
+      it is the red fighter which will be eaten.
+    </text>
+    <text>
+      When a fighter is attacked, he first looses health,
+      that is to say that he gets darker.
+      When his health reaches 0, his color changes
+      and he becomes a member of the team by which
+      he has been attacked.
+      Therefore the number of fighters on the battlefield
+      always remains the same.                           
+    </text>
+    <text>
+      When fighters of a same team get stuck together
+      and block each other, then they regenerate,
+      that is to say that they get brighter.        
+    </text>
+    <text>
+      However, I think the best way for you to understand
+      the way it works is to try the game...
+    </text>
+  </chap>
+
+  <chap title="Basic strategy">
+    <text>
+      When I play Liquid War, I always try to surround my opponents,
+      and it usually works. 
+    </text>
+    <text>
+      By the way, the computer has no strategy at all,
+      he is a poor player, and if you get beaten by him,
+      it means you have to improve yourself a lot!
+    </text>
+    <text>
+      But still, the computer doesn't do one thing
+      which I've seen many beginners doing:
+      he never keeps his cursor motionless right in
+      the middle of his own fighters,
+      for this is the best way to loose.
+    </text>
+  </chap>
+
+  <chap title="More strategy">
+    <text>
+       Here are some more tips, kindly submitted by Jan Samohýl.
+    </text>
+    <list>
+      <elem>
+         Try to cut your opponent off walls and surround him completely with
+         your troops; when trying to  penetrate his forces inside a tunnel, keep
+         your troops at the wall (and force them ocassionaly to attack off the
+         wall). I think this is a biggest weakness of the computer AI, that it
+         doesn't know this.
+      </elem>
+      <elem>
+         When luring your troops to outflank an enemy, always move your cursor
+         through the enemy, not the other way around.
+      </elem>
+      <elem>
+         To penetrate very narrow tunnels, stand back for a while and let some
+         enemy troops come from the tunnel to you. Then surround them, destroy,
+         repeat.
+      </elem>
+      <elem>
+         I have observed that with more than 2 players (6), the game difficulty
+         depends on the map in the following way: If the playing field is
+         completely empty, without any holes (topologically equivalent to full
+         circle), the game is the easiest, because you can just go through the
+         middle to outflank your opponent. If there is a single large obstacle
+         (ie. playfield is topologically equivalent to ring (the area between two
+         nested circles)), the game is the most difficult, because you have to
+         choose one direction for the attack, and cannot simply defend the other
+         direction. For other maps, it seems to really depend on their similarity
+         to one of these two extreme situations (and army size, of course,
+         because it changes the relative size of obstacles). Also, if you would
+         later add another cursor, this property would probably disappear (maybe
+         then games with n+1 obstacles would be the hardest ones with n cursors).
+      </elem>
+      <elem>
+         If you want a particularly challenging computer game (at least for
+         some maps), use several players, max out attack, min out defense, max
+         out base health (opposite would be harder, but game then changes to the
+         large cloud of black troops, so you don't see anything) and give winner
+         an advantage.
+      </elem>
+    </list>
+  </chap>
+
+  <chap title="The winner is...">
+    <text>
+      The clever guy who has got the greatest number
+      of fighters in his team at the end of the game.
+      Or the one who exterminates all the other teams!
+    </text>
+  </chap>
+
+</file>

Added: unstable/liquidwar/branches/upstream/current/doc/xml/source.xml
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/xml/source.xml	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/xml/source.xml	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,1021 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE file SYSTEM "file:xml/file.dtd">
+<file title="Source code">
+
+  <chap title="General remarks">
+    <part title="Modularity">
+      <text>
+	Liquid War 5 is basically a big C program. I've splitted
+	the source code in many small files for I do not like to
+	have to handle big monolithic sources, but this does not
+	mean Liquid War is very modular. In fact Liquid War 5
+	is quite bloated with global variables and other ugly
+	stuff 8-(
+      </text>
+    </part>
+    <part title="Coding style">
+      <text>
+	To be honest, it's a big mess. You won't find 2 files
+	coded in the same maner... OK, I'm exagerating a bit.
+	From now I try to make an effort and
+	stick to basic rules such as:
+      </text>
+      <list>
+	<elem>
+	  use the GNUish-style indentation - the default Emacs mode in fact	  
+	</elem>
+	<elem>
+	  prefix global functions / variables / constants / types with
+	  lw_&lt;NAME_OF_THE_file&gt;_. For instance, a "do_it" function
+	  in myfile.c will be called lw_myfile_do_it
+	</elem>
+	<elem>
+	  use capitals for constants, globals and types only. All functions
+	  are in lowercase with "_" to separate words
+	</elem>
+	<elem>
+	  keep on using 8.3 filenames for .c source files. This is for
+	  better DOS integration. DOS version of Liquid War is still
+	  maintained, you know 8-)
+	</elem>
+	<elem>
+	  use English only for code and comments
+	</elem>
+      </list>
+      <text>
+	I might decide to rename and cleanup everything some day, for
+	it would help other coders to understand what I wrote, but well,
+	this is certainly not a thrilling task 8-/
+      </text>
+    </part>
+  </chap>
+
+  <chap title="Source files organization">
+    <part title="Main game code">
+      <text>
+	Here you'll find the main() function, the main game
+	loop, application-wide constants and other global stuff.
+      </text>
+      <text>
+	It might be a good start if you want to hack the code.
+      </text>
+      <list>
+	<elem>
+	  base.h: 
+	  contains global constants used in many different files.
+	</elem>
+	<elem>
+	  game.c / game.h: 
+	  contains the main game loop.
+	</elem>
+	<elem>
+	  main.c / main.h: 
+	  the file where the main C function is declared.
+	  Doesn't contain much except calling init functions and
+	  running the GUI.
+	</elem>
+      </list>
+    </part>
+
+    <part title="Menus">
+      <text>
+	The menus are coded using the Allegro GUI system.
+	While this system is very powerfull, it's IMHO not adapted to
+	very complex GUIs, and one of its drawbacks is that it's not
+	so easy to redesign something once you've coded it.
+      </text>
+      <text>
+	Besides, when I started coding the GUI in 1998, I did it
+	in a rather ugly way, and now I'm paying for my being lazy
+	at that time, since I spent hours coding when I want to
+	change something 8-/
+      </text>
+      <list>
+	<elem>
+	  about.c / about.h: 
+	  contains the code for the about menu.
+	</elem>
+	<elem>
+	  advanced.c / advanced.h: 
+	  contains the GUI advanced options menu. 
+	</elem>
+	<elem>
+	  connect.c / connect.h: 
+	  contains code for the "connect" menu which displays which players
+	  are connected to the server, before the game actually starts.
+	</elem>
+	<elem>
+	  controls.c / controls.h: 
+	  contains the code for the controls menu.
+	</elem>
+	<elem>
+	  graphics.c / graphics.h: 
+	  code for the graphic options menu.
+	</elem>
+	<elem>
+	  internet.c / internet.h: 
+	  contains the code for the "Search for Internet games" menu, where one
+	  can pick up a running server automatically with the help of the meta-server.
+	</elem>
+	<elem>
+	  language.c / language.h: 
+	  contains the code for the "Language" menu.
+	</elem>
+	<elem>
+	  level.c / level.h: 
+	  contains code for the menu where the player
+	  can select a level and its options (texture or color).
+	</elem>
+	<elem>
+	  menu.c / menu.h: 
+	  contains the code for the main menu.
+	</elem>
+	<elem>
+	  netgame.c / netgame.h: 
+	  contains the code for the net game menu.
+	</elem>
+	<elem>
+	  options.c / options.h: 
+	  contains the code for the options menu.
+	</elem>
+	<elem>
+	  play.c / play.h: 
+	  contains the code which ties the menu to the main gameloop.
+	</elem>
+	<elem>
+	  rules.c / rules.h: 
+	  code for the rules menu.
+	</elem>
+	<elem>
+	  score.c / score.h: 
+	  functions to display the scores at the end of the game.
+	</elem>
+	<elem>
+	  speeds.c / speeds.h: 
+	  contains the code for the speeds menu.
+	</elem>
+	<elem>
+	  team.c / team.h: 
+	  code for the team menu, where one choses which teams will play.
+	</elem>
+	<elem>
+	  volume.c / volume.h: 
+	  code for the sound menu.
+	</elem>
+	<elem>
+	  wave.c / wave.h: 
+	  code for the wave menu.
+	</elem>
+      </list>
+    </part>
+
+    <part title="GUI tools">
+      <text>
+	These files contain various utilities which are used
+	in the menus.
+      </text>
+      <list>
+	<elem>
+	  alleg2.c / alleg2.h: 
+	  contains some tweaked allegro functions. I wanted to use
+	  bitmaps with sevral colors for my fonts, and change some
+	  of the allegro default behavior. So rather than modifying
+	  the allegro source code right in the library I copied
+	  it in this file and then modified it.
+	</elem>
+	<elem>
+	  back.c / back.h: 
+	  this modules displays the background image.
+	</elem>
+	<elem>
+	  dialog.c / dialog.h: 
+	  contains code for standard dialog boxes.
+	</elem>
+	<elem>
+	  error.c / error.h: 
+	  contains functions to display error messages once the game
+	  is in graphical mode.
+	</elem>
+	<elem>
+	  help.c / help.h: 
+	  generic functions to display the various help pages.
+	</elem>
+      </list>
+    </part>
+
+    <part title="Core algorithm">
+      <text>
+	Here's *the* interesting part.
+	All the rest of the code is just sugar coat to display stuff,
+	receive players commands, communicate with other computers,
+	handle errors, etc... But the real thing is here!
+      </text>
+      <text>
+	It's funny to note that these files have almost not been
+	modified since Liquid War 5.0.
+      </text>
+      <text>
+	It's also interesting to note that they represent a small
+	percentage of the total amount of code in the game.
+	This tends to prove - and I'm convinced of it - that game
+	programming does not only consists in having great ideas,
+	but also requires a lot of "dirty" and boring work.
+	Honestly, coding an option menu is as boring as
+	coding Liquid War algorithm is fun.
+      </text>
+      <list>
+	<elem>
+	  fighter.c / fighter.h: 
+	  contains code to move the armies, once the gradient has been calculated.
+	</elem>
+	<elem>
+	  grad.c / grad.h: 
+	  this module calculates the gradient for each team.
+	  One could say it's the "kernel" of the game,
+	  since most of the CPU time is spent in this module
+	  (except if you have a slow display...).
+	</elem>
+	<elem>
+	  mesh.c / mesh.h: 
+	  contains code to set up a usable mesh with a map.
+	  Mesh are re-calculated at each time a new game is started,
+	  the reason for this being that meshes are *very* big so
+	  it would not be reasonnable to save them directly on the HD.
+	</elem>
+	<elem>
+	  monster.s / monster.h: 
+	  assembly functions to speed-up the game.
+	  It's a replacement for some fighter.c functions.
+	</elem>
+	<elem>
+	  spread.s / spread.h: 
+	  contains assembly replacements for some functions of grad.c.
+	  These replacements do the same than the original ones from grad.c,
+	  but faster. Could still be optimized.
+	</elem>
+      </list>
+    </part>
+
+    <part title="Moving cursors">
+      <text>
+	It looks like nothing, but moving a cursor and deciding where
+	it should go if there's a wall in front of it is not that easy,
+	especially if you want things to work nicely.
+      </text>
+      <list>
+	<elem>
+	  autoplay.c / autoplay.h: 
+	  contains the code for the computer AI.
+	  This module simulates keypresses from the computer,
+	  then the computer is handled as any other player.
+	</elem>
+	<elem>
+	  move.c / move.h: 
+	  provides an API to move the cursors.
+	</elem>
+      </list>
+    </part>
+
+    <part title="User input">
+      <text>
+	Until 5.4.0, Liquid War did not have network support.
+	As it is designed to be multiplayer, one needed to have
+	several players on the same computer. The mouse also
+	needed to be handled in a special way since cursors
+	can *not* pass walls in Liquid War. Additionnally,
+	I wanted all input channels (keyboard mouse and joystick)
+	to be handled in a unified way.
+      </text>
+      <text>
+	This explains why there's so much code for user input,
+	when one would think at first sight that 
+	"polling the keyboard is enough".
+      </text>
+      <list>
+	<elem>
+	  joystick.c / joystick.h: 
+	  contains code to support joystick input. It wraps joystick buttons
+	  to virtual keyboard keys, so that joystick and keyboard behave
+	  exactly the same.
+	</elem>
+	<elem>
+	  keyboard.c / keyboard.h: 
+	  contains code to handle key presses.
+	</elem>
+	<elem>
+	  mouse.c / mouse.h: 
+	  wraps the mouse movements to virtual keyboard keys.
+	  This way the mouse can be used to control the players.
+	</elem>
+      </list>
+    </part>
+
+    <part title="Initialisations">
+      <text>
+	These files contain functions to intialize various game
+	components. 100% boring code.
+      </text>
+      <list>
+	<elem>
+	  area.c / area.h: 
+	  contains functions to create the game area.
+	  Basically it contains functions to create
+	  the data structures in which the level is
+	  stored during the game.
+	</elem>
+	<elem>
+	  army.c / army.h: 
+	  functions to create the armies, and place them on the
+	  battlefield.
+	</elem>
+	<elem>
+	  asm.c / asm.h: 
+	  various constants, macros and utilities to
+	  ensure that asembly code works correctly.
+	</elem>
+	<elem>
+	  bigdata.c / bigdata.h: 
+	  I had a really hard time with the malloc function with DJGPP
+	  under Win95 dos box. I tried to have it working for hours and
+	  hours but my program kept being buggy. So I decided to allocate
+	  the memory myself, in a memory zone I create at startup.
+	  This is what this module does: create a huge memory zone
+	  and then give parts of it to the rest of the program.
+	</elem>
+	<elem>
+	  config.c / config.h: 
+	  contains everything that is related to the game configuration.
+	  This module contains in global variables all the parameters
+	  that are stored in the config file.
+	</elem>
+	<elem>
+	  cursor.c / cursor.h: 
+	  contains the code to init the cursors and place them
+	  on the battlefield at the beginning of the game.
+	</elem>
+	<elem>
+	  decal.c / decal.h: 
+	  This module makes the link between teams and players.
+	  Its coding is quite ugly, for some modules in LW assume
+	  that when 2 teams are playing they are always teams 0 and 1.
+	  So when 3 teams are playing are playing and the second team loses,
+	  one has to make team 2 become team 1.
+	  That's what this module is for.
+	</elem>
+	<elem>
+	  exit.c / exit.h: 
+	  contains code that is executed when the game ends,
+	  it shuts down Allegro and displays messages on the console.
+	</elem>
+	<elem>
+	  gfxmode.c / gfxmode.h: 
+	  contains code to set up the various video modes,
+	  and defines which modes are available for each platform.
+	</elem>
+	<elem>
+	  init.c / init.h: 
+	  contains code to initialize Allegro with proper options and analyze failures.
+	</elem>
+	<elem>
+	  palette.c / palette.h: 
+	  contains function to set up the current color palette.
+	  Liquid War uses different palettes, depending on what
+	  colors are chosen for teams.
+	</elem>
+      </list>
+    </part>
+
+    <part title="Graphics">
+      <text>
+	Here lies most of the graphic functions in Liquid War.
+	There's not that much code since Liquid War's strength
+	is not its visual effects, but rather its gameplay.
+      </text>
+      <text>
+	The only "funny" thing is the wave effect. I'm quite
+	happy with it, and honestly, I do think it is rather fast,
+	given the fact that it uses no 3D hardware at all.
+      </text>
+      <list>
+	<elem>
+	  disp.c / disp.h: 
+	  contains functions to display the battlefield.
+	</elem>
+	<elem>
+	  distor.c / distor.h: 
+	  this module contains code to create the "wave effect".
+	  It uses a lot of data tables, and is quite complicated
+	  to understand...
+	</elem>
+	<elem>
+	  glouglou.s / glouglou.h: 
+	  assembly module, it is a replacement for some functions of distor.c.
+	  It goes much faster but does the same.
+	</elem>
+	<elem>
+	  info.c / info.h: 
+	  contains code to display the info bar.
+	  The info bar is the bar which display the time left and the amount of players
+	  for each team while the game is running.
+	</elem>
+	<elem>
+	  message.c / message.h: 
+	  provides an API to display messages during the game.
+	  Very useful if you want to debug the game: you can trace
+	  and display anything.
+	</elem>
+	<elem>
+	  pion.c / pion.h: 
+	  contains code to display the cursors.
+	</elem>
+	<elem>
+	  viewport.c / vieport.h: 
+	  code to allocate and resize the zone where the map is
+	  displayed, also called "viewport".
+	</elem>
+      </list>
+    </part>
+
+    <part title="Sound and music">
+      <text>
+	Sound and music routines required some encapsulation,
+	since the game must be able to run even if the sound and/or
+	music did not load correctly.
+      </text>
+      <list>
+	<elem>
+	  music.c / music.h: 
+	  contains the code to control MIDI playback.
+	</elem>
+	<elem>
+	  sound.c / sound.h: 
+	  functions to play sound.
+	</elem>
+      </list>
+    </part>
+
+    <part title="Data management">
+      <text>
+	These functions handle the datafile contents and
+	also the custom data.
+      </text>
+      <text>
+	Note that the various utilities such as liquidwarcol,
+	liquidwarmap and liquidwartex do not share code with
+	the main executable. This is obviously a design error,
+	for liquidwarmap will handle maps in a very poor
+	way and is unable to autodetect map errors, whereas
+	the game does it rather well. Blame the programmer.
+      </text>
+      <list>
+	<elem>
+	  disk.c / disk.h: 
+	  contains all the code to access data from the hard drive.
+	  In fact, all the HD access is done at startup.
+	</elem>
+	<elem>
+	  map.c / map.h: 
+	  contains code to load the maps from a datafile raw data
+	  or a user defined bitmap
+	  to a usable structure in RAM.
+	</elem>
+	<elem>
+	  maptex.c / maptex.h: 
+	  contains code to handle the "use default texture"
+	  option, and associate a map with a given texture
+	  automatically.
+	</elem>
+	<elem>
+	  texture.c / texture.h: 
+	  contains code to handle textures.
+	  Textures are stored in a special format which uses
+	  5 bits per pixel.
+	</elem>
+      </list>
+    </part>
+
+    <part title="Random map generator">
+      <text>
+	Liquid War has a "generate random map" feature which is
+	available within the game and also as an external program.
+	The source code for the external program is in ./utils/lwmapgen
+	in Liquid War source distribution. This program has been
+	coded by David Redick, is also available on
+	"http://www.cs.clemson.edu/~dredick/lwmapgen/"
+	and works on GNU/Linux. Compiling this program under DOS
+	and/or Windows is untested and unsupported.
+      </text>
+      <text>
+	The random map generator within Liquid War - which of course
+	works on any platform support by LW - uses for its greater 
+	part the same source code as the external lwmapgen program.
+      </text>
+      <list>
+	<elem>
+	  random.c / random.h:
+	  wrapper for the map generator written by David Redick.
+	  It basically does the same as ./utils/lwmapgen/main.c 
+	  except that it does it within Liquid War as it is running
+	  and not in an external independant program.
+	</elem>
+      </list>
+    </part>
+
+    <part title="Time handling">
+      <text>
+	Time handling is fundamental in a game. Time is used for
+	visual effects (waves...) during the game, it's used to generate
+	some pseudo random stuff, well, it's used everywhere!
+      </text>
+      <text>
+	Note that on the client, I use 2 "different" clocks. The first
+	counts the "real" time, in seconds. The second one is counts "rounds" 
+	and is incremented by 1 at each game round.
+      </text>
+      <list>
+	<elem>
+	  srvtime.c / srvtime.h: 
+	  code used to handle time on the server, where Allegro's functions
+	  are not available.
+	</elem>
+	<elem>
+	  ticker.c / ticker.h: 
+	  sets up a timer callback.
+	</elem>
+	<elem>
+	  time.c / time.h: 
+	  functions to know how long the game has been running,
+	  knowing that it can be interrupted.
+	</elem>
+      </list>
+    </part>
+
+    <part title="In-game utilities">
+      <text>
+	These are various utilities use to monitor and control
+	the game while one's playing. 
+      </text>
+      <list>
+	<elem>
+	  capture.c / capture.h: 
+	  code used to capture the video output of the game and store it
+	  in .bmp files while playing.
+	</elem>
+	<elem>
+	  checksum.c / checksum.h: 
+	  utilities to generate a checksum from a given game state.
+	  Used in network code to make sure all the clients stay
+	  synchronized.
+	</elem>
+	<elem>
+	  code.c / code.h: 
+	  This file contains the code to handle key presses during
+	  the game. That's to say the pause key for instance.
+	</elem>
+	<elem>
+	  profile.c / profile.h: 
+	  provides tools to calculate how fast the game is runnning
+	  and what operations slow it down.
+	</elem>
+	<elem>
+	  watchdog.c / watchdog.h: 
+	  this module waits for "secret codes" to be typed while
+	  the game is running, and traps them.
+	</elem>
+      </list>
+    </part>
+
+    <part title="Command line handling">
+      <text>
+	OK, now to all the UNIX guys, I *know* there are many
+	ways to do things in a better and simple way than I did.
+	But keep in mind that in 1998, under DOS, I had a rotten command
+	line and even now I need everything to work on both UNIX and
+	Microsoft platforms.
+      </text>
+      <text>
+	These utilities are not perfect, but they work, that's all
+	I ask them.
+      </text>
+      <list>
+	<elem>
+	  basicopt.c / basicopt.h: 
+	  handles basic command line parameters such as "-v" or "-h".
+	</elem>
+	<elem>
+	  parser.c / parser.h: 
+	  contains code to parse and analyze the command line parameters.
+	</elem>
+	<elem>
+	  startup.c / startup.h: 
+	  analyzes the command line parameters and stores them
+	  into global variables.
+	</elem>
+      </list>
+    </part>
+
+    <part title="Locale support">
+      <text>
+	Liquid War now has locale support. Basically, all the
+	labels and texts in the UI are stored in constants.
+	There's simply file per language.
+      </text>
+      <text>
+	Note to translators: if you decide to translate the
+	menus in another language, keep in mind that all the
+	translations must fit in the various buttons and textboxes.
+	The best resolution to test this 
+	- the one where letters take most place - is 640x480.
+      </text>
+      <list>
+	<elem>
+	  lang.c / lang.h: 
+	  contains code to handle language dependant stuff.
+	</elem>
+	<elem>
+	  langen.c / langen.h: 
+	  contains code to handle English specific stuff.
+	</elem>
+	<elem>
+	  langfr.c / langfr.h: 
+	  contains code to handle French specific stuff.
+	</elem>
+      </list>
+    </part>
+
+    <part title="Log and various messages">
+      <text>
+	OK, the API of the log routines is a piece of crap.
+	Now I'm simply too lazy to change it. It works, that's
+	all I ask.
+      </text>
+      <text>
+	BTW, there's a clear advantage in using custom-made
+	log functions instead of plain calls to "fprintf(stderr,...".
+	It might not be obvious for UNIX users, but think about
+	Windows. Nothing like a "tail -f" there, nor a proper
+	output redirection system. When a user clicks on the
+	Liquid War icon, I want "console" information to be logged
+	in a file!
+      </text>
+      <list>
+	<elem>
+	  log.h: 
+	  common header for logcli.c and logsrv.c.
+	</elem>
+	<elem>
+	  logcli.c: 
+	  contains code to display messages on the console.
+	  It's usefull for console may have different behaviors
+	  when the games is used on different platforms.
+	  This file is used to compile the client.
+	</elem>
+	<elem>
+	  logsrv.c: 
+	  contains code to display messages on the console.
+	  This file is used to compile the server, which does not
+	  use Allegro at all.
+	</elem>
+	<elem>
+	  popupgen.h:
+	  common header for popup functions.
+	</elem>
+	<elem>
+	  popupw32.c:
+	  code to handle popup on the Win32 platform. Popups are a must-have
+	  under Windows for error diagnostics, since the average Windows user
+	  never gives any look at any log file...
+	</elem>
+      </list>
+    </part>
+
+    <part title="Macros, utilities and string support">
+      <text>
+	As usual, I needed to prepare a small set of usefull macros.
+      </text>
+      <list>
+	<elem>
+	  macro.h:
+	  contains basic wrappers/macros for
+	  snprintf like functions. This mostly to ease up string
+	  manipulation which is - as always - a nightmare in standard C.
+	</elem>
+	<elem>
+	  path.c / path.h:
+	  code used to handle filenames and paths, for instance remove
+	  path and file extension from a filename.
+	</elem>
+      </list>
+      <text>
+	It's also important to note that Liquid War uses snprintf instead
+	of sprintf, for using the latter is very likely to cause buffer
+	overflows. Under Linux glibc provides this function but Microsoft 
+	does not provide it natively on Windows. Therefore I used a
+	third party snprintf implementation by Mark Martinec:
+	"http://www.ijs.si/software/snprintf/" and its source is available
+	in the ./utils directory of Liquid War source distribution.
+      </text>
+    </part>
+
+    <part title="Byte order and endianess">
+      <text>
+	  As you might know, PC Intel based computers are "little-endian"
+	  while Sun Sparc stations and Mac computers are "big-endian".
+	  This is an issue for LW since in network games maps are transmitted
+	  in binary format. Therefore I needed to set up some
+	  (un)serialization fonctions.
+      </text>
+      <list>
+	<elem>
+	  serial.c / serial.h:
+	  code used to transform integers and map headers into an uniform
+	  cross-platform byte stream which is readable by both little and
+	  big endian machines.
+	</elem>
+      </list>
+    </part>
+
+    <part title="Thread support">
+      <text>
+	Liquid War does have thread support, but it is a "limited"
+	thread support. I mean that the game is generally monothreaded,
+	but a few functions use threads. For instance, calls to
+	the meta-server are done within threads.
+      </text>
+      <text>
+	Basically, I do not really enjoy programming in a multithreaded
+	environnement. So when possible, I chose the monothread path,
+	and used threads only where I simply would not be able to
+	find another acceptable solution.
+      </text>
+      <text>
+	I also needed to use some mutexes to prevent crashes in the
+	user interface.
+      </text>
+      <list>
+	<elem>
+	  mutxdos.c: 
+	  provides fake mutex support under DOS.
+	  This module is here only to make compilation easier.
+	</elem>
+	<elem>
+	  mutxgen.h: 
+	  header for mutxdos.c, mutxunix.c and mutxw32.c.
+	</elem>
+	<elem>
+	  mutxunix.c: 
+	  provides mutex support on UNIX.
+	</elem>
+	<elem>
+	  mutxw32.c: 
+	  provides mutex support on Win32.
+	</elem>
+	<elem>
+	  thrddos.c: 
+	  provides fake thread support under DOS.
+	  This module is here only to make compilation easier.
+	</elem>
+	<elem>
+	  thrdgen.h: 
+	  header for thrddos.c, thrdunix.c and thrdw32.c.
+	</elem>
+	<elem>
+	  thrdunix.c: 
+	  provides thread support on UNIX.
+	</elem>
+	<elem>
+	  thrdw32.c: 
+	  provides thread support on Win32.
+	</elem>
+      </list>
+    </part>
+
+    <part title="Launching external programs">
+      <text>
+	Liquid War might sometimes launch external programs.
+	This is (for security reason) not a default behavior and has
+	to be activated and configured by yourself, using the "-callback"
+	command line option on the server for instance.
+      </text>
+      <list>
+	<elem>
+	  execgen.h:
+	  header for execunix.c and execw32.c.
+	</elem>
+	<elem>
+	  execunix.c:
+	  code to launch external programs on UNIX.
+	</elem>
+	<elem>
+	  execw32.c:
+	  code to launch external programs on Win32.
+	</elem>
+	<elem>
+	  exec2.c:
+	  code to launch external programs within the client, without any
+	  interaction with the user, ie no unwanted popping window for instance.
+	</elem>
+      </list>
+    </part>
+
+    <part title="Low-level network code">
+      <text>
+	There are network packages for Allegro, but I decided not to
+	use them. Socket support is not that hard to implement under UNIX
+	and Win32 and besides, I've done it for my job recently, so I just
+	knew how to do it.
+      </text>
+      <text>
+	Another reason which decided me to code my own toolbox is that
+	I did not want Liquid War to have external dependencies - except
+	Allegro of course. This way, UNIX gamers to not have to set up and/or
+	download a specific network library. It's also easier to integrate
+	the game in projects like Debian if it has few dependencies.
+      </text>
+      <text>
+	This network code is not a masterpiece, it's just a little set
+	of tools that have proven to work. That's all.
+      </text>
+      <text>
+	BTW, it's important to notice that when linking with Allegro,
+	most blocking UNIX calls ("sleep" or "recv" for instance) stop
+	working: they alwasys return immediately. This led me to
+	implement weird ugly hacks, like calling "recv" in a loop until
+	it gets what it wants... This is theorically and practically
+	a performance killer, but I found no other way to fix this.
+	And FYI, this is not an Allegro bug, it's a feature 8-)
+      </text>
+      <list>
+	<elem>
+	  dnsutil.c / dnsutil.h: 
+	  wrapper code to issue DNS requests, without having
+	  to handle the hostent struct.
+	</elem>
+	<elem>
+	  sock2cli.c: 
+	  sode used to wrap low-level network function on the client.
+	</elem>
+	<elem>
+	  sock2gen.h: 
+	  header for sock2cli.c and sock2srv.c.
+	</elem>
+	<elem>
+	  sock2srv.c: 
+	  code used to wrap low-level network function on the server.
+	</elem>
+	<elem>
+	  sockdos.c: 
+	  network API for DOS.
+	</elem>
+	<elem>
+	  sockex.c: 
+	  netowrk routines shared by sockunix and sockw32.
+	</elem>
+	<elem>
+	  sockgen.h: 
+	  header for sockdos.c, sockunix.c and sockw32.c.
+	</elem>
+	<elem>
+	  sockunix.c: 
+	  network API for UNIX.
+	</elem>
+	<elem>
+	  sockw32.c: 
+	  network API for Win32.
+	</elem>
+      </list>
+    </part>
+
+    <part title="High-level network code">
+      <text>
+	These files contains network utilities 
+	which are Liquid War specific.
+      </text>
+      <list>
+	<elem>
+	  chat.c / chat.h: 
+	  functions used to handle chat messages in network games.
+	</elem>
+	<elem>
+	  keyexch.c / keyexch.h: 
+	  functions to send and receive keys to the server. Used on the
+	  client.
+	</elem>
+	<elem>
+	  netconf.c / netconf.h: 
+	  code to send and receive the config of the clients over the network.
+	</elem>
+	<elem>
+	  netkey.c / netkey.h: 
+	  contains some tools to manipulate key strokes over the network.
+	</elem>
+	<elem>
+	  netmap.c / netmap.h: 
+	  code to send and receive the maps over the network.
+	</elem>
+	<elem>
+	  netmess.c / netmess.h: 
+	  contains a parser to interpret plain text messages. Used when
+	  exhanging information over the network.
+	</elem>
+	<elem>
+	  netplay.c / netplay.h: 
+	  contains the code to set up and start network games.
+	</elem>
+	<elem>
+	  network.c / network.h: 
+	  contains some network related functions and constants used on
+	  the client.
+	</elem>
+	<elem>
+	  ping.c / ping.h: 
+	  code used on the client to estimate the average ping time
+	  with a server.
+	</elem>
+	<elem>
+	  protocol.c / protocol.h: 
+	  contains the sequence of messages send and recevied by the
+	  client when connecting on the server.
+	</elem>
+	<elem>
+	  startinf.c / startinf.h: 
+	  contains struct and tools to handle some network informations while
+	  starting a network game.
+	</elem>
+      </list>
+    </part>
+
+    <part title="Communication with the meta-server">
+      <text>
+	The meta-server is called by both client and server.
+	Basically, the server registers itself, and the client
+	asks for a list of servers.
+      </text>
+      <text>
+	The meta-server itself is just a set of simple PHP scripts
+	with a simple MySQL database. I chose PHP because my
+	provider allows execution of PHP pages, that's all.
+      </text>
+      <text>
+	The protocol is *very* basic, and uses HTTP 1.0 for
+	requests. Answers are received in plain text, with
+	one information per line. There's no garantee that
+	this would work with any HTTP server, but experience
+	proved that it works with my provider 8-)
+      </text>
+      <list>
+	<elem>
+	  httputil.c / httputil.h: 
+	  low level functions to handle http requests.
+	</elem>
+	<elem>
+	  wwwcli.c / wwwcli.h: 
+	  code used on the client to communicate with the meta-server.
+	</elem>
+	<elem>
+	  wwwsrv.c / wwwsrv.h: 
+	  code used on the server to communicate with the meta-server.
+	</elem>
+      </list>
+    </part>
+
+    <part title="Server code">
+      <text>
+	The Liquid War server is a rather small program. The only
+	thing it does is accept new players, transmit map and
+	game parameters between them, and then "replicate keys".
+      </text>
+      <text>
+	By "replicate keys" I mean that the server asks each client
+	what keys have been pressed during the last round, and
+	then dispatches this informations to all clients.
+	This implies that the server has absolutely no idea of
+	who's loosing, who's winning, etc...
+      </text>
+      <text>
+	All the "logic" of the server is coded in these files,
+	the rest is only utilities and helper functions.
+      </text>
+      <list>
+	<elem>
+	  server.c / server.h: 
+	  main code for the server (equivalent of main.c for the client).
+	</elem>
+	<elem>
+	  srvchan.c / srvchan.h: 
+	  code used to handles channels on the server. A channel is associated
+	  to a given computer and may manage several teams.
+	</elem>
+	<elem>
+	  srvcont.c / srvcont.h: 
+	  global network controler used on the server.
+	</elem>
+	<elem>
+	  srvteam.c / srvteam.h: 
+	  code used to handle teams on the server.
+	</elem>
+      </list>
+    </part>
+  </chap>
+
+</file>

Added: unstable/liquidwar/branches/upstream/current/doc/xml/todo.xml
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/xml/todo.xml	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/xml/todo.xml	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE file SYSTEM "file:xml/file.dtd">
+<file title="To do">
+
+  <chap title="Bug-fixing">
+    <text>
+      In its latest releases Liquid War is quite stable IMHO. 
+      However there are still some issues with network under Windows
+      for instance. I'm aware of these bugs and I'm trying to fix them
+      but this does really take time.
+    </text>
+    <text>
+      I always welcome bug-reports and patches, as making Liquid War W 5.x.x as
+      stable and bug-free as possible is really important to me - and
+      most of the time players also appreciate stable programs 8-)
+    </text>
+  </chap>
+  
+  <chap title="Artwork">
+    <text>
+      It's hard to find people to do that kind of thing.
+      Artists are indeed pretty rare, at least artists who wish to
+      create stuff freely...
+      So if you feel like adding some theme support to Liquid War,
+      this could *really* help.
+      I used the textures I had but it would be nice
+      if one could have a "space" ambiance, an "ocean" ambiance
+      or a "desert" ambiance.
+      This could really make the game better I think.
+    </text>
+    <text>
+      Musics (in midi format) are also appreciated.
+      Tim Chadburn spontaneously contributed the first midi files,
+      and it really pleased me 8-)
+    </text>
+  </chap>
+
+  <chap title="New features">
+    <text>
+      I regularly receive requests for new features in Liquid War.
+      Of course I do not have enough time to implement them all,
+      so they land in my "todo" list. However, most "major"
+      evolutions are now planned for Liquid War 6, since the code
+      in Liquid War 5 is bloated as hell. It's all right to
+      debug it and code minor evolutions, but that's all.
+    </text>
+    <text>
+      However, here's a list of what "could be" in the next
+      Liquid War 5.x.x releases, although it might never be
+      implemented there and come later with Liquid War 6:
+    </text>
+    <list>
+      <elem>
+	Network enhancements. Network in LW5 is somewhat buggy and
+	hard to use, improvements wouldn't harm.
+      </elem>
+      <elem>
+	Theme support. This would be a way to get rid of the ugly
+	current fonts and menus.
+      </elem>
+    </list>
+  </chap>
+
+  <chap title="Liquid War 6">
+    <text>
+      Since summer 2005, Liquid War 6, a complete rewrite of Liquid War,
+      is on its way. See 
+      "http://www.ufoot.org/liquidwar/liquidwar6" 
+      for more informations.
+    </text>
+  </chap>
+
+</file>

Added: unstable/liquidwar/branches/upstream/current/doc/xml/userlevels.xml
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/xml/userlevels.xml	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/xml/userlevels.xml	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE file SYSTEM "file:xml/file.dtd">
+<file title="User levels">
+
+  <chap title="A piece of advice"> 
+    <text>
+      You can use your own levels whith Liquid War 5.
+      The only thing you have to do is to put your own 256-colors vbitmap files
+      in a special directory, and the program will use them.
+      Currently, BMP, LBM, PCX, and TGA files are supported.
+      It is a good thing to use 256 colors bitmaps,
+      for they waste less disk space than truecolor bitmaps,
+      and Liquid War 5 converts all bitmaps to 32 colors bitmaps.
+      Additionnally, truecolor bitmaps might cause the DOS version
+      to crash randomly...
+      2-color bitmaps will also cause the program to crash.
+      I warned you!
+    </text>
+    <text>
+      The best thing you can do to create your user levels
+      is to have a look at the few user files I put in the .zip file
+      and try at first to do something that looks about the same!
+    </text>
+  </chap>
+
+  <chap title="Maps">
+    <text> 
+      Liquid War 5 does many checks on user levels
+      and is much safer than Liquid War 3.
+      Still, try and help the program not to crash, if possible. 
+    </text>
+    <text>
+      Liquid War considers that dark colors are walls
+      and bright colors are associated to the playable area.
+      So you can draw your walls in black, dark blue, etc...
+      And the rest of the map can be of any bright color
+      such as white or yellow.
+    </text>
+    <text>
+      You can draw a small map on a big bitmap,
+      as long as you use a bright background color.
+      Liquid War will autodetect the range of your map
+      and add the border line if necessary.
+    </text>
+    <text>
+      Liquid War re-orders all the maps,
+      so that the smallest ones are on the left
+      and the most complicated ones on the right
+      when you choose them with the slider
+      in the "map" menu.
+      So if you can't find the map you just draw,
+      don't worry, it is probably just mixed with
+      the levels from the .dat file.
+    </text>
+    <text>
+      The default path for maps is "custom\map\" on windows, and
+      "/usr/local/share/games/liquidwar/map" on GNU/Linux.
+    </text>
+  </chap>
+
+  <chap title="Textures">
+    <text> 
+      All you have to do is put a bitmap in the default directory
+      which is "custom\texture\" on windows, and 
+      "/usr/local/share/games/liquidwar/texture" on GNU/Linux.
+    </text>
+  </chap>
+
+  <chap title="Textures">
+    <text>
+      As of Liquid War 5.6.x, it's possible to associate a map with
+      a texture. All you need is to call the maps with the same name
+      (case is important, lowercase recommendend...). Look at the
+      "meditate" custom map which is shipped with Liquid War for
+      instance.
+    </text>
+    <text>
+      This also works with internal builtin maps (those stored in
+      the datafile) so for instance if you name a custom texture
+      "world1.bmp" it will automatically be associated to the builtin
+      map world1 (to figure out internal names you have to unpack
+      the source distribution and look in the ./data directory).
+      This also works the other way, if you name a map "wood2.bmp"
+      it will be automatically associated with the builtin texture
+      wood2.
+    </text>
+    <text>
+      Associating a texture with a map requires more work than
+      designing a simple map, but the results is usually much
+      nicer. See the "Kasper - ..." series of maps for instance.
+    </text>
+  </chap>
+
+  <chap title="Send your levels">
+    <text>
+      Maybe you will find that the original levels are ugly and unplayable.
+      Well, if you have made user levels and think they are great,
+      just send them to the Liquid War user mailing list.
+      Please use only 256 colors bitmap and zip them before sending them,
+      or else they might be blocked by my provider...
+    </text>
+    <text>
+      As of today, dozens of user maps have already been included
+      in Liquid War, this is very nice for it happens that every
+      map designer has his own personnal tastes, so the maps all
+      look different.
+    </text>
+    <text>
+      Still, to be included in Liquid War's mainstream distribution,
+      your maps will need to be placed under the terms of the 
+      GNU General Public License, or at least a compatible license.
+      You should have received a copy of this license with Liquid War
+      anyway. Read it 8-)
+    </text>
+    <text>
+      Of course, you can use *any* map when playing. You can even
+      play with a bitmap you got from a proprietary source - such a
+      proprietary game you bought for instance - but the point
+      is that I can't - and you can't either - distribute such a map
+      along with Liquid War.
+    </text>
+    <text>
+      However, this is enough legal boring stuff! What you should keep
+      in mind is that I'm always happy when I receive maps from
+      players, and it's a pleasure for me to include them in the
+      mainstream distribution.
+    </text>
+  </chap>
+
+</file>

Added: unstable/liquidwar/branches/upstream/current/doc/xml/wip.xml
===================================================================
--- unstable/liquidwar/branches/upstream/current/doc/xml/wip.xml	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/doc/xml/wip.xml	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE file SYSTEM "file:xml/file.dtd">
+<file title="Work in progress">
+  <chap title="Note on releases">
+    <text>
+      Whenever Liquid War is released, I usually pass
+      the good news to Freshmeat
+      ( "http://freshmeat.net/projects/liquidwar/" ).
+      Then all releases are accessible from the main
+      download page, which is "http://www.ufoot.org/liquidwar/download".
+    </text>
+    <text>
+      Releasing the game takes time, for I want all binaries
+      to install properly and sources to compile cleanly.
+      Therefore there might be some delay before the time
+      coding is over and the time a release is actually
+      ready.
+      So for impatients and/or for people who need to test
+      out the very latest versions (eg someone who wants
+      to compile the game on a new platform), it's possible
+      to access the source repository directly.
+    </text>
+  </chap>
+  <chap title="About GNU Arch">
+    <text>
+      I use GNU Arch (Tom Lord's Arch in fact, 
+      "http://www.gnu.org/software/gnu-arch/" ) instead of the
+      previously used CVS. Indeed, tla has some very fancy features
+      such as signing patches with gpg, and I'm tired of suffering
+      CVS limitations.
+    </text>
+    <text>
+      So FYI the previously active CVS repositories, on Sourceforge
+      and Savannah, are currently unmaintained.
+    </text>
+  </chap>
+  <chap title="How to get latest releases">
+    <list>
+      <elem>
+	Step 1: read the excellent Arch tutorial
+	"http://regexps.srparish.net/www/tutorial/html/arch.html"
+	if you are not familiar with tla. I admit there's
+	a steep learning curve, but it's yet clear and understandable.
+      </elem>
+      <elem>
+	Step 2: point on my repository, which is accessible (read-only) on
+	"http://ufoot.hd.free.fr/depot/pub/2005-freesoftware/liquidwar/".
+	Should this address move, try "http://ufoot.hd.free.fr/depot/pub/"
+	and browse until you find Liquid War.
+      </elem>
+    </list>
+    <text>
+      Note that "http://ufoot.hd.free.fr" is a personnal web server
+      located in my living room. It uses a simple DSL connection,
+      so bandwidth won't be exceptionnally high, and it may suffer
+      long and unexpected downtimes.
+    </text>
+    <text>
+      If you are interested, I can open this repository in read/write
+      mode, however one of the points of GNU Arch is that it allows
+      cooperative developpement with multiple depots, so this isn't
+      mandatory. And anyways, importing myself patches received
+      by email has never been a real burden.
+    </text>
+  </chap>
+</file>

Added: unstable/liquidwar/branches/upstream/current/fix.sh
===================================================================
--- unstable/liquidwar/branches/upstream/current/fix.sh	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/fix.sh	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,116 @@
+#!/bin/sh
+#
+# This script has been ripped from the Allegro game library.
+# It handles the CR/LF in the text files so that there are
+# no conflicts between DOS/Windows and UNIX text readers.
+
+proc_help()
+{
+   echo "Usage: ./fix.sh {unix|dos}"
+   exit 1
+}
+
+proc_fix_unix()
+{
+   proc_filelist
+   FILELIST="$FILELIST `find . -type f "(" \
+   	-name "*.sh" -o \
+        -name "*.in" -o \
+        -name "config.guess" -o \
+        -name "config.sub" -o \
+        -name "install-sh" -o \
+        -name "liquidward" \
+	")"`" 
+   proc_dtou
+   proc_chmod
+}
+
+proc_fix_dos()
+{
+   proc_filelist
+   FILELIST="$FILELIST `find . -type f "(" \
+   	-name "*.bat" -o \
+        -name "*.js" \
+	")"`" 
+   proc_utod
+}
+
+proc_filelist()
+{
+   # common files.
+   FILELIST=`find . -type f "(" \
+      -name "*.c" -o \
+      -name "*.h" -o \
+      -name "*.s" -o \
+      -name "*.txt" -o \
+      -name "*.xml" -o \
+      -name "*.html" -o \
+      -name "*.tex" -o \
+      -name "*.texi" -o \
+      -name "*.man" -o \
+      -name "*.py" -o \
+      -name "*.win" -o \
+      -name "*.dos" -o \
+      -name "ALLEGRO" -o \
+      -name "COPYING" -o \
+      -name "INSTALL" -o \
+      -name "README" -o \
+      -name "README.*" -o \
+      -name "ChangeLog" \
+   ")"`
+}
+
+proc_chmod()
+{
+   echo "Changing file attributes..."
+   find . -type d | xargs chmod 755
+   find . -type f | xargs chmod 644
+   find . -type f "(" \
+   	-name "configure" -o \
+	-name "config.status" -o \
+	-name "config.guess" -o \
+	-name "config.sub" -o \
+	-name "install-sh" -o \
+	-name "*.sh" -o \
+	-name "liquidwar" -o \
+	-name "liquidwar-server" -o \
+	-name "liquidward" \
+   ")" | xargs chmod 755
+}
+
+proc_utod()
+{
+   echo "Converting files from Unix to DOS/Win32..."
+   for file in $FILELIST; do
+      #echo "$file"
+      cp $file _tmpfile
+      perl -p -i -e "s/([^\r]|^)\n/\1\r\n/" _tmpfile
+      touch -r $file _tmpfile
+      mv _tmpfile $file
+   done
+}
+
+proc_dtou()
+{
+   echo "Converting files from DOS/Win32 to Unix..."
+   for file in $FILELIST; do
+      #echo "$file"
+      mv $file _tmpfile
+      tr -d '\015' < _tmpfile > $file
+      touch -r _tmpfile $file
+      rm _tmpfile
+   done
+}
+
+# prepare allegro for the given platform.
+
+case "$1" in
+   "unix"    ) proc_fix_unix;;
+   "dos"     ) proc_fix_dos;;
+   *         ) proc_help;;
+esac
+
+echo "Done!"
+
+exit 0
+


Property changes on: unstable/liquidwar/branches/upstream/current/fix.sh
___________________________________________________________________
Name: svn:executable
   + 

Added: unstable/liquidwar/branches/upstream/current/install-sh
===================================================================
--- unstable/liquidwar/branches/upstream/current/install-sh	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/install-sh	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,250 @@
+#! /bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission.  M.I.T. makes no representations about the
+# suitability of this software for any purpose.  It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.  It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+    case $1 in
+	-c) instcmd="$cpprog"
+	    shift
+	    continue;;
+
+	-d) dir_arg=true
+	    shift
+	    continue;;
+
+	-m) chmodcmd="$chmodprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-o) chowncmd="$chownprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-g) chgrpcmd="$chgrpprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-s) stripcmd="$stripprog"
+	    shift
+	    continue;;
+
+	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
+	    shift
+	    continue;;
+
+	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+	    shift
+	    continue;;
+
+	*)  if [ x"$src" = x ]
+	    then
+		src=$1
+	    else
+		# this colon is to work around a 386BSD /bin/sh bug
+		:
+		dst=$1
+	    fi
+	    shift
+	    continue;;
+    esac
+done
+
+if [ x"$src" = x ]
+then
+	echo "install:	no input file specified"
+	exit 1
+else
+	true
+fi
+
+if [ x"$dir_arg" != x ]; then
+	dst=$src
+	src=""
+	
+	if [ -d $dst ]; then
+		instcmd=:
+	else
+		instcmd=mkdir
+	fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad 
+# if $src (and thus $dsttmp) contains '*'.
+
+	if [ -f $src -o -d $src ]
+	then
+		true
+	else
+		echo "install:  $src does not exist"
+		exit 1
+	fi
+	
+	if [ x"$dst" = x ]
+	then
+		echo "install:	no destination specified"
+		exit 1
+	else
+		true
+	fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+	if [ -d $dst ]
+	then
+		dst="$dst"/`basename $src`
+	else
+		true
+	fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+#  this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='	
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+	pathcomp="${pathcomp}${1}"
+	shift
+
+	if [ ! -d "${pathcomp}" ] ;
+        then
+		$mkdirprog "${pathcomp}"
+	else
+		true
+	fi
+
+	pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+	$doit $instcmd $dst &&
+
+	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+	if [ x"$transformarg" = x ] 
+	then
+		dstfile=`basename $dst`
+	else
+		dstfile=`basename $dst $transformbasename | 
+			sed $transformarg`$transformbasename
+	fi
+
+# don't allow the sed command to completely eliminate the filename
+
+	if [ x"$dstfile" = x ] 
+	then
+		dstfile=`basename $dst`
+	else
+		true
+	fi
+
+# Make a temp file name in the proper directory.
+
+	dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+	$doit $instcmd $src $dsttmp &&
+
+	trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing.  If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+	$doit $rmcmd -f $dstdir/$dstfile &&
+	$doit $mvcmd $dsttmp $dstdir/$dstfile 
+
+fi &&
+
+
+exit 0


Property changes on: unstable/liquidwar/branches/upstream/current/install-sh
___________________________________________________________________
Name: svn:executable
   + 

Added: unstable/liquidwar/branches/upstream/current/liquidwar.spec
===================================================================
--- unstable/liquidwar/branches/upstream/current/liquidwar.spec	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/liquidwar.spec	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,117 @@
+Summary: A unique multiplayer wargame.
+Summary(fr): Un "wargame" multijoueur inédit.
+Summary(de): Ein einzigartiges Kriegspiel für mehrere Spieler.
+Name: liquidwar
+Version: 5.6.3
+Release: 1
+Copyright: GPL
+Group: Amusements/Games
+Source: http://freesoftware.fsf.org/download/liquidwar/liquidwar-5.6.3.tar.gz
+URL: http://www.ufoot.org/liquidwar
+Vendor: Christian Mauduit <ufoot at ufoot.org>
+Packager: Christian Mauduit <ufoot at ufoot.org>
+BuildRoot: %{_tmppath}/%{name}-buildroot
+
+%description
+Liquid War is a unique multiplayer wargame. Its rules are
+truely original and have been invented by Thomas Colcombet.
+You control an army of liquid and have to try and eat your
+opponents. A single player mode is available, but the game is
+definitely designed to be multiplayer, and has network support.
+
+%description -l fr
+Liquid War est un "wargame" multijoueur inédit. Ses règles sont vraiment
+originales et ont été inventées par Thomas Colcombet. L'idée est de
+contrôler une armée de liquide et d'essayer de "manger" ses adversaires.
+Il est possible de jouer seul, mais le jeux est conçu pour se jouer à
+plusieurs, un mode réseau étant disponible.
+
+%description -l de
+Liquid War ist ein einzigartiges Kriegsspiel für mehrere Spieler. Die
+Regeln sind wahrhaft neuartig und wurden von Thomas Colcombet entwickelt.
+Man steuert eine flüssige Armee und muss versuchen die Gegner aufzufressen.
+Es gibt einen Einzelspielermodus, aber das Spiel ist eindeutig auf mehrere
+Spieler ausgelegt und unterstützt das Spielen über Netzwerk.
+
+%description -l dk
+Liquid war er et unikt multiplayer krigsspil. Reglerne er
+uhyre originale og er opfundet af Thomas Colcombet. Du styrer
+en hær af væske og skal prøve at æde dine modstandere.
+Liquid War kan spilles alene, men er helt afgjort designet
+til multiplayer, og har netværks-support.
+
+# Preparation of the package
+%prep
+%setup
+./configure --prefix=%{_prefix} --target=%{_target}
+
+# Building the package
+%build
+make 
+
+# Installing the package
+# The "make uninstall" is important since it prevents rpm from
+# putting old unused files in the archive.
+%install
+export DESTDIR=%{buildroot} && make uninstall && make install 
+
+# Cleaning
+%clean
+rm -rf %{buildroot}
+
+# Pre-install script
+%pre
+
+# Post-install script
+# It basically adds the info page to the Top info page.
+%post
+if which install-info; then if test -d %{_prefix}/info; then if test -f %{_prefix}/info/dir; then install-info --info-dir=%{_prefix}/info %{_prefix}/share/info/liquidwar.info.gz; fi; fi; fi
+
+# Pre-uninstall script
+%preun
+
+# Post-uninstall script
+# It basically removes the info page to the Top info page.
+%postun
+if which install-info; then if test -d %{_prefix}/info; then if test -f %{_prefix}/info/dir; then install-info --info-dir=%{_prefix}/info --remove liquidwar; fi; fi; fi
+
+%files
+%defattr(-,root,root)
+%{_prefix}/games/liquidwar
+%{_prefix}/games/liquidwar-server
+%{_prefix}/bin/liquidwar
+%{_prefix}/bin/liquidwar-server
+%{_prefix}/share/games/liquidwar/
+%{_prefix}/share/doc/liquidwar/
+%{_prefix}/share/man/man6/liquidwar.6*
+%{_prefix}/share/man/man6/liquidwar-server.6*
+%{_prefix}/share/info/liquidwar.info*
+%{_prefix}/share/pixmaps/liquidwar.xpm
+
+%changelog
+
+* Fri Dec 13 2002 Christian Mauduit <ufoot at ufoot.org>
+- Added French and German informations.
+
+* Fri Jul 12 2002 Christian Mauduit <ufoot at ufoot.org>
+- Used wildcards for man pages names, to solve a bzip2 vs gzip issue.
+
+* Wed Jul 10 2002 Christian Mauduit <ufoot at ufoot.org>
+- Managed to make GPG signing to work, so RPMs should be signed now.
+
+* Tue Mar 12 2002 Christian Mauduit <ufoot at ufoot.org>
+- Fixed some buildroot bugs
+- Replaced install-info --infodir=... by --info-dir=...
+
+* Mon Mar 11 2002 Christian Mauduit <ufoot at ufoot.org> 
+- Recompiled with Allegro's rpm (fixes the error:
+  "/usr/lib/liballeg.so.4.0: undefined symbol: _poly_scanline_gcol8")
+- Fixed the post-install script
+
+* Sat Feb 23 2002 Christian Mauduit <ufoot at ufoot.org> 
+- Added proper "--target" support.
+- Added info documentation with install and uninstall scripts
+
+* Thu Jan 28 2002 Christian Mauduit <ufoot at ufoot.org> 
+- My first rpm build of Liquid War
+

Added: unstable/liquidwar/branches/upstream/current/liquidwar.spec.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/liquidwar.spec.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/liquidwar.spec.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,117 @@
+Summary: A unique multiplayer wargame.
+Summary(fr): Un "wargame" multijoueur inédit.
+Summary(de): Ein einzigartiges Kriegspiel für mehrere Spieler.
+Name: liquidwar
+Version: @VERSION@
+Release: @VERSION_REL@
+Copyright: GPL
+Group: Amusements/Games
+Source: http://freesoftware.fsf.org/download/liquidwar/liquidwar-@VERSION@.tar.gz
+URL: http://www.ufoot.org/liquidwar
+Vendor: Christian Mauduit <ufoot at ufoot.org>
+Packager: Christian Mauduit <ufoot at ufoot.org>
+BuildRoot: %{_tmppath}/%{name}-buildroot
+
+%description
+Liquid War is a unique multiplayer wargame. Its rules are
+truely original and have been invented by Thomas Colcombet.
+You control an army of liquid and have to try and eat your
+opponents. A single player mode is available, but the game is
+definitely designed to be multiplayer, and has network support.
+
+%description -l fr
+Liquid War est un "wargame" multijoueur inédit. Ses règles sont vraiment
+originales et ont été inventées par Thomas Colcombet. L'idée est de
+contrôler une armée de liquide et d'essayer de "manger" ses adversaires.
+Il est possible de jouer seul, mais le jeux est conçu pour se jouer à
+plusieurs, un mode réseau étant disponible.
+
+%description -l de
+Liquid War ist ein einzigartiges Kriegsspiel für mehrere Spieler. Die
+Regeln sind wahrhaft neuartig und wurden von Thomas Colcombet entwickelt.
+Man steuert eine flüssige Armee und muss versuchen die Gegner aufzufressen.
+Es gibt einen Einzelspielermodus, aber das Spiel ist eindeutig auf mehrere
+Spieler ausgelegt und unterstützt das Spielen über Netzwerk.
+
+%description -l dk
+Liquid war er et unikt multiplayer krigsspil. Reglerne er
+uhyre originale og er opfundet af Thomas Colcombet. Du styrer
+en hær af væske og skal prøve at æde dine modstandere.
+Liquid War kan spilles alene, men er helt afgjort designet
+til multiplayer, og har netværks-support.
+
+# Preparation of the package
+%prep
+%setup
+./configure --prefix=%{_prefix} --target=%{_target}
+
+# Building the package
+%build
+make 
+
+# Installing the package
+# The "make uninstall" is important since it prevents rpm from
+# putting old unused files in the archive.
+%install
+export DESTDIR=%{buildroot} && make uninstall && make install 
+
+# Cleaning
+%clean
+rm -rf %{buildroot}
+
+# Pre-install script
+%pre
+
+# Post-install script
+# It basically adds the info page to the Top info page.
+%post
+if which install-info; then if test -d %{_prefix}/info; then if test -f %{_prefix}/info/dir; then install-info --info-dir=%{_prefix}/info %{_prefix}/share/info/liquidwar.info.gz; fi; fi; fi
+
+# Pre-uninstall script
+%preun
+
+# Post-uninstall script
+# It basically removes the info page to the Top info page.
+%postun
+if which install-info; then if test -d %{_prefix}/info; then if test -f %{_prefix}/info/dir; then install-info --info-dir=%{_prefix}/info --remove liquidwar; fi; fi; fi
+
+%files
+%defattr(-,root,root)
+%{_prefix}/games/liquidwar
+%{_prefix}/games/liquidwar-server
+%{_prefix}/bin/liquidwar
+%{_prefix}/bin/liquidwar-server
+%{_prefix}/share/games/liquidwar/
+%{_prefix}/share/doc/liquidwar/
+%{_prefix}/share/man/man6/liquidwar.6*
+%{_prefix}/share/man/man6/liquidwar-server.6*
+%{_prefix}/share/info/liquidwar.info*
+%{_prefix}/share/pixmaps/liquidwar.xpm
+
+%changelog
+
+* Fri Dec 13 2002 Christian Mauduit <ufoot at ufoot.org>
+- Added French and German informations.
+
+* Fri Jul 12 2002 Christian Mauduit <ufoot at ufoot.org>
+- Used wildcards for man pages names, to solve a bzip2 vs gzip issue.
+
+* Wed Jul 10 2002 Christian Mauduit <ufoot at ufoot.org>
+- Managed to make GPG signing to work, so RPMs should be signed now.
+
+* Tue Mar 12 2002 Christian Mauduit <ufoot at ufoot.org>
+- Fixed some buildroot bugs
+- Replaced install-info --infodir=... by --info-dir=...
+
+* Mon Mar 11 2002 Christian Mauduit <ufoot at ufoot.org> 
+- Recompiled with Allegro's rpm (fixes the error:
+  "/usr/lib/liballeg.so.4.0: undefined symbol: _poly_scanline_gcol8")
+- Fixed the post-install script
+
+* Sat Feb 23 2002 Christian Mauduit <ufoot at ufoot.org> 
+- Added proper "--target" support.
+- Added info documentation with install and uninstall scripts
+
+* Thu Jan 28 2002 Christian Mauduit <ufoot at ufoot.org> 
+- My first rpm build of Liquid War
+

Added: unstable/liquidwar/branches/upstream/current/misc/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/misc/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/misc/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,2 @@
+liquidward
+macosx_info.plist

Added: unstable/liquidwar/branches/upstream/current/misc/fix_map_palette.sh
===================================================================
--- unstable/liquidwar/branches/upstream/current/misc/fix_map_palette.sh	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/misc/fix_map_palette.sh	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+#############################################################################
+# Liquid War is a multiplayer wargame                                       #
+# Copyright (C) 1998-2005 Christian Mauduit                                 #
+#                                                                           #
+# 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 #
+#                                                                           #
+# Liquid War homepage : http://www.ufoot.org/liquidwar                      #
+# Contact author      : ufoot at ufoot.org                                     #
+#############################################################################
+
+# Dirty hack based on Image Magick to make maps more "liquidwarmap"
+# friendly. Indeed, we want for instance _all_ the black zones to
+# have index 0. Using Image Magick can help achieving this.
+#
+# The script processes .bmp files only since processing .pcx files
+# seems to wreck them up - from Gimp's point of view at least.
+#
+# Use this script with caution.
+
+#for f in ../data/map/*.bmp ; do
+for f in $* ; do
+    f="../data/map/$f"
+    echo $f
+    mogrify -colors 256 $f
+    #mogrify -map ../data/map/world1.bmp $f
+    mogrify -map $f $f
+done
+


Property changes on: unstable/liquidwar/branches/upstream/current/misc/fix_map_palette.sh
___________________________________________________________________
Name: svn:executable
   + 

Added: unstable/liquidwar/branches/upstream/current/misc/globe.icns
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/misc/globe.icns
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/misc/globe.png
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/misc/globe.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/misc/globe.pov
===================================================================
--- unstable/liquidwar/branches/upstream/current/misc/globe.pov	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/misc/globe.pov	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,16 @@
+// Persistence of Vision Ray Tracer Scene Description File for Liquid War icon.
// Copyright (C) 2003  Ryan Brown
+
+// 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.
+
#version 3.5;
#include "colors.inc"
#include "textures.inc"
#include "glass.inc"
//#include "woods.inc"
global_settings {
  assumed_gamma 1.2
  max_trace_level 5
}
// ----------------------------------------
camera {
//  orthographic
  location  <0.0, 10, -20.0>
  direction 1.59*z
  right     x*image_width/image_height
  look_at   1.6*<0.0, 3.0,  0.0>
}
#declare BGColor = Gray50;
background{Gray35}
light_source {
  30*<1, 5, -3>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  area_light <10, 0, 0>, <0, 0, 10>, 5, 5
  adaptive 1
  jitter
}
// ----------------------------------------



#declare Globe = sphere {<0,6,0>,5}
#declare Ring = torus {
	4.001,1.001
	translate 2*y
		
}

#declare Base = difference {
	cylinder {0,2*y,4}
	object { Ring }
	object { Globe }
}
object {
	Base
	texture { 
		DMFDarkOak
		rotate 45*<1,1,0>	
	}
	
}
union {
object {
	Globe
	//material { M_Glass4 }
	//material {M_NB_Old_Glass}
	texture { T_Glass4 }
	interior { I_Glass }
}
blob {
	threshold .6
	sphere { <-1.5,7.5,0>, 2.5, .75 pigment { Red } }
	sphere { <0,7.5,1.5>, 2.5, .5 pigment { Red } }
	sphere { <-1.5,6,-1.5>, 2.5, .5 pigment {Red} }
	sphere { <.75, 6, -.75>, 2.5, .25 pigment {Yellow}}
	sphere { <1.5, 4.5,0>, 2.5, .75 pigment { Yellow } }
	sphere { <0,4.5,-1.5>, 2.5, .5 pigment { Yellow } }
	sphere { <1.5,6,1.5>, 2.5, .5 pigment {Yellow} }
	sphere { <-.75, 6, .75>, 2.5, .25 pigment {Red}}
}

}
\ No newline at end of file

Added: unstable/liquidwar/branches/upstream/current/misc/gpl_de.html
===================================================================
--- unstable/liquidwar/branches/upstream/current/misc/gpl_de.html	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/misc/gpl_de.html	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,527 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//DE"><html><head><!--Converted with LaTeX2HTML 97.1 (release) (July 13th, 1997)
+ by Nikos Drakos (nikos at cbl.leeds.ac.uk), CBLU, University of Leeds
+* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
+* with significant contributions from:
+  Jens Lippman, Marek Rouchal, Martin Wilck and others --><title>GNU General Public License</title>
+
+<meta name="description" content="GNU General Public License">
+<meta name="keywords" content="gpl-ger">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta http-equiv="Content-Type" content="text/html; charset=iso_8859_1">
+<!-- <LINK REL="STYLESHEET" HREF="gpl-ger.css"> --></head>
+
+
+<body>
+<p>  </p><h1><a name="SECTION00010000000000000000">
+Deutsche Übersetzung der
+<br>
+GNU General Public License</a>
+</h1>
+<p>   <small>
+    Erstellt im Auftrag der S.u.S.E. GmbH <tt>http://www.suse.de</tt> <br>
+von Katja Lachmann Übersetzungen, <br>
+    überarbeitet von Peter Gerwinski, G-N-U GmbH <tt>http://www.g-n-u.de</tt> <br>
+    (31. Oktober 1996, 4. Juni 2000)
+</small></p><p><small>  </small></p><p>
+</p><p>
+<small><br>
+</small></p><p>
+<small>Diese Übersetzung wird mit der Absicht angeboten, das
+  Verständnis der <em>GNU General Public License</em>  (GNU-GPL) zu
+  erleichtern. Es handelt sich jedoch nicht um eine offizielle oder im
+  rechtlichen Sinne anerkannte Übersetzung.
+</small></p><p>
+<small>Die <em>Free Software Foundation</em>  (FSF) ist nicht der Herausgeber
+  dieser Übersetzung, und sie hat diese Übersetzung auch nicht als
+  rechtskräftigen Ersatz für die Original-GNU-GPL anerkannt. Da die
+  Übersetzung nicht sorgfältig von Anwälten überprüft wurde, können die
+  Übersetzer nicht garantieren, daß die Übersetzung die rechtlichen
+  Aussagen der GNU-GPL exakt wiedergibt. Wenn Sie sichergehen wollen,
+  daß von Ihnen geplante Aktivitäten im Sinne der GNU-GPL gestattet
+  sind, halten Sie sich bitte an die englischsprachige Originalversion.
+</small></p><p>
+<small>Die <em>Free Software Foundation</em>  möchte Sie darum bitten, diese
+  Übersetzung nicht als offizielle Lizenzbedingungen für von Ihnen
+  geschriebene Programme zu verwenden. Bitte benutzen Sie hierfür
+  stattdessen die von der <em>Free Software Foundation</em>  herausgegebene
+  englischsprachige Originalversion.
+</small></p><p><small>  </small></p><p>
+</p><p>
+<small><br>
+</small></p><p><small>  <em>This is a translation of the GNU General Public License
+  into German. This translation is distributed in the hope that it will
+  facilitate understanding, but it is not an official or legally
+  approved translation.</em>
+</small></p><p><small>  <em>The Free Software Foundation is not the publisher of this
+  translation and has not approved it as a legal substitute for the
+  authentic GNU General Public License. The translation has not been
+  reviewed carefully by lawyers, and therefore the translator cannot be
+  sure that it exactly represents the legal meaning of the GNU General
+  Public License. If you wish to be sure whether your planned activities
+  are permitted by the GNU General Public License, please refer to the
+  authentic English version.</em>
+</small></p><p><small>  <em>The Free Software Foundation strongly urges you not to use this
+  translation as the official distribution terms for your programs;
+  instead, please use the authentic English version published by the
+  Free Software Foundation.</em>
+</small></p><p><small>  </small></p><h1 align="center"><small>GNU General Public License</small></h1>
+<p align="center"><small><strong>Deutsche Übersetzung der Version 2, Juni 1991</strong></small></p>
+<p align="center"><small><strong>Copyright © 1989, 1991 Free Software Foundation, Inc.
+<br>
+<br>
+59 Temple Place, Suite 330, Boston, MA 02111-1307, USA</strong></small></p>
+<p align="left">
+</p><p align="left"><small><small><a name="tex2html2" href="mailto:peter at gerwinski.de">peter at gerwinski.de</a></small></small></p>
+<p>
+<small>Es ist jedermann gestattet, diese Lizenzurkunde zu
+  vervielfältigen und unveränderte Kopien zu verbreiten; Änderungen sind
+  jedoch nicht erlaubt.
+</small></p><p><small>  </small></p><p>
+<small><br>
+</small></p><p><small>  <b>Diese Übersetzung ist kein rechtskräftiger Ersatz für
+  die englischsprachige Originalversion!</b>
+</small></p><p><small>  </small></p><h1><a name="SECTION00020000000000000000">
+Vorwort</a>
+</h1>
+<p>
+Die meisten Softwarelizenzen sind daraufhin entworfen worden, Ihnen
+  die Freiheit zu nehmen, die Software weiterzugeben und zu verändern.
+  Im Gegensatz dazu soll Ihnen die <em>GNU General Public License</em> ,
+  die Allgemeine Öffentliche GNU-Lizenz, ebendiese Freiheit garantieren.
+  Sie soll sicherstellen, daß die Software für alle Benutzer frei ist.
+  Diese Lizenz gilt für den Großteil der von der <em>Free Software
+  Foundation</em>  herausgegebenen Software und für alle anderen Programme,
+  deren Autoren ihr Datenwerk dieser Lizenz unterstellt haben.  Auch Sie
+  können diese Möglichkeit der Lizenzierung für Ihre Programme anwenden.
+  (Ein anderer Teil der Software der <em>Free Software Foundation</em> 
+  unterliegt stattdessen der <em>GNU Library General Public License</em> ,
+  der Allgemeinen Öffentlichen GNU-Lizenz für Bibliotheken.)
+  [Mittlerweile wurde die GNU Library Public License von der GNU Lesser
+  Public License abgelöst - Anmerkung des Übersetzers.]
+</p><p>
+Die Bezeichnung <em>,,freie`` Software</em>  bezieht sich auf Freiheit,
+  nicht auf den Preis. Unsere Lizenzen sollen Ihnen die Freiheit
+  garantieren, Kopien freier Software zu verbreiten (und etwas für
+  diesen Service zu berechnen, wenn Sie möchten), die Möglichkeit, die
+  Software im Quelltext zu erhalten oder den Quelltext auf Wunsch zu
+  bekommen. Die Lizenzen sollen garantieren, daß Sie die Software ändern
+  oder Teile davon in neuen freien Programmen verwenden dürfen - und
+  daß Sie wissen, daß Sie dies alles tun dürfen.
+</p><p>
+Um Ihre Rechte zu schützen, müssen wir Einschränkungen machen, die
+  es jedem verbieten, Ihnen diese Rechte zu verweigern oder Sie
+  aufzufordern, auf diese Rechte zu verzichten. Aus diesen
+  Einschränkungen folgen bestimmte Verantwortlichkeiten für Sie, wenn
+  Sie Kopien der Software verbreiten oder sie verändern.
+</p><p>
+Beispielsweise müssen Sie den Empfängern alle Rechte gewähren, die
+  Sie selbst haben, wenn Sie - kostenlos oder gegen Bezahlung - Kopien
+  eines solchen Programms verbreiten. Sie müssen sicherstellen, daß
+  auch die Empfänger den Quelltext erhalten bzw. erhalten können. Und
+  Sie müssen ihnen diese Bedingungen zeigen, damit sie ihre Rechte
+  kennen.
+</p><p>
+Wir schützen Ihre Rechte in zwei Schritten: (1) Wir stellen die
+  Software unter ein Urheberrecht (Copyright), und (2) wir bieten Ihnen
+  diese Lizenz an, die Ihnen das Recht gibt, die Software zu
+  vervielfältigen, zu verbreiten und/oder zu verändern.
+</p><p>
+Um die Autoren und uns zu schützen, wollen wir darüberhinaus
+  sicherstellen, daß jeder erfährt, daß für diese freie Software
+  keinerlei Garantie besteht. Wenn die Software von jemand anderem
+  modifiziert und weitergegeben wird, möchten wir, daß die Empfänger
+  wissen, daß sie nicht das Original erhalten haben, damit irgendwelche
+  von anderen verursachte Probleme nicht den Ruf des ursprünglichen
+  Autors schädigen.
+</p><p>
+Schließlich und endlich ist jedes freie Programm permanent durch
+  Software-Patente bedroht. Wir möchten die Gefahr ausschließen, daß
+  Distributoren eines freien Programms individuell Patente lizensieren
+  - mit dem Ergebnis, daß das Programm proprietär würde. Um dies zu
+  verhindern, haben wir klargestellt, daß jedes Patent entweder für
+  freie Benutzung durch jedermann lizenziert werden muß oder überhaupt
+  nicht lizenziert werden darf.
+</p><p>
+Es folgen die genauen Bedingungen für die Vervielfältigung,
+  Verbreitung und Bearbeitung:
+</p><p>  </p><h1><a name="SECTION00030000000000000000">
+Allgemeine Öffentliche GNU-Lizenz
+<br>
+Bedingungen für die Vervielfältigung,
+<br>
+Verbreitung und Bearbeitung</a>
+</h1>
+<p>  §0. Diese Lizenz gilt für jedes Programm und jedes andere
+  Datenwerk, in dem ein entsprechender Vermerk des Copyright-Inhabers
+  darauf hinweist, daß das Datenwerk unter den Bestimmungen dieser <em>
+  General Public License</em> verbreitet werden darf. Im folgenden wird
+  jedes derartige Programm oder Datenwerk als ,,das Programm``
+  bezeichnet; die Formulierung ,,auf dem Programm basierendes
+  Datenwerk`` bezeichnet das Programm sowie jegliche Bearbeitung des
+  Programms im urheberrechtlichen Sinne, also ein Datenwerk, welches das
+  Programm, auch auszugsweise, sei es unverändert oder verändert
+  und/oder in eine andere Sprache übersetzt, enthält. (Im folgenden wird
+  die Übersetzung ohne Einschränkung als ,,Bearbeitung`` eingestuft.)
+  Jeder Lizenznehmer wird im folgenden als ,,Sie`` angesprochen.
+</p><p>
+Andere Handlungen als Vervielfältigung, Verbreitung und Bearbeitung
+  werden von dieser Lizenz nicht berührt; sie fallen nicht in ihren
+  Anwendungsbereich. Der Vorgang der Ausführung des Programms wird nicht
+  eingeschränkt, und die Ausgaben des Programms unterliegen dieser
+  Lizenz nur, wenn der Inhalt ein auf dem Programm basierendes Datenwerk
+  darstellt (unabhängig davon, daß die Ausgabe durch die Ausführung des
+  Programmes erfolgte). Ob dies zutrifft, hängt von den Funktionen des
+  Programms ab.
+</p><p>  §1. Sie dürfen auf beliebigen Medien unveränderte Kopien
+  des Quelltextes des Programms, wie sie ihn erhalten haben, anfertigen
+  und verbreiten. Voraussetzung hierfür ist, daß Sie mit jeder Kopie
+  einen entsprechenden Copyright-Vermerk sowie einen Haftungsausschluß
+  veröffentlichen, alle Vermerke, die sich auf diese Lizenz und das
+  Fehlen einer Garantie beziehen, unverändert lassen und desweiteren
+  allen anderen Empfängern des Programms zusammen mit dem Programm eine
+  Kopie dieser Lizenz zukommen lassen.
+</p><p>
+Sie dürfen für den eigentlichen Kopiervorgang eine Gebühr
+  verlangen. Wenn Sie es wünschen, dürfen Sie auch gegen Entgeld
+  eine Garantie für das Programm anbieten.
+</p><p>  §2. Sie dürfen Ihre Kopie(n) des Programms oder eines
+  Teils davon verändern, wodurch ein auf dem Programm basierendes Datenwerk
+  entsteht; Sie dürfen derartige Bearbeitungen unter den Bestimmungen
+  von Paragraph 1 vervielfältigen und verbreiten, vorausgesetzt, daß
+  zusätzlich alle im folgenden genannten Bedingungen erfüllt werden:
+</p><p>  </p><dl compact=""><dt>1.
+</dt><dd>Sie müssen die veränderten Dateien mit einem auffälligen Vermerk
+versehen, der auf die von Ihnen vorgenommene Modifizierung und das
+      Datum jeder Änderung hinweist.
+<p>    </p></dd><dt>2.
+</dt><dd>Sie müssen dafür sorgen, daß jede von Ihnen verbreitete oder
+      veröffentlichte Arbeit, die ganz oder teilweise von dem Programm
+      oder Teilen davon abgeleitet ist, Dritten gegenüber als Ganzes
+      unter den Bedingungen dieser Lizenz ohne Lizenzgebühren zur
+      Verfügung gestellt wird.
+<p>    </p></dd><dt>3.
+</dt><dd>Wenn das veränderte Programm normalerweise bei der Ausführung
+      interaktiv Kommandos einliest, müssen Sie dafür sorgen, daß es,
+      wenn es auf dem üblichsten Wege für solche interaktive Nutzung
+      gestartet wird, eine Meldung ausgibt oder ausdruckt, die einen
+      geeigneten Copyright-Vermerk enthält sowie einen Hinweis, daß es
+      keine Gewährleistung gibt (oder anderenfalls, daß Sie Garantie
+      leisten), und daß die Benutzer das Programm unter diesen
+      Bedingungen weiter verbreiten dürfen. Auch muß der Benutzer darauf
+      hingewiesen werden, wie er eine Kopie dieser Lizenz ansehen kann.
+      (Ausnahme: Wenn das Programm selbst interaktiv arbeitet, aber
+      normalerweise keine derartige Meldung ausgibt, muß Ihr auf dem
+      Programm basierendes Datenwerk auch keine solche Meldung
+      ausgeben).
+<p>  </p></dd></dl>
+<p>
+Diese Anforderungen gelten für das bearbeitete Datenwerk als Ganzes.
+  Wenn identifizierbare Teile des Datenwerkes nicht von dem Programm
+  abgeleitet sind und vernünftigerweise als unabhängige und
+  eigenständige Datenwerke für sich selbst zu betrachten sind, dann
+  gelten diese Lizenz und ihre Bedingungen nicht für die betroffenen
+  Teile, wenn Sie diese als eigenständige Datenwerke weitergeben.  Wenn
+  Sie jedoch dieselben Abschnitte als Teil eines Ganzen weitergeben, das
+  ein auf dem Programm basierendes Datenwerk darstellt, dann muß die
+  Weitergabe des Ganzen nach den Bedingungen dieser Lizenz erfolgen,
+  deren Bedingungen für weitere Lizenznehmer somit auf das gesamte Ganze
+  ausgedehnt werden - und somit auf jeden einzelnen Teil, unabhängig
+  vom jeweiligen Autor.
+</p><p>
+Somit ist es nicht die Absicht dieses Abschnittes, Rechte für
+  Datenwerke in Anspruch zu nehmen oder Ihnen die Rechte für Datenwerke
+  streitig zu machen, die komplett von Ihnen geschrieben wurden;
+  vielmehr ist es die Absicht, die Rechte zur Kontrolle der Verbreitung
+  von Datenwerken, die auf dem Programm basieren oder unter seiner
+  auszugsweisen Verwendung zusammengestellt worden sind, auszuüben.
+</p><p>
+Ferner bringt auch das einfache Zusammenlegen eines anderen
+  Datenwerkes, das nicht auf dem Programm basiert, mit dem Programm oder
+  einem auf dem Programm basierenden Datenwerk auf ein- und demselben
+  Speicher- oder Vertriebsmedium dieses andere Datenwerk nicht in den
+  Anwendungsbereich dieser Lizenz.
+</p><p>  §3. Sie dürfen das Programm (oder ein darauf basierendes
+  Datenwerk gemäß Paragraph 2) als Objectcode oder in ausführbarer Form
+  unter den Bedingungen der Paragraphen 1 und 2 kopieren und weitergeben
+  - vorausgesetzt, daß Sie außerdem eine der folgenden Leistungen
+  erbringen:
+</p><p>  </p><dl compact=""><dt>1.
+</dt><dd>Liefern Sie das Programm zusammen mit dem vollständigen
+zugehörigen maschinenlesbaren Quelltext auf einem für den
+      Datenaustausch üblichen Medium aus, wobei die Verteilung unter
+      den Bedingungen der Paragraphen 1 und 2 erfolgen muß. Oder:
+<p>    </p></dd><dt>2.
+</dt><dd>Liefern Sie das Programm zusammen mit einem mindestens drei Jahre
+      lang gültigen schriftlichen Angebot aus, jedem Dritten eine
+      vollständige maschinenlesbare Kopie des Quelltextes zur
+      Verfügung zu stellen - zu nicht höheren Kosten als denen, die
+      durch den physikalischen Kopiervorgang anfallen -, wobei der
+      Quelltext unter den Bedingungen der Paragraphen 1 und 2 auf einem
+      für den Datenaustausch üblichen Medium weitergegeben wird. Oder:
+<p>    </p></dd><dt>3.
+</dt><dd>Liefern Sie das Programm zusammen mit dem schriftlichen Angebot
+      der Zurverfügungstellung des Quelltextes aus, das Sie selbst
+      erhalten haben. (Diese Alternative ist nur für nicht-kommerzielle
+      Verbreitung zulässig und nur, wenn Sie das Programm als
+      Objectcode oder in ausführbarer Form mit einem entsprechenden
+      Angebot gemäß Absatz b erhalten haben.)
+<p>  </p></dd></dl>
+<p>
+Unter dem Quelltext eines Datenwerkes wird diejenige Form des
+  Datenwerkes verstanden, die für Bearbeitungen vorzugsweise verwendet
+  wird. Für ein ausführbares Programm bedeutet ,,der komplette
+  Quelltext``: Der Quelltext aller im Programm enthaltenen Module
+  einschließlich aller zugehörigen
+  Modulschnittstellen-Definitionsdateien sowie der zur
+  Compilation und Installation verwendeten Skripte. Als besondere
+  Ausnahme jedoch braucht der verteilte Quelltext nichts von dem zu
+  enthalten, was üblicherweise (entweder als Quelltext oder in binärer
+  Form) zusammen mit den Hauptkomponenten des Betriebssystems (Kernel,
+  Compiler usw.) geliefert wird, unter dem das Programm läuft - es sei
+  denn, diese Komponente selbst gehört zum ausführbaren Programm.
+</p><p>
+Wenn die Verbreitung eines ausführbaren Programms oder von Objectcode
+  dadurch erfolgt, daß der Kopierzugriff auf eine dafür vorgesehene
+  Stelle gewährt wird, so gilt die Gewährung eines gleichwertigen
+  Zugriffs auf den Quelltext als Verbreitung des Quelltextes, auch wenn
+  Dritte nicht dazu gezwungen sind, den Quelltext zusammen mit dem
+  Objectcode zu kopieren.
+</p><p>  §4. Sie dürfen das Programm nicht vervielfältigen,
+  verändern, weiter lizenzieren oder verbreiten, sofern es nicht durch
+  diese Lizenz ausdrücklich gestattet ist. Jeder anderweitige Versuch
+  der Vervielfältigung, Modifizierung, Weiterlizenzierung und
+  Verbreitung ist nichtig und beendet automatisch Ihre Rechte unter
+  dieser Lizenz. Jedoch werden die Lizenzen Dritter, die von Ihnen
+  Kopien oder Rechte unter dieser Lizenz erhalten haben, nicht beendet,
+  solange diese die Lizenz voll anerkennen und befolgen.
+</p><p>  §5. Sie sind nicht verpflichtet, diese Lizenz anzunehmen,
+  da Sie sie nicht unterzeichnet haben. Jedoch gibt Ihnen nichts anderes
+  die Erlaubnis, das Programm oder von ihm abgeleitete Datenwerke zu
+  verändern oder zu verbreiten. Diese Handlungen sind gesetzlich
+  verboten, wenn Sie diese Lizenz nicht anerkennen. Indem Sie das
+  Programm (oder ein darauf basierendes Datenwerk) verändern oder
+  verbreiten, erklären Sie Ihr Einverständnis mit dieser Lizenz und
+  mit allen ihren Bedingungen bezüglich der Vervielfältigung,
+  Verbreitung und Veränderung des Programms oder eines darauf
+  basierenden Datenwerks.
+</p><p>  §6. Jedesmal, wenn Sie das Programm (oder ein auf dem
+  Programm basierendes Datenwerk) weitergeben, erhält der Empfänger
+  automatisch vom ursprünglichen Lizenzgeber die Lizenz, das Programm
+  entsprechend den hier festgelegten Bestimmungen zu vervielfältigen,
+  zu verbreiten und zu verändern. Sie dürfen keine weiteren
+  Einschränkungen der Durchsetzung der hierin zugestandenen Rechte des
+  Empfängers vornehmen. Sie sind nicht dafür verantwortlich, die
+  Einhaltung dieser Lizenz durch Dritte durchzusetzen.
+</p><p>  §7. Sollten Ihnen infolge eines Gerichtsurteils, des
+  Vorwurfs einer Patentverletzung oder aus einem anderen Grunde (nicht
+  auf Patentfragen begrenzt) Bedingungen (durch Gerichtsbeschluß,
+  Vergleich oder anderweitig) auferlegt werden, die den Bedingungen
+  dieser Lizenz widersprechen, so befreien Sie diese Umstände nicht von
+  den Bestimmungen dieser Lizenz. Wenn es Ihnen nicht möglich ist, das
+  Programm unter gleichzeitiger Beachtung der Bedingungen in dieser
+  Lizenz und Ihrer anderweitigen Verpflichtungen zu verbreiten, dann
+  dürfen Sie als Folge das Programm überhaupt nicht verbreiten. Wenn
+  zum Beispiel ein Patent nicht die gebührenfreie Weiterverbreitung des
+  Programms durch diejenigen erlaubt, die das Programm direkt oder
+  indirekt von Ihnen erhalten haben, dann besteht der einzige Weg,
+  sowohl das Patentrecht als auch diese Lizenz zu befolgen, darin, ganz
+  auf die Verbreitung des Programms zu verzichten.
+</p><p>
+Sollte sich ein Teil dieses Paragraphen als ungültig oder unter
+  bestimmten Umständen nicht durchsetzbar erweisen, so soll dieser
+  Paragraph seinem Sinne nach angewandt werden; im übrigen soll dieser
+  Paragraph als Ganzes gelten.
+</p><p>
+Zweck dieses Paragraphen ist nicht, Sie dazu zu bringen, irgendwelche
+  Patente oder andere Eigentumsansprüche zu verletzen oder die
+  Gültigkeit solcher Ansprüche zu bestreiten; dieser Paragraph hat
+  einzig den Zweck, die Integrität des Verbreitungssystems der freien
+  Software zu schützen, das durch die Praxis öffentlicher Lizenzen
+  verwirklicht wird. Viele Leute haben großzügige Beiträge zu dem
+  großen Angebot der mit diesem System verbreiteten Software im
+  Vertrauen auf die konsistente Anwendung dieses Systems geleistet; es
+  liegt am Autor/Geber, zu entscheiden, ob er die Software mittels
+  irgendeines anderen Systems verbreiten will; ein Lizenznehmer hat auf
+  diese Entscheidung keinen Einfluß.
+</p><p>
+Dieser Paragraph ist dazu gedacht, deutlich klarzustellen, was als
+  Konsequenz aus dem Rest dieser Lizenz betrachtet wird.
+</p><p>  §8. Wenn die Verbreitung und/oder die Benutzung des
+  Programms in bestimmten Staaten entweder durch Patente oder durch
+  urheberrechtlich geschützte Schnittstellen eingeschränkt ist, kann
+  der Urheberrechtsinhaber, der das Programm unter diese Lizenz gestellt
+  hat, eine explizite geographische Begrenzung der Verbreitung angeben,
+  in der diese Staaten ausgeschlossen werden, so daß die Verbreitung
+  nur innerhalb und zwischen den Staaten erlaubt ist, die nicht
+  ausgeschlossen sind. In einem solchen Fall beinhaltet diese Lizenz die
+  Beschränkung, als wäre sie in diesem Text niedergeschrieben.
+</p><p>  §9. Die <em>Free Software Foundation</em>  kann von Zeit zu
+  Zeit überarbeitete und/oder neue Versionen der <em>General Public
+  License</em>  veröffentlichen. Solche neuen Versionen werden vom
+  Grundprinzip her der gegenwärtigen entsprechen, können aber im Detail
+  abweichen, um neuen Problemen und Anforderungen gerecht zu werden.
+</p><p>
+Jede Version dieser Lizenz hat eine eindeutige Versionsnummer. Wenn in
+  einem Programm angegeben wird, daß es dieser Lizenz in einer
+  bestimmten Versionsnummer oder ,,jeder späteren Version``
+  <em>(``any later version'')</em>  unterliegt, so haben Sie die Wahl,
+  entweder den Bestimmungen der genannten Version zu folgen oder denen
+  jeder beliebigen späteren Version, die von der <em>Free Software
+  Foundation</em>  veröffentlicht wurde. Wenn das Programm keine
+  Versionsnummer angibt, können Sie eine beliebige Version wählen, die
+  je von der <em>Free Software Foundation</em>  veröffentlicht wurde.
+</p><p>  §10. Wenn Sie den Wunsch haben, Teile des Programms in
+  anderen freien Programmen zu verwenden, deren Bedingungen für die
+  Verbreitung anders sind, schreiben Sie an den Autor, um ihn um die
+  Erlaubnis zu bitten. Für Software, die unter dem Copyright der
+  <em>Free Software Foundation</em>  steht, schreiben Sie an die <em>Free
+  Software Foundation</em> ; wir machen zu diesem Zweck gelegentlich
+  Ausnahmen. Unsere Entscheidung wird von den beiden Zielen geleitet
+  werden, zum einen den freien Status aller von unserer freien Software
+  abgeleiteten Datenwerke zu erhalten und zum anderen das
+  gemeinschaftliche Nutzen und Wiederverwenden von Software im
+  allgemeinen zu fördern.
+</p><p>  </p><h2><a name="SECTION00031000000000000000">
+Keine Gewährleistung</a>
+</h2>
+<p>  <b>
+</b></p><p><b>  §11. Da das Programm ohne jegliche Kosten lizenziert wird,
+  besteht keinerlei Gewährleistung für das Programm, soweit dies
+  gesetzlich zulässig ist. Sofern nicht anderweitig schriftlich
+  bestätigt, stellen die Copyright-Inhaber und/oder Dritte das Programm
+  so zur Verfügung, ,,wie es ist``, ohne irgendeine Gewährleistung,
+  weder ausdrücklich noch implizit, einschließlich - aber nicht
+  begrenzt auf - Marktreife oder Verwendbarkeit für einen bestimmten
+  Zweck. Das volle Risiko bezüglich Qualität und Leistungsfähigkeit
+  des Programms liegt bei Ihnen. Sollte sich das Programm als fehlerhaft
+  herausstellen, liegen die Kosten für notwendigen Service, Reparatur
+  oder Korrektur bei Ihnen.
+</b></p><p><b>  §12. In keinem Fall, außer wenn durch geltendes Recht
+  gefordert oder schriftlich zugesichert, ist irgendein
+  Copyright-Inhaber oder irgendein Dritter, der das Programm wie oben
+  erlaubt modifiziert oder verbreitet hat, Ihnen gegenüber für
+  irgendwelche Schäden haftbar, einschließlich jeglicher allgemeiner
+  oder spezieller Schäden, Schäden durch Seiteneffekte
+  (Nebenwirkungen) oder Folgeschäden, die aus der Benutzung des
+  Programms oder der Unbenutzbarkeit des Programms folgen
+  (einschließlich - aber nicht beschränkt auf - Datenverluste,
+  fehlerhafte Verarbeitung von Daten, Verluste, die von Ihnen oder
+  anderen getragen werden müssen, oder dem Unvermögen des Programms,
+  mit irgendeinem anderen Programm zusammenzuarbeiten), selbst wenn ein
+  Copyright-Inhaber oder Dritter über die Möglichkeit solcher Schäden
+  unterrichtet worden war.
+</b></p><p><b>  </b></p><h2><a name="SECTION00032000000000000000">
+Ende der Bedingungen</a>
+</h2>
+<p>  </p><h1><a name="SECTION00040000000000000000">
+Anhang: Wie Sie diese Bedingungen auf Ihre eigenen,
+<br>
+neuen Programme anwenden können</a>
+</h1>
+<p>
+Wenn Sie ein neues Programm entwickeln und wollen, daß es vom
+  größtmöglichen Nutzen für die Allgemeinheit ist, dann erreichen
+  Sie das am besten, indem Sie es zu freier Software machen, die jeder
+  unter diesen Bestimmungen weiterverbreiten und verändern kann.
+</p><p>
+Um dies zu erreichen, fügen Sie die folgenden Vermerke zu Ihrem
+  Programm hinzu. Am sichersten ist es, sie an den Anfang einer jeden
+  Quelldatei zu stellen, um den Gewährleistungsausschluß möglichst
+  deutlich darzustellen; zumindest aber sollte jede Datei eine
+  Copyright-Zeile besitzen sowie einen kurzen Hinweis darauf, wo die
+  vollständigen Vermerke zu finden sind.
+  </p><blockquote>
+<tt>[<i>eine Zeile mit dem Programmnamen und einer kurzen Beschreibung</i>] <br>
+Copyright (C) [<i>Jahr</i>]  [<i>Name des Autors</i>]</tt><p>
+<tt>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.
+</tt></p><p>
+<tt>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.
+</tt></p><p>
+<tt>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.
+</tt></p><p><tt>  </tt></p></blockquote>  Auf Deutsch:
+  <blockquote>
+<tt>[<i>eine Zeile mit dem Programmnamen und einer kurzen Beschreibung</i>] <br>
+Copyright (C) [<i>Jahr</i>]  [<i>Name des Autors</i>]</tt><p>
+<tt>Dieses Programm ist freie Software. Sie können es unter den
+    Bedingungen der GNU General Public License, wie von der Free
+    Software Foundation veröffentlicht, weitergeben und/oder
+    modifizieren, entweder gemäß Version 2 der Lizenz oder (nach Ihrer
+    Option) jeder späteren Version.
+</tt></p><p>
+<tt>Die Veröffentlichung dieses Programms erfolgt in der Hoffnung, daß
+    es Ihnen von Nutzen sein wird, aber OHNE IRGENDEINE GARANTIE, sogar
+    ohne die implizite Garantie der MARKTREIFE oder der VERWENDBARKEIT
+    FÜR EINEN BESTIMMTEN ZWECK. Details finden Sie in der GNU General
+    Public License.
+</tt></p><p>
+<tt>Sie sollten eine Kopie der GNU General Public License zusammen mit
+    diesem Programm erhalten haben. Falls nicht, schreiben Sie an die
+    Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+    Boston, MA 02111-1307, USA.
+</tt></p><p><tt>  </tt></p></blockquote>
+  Fügen Sie auch einen kurzen Hinweis hinzu, wie Sie elektronisch und
+  per Brief erreichbar sind.
+<p>
+Wenn Ihr Programm interaktiv ist, sorgen Sie dafür, daß es nach dem
+  Start einen kurzen Vermerk ausgibt:
+  </p><blockquote>
+<tt>
+version 69, Copyright (C) [<i>Jahr</i>]  [<i>Name des Autors</i>]
+<br>
+Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type
+    `show w'. This is free software, and you are welcome to redistribute
+    it under certain conditions; type `show c' for details.
+</tt><p><tt>  </tt>  </p></blockquote>  Auf Deutsch:
+  <blockquote>
+<tt>
+Version 69, Copyright (C) [<i>Jahr</i>]  [<i>Name des Autors</i>]
+    Für Gnomovision besteht KEINERLEI GARANTIE; geben Sie `show w' für
+    Details ein. Gnonovision ist freie Software, die Sie unter
+    bestimmten Bedingungen weitergeben dürfen; geben Sie `show c' für
+    Details ein.
+</tt><p><tt>  </tt>  </p></blockquote>
+  Die hypothetischen Kommandos <code>`show w'</code> und <code>`show c'</code>
+  sollten die entsprechenden Teile der GNU-GPL anzeigen. Natürlich
+  können die von Ihnen verwendeten Kommandos anders heißen als
+  <code>`show w'</code> und <code>`show c'</code>; es könnten auch Mausklicks oder
+  Menüpunkte sein - was immer am besten in Ihr Programm paßt.
+<p>
+Soweit vorhanden, sollten Sie auch Ihren Arbeitgeber (wenn Sie als
+  Programmierer arbeiten) oder Ihre Schule einen Copyright-Verzicht für
+  das Programm unterschreiben lassen. Hier ein Beispiel. Die Namen
+  müssen Sie natürlich ändern.
+  </p><blockquote> <tt>
+Yoyodyne, Inc., hereby disclaims all copyright interest in the
+    program `Gnomovision' (which makes passes at compilers) written by
+    James Hacker.
+</tt><p><tt>    [<i>Unterschrift von Ty Coon</i>], 1 April 1989
+<br>
+Ty Coon, President of Vice
+</tt></p><p><tt>  </tt>  </p></blockquote>
+  Auf Deutsch:
+  <blockquote> <tt>
+Die Yoyodyne GmbH erhebt keinen urheberrechtlichen Anspruch auf das
+    von James Hacker geschriebene Programm ,Gnomovision` (einem
+    Schrittmacher für Compiler).
+</tt><p><tt>    [<i>Unterschrift von Ty Coon</i>], 1. April 1989
+<br>
+Ty Coon, Vizepräsident
+</tt></p><p><tt>  </tt>  </p></blockquote>
+<p>
+Diese <em>General Public License</em>  gestattet nicht die Einbindung des
+  Programms in proprietäre Programme. Ist Ihr Programm eine
+  Funktionsbibliothek, so kann es sinnvoller sein, das Binden
+  proprietärer Programme mit dieser Bibliothek zu gestatten. Wenn Sie
+  dies tun wollen, sollten Sie die GNU Library General Public License
+  anstelle dieser Lizenz verwenden.
+</p></body></html>
\ No newline at end of file

Added: unstable/liquidwar/branches/upstream/current/misc/gpl_fr.html
===================================================================
--- unstable/liquidwar/branches/upstream/current/misc/gpl_fr.html	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/misc/gpl_fr.html	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,660 @@
+<html><head><!-- Template begins !!! --><!-- $Id: gpl_fr.html,v 1.1 2002/10/10 19:25:00 ufoot Exp $ --><title>Traduction de la GPL</title></head>
+
+
+<body bgcolor="White" text="Black" link="SteelBlue" vlink="Black">
+<!-- Navigation bar begins !!! -->
+<!-- $Id: gpl_fr.html,v 1.1 2002/10/10 19:25:00 ufoot Exp $ -->
+<div align="center">
+<table width="100%" bgcolor="SteelBlue" cellspacing="0" cellpadding="0" border="0">
+<tbody><tr>
+  <td>
+  <table width="100%" cellspacing="1" cellpadding="0" border="0">
+  <tbody><tr>
+    <td>
+      <table width="100%" bgcolor="LightSteelBlue" cellspacing="0" cellpadding="5" border="0">
+      <tbody><tr>
+<td align="center">
+          <font face="Helvetica" size="+1">
+          <b><a href="http://www.april.org/gnu/index.html" onmouseover="self.status = 'index.html'; return true" onmouseout="self.status = ''; return true"><font color="SteelBlue">Retour</font></a></b>
+          </font>
+        </td>
+<td align="center">
+          <font face="Helvetica" size="+1">
+          <b><a href="http://www.april.org/association/" onmouseover="self.status = '/association/'; return true" onmouseout="self.status = ''; return true"><font color="SteelBlue">L'association</font></a></b>
+          </font>
+        </td>
+<td align="center">
+          <font face="Helvetica" size="+1">
+          <b><a href="http://www.april.org/gnu/" onmouseover="self.status = '/gnu/'; return true" onmouseout="self.status = ''; return true"><font color="SteelBlue">Le projet GNU</font></a></b>
+          </font>
+        </td>
+<td align="center">
+          <font face="Helvetica" size="+1">
+          <b><a href="http://www.april.org/articles/" onmouseover="self.status = '/articles/'; return true" onmouseout="self.status = ''; return true"><font color="SteelBlue">Articles</font></a></b>
+          </font>
+        </td>
+<td align="center">
+          <font face="Helvetica" size="+1">
+          <b><a href="http://www.april.org/groupes/" onmouseover="self.status = '/groupes/'; return true" onmouseout="self.status = ''; return true"><font color="SteelBlue">Activités</font></a></b>
+          </font>
+        </td>
+<td align="center">
+          <font face="Helvetica" size="+1">
+          <b><a href="http://www.april.org/actions/" onmouseover="self.status = '/actions/'; return true" onmouseout="self.status = ''; return true"><font color="SteelBlue">Actions</font></a></b>
+          </font>
+        </td>
+<td align="center">
+          <font face="Helvetica" size="+1">
+          <b><a href="http://france.fsfeurope.org/" onmouseover="self.status = 'http://france.fsfeurope.org'; return true" onmouseout="self.status = ''; return true"><font color="SteelBlue">FSF France</font></a></b>
+          </font>
+        </td>
+<td align="center">
+          <font face="Helvetica" size="+1">
+          <b><a href="http://gnu.april.org/" onmouseover="self.status = 'http://gnu.april.org'; return true" onmouseout="self.status = ''; return true"><font color="SteelBlue">Miroir GNU</font></a></b>
+          </font>
+        </td>
+</tr>
+      </tbody></table>
+    </td>
+  </tr>
+  <tr>
+    <td>
+      <table width="100%" bgcolor="White" cellspacing="0" cellpadding="5" border="0">
+      <tbody><tr>
+        <td valign="center" align="left">
+	  <p>
+    	  <font size="+2" color="SteelBlue" face="Helvetica">Traduction de la GPL</font>
+	  </p>
+        </td>
+        <td valign="center" align="right">
+	  <p>
+	  </p>
+        </td>
+      </tr>
+      </tbody></table>
+    </td>
+  </tr>
+  </tbody></table>
+  </td>
+</tr>
+</tbody></table>
+</div>
+<!--
+Local Variables:
+mode: html
+End:
+-->
+<!-- Navigation bar ends -->
+<p>
+<!-- Body begins -->
+<!--
+Local Variables:
+mode: html
+End:
+-->
+<!-- Template ends -->
+</p><p>
+<font size="+2">
+<b>
+Table des matières
+</b>
+</font>
+</p><p>
+</p><ol><li><a name="TocToc1" href="#ToC1"><strong>Notice d'accompagnement de la traduction non officielle à
+conserver dans toute reproduction de cette traduction</strong></a>
+</li><li><a name="TocToc2" href="#ToC2"><strong>GNU GENERAL PUBLIC LICENSE (<em>TRADUCTION NON OFFICIELLE</em>)</strong></a>
+</li><li><a name="TocToc3" href="#ToC3"><strong>Préambule</strong></a>
+</li><li><a name="TocToc4" href="#ToC4"><strong>Conditions d'exploitation portant sur la duplication,
+la distribution et la modification</strong></a>
+</li><li><a name="TocToc5" href="#ToC5"><strong>ABSENCE DE GARANTIE</strong></a>
+</li><li><a name="TocToc6" href="#ToC6"><strong>Comment appliquer ces dispositions a vos nouveaux programmes?</strong></a>
+</li></ol>
+<p>
+</p><hr noshade="" size="1">
+<p>
+</p><h1><br>
+<a href="#TocToc1" name="ToC1">Notice d'accompagnement de la traduction non officielle à
+conserver dans toute reproduction de cette traduction</a></h1>
+<p><b> This is an unofficial translation of the GNU General Public
+License into <em>french</em>. It was not published by the Free
+Software Foundation, and does not legally state the distribution terms
+for software that uses the GNU GPL--only the <a href="http://www.gnu.org/copyleft/gpl.html">original English text of
+the GNU GPL</a> does that. However, we hope that this translation
+will help <em>french</em> speakers understand the GNU GPL better.</b>
+</p>
+<p><b> Ceci est une traduction non officielle de la GNU General Public
+License en français. Elle n'a pas été publiée par la Free Software
+Foundation, et ne détermine pas les termes de distribution pour les
+logiciels qui utilisent la GNU GPL--seul le <a href="http://www.gnu.org/copyleft/gpl.html">texte anglais original de
+la GNU GPL</a> en a le droit. Cependant, nous espérons que cette
+traduction aidera les francophones à mieux comprendre la GPL.</b>  </p>
+<b></b><p><b> Cette traduction est sous Copyright 2001 APRIL (http://www.april.org).<br>
+La version la plus à jour de ce document est disponible sur <a href="http://www.april.org/gnu/gpl_french.html">http://www.april.org/gnu/gpl_french.html</a><br>
+</b></p><p><b>Il est permis à tout le monde de reproduire et distribuer des
+copies conformes de cette traduction, mais aucune modification ne doit
+y être apportée, et la présente notice doit être préservée.</b></p>
+Nous autorisons la FSF à apporter toute modification qu'elle jugera
+nécessaire pour rendre la traduction plus claire. <p></p>
+<p>
+</p><h1><br>
+<a href="#TocToc1" name="ToC2">GNU GENERAL PUBLIC LICENSE (<em>TRADUCTION NON OFFICIELLE</em>)</a></h1>
+<p>Version 2, juin 1991
+</p><p>Copyright (C) 1989, 1991, Free Software Foundation Inc. 675 Mass Ave, Cambridge, MA02139, Etats-Unis.
+</p><p>Il est permis à tout le monde de reproduire et distribuer
+des copies conformes de ce document de licence, mais aucune
+modification ne doit y être apportée.</p>
+<br>
+<br>
+<h1><br>
+<a href="#TocToc1" name="ToC3">Préambule</a></h1>
+<p>
+Les licences relatives à la plupart des logiciels sont
+destinées à supprimer votre liberté de les
+partager et de les modifier. Par contraste, la licence publique
+générale GNU General Public License veut garantir votre
+liberté de partager et de modifier les logiciels libres, pour
+qu'ils soient vraiment libres pour tous leurs utilisateurs. La
+présente licence publique générale s'applique
+à la plupart des logiciels de la Free Software Foundation,
+ainsi qu'à tout autre programme dont les auteurs s'engagent
+à l'utiliser. (Certains autres logiciels sont couverts par la
+Licence Publique Générale pour Bibliothèques GNU
+à la place). Vous pouvez aussi l'appliquer à vos
+programmes.</p>
+<p>Quand nous parlons de logiciels libres, nous parlons de
+liberté, non de gratuité. Nos licences publiques
+générales veulent vous garantir :</p>
+<ul>
+<p>
+</p><li>que vous avez toute liberté de distribuer des copies des
+logiciels libres (et de facturer ce service, si vous le souhaitez)
+;
+<p>
+</p></li><li>que vous recevez les codes sources ou pouvez les obtenir si vous
+le souhaitez ;
+<p>
+</p></li><li>que vous pouvez modifier les logiciels ou en utiliser des
+éléments dans de nouveaux programmes libres ;
+<p>
+</p></li><li>et que vous savez que vous pouvez le faire.
+</li></ul>
+<p>Pour protéger vos droits, nous devons apporter des
+restrictions, qui vont interdire à quiconque de vous
+dénier ces droits, ou de vous demander de vous en
+désister. Ces restrictions se traduisent par certaines
+responsabilités pour ce qui vous concerne, si vous distribuez
+des copies de logiciels, ou si vous les modifiez.</p>
+<p>Par exemple, si vous distribuez des copies d'un tel programme,
+gratuitement ou contre une rémunération, vous devez
+transférer aux destinataires tous les droits dont vous
+disposez. Vous devez vous garantir qu'eux-mêmes, par ailleurs,
+reçoivent ou peuvent recevoir le code source. Et vous devez
+leur montrer les présentes dispositions, de façon qu'ils
+connaissent leurs droits. </p>
+<p>Nous protégeons vos droits en deux étapes :</p>
+<ol>
+<p>
+</p><li> Nous assurons le droit d'auteur (copyright) du logiciel, et
+<p>
+</p></li><li> Nous vous proposons cette licence, qui vous donne l'autorisation
+légale de dupliquer, distribuer et/ou modifier le logiciel.
+</li></ol>
+<p>De même, pour la protection de chacun des auteurs, et pour
+notre propre protection, nous souhaitons nous assurer que tout le
+monde comprenne qu'il n'y a aucune garantie portant sur ce logiciel
+libre. Si le logiciel est modifié par quelqu'un d'autre puis
+transmis à des tiers, nous souhaitons que les destinataires
+sachent que ce qu'ils possèdent n'est pas l'original, de
+façon que tous problèmes introduits par d'autres ne se
+traduisent pas par une répercussion négative sur la
+réputation de l'auteur original.</p>
+<p>Enfin, tout programme libre est en permanence menacé par des
+brevets de logiciels. Nous souhaitons éviter le danger que des
+sous-distributeurs d'un programme libre obtiennent à titre
+individuel des licences de brevets, avec comme conséquence
+qu'ils ont un droit de propriété sur le programme. Pour
+éviter cette situation, nous avons fait tout ce qui est
+nécessaire pour que tous brevets doivent faire l'objet d'une
+concession de licence qui en permette l'utilisation libre par
+quiconque, ou bien qu'il ne soit pas concédé du
+tout.</p>
+<p>Nous présentons ci-dessous les clauses et dispositions
+concernant la duplication, la distribution et la modification.</p>
+<br>
+<br>
+<h1><br>
+<a href="#TocToc1" name="ToC4">Conditions d'exploitation portant sur la duplication,
+la distribution et la modification</a></h1>
+<ol>
+<p>
+</p><li>Le présent contrat de licence s'applique à tout
+programme ou autre ouvrage contenant un avis, apposé par le
+détenteur du droit de propriété, disant qu'il
+peut être distribué au titre des dispositions de la
+présente Licence Publique
+Générale. Ci-après, le "Programme" désigne
+l'un quelconque de ces programmes ou ouvrages, et un "ouvrage
+fondé sur le programme" désigne soit le programme, soit
+un ouvrage qui en dérive au titre de la loi sur le droit
+d'auteur ; plus précisément, il s'agira d'un ouvrage
+contenant le programme ou une version de ce dernier, soit mot à
+mot, soit avec des modifications et/ou traduit en une autre langue
+(ci-après, le terme "modification" englobe, sans aucune
+limitation, les traductions qui en sont faites). Chaque titulaire de
+licence sera appelé "concessionnaire".<p></p>
+<p>Les activités autres que la duplication, la distribution et
+la modification ne sont pas couvertes par la présente licence ;
+elles n'entrent pas dans le cadre de cette
+dernière. L'exécution du programme n'est soumise
+à aucune restriction, et les résultats du programme ne
+sont couverts que si son contenu constitue un ouvrage fondé sur
+le programme (indépendamment du fait qu'il a été
+réalisé par exécution du programme). La
+véracité de ce qui précède dépend
+de ce que fait le programme. </p>
+<p>
+</p></li><li>Le concessionnaire peut dupliquer et distribuer des copies mot
+à mot du code source du programme tel qu'il les reçoit,
+et ce sur un support quelconque, du moment qu'il appose, d'une
+manière parfaitement visible et appropriée, sur chaque
+exemplaire, un avis approprié de droits d'auteur (Copyright) et
+de renonciation à garantie ; qu'il maintient intacts tous
+les avis qui se rapportent à la présente licence et
+à l'absence de toute garantie ; et qu'il transmet à tout
+destinataire du programme un exemplaire de la présente licence
+en même temps que le programme.<p></p>
+<p>Le concessionnaire peut facturer l'acte physique de transfert d'un
+exemplaire, et il peut, à sa discrétion, proposer en
+échange d'une rémunération une protection en
+garantie.</p>
+<p>
+</p></li><li>Le concessionnaire peut modifier son ou ses exemplaires du
+programme ou de toute portion de ce dernier, en formant ainsi un
+ouvrage fondé sur le programme, et dupliquer et distribuer ces
+modifications ou cet ouvrage selon les dispositions de la section 1
+ci-dessus, du moment que le concessionnaire satisfait aussi à
+toutes ces conditions :<p></p>
+<ol type="a">
+<p>
+</p><li>Le concessionnaire doit faire en sorte que les fichiers
+modifiés portent un avis, parfaitement visible, disant que le
+concessionnaire a modifié les fichiers, avec la date de tout
+changement.
+<p>
+</p></li><li> Le concessionnaire doit faire en sorte que tout ouvrage qu'il
+distribue ou publie, et qui, en totalité ou en partie, contient
+le programme ou une partie quelconque de ce dernier ou en
+dérive, soit concédé en bloc, à titre
+gracieux, à tous tiers au titre des dispositions de la
+présente licence.
+<p>
+</p></li><li> Si le programme modifié lit normalement des instructions
+interactives lors de son exécution, le concessionnaire doit,
+quand il commence l'exécution du programme pour une telle
+utilisation interactive de la manière la plus usuelle, faire en
+sorte que ce programme imprime ou affiche une annonce, comprenant un
+avis approprié de droits d'auteur, et un avis selon lequel il
+n'y a aucune garantie (ou autrement, que le concessionnaire fournit
+une garantie), et que les utilisateurs peuvent redistribuer le
+programme au titre de ces dispositions, et disant à
+l'utilisateur comment visualiser une copie de cette licence (exception
+: si le programme par lui-même est interactif mais n'imprime
+normalement pas une telle annonce, l'ouvrage du concessionnaire se
+fondant sur le programme n'a pas besoin d'imprimer une annonce).<p></p>
+</li></ol>
+<p>Les exigences ci-dessus s'appliquent à l'ouvrage
+modifié pris en bloc. Si des sections identifiables de cet
+ouvrage ne dérivent pas du programme et peuvent être
+considérées raisonnablement comme représentant
+des ouvrages indépendants et distincts par eux-mêmes,
+alors la présente licence, et ses dispositions, ne s'appliquent
+pas à ces sections quand le concessionnaire les distribue sous
+forme d'ouvrages distincts. Mais quand le concessionnaire distribue
+ces mêmes sections en tant qu'élément d'un tout
+qui représente un ouvrage se fondant sur le programme, la
+distribution de ce tout doit se faire conformément aux
+dispositions de la présente licence, dont les autorisations,
+portant sur d'autres concessionnaires, s'étendent à la
+totalité dont il est question, et ainsi à chacune de ces
+parties, indépendamment de celui qu'il a écrite.</p>
+<p>Ainsi, cette section n'a pas pour but de revendiquer des droits ou
+de contester vos droits sur un ouvrage entièrement écrit
+par le concessionnaire ; bien plus, l'intention est d'exercer le droit
+de surveiller la distribution d'ouvrages dérivée ou
+collective se fondant sur le programme.</p>
+<p>De plus, un simple assemblage d'un autre ouvrage ne se fondant pas
+sur le programme, avec le programme (ou avec un ouvrage se fondant sur
+le programme) sur un volume d'un support de stockage ou distribution,
+ne fait pas entrer l'autre ouvrage dans le cadre de la présente
+licence.</p>
+<p>
+</p></li><li> Le concessionnaire peut dupliquer et distribuer le programme (ou
+un ouvrage se fondant sur ce dernier, au titre de la Section 2), en
+code objet ou sous une forme exécutable, au titre des
+dispositions des Sections 1 et 2 ci-dessus, du moment que le
+concessionnaire effectue aussi l'une des opérations suivantes :
+<ol type="a">
+<p>
+</p><li>Lui joindre le code source complet correspondant, exploitable par
+une machine, code qui doit être distribué au titre des
+Sections 1 et 2 ci-dessus sur un support couramment utilisé
+pour l'échange de logiciels ; ou bien
+<p>
+</p></li><li>Lui joindre une offre écrite, dont la validité se
+prolonge pendant au moins 3 ans, de transmettre à un tiers
+quelconque, pour un montant non supérieur au coût pour le
+concessionnaire, de réalisation physique de la distribution de
+la source, un exemplaire complet, exploitable par une machine, du code
+source correspondant, qui devra être distribué au titre
+des dispositions des Sections 1 et 2 ci-dessus sur un support
+couramment utilisé pour l'échange des logiciels ; ou
+bien
+<p>
+</p></li><li>Lui joindre les informations que le concessionnaire a
+reçues, pour proposer une distribution du code source
+correspondant (cette variante n'est autorisée que pour la
+distribution non commerciale, et seulement si le concessionnaire a
+reçu le programme sous forme exécutable ou sous forme
+d'un code objet, avec une telle offre, conformément à
+l'alinéa b) ci-dessus).
+</li></ol>
+<p>Le code source d'un ouvrage représente la forme
+préférée de l'ouvrage pour y effectuer des
+modifications. Pour un ouvrage exécutable, le code source
+complet représente la totalité du code source pour tous
+les modules qu'il contient, plus tous fichiers de définitions
+d'interface associés, plus les informations en code machine
+pour commander la compilation et l'installation du programme
+exécutable. Cependant, à titre d'exceptions
+spéciales, le code source distribué n'a pas besoin de
+comprendre quoi que ce soit qui est normalement distribué (sous
+forme source ou sous forme binaire) avec les composants principaux
+(compilateur, noyau de système d'exploitation, etc.) du
+système d'exploitation sur lequel est exécuté le
+programme exécutable, à moins que le composant, par
+lui-même, soit joint au programme exécutable.</p>
+<p>Si la distribution de l&#8216;exécutable ou du code objet est
+réalisée de telle sorte qu'elle offre d'accéder
+à une copie à partir d'un lieu désigné,
+alors le fait d'offrir un accès équivalent à la
+duplication du code source à partir de ce même lieu
+s'entend comme distribution du code source, même si des tiers ne
+sont pas contraints de dupliquer la source en même temps que le
+code objet.</p>
+<p>
+</p></li><li> Le concessionnaire ne peut dupliquer, modifier, concéder
+en sous-licence ou distribuer le programme, sauf si cela est
+expressément prévu par les dispositions de la
+présente licence. Toute tentative pour autrement dupliquer,
+modifier, concéder en sous-licence ou distribuer le programme
+est répétée nulle, et met automatiquement fin aux
+droits du concessionnaire au titre de la présente
+licence. Cependant, les parties qui ont reçu des copies, ou des
+droits, de la part du concessionnaire au titre de la présente
+licence, ne verront pas expirer leur contrat de licence, tant que ces
+parties agissent d'une manière parfaitement conforme.<p></p>
+<p>
+</p></li><li> Il n'est pas exigé du concessionnaire qu'il accepte la
+présente licence, car il ne l'a pas signée. Cependant,
+rien d'autre n'octroie au concessionnaire l'autorisation de modifier
+ou de distribuer le programme ou ses ouvrages
+dérivés. Ces actions sont interdites par la loi si le
+concessionnaire n'accepte pas la présente licence. En
+conséquence, par le fait de modifier ou de distribuer le
+programme (ou un ouvrage quelconque se fondant sur le programme), le
+concessionnaire indique qu'il accepte la présente licence, et
+qu'il a la volonté de se conformer à toutes les clauses
+et dispositions concernant la duplication, la distribution ou la
+modification du programme ou d'ouvrages se fondant sur ce dernier.<p></p>
+<p>
+</p></li><li> Chaque fois que le concessionnaire redistribue le programme (ou
+tout ouvrage se fondant sur le programme), le destinataire
+reçoit automatiquement une licence de l'émetteur initial
+de la licence, pour dupliquer, distribuer ou modifier le programme,
+sous réserve des présentes clauses et dispositions. Le
+concessionnaire ne peut imposer aucune restriction plus poussée
+sur l'exercice, par le destinataire, des droits octroyés au
+titre des présentes. Le concessionnaire n'a pas pour
+responsabilité d'exiger que des tiers se conforment à la
+présente licence.<p></p>
+<p>
+</p></li><li> Si, en conséquence une décision de justice ou une
+allégation d'infraction au droit des brevets, ou pour toute
+autre raison (qui n'est pas limitée à des
+problèmes de propriétés industrielles), des
+conditions sont imposées au concessionnaire (par
+autorité de justice, par convention ou autrement), qui entrent
+en contradiction avec les dispositions de la présente licence,
+elles n'exemptent pas le concessionnaire de respecter les dispositions
+de la présente licence. Si le concessionnaire ne peut
+procéder à la distribution de façon à
+satisfaire simultanément à ces obligations au titre de
+la présente licence et à toutes autres obligations
+pertinentes, alors, en conséquence de ce qui
+précède, le concessionnaire peut ne pas procéder
+du tout à la distribution du programme. Par exemple, si une
+licence de brevet ne permettait pas une redistribution du programme,
+sans redevances, par tous ceux qui reçoivent des copies
+directement ou indirectement par l'intermédiaire du
+concessionnaire, alors le seul moyen par lequel le concessionnaire
+pourrait satisfaire tant à cette licence de brevet qu'à
+la présente licence, consisterait à s'abstenir
+complètement de distribuer le programme.<p></p>
+<p>Si une partie quelconque de cette section est
+considérée comme nulle ou non exécutoire dans
+certaines circonstances particulières, le reste de cette
+section est réputé s'appliquer, et la section dans son
+ensemble est considérée comme s'appliquant dans les
+autres circonstances.</p>
+<p>La présente section n'a pas pour objet de pousser le
+concessionnaire à enfreindre tous brevets ou autres
+revendications à droit de propriété, ou encore
+à contester la validité de une ou plusieurs quelconques
+de ces revendications ; la présente section a pour objet unique
+de protéger l'intégrité du système de
+distribution des logiciels libres, système qui est mis en
+oeuvre par les pratiques liées aux licences publiques. De
+nombreuses personnes ont apporté une forte contribution
+à la gamme étendue des logiciels distribués par
+ce système, en comptant sur l'application systématique
+de ce système ; c'est à l'auteur/donateur de
+décider s'il a la volonté de distribuer le logiciel par
+un quelconque autre système, et un concessionnaire ne peut
+imposer ce choix.</p>
+<p>La présente section veut rendre parfaitement claire ce que
+l'on pense être une conséquence du reste de la
+présente licence.</p>
+<p>
+</p></li><li> Si la distribution et/ou l'utilisation du Programme est
+restreinte dans certains pays, sous l'effet de brevets ou d'interfaces
+présentant un droit d'auteur, le détenteur du droit
+d'auteur original, qui soumet le Programme aux dispositions de la
+présente licence, pourra ajouter une limitation expresse de
+distribution géographique excluant ces pays, de façon
+que la distribution ne soit autorisée que dans les pays ou
+parmi les pays qui ne sont pas ainsi exclus. Dans ce cas, la
+limitation fait partie intégrante de la présente
+licence, comme si elle était écrite dans le corps de la
+présente licence.<p></p>
+<p>La Free Software Foundation peut, de temps à autre, publier
+des versions révisées et/ou nouvelles du General Public
+License. Ces nouvelles versions seront analogues, du point de vue de
+leur esprit, à la présente version, mais pourront en
+différer dans le détail, pour résoudre de
+nouveaux problèmes ou de nouvelles situations.</p>
+<p>Chaque version reçoit un numéro de version qui lui
+est propre. Si le programme spécifie un numéro de
+version de la présente licence, qui s'applique à cette
+dernier et "à toute autre version ultérieure", le
+concessionnaire a le choix de respecter les clauses et dispositions de
+cette version, ou une quelconque version ultérieure
+publiée par la Free Software Foundation. Si le programme ne
+spécifie pas de numéro de version de la présente
+licence, le concessionnaire pourra choisir une version quelconque
+publiée à tout moment par la Free Software
+Foundation.</p>
+<p>
+</p></li><li> Si le concessionnaire souhaite incorporer des parties du
+programme dans d'autres programmes libres dont les conditions de
+distribution sont différentes, il devrait écrire
+à l'auteur pour demander son autorisation. Pour un logiciel
+soumis à droit d'auteur par la Free Software Foundation, il
+devra écrire à la Free Software Foundation ; nous
+faisons quelquefois des exceptions à cette règle. Notre
+décision va être guidée par le double objectif de
+protéger le statut libre de tous les dérivés de
+nos logiciels libres, et de favoriser le partage et la
+réutilisation des logiciels en général.<p></p>
+<h1><br>
+<a href="#TocToc1" name="ToC5">ABSENCE DE GARANTIE</a></h1>
+<p>
+</p><p>
+</p></li><li>
+<font face="Helvetica">COMME LA LICENCE DU PROGRAMME EST CONCEDEE A
+TITRE GRATUIT, IL N'Y AUCUNE GARANTIE S'APPLIQUANT AU PROGRAMME, DANS
+LA MESURE AUTORISEE PAR LA LOI EN VIGUEUR. SAUF MENTION CONTRAIRE
+ECRITE, LES DETENTEURS DU DROIT D'AUTEUR ET/OU LES AUTRES PARTIES
+METTENT LE PROGRAMME A DISPOSITON "EN L'ETAT", SANS AUCUNE GARANTIE DE
+QUELQUE NATURE QUE CE SOIT, EXPRESSE OU IMPLICITE, Y COMPRIS, MAIS
+SANS LIMITATION, LES GARANTIES IMPLICITES DE COMMERCIALISATION ET DE
+L'APTITUDE A UN OBJET PARTICULIER. C'EST LE CONCESSIONNAIRE QUI PREND
+LA TOTALITE DU RISQUE QUANT A LA QUALITE ET AUX PERFORMANCES DU
+PROGRAMME. SI LE PROGRAMME SE REVELAIT DEFECTUEUX, C'EST LE
+CONCESSIONNAIRE QUI PRENDRAIT A SA CHARGE LE COUT DE L'ENSEMBLE DES
+OPERATIONS NECESSAIRES D'ENTRETIEN, REPARATION OU CORRECTION.</font><p></p>
+<p><font face="Helvetica">12. EN AUCUN CAS, SAUF SI LA LOI EN VIGUEUR L'EXIGE OU SI UNE
+CONVENTION ECRITE EXISTE A CE SUJET, AUCUN DETENTEUR DE DROITS
+D'AUTEUR, OU AUCUNE PARTIE AYANT LE POUVOIR DE MODIFIER ET/OU DE
+REDISTRIBUER LE PROGRAMME CONFORMEMENT AUX AUTORISATIONS CI-DESSUS,
+N'EST RESPONSABLE VIS-A-VIS DU CONCESSIONNAIRE POUR CE QUI EST DES
+DOMMAGES, Y COMPRIS TOUS DOMMAGES GENERAUX, SPECIAUX, ACCIDENTELS OU
+INDIRECTS, RESULTANT DE L'UTILISATION OU DU PROGRAMME OU DE
+L'IMPOSSIBILITE D'UTILISER LE PROGRAMME (Y COMPRIS, MAIS SANS
+LIMITATION, LA PERTE DE DONNEES, OU LE FAIT QUE DES DONNEES SONT
+RENDUES IMPRECISES, OU ENCORE LES PERTES EPROUVEES PAR LE
+CONCESSIONNAIRE OU PAR DES TIERS, OU ENCORE UN MANQUEMENT DU PROGRAMME
+A FONCTIONNER AVEC TOUS AUTRES PROGRAMMES), MEME SI CE DETENTEUR OU
+CETTE AUTRE PARTIE A ETE AVISE DE LA POSSIBILITE DE TELS DOMMAGES.</font></p>
+
+</li></ol>
+<br>
+<div align="center"><font color="SteelBlue">
+<b>
+FIN DES CONDITIONS D'EXPLOITATION
+</b>
+</font></div>
+<p>
+</p><hr noshade="" size="1">
+<p>
+<br>
+<br>
+</p><h1><br>
+<a href="#TocToc1" name="ToC6">Comment appliquer ces dispositions a vos nouveaux programmes?</a></h1>
+<p>Si le concessionnaire développe un nouveau programme, et s'il en souhaite
+l'utilisation la plus large possible dans le public, le meilleur moyen d'y
+arriver est d'en faire un logiciel libre, que tout le monde pourra redistribuer
+et modifier au titre des présentes dispositions.</p>
+<p>Dans ce but, il convient de rattacher au programme les avis suivants.
+Le moyen le plus sûr consiste à les rattacher au début de chaque fichier
+source, pour avertir le plus efficacement possible de l'exclusion de garantie
+; et chaque fichier doit comporter au moins la ligne "copyright", et un pointeur
+indiquant où est localisée la totalité de l'avis.</p>
+<tt>
+<i><p>Une ligne pour donner le nom du programme et une idée de ce qu'il fait.</p>
+</i></tt><p><tt>Copyright (C) 19<i>yy</i> <i>nom de l'auteur</i></tt></p>
+<p><tt>Ce programme est un logiciel libre ; vous pouvez le
+redistribuer et/ou le modifier conformément aux dispositions de
+la Licence Publique Générale GNU, telle que
+publiée par la Free Software Foundation ; version 2 de la
+licence, ou encore (à votre choix) toute version
+ultérieure.</tt></p>
+<p><tt>Ce programme est distribué dans l'espoir qu'il sera utile,
+mais SANS AUCUNE GARANTIE ; sans même la garantie implicite de
+COMMERCIALISATION ou D'ADAPTATION A UN OBJET PARTICULIER. Pour plus de
+détail, voir la Licence Publique Générale GNU
+.</tt></p>
+<p><tt>Vous devez avoir reçu un exemplaire de la Licence Publique
+Générale GNU en même temps que ce programme ; si
+ce n'est pas le cas, écrivez à la Free Software
+Foundation Inc., 675 Mass Ave, Cambridge, MA 02139, Etats-Unis.</tt></p>
+
+<p>Ajoutez aussi des informations sur le moyen permettant
+d'entrer en contact avec vous par courrier électronique
+(e-mail) et courrier normal.</p>
+<p>Si le programme est interactif, prévoyez en sortie un court
+avis, tel que celui qui est présenté ci-dessous, lors du
+démarrage en mode interactif.</p>
+<tt>
+</tt><p><tt>Gnomovision version 69, Copyright (C) 19 <i>yy nom de
+l'auteur</i></tt></p>
+<p><tt>Gnomovision est livré absolument SANS AUCUNE GARANTIE ;
+pour plus de détail, tapez "show w". Il s'agit d'un logiciel
+libre, et vous avez le droit de le redistribuer dans certaines
+conditions ; pour plus de détail, tapez "show c".</tt></p>
+
+<p>Les instructions hypothétiques "show w"<font>
+et </font>"show c"<font> doivent présenter les parties
+appropriées de la Licence Publique Générale. Bien
+évidemment, les instructions que vous utilisez peuvent porter
+d'autres noms que </font>"show w"<font> et </font>"show
+c" <font>; elles peuvent même correspondre à des
+clics de souris ou à des éléments d'un menu,
+selon ce qui convient à votre programme.</font></p>
+<p><font>Si nécessaire, vous devrez aussi demander à votre
+employeur (si vous travaillez en tant que programmeur) ou à
+votre éventuelle école ou université, de signer
+une "renonciation à droit d'auteur" concernant le programme. En
+voici un échantillon (il suffit de modifier les noms) :</font></p>
+<font><tt>
+</tt></font><p><font><tt>Yoyodyne, Inc., par la présente, renonce à tout
+intérêt de droits d'auteur dans le programme "Gnomovision" (qui fait des
+passages au niveau des compilateurs) écrit par James Hacker.</tt></font></p>
+<font><tt><i></i></tt></font><p><font><tt><i>Signature de Ty Coon</i>, 1<sup>er</sup> avril 1989</tt></font></p>
+<p><font><tt>Ty Coon, President of Vice</tt></font></p>
+
+<font><font></font></font><p><font><font>La présente Licence Publique Générale
+n'autorise pas le concessionnaire à incorporer son programme
+dans des programmes propriétaires. Si votre programme est une
+bibliothèque de sous-programmes, vous pouvez considérer
+comme plus intéressant d'autoriser une édition de liens
+des applications propriétaires avec la bibliothèque. Si
+c'est ce que vous souhaitez, vous devrez utiliser non pas la
+présente licence, mais la Licence Publique
+Générale pour Bibliothèques GNU.</font></font></p>
+<p><font><font> </font></font></p>
+<!-- Body ends -->
+<p>
+<table width="100%" bgcolor="SteelBlue" cellspacing="0" cellpadding="0" border="0">
+<tbody><tr>
+  <td>
+    <table width="100%" bgcolor="White" cellspacing="1" cellpadding="5" border="0">
+    <tbody><tr>
+      <td>
+	<font size="-1" face="Helvetica" color="SteelBlue">
+	<b>
+<a href="http://www.april.org/gnu/index.html">Niveau supérieur</a>
+ | <font face="Helvetica" color="SteelBlue">Généré le 26/11/2001 par <a href="mailto:oberger%20AT%20april.org">Olivier Berger</a> </font>
+	</b>
+	</font>
+      </td>
+    </tr>
+    <tr>
+      <td>
+	<font size="-1" face="Helvetica" color="SteelBlue">
+	Sauf mention contraire indiquée plus haut, le présent document
+	est soumis aux conditions d'exploitation suivantes :
+	</font><p>
+<font size="-1" face="Helvetica" color="SteelBlue">	Copyright 2001
+	APRIL
+	<br>
+	Ce document peut être reproduit par n'importe quel moyen que ce soit,
+	pourvu qu'aucune modification ne soit effectuée et que cette notice
+	soit préservée.
+	</font>
+      </p></td>
+    </tr>
+    </tbody></table>
+  </td>
+</tr>
+</tbody></table>
+</p></body></html>
\ No newline at end of file

Added: unstable/liquidwar/branches/upstream/current/misc/liquidwar.desktop
===================================================================
--- unstable/liquidwar/branches/upstream/current/misc/liquidwar.desktop	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/misc/liquidwar.desktop	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,19 @@
+[Desktop Entry]
+Version=1.0
+Encoding=UTF-8
+
+Name=Liquid War
+#Name[fr]=French translation of Name
+
+Comment=A unique multiplayer wargame
+#Name[fr]=French translation of Comment
+
+Type=Application
+Categories=Application;Game;ArcadeGame;
+
+TryExec=liquidwar
+Exec=liquidwar
+FilePattern=liquidwar
+
+Icon=liquidwar.xpm
+Terminal=false

Added: unstable/liquidwar/branches/upstream/current/misc/liquidwar.ico
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/misc/liquidwar.ico
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/misc/liquidwar.xpm
===================================================================
--- unstable/liquidwar/branches/upstream/current/misc/liquidwar.xpm	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/misc/liquidwar.xpm	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,586 @@
+/* XPM */
+static char * liquidwar_xpm[] = {
+"48 48 535 2",
+"  	c None",
+". 	c #004F20",
+"+ 	c #000179",
+"@ 	c #00009C",
+"# 	c #0000D0",
+"$ 	c #0000FA",
+"% 	c #0000FE",
+"& 	c #0000FF",
+"* 	c #0000F3",
+"= 	c #0000C0",
+"- 	c #00800E",
+"; 	c #00E20C",
+"> 	c #00F900",
+", 	c #00B900",
+"' 	c #00533B",
+") 	c #00018F",
+"! 	c #00009A",
+"~ 	c #0000D7",
+"{ 	c #0000FC",
+"] 	c #0000D4",
+"^ 	c #097A07",
+"/ 	c #00F006",
+"( 	c #00FE00",
+"_ 	c #00DC00",
+": 	c #009900",
+"< 	c #003E51",
+"[ 	c #000092",
+"} 	c #0000A3",
+"| 	c #0000E9",
+"1 	c #0000DD",
+"2 	c #6B2F04",
+"3 	c #00EC00",
+"4 	c #00AD00",
+"5 	c #00442A",
+"6 	c #00008F",
+"7 	c #000091",
+"8 	c #990001",
+"9 	c #682600",
+"0 	c #00D400",
+"a 	c #00FC00",
+"b 	c #00BE00",
+"c 	c #004126",
+"d 	c #00007F",
+"e 	c #000090",
+"f 	c #0000D8",
+"g 	c #9A000E",
+"h 	c #EE0000",
+"i 	c #9B0000",
+"j 	c #7B0F00",
+"k 	c #00C100",
+"l 	c #00E300",
+"m 	c #004B4D",
+"n 	c #000089",
+"o 	c #0000BC",
+"p 	c #0000FB",
+"q 	c #0000CA",
+"r 	c #002B6E",
+"s 	c #950012",
+"t 	c #FD0000",
+"u 	c #DB0000",
+"v 	c #880000",
+"w 	c #721400",
+"x 	c #00AF00",
+"y 	c #00F700",
+"z 	c #00C400",
+"A 	c #006033",
+"B 	c #00008B",
+"C 	c #0000BE",
+"D 	c #0000F7",
+"E 	c #0000B4",
+"F 	c #004052",
+"G 	c #00D505",
+"H 	c #FE0000",
+"I 	c #FB0000",
+"J 	c #BF0000",
+"K 	c #6E0000",
+"L 	c #5D2200",
+"M 	c #00A700",
+"N 	c #00F400",
+"O 	c #00EF00",
+"P 	c #004742",
+"Q 	c #000088",
+"R 	c #0000CD",
+"S 	c #0000FD",
+"T 	c #0000DE",
+"U 	c #004642",
+"V 	c #00DA00",
+"W 	c #00F101",
+"X 	c #F90003",
+"Y 	c #FC0000",
+"Z 	c #C80000",
+"` 	c #750000",
+" .	c #483A00",
+"..	c #00F300",
+"+.	c #00EE00",
+"@.	c #002165",
+"#.	c #000087",
+"$.	c #000097",
+"%.	c #0000E3",
+"&.	c #000083",
+"*.	c #004B33",
+"=.	c #00D900",
+"-.	c #00D603",
+";.	c #E0000C",
+">.	c #EB0000",
+",.	c #9A0000",
+"'.	c #325600",
+").	c #00AC00",
+"!.	c #00F600",
+"~.	c #00F000",
+"{.	c #00A702",
+"].	c #000970",
+"^.	c #0000A8",
+"/.	c #0000F4",
+"(.	c #0000EA",
+"_.	c #000382",
+":.	c #005126",
+"<.	c #00D700",
+"[.	c #00FF00",
+"}.	c #009505",
+"|.	c #81000D",
+"1.	c #F00000",
+"2.	c #970000",
+"3.	c #285A00",
+"4.	c #00B100",
+"5.	c #00B503",
+"6.	c #000A77",
+"7.	c #00166B",
+"8.	c #00660E",
+"9.	c #00F100",
+"0.	c #00FC01",
+"a.	c #F10006",
+"b.	c #E40000",
+"c.	c #7A0000",
+"d.	c #136300",
+"e.	c #009700",
+"f.	c #00F200",
+"g.	c #009B0B",
+"h.	c #000682",
+"i.	c #00009B",
+"j.	c #002862",
+"k.	c #007203",
+"l.	c #00A500",
+"m.	c #00E800",
+"n.	c #00B20F",
+"o.	c #80000E",
+"p.	c #D30000",
+"q.	c #7E0000",
+"r.	c #146500",
+"s.	c #008A00",
+"t.	c #00C800",
+"u.	c #00FD00",
+"v.	c #00D300",
+"w.	c #007E11",
+"x.	c #00018A",
+"y.	c #0000C6",
+"z.	c #0000E7",
+"A.	c #0000B9",
+"B.	c #00245A",
+"C.	c #007B00",
+"D.	c #00C900",
+"E.	c #00F802",
+"F.	c #E2000C",
+"G.	c #F40000",
+"H.	c #B60000",
+"I.	c #6C0000",
+"J.	c #025709",
+"K.	c #007F00",
+"L.	c #00F800",
+"M.	c #006722",
+"N.	c #0000DA",
+"O.	c #0000F8",
+"P.	c #000084",
+"Q.	c #004C23",
+"R.	c #00A800",
+"S.	c #006E0D",
+"T.	c #D40000",
+"U.	c #9E0000",
+"V.	c #550F00",
+"W.	c #005700",
+"X.	c #006B00",
+"Y.	c #00CE00",
+"Z.	c #00A000",
+"`.	c #005F29",
+" +	c #000095",
+".+	c #0000B3",
+"++	c #0000EE",
+"@+	c #0000B0",
+"#+	c #000485",
+"$+	c #006C01",
+"%+	c #009E00",
+"&+	c #00E600",
+"*+	c #008D09",
+"=+	c #7E001A",
+"-+	c #C40000",
+";+	c #890000",
+">+	c #4B1000",
+",+	c #006E00",
+"'+	c #009300",
+")+	c #005C2A",
+"!+	c #0000A7",
+"~+	c #0000DB",
+"{+	c #0000C5",
+"]+	c #0000C8",
+"^+	c #0000F5",
+"/+	c #0000D5",
+"(+	c #000093",
+"_+	c #002E5E",
+":+	c #007200",
+"<+	c #00EA00",
+"[+	c #9F0035",
+"}+	c #CD0000",
+"|+	c #6F0000",
+"1+	c #3C100B",
+"2+	c #005B00",
+"3+	c #008500",
+"4+	c #00E900",
+"5+	c #008800",
+"6+	c #004924",
+"7+	c #0000A2",
+"8+	c #0000BB",
+"9+	c #0000B5",
+"0+	c #0000C4",
+"a+	c #00008E",
+"b+	c #005E2F",
+"c+	c #008E00",
+"d+	c #00CB00",
+"e+	c #009B00",
+"f+	c #DF001F",
+"g+	c #C60000",
+"h+	c #660000",
+"i+	c #271619",
+"j+	c #005C00",
+"k+	c #004520",
+"l+	c #00006D",
+"m+	c #0000AB",
+"n+	c #0000D3",
+"o+	c #00226A",
+"p+	c #004E3D",
+"q+	c #004E41",
+"r+	c #004E3F",
+"s+	c #004843",
+"t+	c #000E91",
+"u+	c #0000A5",
+"v+	c #00009F",
+"w+	c #000082",
+"x+	c #000A6D",
+"y+	c #007102",
+"z+	c #00AE00",
+"A+	c #00A300",
+"B+	c #003F1A",
+"C+	c #F50000",
+"D+	c #AE0000",
+"E+	c #830000",
+"F+	c #34300A",
+"G+	c #006300",
+"H+	c #005F24",
+"I+	c #000061",
+"J+	c #00006B",
+"K+	c #003655",
+"L+	c #008603",
+"M+	c #008900",
+"N+	c #008200",
+"O+	c #008100",
+"P+	c #006A1A",
+"Q+	c #00058D",
+"R+	c #000068",
+"S+	c #002440",
+"T+	c #006500",
+"U+	c #00BF00",
+"V+	c #003C34",
+"W+	c #9D0000",
+"X+	c #920000",
+"Y+	c #276000",
+"Z+	c #008B00",
+"`+	c #00F500",
+" @	c #00850D",
+".@	c #000058",
+"+@	c #00005E",
+"@@	c #000067",
+"#@	c #002747",
+"$@	c #008C00",
+"%@	c #009000",
+"&@	c #007600",
+"*@	c #006A00",
+"=@	c #00461C",
+"-@	c #000367",
+";@	c #000066",
+">@	c #005A1D",
+",@	c #00D100",
+"'@	c #009200",
+")@	c #001F4E",
+"!@	c #8A0000",
+"~@	c #0A7100",
+"{@	c #00ED00",
+"]@	c #003030",
+"^@	c #001552",
+"/@	c #003447",
+"(@	c #007908",
+"_@	c #00C700",
+":@	c #00DF00",
+"<@	c #00CF00",
+"[@	c #00B800",
+"}@	c #008600",
+"|@	c #002E29",
+"1@	c #000E5A",
+"2@	c #007703",
+"3@	c #008406",
+"4@	c #00056A",
+"5@	c #FF0000",
+"6@	c #F80000",
+"7@	c #AC0000",
+"8@	c #800000",
+"9@	c #086B00",
+"0@	c #00EB00",
+"a@	c #00BD00",
+"b@	c #009600",
+"c@	c #008F00",
+"d@	c #00580D",
+"e@	c #004125",
+"f@	c #006000",
+"g@	c #009500",
+"h@	c #007811",
+"i@	c #000071",
+"j@	c #AF0000",
+"k@	c #630000",
+"l@	c #185D00",
+"m@	c #00E700",
+"n@	c #00E500",
+"o@	c #00FA00",
+"p@	c #009F00",
+"q@	c #006F00",
+"r@	c #00B300",
+"s@	c #006623",
+"t@	c #000075",
+"u@	c #FC0002",
+"v@	c #FA0000",
+"w@	c #790000",
+"x@	c #214E00",
+"y@	c #006C00",
+"z@	c #00A200",
+"A@	c #004B3E",
+"B@	c #E4000E",
+"C@	c #E80000",
+"D@	c #B10000",
+"E@	c #8D0000",
+"F@	c #4B1D00",
+"G@	c #005800",
+"H@	c #00DE00",
+"I@	c #002466",
+"J@	c #B0000F",
+"K@	c #F10000",
+"L@	c #700000",
+"M@	c #144500",
+"N@	c #00FB00",
+"O@	c #00B700",
+"P@	c #00A600",
+"Q@	c #008A02",
+"R@	c #000B83",
+"S@	c #DA0000",
+"T@	c #8C0000",
+"U@	c #5D0D00",
+"V@	c #026100",
+"W@	c #00CA00",
+"X@	c #008700",
+"Y@	c #0D7F00",
+"Z@	c #146700",
+"`@	c #007A00",
+" #	c #008D00",
+".#	c #006D1C",
+"+#	c #0000AA",
+"@#	c #FB0003",
+"##	c #F70000",
+"$#	c #293300",
+"%#	c #00AB00",
+"&#	c #00E400",
+"*#	c #00CD00",
+"=#	c #009100",
+"-#	c #007900",
+";#	c #154E00",
+">#	c #5F1000",
+",#	c #5A0500",
+"'#	c #124B00",
+")#	c #002D69",
+"!#	c #0000AC",
+"~#	c #C30010",
+"{#	c #B20000",
+"]#	c #640100",
+"^#	c #285900",
+"/#	c #00BC00",
+"(#	c #00B500",
+"_#	c #006100",
+":#	c #134E00",
+"<#	c #374A00",
+"[#	c #532900",
+"}#	c #610100",
+"|#	c #5D0000",
+"1#	c #5B0000",
+"2#	c #4F1800",
+"3#	c #018500",
+"4#	c #00D600",
+"5#	c #00711C",
+"6#	c #0003C2",
+"7#	c #583000",
+"8#	c #1A6F00",
+"9#	c #007E00",
+"0#	c #037D00",
+"a#	c #215300",
+"b#	c #5B1E00",
+"c#	c #7C0000",
+"d#	c #840000",
+"e#	c #850000",
+"f#	c #730000",
+"g#	c #3D4C00",
+"h#	c #00D500",
+"i#	c #00AA00",
+"j#	c #009400",
+"k#	c #007100",
+"l#	c #007C04",
+"m#	c #002894",
+"n#	c #D2000A",
+"o#	c #C30000",
+"p#	c #8B0400",
+"q#	c #701900",
+"r#	c #860300",
+"s#	c #8E0000",
+"t#	c #8B0000",
+"u#	c #8F0000",
+"v#	c #900000",
+"w#	c #7C0005",
+"x#	c #00441E",
+"y#	c #006D00",
+"z#	c #007000",
+"A#	c #006700",
+"B#	c #00760C",
+"C#	c #001589",
+"D#	c #0000EB",
+"E#	c #F90000",
+"F#	c #960000",
+"G#	c #AA0000",
+"H#	c #BE0000",
+"I#	c #CF0000",
+"J#	c #C00000",
+"K#	c #BC0000",
+"L#	c #BA0000",
+"M#	c #4B0039",
+"N#	c #000463",
+"O#	c #00500F",
+"P#	c #007300",
+"Q#	c #006900",
+"R#	c #006800",
+"S#	c #006512",
+"T#	c #001B88",
+"U#	c #AD0012",
+"V#	c #E20000",
+"W#	c #C50000",
+"X#	c #CB0000",
+"Y#	c #F30000",
+"Z#	c #D60000",
+"`#	c #7B0000",
+" $	c #24005A",
+".$	c #00007A",
+"+$	c #00086D",
+"@$	c #00323D",
+"#$	c #005827",
+"$$	c #00601A",
+"%$	c #006D1A",
+"&$	c #006120",
+"*$	c #003940",
+"=$	c #000488",
+"-$	c #0000C1",
+";$	c #0000ED",
+">$	c #DC0008",
+",$	c #B30000",
+"'$	c #670000",
+")$	c #560009",
+"!$	c #02006A",
+"~$	c #0000C9",
+"{$	c #0000C3",
+"]$	c #0000B6",
+"^$	c #00009E",
+"/$	c #000094",
+"($	c #0000A9",
+"_$	c #EE0005",
+":$	c #D80000",
+"<$	c #860000",
+"[$	c #310053",
+"}$	c #0000B1",
+"|$	c #0000D9",
+"1$	c #0000F9",
+"2$	c #0000F2",
+"3$	c #0000C7",
+"4$	c #F70007",
+"5$	c #ED0000",
+"6$	c #9C0000",
+"7$	c #6A0000",
+"8$	c #540025",
+"9$	c #0000F0",
+"0$	c #0000E4",
+"a$	c #F00003",
+"b$	c #A60000",
+"c$	c #690000",
+"d$	c #5B0010",
+"e$	c #0D0094",
+"f$	c #0000E2",
+"g$	c #D0000B",
+"h$	c #F60000",
+"i$	c #A70000",
+"j$	c #560013",
+"k$	c #0C007C",
+"l$	c #0000AF",
+"m$	c #0000F1",
+"n$	c #0000A0",
+"o$	c #8B0011",
+"p$	c #FA0004",
+"q$	c #A10000",
+"r$	c #740000",
+"s$	c #680000",
+"t$	c #5E0013",
+"u$	c #0D0089",
+"v$	c #0000AD",
+"w$	c #BB0006",
+"x$	c #550010",
+"y$	c #270065",
+"z$	c #0400A5",
+"A$	c #0000DF",
+"B$	c #0000F6",
+"C$	c #87000F",
+"D$	c #D8000C",
+"E$	c #58000A",
+"F$	c #410048",
+"G$	c #080094",
+"H$	c #01004A",
+"I$	c #0000CF",
+"J$	c #0000BD",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                    . + @ # $ % % & & * =                                       ",
+"                              - ; > , ' ) ! ~ { % & & & & & & ]                                 ",
+"                          ^ / ( ( ( _ : < [ } | % & & & & & & & & 1                             ",
+"                        2 3 ( ( ( ( > 4 5 6 7 # % & & & & & & & & & & =                         ",
+"                      8 9 0 ( ( ( ( a b c d e = { & & & & & & & & & & % f                       ",
+"                  g h i j k a ( ( ( ( l m n e o p & & & & & & & & & & { q r                     ",
+"                s t u v w x y ( ( ( y z A B 6 C p & & & & & & & & & % D E F G                   ",
+"                H I J K L M N ( ( ( O x P Q e R S & & & & & & & & & S T B U V W                 ",
+"              X H Y Z `  .M ..( ( ( +.4 @.#.$.%.% & & & & & & & & & % T &.*.=.( -.              ",
+"            ;.H H H >.,.'.).!.( ( ( ~.{.].#.^./.% & & & & & & & & & % (._.:.<.( [.}.            ",
+"          |.H H H H 1.2.3.4.> ( ( ( > 5.6.B = p % & & & & & & & & & % | 7.8., 9.( 0.            ",
+"          a.H H H H b.c.d.e.l ( ( ( f.g.h.i.%.% % & & & & & & & & & % | j.k.l.m.( [.n.          ",
+"        o.H H H H Y p.q.r.s.t.( ( u.v.w.x.y.p % % & & & & & & & & S z.A.B.C.D.> ( [.E.          ",
+"        F.H H H H G.H.I.J.K.D.( ( L.4.M.[ N.{ % % & & & & & & & & O.= P.Q.R.O ( [.( f.S.        ",
+"        H H H H t T.U.V.W.X.Y.( ( ~.Z.`. +.+(.% % & % { S % & & % ++ at +#+$+%++.[.[.( &+*+        ",
+"      =+H H H H Y -+;+>+W.,+V ( ( &+'+)+@ !+~+% % /.N.{+]+(.D ^+{ /+(+_+:+Z.<+[.[.[.<+%+        ",
+"      [+H H H H H }+|+1+2+3+<+( ( 4+5+6+(+7+8+/.| 9+ +e e ^.0+8+] 8+a+b+c+d+L.[.[.[.4+e+        ",
+"      f+H H H H H g+h+i+j+'+..( ( y e+k+l+(+m+n+!+o+p+q+r+s+t+u+v+w+x+y+z+!.( [.[.[.+.A+B+      ",
+"      H H H H H C+D+E+F+G+R.> ( ( ( v.H+I+J+e 6 K+L+s.M+N+O+P+Q+7 R+S+T+U+u.[.[.[.( 3 l.V+      ",
+"      H H H H H >.W+X+Y+Z+_ ( ( ( ( `+ @. at +@@@#@5+s.$@%@&@*@*@=@-@;@>@O+V ( [.[.[.a ,@'@)@      ",
+"      H H H H H h U.!@~@$@{@( ( ( ( u., ]@^@/@(@s.e+_@:@<@[@}@j+|@1 at 2@%@3 [.[.[.( O 4.3 at 4@      ",
+"      5 at 5@5 at 5@5 at 6@7 at 8@9 at N+0@( [.[.[.( 9.a at Z.b@c@: 0 a ( u.a l c at d@e at f@g at ..[.[.[.> _ at g@h at i@      ",
+"      5 at 5@5 at 5@5 at Y j at k@l@$@m.[.[.[.[.[.( a ..m at V n at o@[.[.[.[.( 3 p at q@5+0 u.[.[.[...r at c+s@t@      ",
+"      u at 5@5 at 5@H v at Z w at x@y at t.( [.[.[.[.[.[.[.( ( ( [.( ( ( [.[.( m., at m.a [.[.[.( 4+z at Z+A@i@      ",
+"      B at 5@5 at 5@H C at D@E at F@G at e.y [.[.[.( ( ( u.( ( > 3 :@H@<+a [.[.( ( ( [.[.[.[.( m.l.c at I@        ",
+"      J at 5@5 at 5@H K at p.7@L at M@&@m@[.[.[.( u.[.( N at m.O@p at g@g at l.n@( [.[.[.[.[.[.[.[.( m.P at Q@R@        ",
+"        5 at 5@5 at 5@H Y S at T@U at V@W@( ( ( ( a > 3 V R.X@}@Y at Z@`@4.~.( [.[.[.[.[.[.[.> k  #.#+#        ",
+"        @#5 at 5@5 at 5@5@##J c.$#%#o at L.&#<++.*#=#-#3+&@;#>#,#'#3+O at ..( [.[.[.[.( y _@'+s.)#!#        ",
+"        ~#5 at 5@5 at 5@5 at H ##{#]#^#/#(#M+'@=#*@_#:#<#[#}#|#1#2#3#e+4#{@a u.N at o@f.D.'@3+5#6#          ",
+"          H 5 at 5@5 at 5@5 at H C at q.|+7#8#9#O+0#a#b#c#;+;+d#e#f#8 at g#3+'@).H at h#[@%#i#j#k#l#m#|           ",
+"          n#5 at 5@5 at 5@5 at 5@Y o#;+;+X+p#q#r#v !@s#t#t#u#v#;+;+w#x#y#%@M j#z#A#K.X at B#C#D#            ",
+"            H 5 at 5@5 at 5@5 at 5@E#o#F#v#E at t#X+G#H#I#J#K#L#G#!@v M#N#O#z#O+X.P#Q#R#S#T#]+%.            ",
+"            U#5 at 5@5 at 5@5 at 5@5 at v@V#W#{#{#X#Y#Y H Y Y v at Z#`#L@ $.$+$@$#$$$%$&$*$=$-$;$              ",
+"              >$5 at 5@5 at 5@5 at 5@5 at H Y 6 at 6@I H 5 at 5@5 at H C+,$'$)$!$(+~${$]$@+^$/$($n+* v+              ",
+"                _$5 at 5@5 at 5@5 at 5@5 at 5@5 at 5@5 at 5@5 at 5@5 at t :$<$k@[$}$|$1${ $ 2$] # ++{ 3$                ",
+"                  4$5 at 5@5 at 5@5 at 5@5 at 5@5 at 5@5 at 5@5 at H 5$6$7$8$($9$% & & & % p { % 0$                  ",
+"                    a$5 at 5@5 at 5@5 at 5@5 at 5@5 at 5@5 at H 1.b$c$d$e$f${ & & & & & & & 3$                    ",
+"                      g$5 at 5@5 at 5@5 at 5@5 at H I h$u i$c$j$k$l$m$% & & & & & & n$                      ",
+"                        o$p$5 at 5@5 at 5@H G.-+q$r$s$t$u$v$~$1$& & & & & (.                          ",
+"                            w$I 5 at H 6 at H#L at h+x$y$z$8+A$^+% & & & B$                              ",
+"                                C$D$Z 8 at E$F$G$}$(.^+{ % & & q                                   ",
+"                                        H$w+i.v+]+I$J$                                          ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                "};

Added: unstable/liquidwar/branches/upstream/current/misc/liquidwar_32x32.xpm
===================================================================
--- unstable/liquidwar/branches/upstream/current/misc/liquidwar_32x32.xpm	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/misc/liquidwar_32x32.xpm	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,380 @@
+/* XPM */
+static char * liquidwar_32x32_xpm[] = {
+"32 32 345 2",
+"  	c None",
+". 	c #005630",
+"+ 	c #000A87",
+"@ 	c #0000CE",
+"# 	c #0000F8",
+"$ 	c #0000FE",
+"% 	c #0000FF",
+"& 	c #0000EC",
+"* 	c #0000E6",
+"= 	c #03C906",
+"- 	c #00DF04",
+"; 	c #00FA01",
+"> 	c #00B607",
+", 	c #00474A",
+"' 	c #00009F",
+") 	c #0000DC",
+"! 	c #0000FA",
+"~ 	c #0000F9",
+"{ 	c #476902",
+"] 	c #00F500",
+"^ 	c #00FE00",
+"/ 	c #00E200",
+"( 	c #00681B",
+"_ 	c #00008C",
+": 	c #0000B7",
+"< 	c #0000E3",
+"[ 	c #B60009",
+"} 	c #AF0000",
+"| 	c #4E5200",
+"1 	c #00EB00",
+"2 	c #00F000",
+"3 	c #00772B",
+"4 	c #000089",
+"5 	c #0000AE",
+"6 	c #0000FD",
+"7 	c #000BB6",
+"8 	c #B8000C",
+"9 	c #EE0000",
+"0 	c #9B0000",
+"a 	c #474A00",
+"b 	c #00DD00",
+"c 	c #007925",
+"d 	c #0000B2",
+"e 	c #0000F4",
+"f 	c #001688",
+"g 	c #00A51C",
+"h 	c #FD0001",
+"i 	c #E90000",
+"j 	c #8E0000",
+"k 	c #355900",
+"l 	c #00DA00",
+"m 	c #00D900",
+"n 	c #00583C",
+"o 	c #0000C4",
+"p 	c #0000E9",
+"q 	c #00186C",
+"r 	c #00A913",
+"s 	c #00F101",
+"t 	c #F10005",
+"u 	c #FE0000",
+"v 	c #F80000",
+"w 	c #B50000",
+"x 	c #1F7400",
+"y 	c #00DF00",
+"z 	c #00DB01",
+"A 	c #003F4D",
+"B 	c #000096",
+"C 	c #0000DF",
+"D 	c #0000F0",
+"E 	c #00245C",
+"F 	c #00A60A",
+"G 	c #00FB00",
+"H 	c #00CF02",
+"I 	c #CC0008",
+"J 	c #F70000",
+"K 	c #A50000",
+"L 	c #117500",
+"M 	c #00D100",
+"N 	c #00D903",
+"O 	c #003B57",
+"P 	c #0000AC",
+"Q 	c #003B46",
+"R 	c #009702",
+"S 	c #00F100",
+"T 	c #DF0004",
+"U 	c #930000",
+"V 	c #096D02",
+"W 	c #00B200",
+"X 	c #00FC00",
+"Y 	c #00AD08",
+"Z 	c #002865",
+"` 	c #0000B8",
+" .	c #004F30",
+"..	c #00BC00",
+"+.	c #00FF00",
+"@.	c #00E303",
+"#.	c #FB0001",
+"$.	c #CC0000",
+"%.	c #750700",
+"&.	c #006002",
+"*.	c #00AE00",
+"=.	c #00F600",
+"-.	c #008F0D",
+";.	c #002170",
+">.	c #0000D0",
+",.	c #0000DD",
+"'.	c #000295",
+").	c #007708",
+"!.	c #00D500",
+"~.	c #00C803",
+"{.	c #B00017",
+"].	c #FD0000",
+"^.	c #590B02",
+"/.	c #006200",
+"(.	c #00EF00",
+"_.	c #007C0D",
+":.	c #001D73",
+"<.	c #0000B4",
+"[.	c #0000ED",
+"}.	c #0000EF",
+"|.	c #0000CC",
+"1.	c #0000CA",
+"2.	c #0000E5",
+"3.	c #0000EA",
+"4.	c #0000B9",
+"5.	c #002965",
+"6.	c #008C00",
+"7.	c #00D000",
+"8.	c #DB001A",
+"9.	c #A90000",
+"0.	c #420D0E",
+"a.	c #006D00",
+"b.	c #00CF00",
+"c.	c #007B0B",
+"d.	c #00175C",
+"e.	c #0000A0",
+"f.	c #0000CF",
+"g.	c #0008AA",
+"h.	c #002A68",
+"i.	c #00345B",
+"j.	c #003161",
+"k.	c #0006A5",
+"l.	c #0000AF",
+"m.	c #00028B",
+"n.	c #004933",
+"o.	c #00BA00",
+"p.	c #00D300",
+"q.	c #00690F",
+"r.	c #F60000",
+"s.	c #9E0000",
+"t.	c #4D2B04",
+"u.	c #008900",
+"v.	c #00E500",
+"w.	c #00B809",
+"x.	c #002448",
+"y.	c #000070",
+"z.	c #00097B",
+"A.	c #006326",
+"B.	c #008A01",
+"C.	c #008700",
+"D.	c #007B00",
+"E.	c #00502E",
+"F.	c #000A7A",
+"G.	c #001256",
+"H.	c #005C11",
+"I.	c #00CC00",
+"J.	c #005628",
+"K.	c #F30000",
+"L.	c #980000",
+"M.	c #3C4800",
+"N.	c #00AA00",
+"O.	c #00DF01",
+"P.	c #004D2A",
+"Q.	c #001555",
+"R.	c #004A2F",
+"S.	c #008D00",
+"T.	c #00A900",
+"U.	c #00BE00",
+"V.	c #00A400",
+"W.	c #006F03",
+"X.	c #00312C",
+"Y.	c #002B43",
+"Z.	c #008104",
+"`.	c #00EE00",
+" +	c #00F700",
+".+	c #00AB01",
+"++	c #003742",
+"@+	c #FF0000",
+"#+	c #FB0000",
+"$+	c #304400",
+"%+	c #00A700",
+"&+	c #00F800",
+"*+	c #00DE00",
+"=+	c #00B800",
+"-+	c #00AB00",
+";+	c #00C200",
+">+	c #00F400",
+",+	c #00FD00",
+"'+	c #00D700",
+")+	c #008406",
+"!+	c #005A10",
+"~+	c #009600",
+"{+	c #00F900",
+"]+	c #008808",
+"^+	c #002654",
+"/+	c #FE0001",
+"(+	c #FC0000",
+"_+	c #A60000",
+":+	c #3A3700",
+"<+	c #009500",
+"[+	c #00F300",
+"}+	c #00BF00",
+"|+	c #007912",
+"1+	c #001C5E",
+"2+	c #E1000A",
+"3+	c #F10000",
+"4+	c #B00000",
+"5+	c #6D0D00",
+"6+	c #046500",
+"7+	c #00CA00",
+"8+	c #00E900",
+"9+	c #006726",
+"0+	c #DF0006",
+"a+	c #E20000",
+"b+	c #2E3800",
+"c+	c #00B000",
+"d+	c #00CB00",
+"e+	c #009400",
+"f+	c #068900",
+"g+	c #097C00",
+"h+	c #00AF00",
+"i+	c #00EC00",
+"j+	c #00A800",
+"k+	c #005041",
+"l+	c #F70002",
+"m+	c #DF0000",
+"n+	c #720B00",
+"o+	c #1D6B00",
+"p+	c #00E400",
+"q+	c #00CD00",
+"r+	c #027A00",
+"s+	c #0E6F00",
+"t+	c #224F00",
+"u+	c #4E1900",
+"v+	c #491600",
+"w+	c #0D6C00",
+"x+	c #008606",
+"y+	c #001790",
+"z+	c #F60002",
+"A+	c #B60000",
+"B+	c #611400",
+"C+	c #2D6C00",
+"D+	c #068300",
+"E+	c #018600",
+"F+	c #0F6800",
+"G+	c #462C00",
+"H+	c #671900",
+"I+	c #770900",
+"J+	c #780000",
+"K+	c #6D0300",
+"L+	c #414200",
+"M+	c #00B900",
+"N+	c #00E600",
+"O+	c #00C400",
+"P+	c #007D01",
+"Q+	c #005549",
+"R+	c #0001DC",
+"S+	c #F00000",
+"T+	c #8F0000",
+"U+	c #8E0200",
+"V+	c #7F0C00",
+"W+	c #900100",
+"X+	c #9F0000",
+"Y+	c #9C0000",
+"Z+	c #9A0000",
+"`+	c #890000",
+" @	c #75000F",
+".@	c #004025",
+"+@	c #007A02",
+"@@	c #007800",
+"#@	c #007A04",
+"$@	c #003F58",
+"%@	c #0005D0",
+"&@	c #DA0008",
+"*@	c #EF0000",
+"=@	c #C20000",
+"-@	c #AA0000",
+";@	c #AB0000",
+">@	c #CF0000",
+",@	c #EA0000",
+"'@	c #E60000",
+")@	c #D10000",
+"!@	c #7D0000",
+"~@	c #490035",
+"{@	c #000C66",
+"]@	c #003A35",
+"^@	c #006517",
+"/@	c #006B11",
+"(@	c #005B1C",
+"_@	c #00304F",
+":@	c #0006BF",
+"<@	c #0000E2",
+"[@	c #F20003",
+"}@	c #BC0000",
+"|@	c #5C000B",
+"1@	c #190062",
+"2@	c #0000BA",
+"3@	c #0000D7",
+"4@	c #0000B0",
+"5@	c #0000D6",
+"6@	c #0000D3",
+"7@	c #FB0003",
+"8@	c #DC0000",
+"9@	c #880000",
+"0@	c #41003F",
+"a@	c #0500C1",
+"b@	c #0000F5",
+"c@	c #0000FC",
+"d@	c #0000F2",
+"e@	c #0000F1",
+"f@	c #EF0003",
+"g@	c #F90000",
+"h@	c #E10000",
+"i@	c #820002",
+"j@	c #4C0025",
+"k@	c #0600B6",
+"l@	c #0000D9",
+"m@	c #CA0008",
+"n@	c #850000",
+"o@	c #4E0029",
+"p@	c #0F0089",
+"q@	c #0000D2",
+"r@	c #0000F7",
+"s@	c #EC0002",
+"t@	c #E90004",
+"u@	c #D30000",
+"v@	c #7E0002",
+"w@	c #500024",
+"x@	c #250068",
+"y@	c #0200C2",
+"z@	c #0000E0",
+"A@	c #2C002D",
+"B@	c #0F007D",
+"C@	c #0100A1",
+"D@	c #0000D5",
+"                                                                ",
+"                                                                ",
+"                        . + @ # $ % & *                         ",
+"                  = - ; > , ' ) $ % % % ! ~                     ",
+"                { ] ^ ^ / ( _ : $ % % % % % % <                 ",
+"            [ } | 1 ^ ^ 2 3 4 5 6 % % % % % % 6 7               ",
+"          8 9 0 a b ^ ^ / c _ d 6 % % % % % % e f g             ",
+"          h i j k l ^ ^ m n _ o $ % % % % % % p q r s           ",
+"        t u v w x y ^ ^ z A B C $ % % % % % % D E F G H         ",
+"      I u u J K L M ^ ^ N O P D $ % % % % % % D Q R S ^         ",
+"      T u u i U V W ^ X Y Z ) 6 $ % % % % % D `  ...X +. at .      ",
+"      #.u u $.%.&.*.^ =.-.;.>.~ $ % 6 $ % % ,.'.).!.+.^ ~.      ",
+"    {.u u ].} ^./...^ (._.:.<.[.}.|.<.1.2.3.4.5.6.m +.+.7.      ",
+"    8.u u u 9.0.a.b.^ =.c.d.e.f.g.h.i.j.k.l.m.n.o.] +.+.p.q.    ",
+"    u u u r.s.t.u.v.^ ^ w.x.y.z.A.B.C.D.E.F.G.H.l ^ +.^ I.J.    ",
+"    u u u K.L.M.N.=.^ ^ O.P.Q.R.S.T.U.V.W.X.Y.Z.`.+.+. +.+++    ",
+"    @+ at +@+#+0 $+%+&++.+.G *+=+-+;+>+^ ,+'+)+!+~+{++.X p.]+^+    ",
+"    /+ at +@+(+_+:+<+2 +.+.+.^ {+[+&+^ ^ +.X b =+/ +.+.&+}+|+1+    ",
+"    2+ at +@+3+4+5+6+7.+.+.^ ^ ,+{+b 7+7+8++.+.^ +.+.+. +..9+      ",
+"    0+ at +@+#+a+0 b+c+^ ^ ,+G `.d+e+f+g+h+&++.+.+.+.+.i+j+k+      ",
+"      l+ at +@+].m+n+o+p+b.q+=+r+s+t+u+v+w+;+[+^ ^ X `.j+x+y+      ",
+"      z+ at +@+ at +].A+B+C+D+E+F+G+H+I+J+K+L+~+M+N+!.O+h+P+Q+R+      ",
+"        @+ at +@+ at +S+} T+U+V+W+s.X+Y+Z+`+ @. at +@e+@@a.#@$@%@        ",
+"        &@@+ at +@+u *@=@-@;@>@,@,@'@)@!@~@{@]@^@/@(@_@:@<@        ",
+"          [@@+ at +@+ at +u #+#+u @+ at +v }@|@1 at 2@3 at 1.: 4 at 5@6@          ",
+"            7@@+ at +@+ at +@+ at +@+ at +@+8 at 9@0 at a@b@$ c at d@e at D             ",
+"              f@@+ at +@+ at +@+u g at h@i at j@k at b@% % % % l@              ",
+"                m@/+ at +@+(+h at 4+n@o at p@q at c@% % ! r@                ",
+"                    s at t@u at v@w at x@y at z@! % d@~                     ",
+"                          A at B@C at 5@D@                            ",
+"                                                                ",
+"                                                                "};

Added: unstable/liquidwar/branches/upstream/current/misc/liquidwar_notify.sh
===================================================================
--- unstable/liquidwar/branches/upstream/current/misc/liquidwar_notify.sh	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/misc/liquidwar_notify.sh	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,81 @@
+#!/bin/sh
+
+#############################################################################
+# Liquid War is a multiplayer wargame                                       #
+# Copyright (C) 1998-2005 Christian Mauduit                                 #
+#                                                                           #
+# 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 #
+#                                                                           #
+# Liquid War homepage : http://www.ufoot.org/liquidwar                      #
+# Contact author      : ufoot at ufoot.org                                     #
+#############################################################################
+
+# A basic script which might for instance be called whenever someone
+# connects on your server, if you use the "-callback" option.
+
+# For now this script simpy send a notification mail to a list of
+# people. You have to parameter the list manually, or else it won't
+# send anything to anyone. Be carefull to put email addresses that
+# correspond to friends and/or people you know, and won't feel offensed
+# by receiving everytime someone connects.
+
+# You might also imagine to write a program that pops-up a window,
+# or a windows .bat file that plays a sound or pops-up a window as well.
+# In fact, you can put pretty much anything in that script. Simply put
+# whatever you find a convenient way to be informed that someones is 
+# ready to play.
+
+HOSTNAME=`hostname`
+DATE=`date`
+SUBJECT="[liquidwar-bot] Connection"
+
+#####################
+# I M P O R T A N T #
+#####################
+
+# You need to uncomment the line bellow, and put the right email 
+# addresses. Putting your address here would possibly be a good choice.
+
+#RECEIVERS="ufoot at ufoot.org"
+
+if test "$RECEIVERS" == "" ; then
+    echo "You need to parameter this script first!"
+    exit 1
+fi
+
+for r in $RECEIVERS; do
+    echo "Sending notification to $r"
+    mail -s "$SUBJECT" $r <<EOF
+Hi,
+
+This is the Liquid War server running on "$HOSTNAME".
+Please notice that someone connected ($DATE).
+
+He/she might be waiting for you to play with him. Ready for a game?
+
+The Liquid War bot.
+
+PS: please note that if you've received this mail it means that the
+person running the server decided to activate the feature "send a mail 
+whenever someone connects" and manually parametered it so that you are 
+the receiver of the mail. Therefore the author(s) of Liquid War are 
+absolutely not the authors of this mail, and also they probably do not
+even know your e-mail. If you think this is spam, please try and find
+out who's the sender by tracking down infos such as IP addresses. But be
+sure that we (Liquid War team) are not responsible for this. Final dot.
+
+EOF
+done
+


Property changes on: unstable/liquidwar/branches/upstream/current/misc/liquidwar_notify.sh
___________________________________________________________________
Name: svn:executable
   + 

Added: unstable/liquidwar/branches/upstream/current/misc/liquidward.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/misc/liquidward.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/misc/liquidward.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,133 @@
+#! /bin/bash
+
+#############################################################################
+# Liquid War is a multiplayer wargame                                       #
+# Copyright (C) 1998-2005 Christian Mauduit                                 #
+#                                                                           #
+# 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 #
+#                                                                           #
+# Liquid War homepage : http://www.ufoot.org/liquidwar                      #
+# Contact author      : ufoot at ufoot.org                                     #
+#############################################################################
+
+# Script used to start Liquid War servers, and run them as UNIX daemons.
+#
+# Typically, you could place this file in /etc/init.d, so that servers
+# are started automatically when you boot your computer.
+#
+# Keep in mind that Liquid War is a *game* so its code might not be
+# 100% exploit proof, and anyway, since Liquid War comes with 
+# NO WARRANTY at all, you simply run it at your own risks. 
+# This is not to scare you, but rather to insist on the fact that
+# you should never run Liquid War servers as root. Run it under a
+# "basic" user, which has very few rights, since the only rights the 
+# Liquid War daemon needs are:
+# - be able to bind on a socket > 1024
+# - be able to append stuff to a log file
+# - be able to write its pid in a file
+# None of these requires to be logged as root, so don't do it.
+#
+# Also keep in mind that running this script with its default options
+# will make the Liquid War server you run on your computer register
+# itself on the meta-server on www.ufoot.org. So people will be aware
+# that you have a Liquid War server on your machine. While this is good
+# for people who try to automatically find other online fellows, 
+# you might find this behaviour somewhat intrusive. Change the $PRIVACY
+# value if the default behaviour does not match your needs.
+
+# Clear our environment so we don't leak.
+unset `env | sed s/=.*//`
+
+prefix=@prefix@
+
+NAME=liquidward
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+DAEMON=$prefix/games/liquidwar-server
+PIDFILE=/var/games/liquidwar/$NAME.pid
+LOGFILE=/var/games/liquidwar/$NAME.log
+
+# As start-stop-daemon seems to be a quite Debian-specific utility,
+# this script is in a way designed for Debian. If you want to run it
+# on a box which does not have start-top-daemon, you'll need to
+# edit the $START and $STOP commands to match your system.
+START="start-stop-daemon --start --background --make-pidfile"
+STOP="start-stop-daemon --stop"
+
+# maximum number of players who can connect on this server
+# by default: 6, which is the maximum
+NBPLAYERS=6
+
+# privacy policy:
+# public -> the server is listed on www.ufoot.org
+# private -> the server does not register itself
+# by default, it is public, but you might want to change this
+PRIVACY=public
+
+# the password which client will have to give to be able
+# to connect themselves on this server
+# by default, no password is used
+PASSWORD=
+
+# the comment which will be associated to the server
+# by default, it contains the name of the machine, but you might
+# want to put your e-mail here for instance
+COMMENT="Public_server_running_on_"`hostname` 
+
+# the user which should be used to start the daemon
+# by default, it is set to "nobody:games", this assumes that
+# there's a games group on your machine which has sufficient rights
+# to write the pid and log files. If this is not the case, you'll
+# need to either create a games group (and maybe a nobody user as weel)
+# or change the $USER value, but remember: do *not* set it to root!
+USER=nobody:games
+
+# if you want the server to warn you whenevver someone connects on it,
+# you might set up a callback script by uncommenting the line below.
+# You'll also need to edit and install the liquidwar_notify.sh script 
+# manually
+CALLBACK=$prefix/games/liquidwar_notify.sh
+
+OPTIONS=" -"$NBPLAYERS" -"$PRIVACY" -log "$LOGFILE" -password "$PASSWORD" -comment \""$COMMENT"\" -callback "$CALLBACK
+
+export LANG=C
+export PATH
+
+test -f $DAEMON || exit 0
+
+case "$1" in
+    start)
+	echo "Starting" $NAME
+	$START --pidfile $PIDFILE --chuid $USER --exec $DAEMON -- $OPTIONS
+	;;
+
+    stop)
+	$STOP --pidfile $PIDFILE --chuid $USER
+	rm -f $PIDFILE
+	;;
+
+    restart)
+	$0 stop
+	sleep 1
+	$0 start
+	;;
+
+    *)
+	echo "Usage: $NAME {start|stop|restart}"
+	exit 1
+	;;
+esac
+
+exit 0
+

Added: unstable/liquidwar/branches/upstream/current/misc/lwpopup.js
===================================================================
--- unstable/liquidwar/branches/upstream/current/misc/lwpopup.js	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/misc/lwpopup.js	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,14 @@
+var wshShell;
+var strText;
+var intDelay;
+var strTitle;
+var intType;
+
+wshShell=WScript.CreateObject("WScript.Shell");
+strText="Someone just connected on your server. Ready for a game?";
+intDelay=5;
+strTitle="Liquid War Server"
+intType=0|64; // OK|Information 
+
+wshShell.Popup(strText,intDelay,strTitle,intType);
+

Added: unstable/liquidwar/branches/upstream/current/misc/lwserver.bat
===================================================================
--- unstable/liquidwar/branches/upstream/current/misc/lwserver.bat	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/misc/lwserver.bat	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,16 @@
+ at echo off
+
+rem This is a sample windows server starting script.
+rem Simply click on it in explorer, and it should launch a server
+rem which will popup a window each time someone connects on it.
+rem You'd better run LW in windowed mode if you use this BTW.
+rem You might also add the "-public" option if you don't want
+rem to be prompted with it all the time. Basically replace
+rem "lwwinsrv.exe -6" by "lwwinsrv.exe -public -6".
+rem Also, we use -nobeep since the popup makes the default
+rem beep pretymuch useless.
+rem Last point: you'll need to have windows scripting host installed.
+
+..\lwwinsrv.exe -6 -nobeep -callback "cscript lwpopup.js"
+
+

Added: unstable/liquidwar/branches/upstream/current/misc/macosx_info.plist.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/misc/macosx_info.plist.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/misc/macosx_info.plist.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleExecutable</key>
+	<string>Liquid War</string>
+	<key>CFBundleIconFile</key>
+	<string>Liquid War.icns</string>
+	<key>CFBundleIdentifier</key>
+	<string>com.ufoot.liquidwar</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>Liquid War</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>@VERSION@</string>
+	<key>CFBundleSignature</key>
+	<string>RRdb</string>
+	<key>CFBundleVersion</key>
+	<string>4</string>
+</dict>
+</plist>

Added: unstable/liquidwar/branches/upstream/current/misc/macosx_launcher.sh
===================================================================
--- unstable/liquidwar/branches/upstream/current/misc/macosx_launcher.sh	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/misc/macosx_launcher.sh	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,86 @@
+#!/bin/sh
+# Application bundle launcher for Liquid War
+# Copyright (C) 2003 Ryan Brown
+
+#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. 
+# prefs="$HOME/Library/Preferences/liquidwar.cfg"
+resources=`dirname "$0"`
+resources=`dirname "$resources"`
+resources="$resources/Resources"
+prefs=~/Library/Preferences/liquidwar.cfg
+parameters="-cfg $prefs -dat liquidwar.dat -map map -tex texture -mid music"
+liquidwar="$resources/liquidwar"
+# Becuase I can't get liquidwar to find the files when they
+# have a space in their filename.
+cd "$resources"
+
+if [ "x`ps ax|grep -e \\\\besd\\\\b`" = 'x' ] ; then 
+    if [ -d /sw/bin ]; then
+	PATH=$PATH:$d
+    fi
+    export PATH
+    esd=`which esd`
+    if [ "x$esd" = "x" ] ; then 
+	:
+    else
+	($esd -nobeeps) &
+	esdpid=$!
+    fi
+fi
+
+for d in /usr/X11R6/bin /usr/bin/X11 /usr/local/bin/X11; do
+	PATH=$PATH:$d
+done
+export PATH
+case `ps ax` in
+    *X11*)
+	xrunning=true
+	;;
+    *XDarwin*)
+	xrunning=true
+	;;
+    *)
+	xrunning=0
+	;;
+esac
+if [ $xrunning = true ] ; then
+    if [ "x$DISPLAY" = "x" ]; then
+	DISPLAY=":0"
+	export DISPLAY
+    fi
+    "$liquidwar" $parameters
+else
+    for server in "/Applications/X11.app/Contents/MacOS/X11" "/Applications/XDarwin.app/Contents/MacOS/XDarwin" "$HOME/Applications/X11.app/Contents/MacOS/X11" "$HOME/Applications/XDarwin.app/Contents/MacOS/XDarwin" `which X` ;
+      do
+      if [ -x "$server" ] ; then
+	  echo running \"xinit \"$liquidwar\" $parameters -- $server\"
+	  xinit "$liquidwar" $parameters -- $server
+	  if [ "x$esdpid" = "x" ]; then
+	      exit 0
+	  else
+	      kill $esdpid
+	  fi
+	  exit 0
+      else
+	  echo $server isn\'t executable
+      fi
+    done
+fi
+if [ "x$esdpid" = "x" ]; then
+    exit 0
+else
+    kill $esdpid
+fi
+exit 0


Property changes on: unstable/liquidwar/branches/upstream/current/misc/macosx_launcher.sh
___________________________________________________________________
Name: svn:executable
   + 

Added: unstable/liquidwar/branches/upstream/current/misc/macosx_readme.rtf
===================================================================
--- unstable/liquidwar/branches/upstream/current/misc/macosx_readme.rtf	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/misc/macosx_readme.rtf	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,32 @@
+{\rtf1\mac\ansicpg10000\cocoartf102
+{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fmodern\fcharset77 Courier;}
+{\colortbl;\red255\green255\blue255;}
+\margl1440\margr1440\vieww9000\viewh9000\viewkind0
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
+
+\f0\fs24 \cf0 Liquid War Client\
+\
+Requirements:\
+	Mac OS X ( Tested with 10.2.4 )\
+	X Server ( Tested with Apple's X11 Beta and XDarwin )\
+	ESound ( Only needed for sound. Available from Fink )\
+\
+This is application bundle attempts to detect if the X server and esd are running.  If not, it will try to start them before running Liquid War.  This works on my computer, there's no guarantee it will work on yours.  If you have problems, try manually starting esd and X.  Sometimes there seems to be a delay between launching X and launching Liquid War.  Moving the mouse around and clicking on the menu bar usually make Liquid War start.  Sometimes there will be no sound even though esd is running.  I have no clue why.  \
+\
+For more information, go to http://www.ufoot.org/liquidwar/\
+\
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
+
+\f1\fs28 \cf0 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. }
\ No newline at end of file

Added: unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_imagestompeg.sh
===================================================================
--- unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_imagestompeg.sh	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_imagestompeg.sh	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,190 @@
+#!/bin/bash
+#
+# This is a script to convert a group of still-frame images to an mpeg animation.
+# The still frame images may be in any format ImageMagick's 'convert' utility handles.
+#
+# ./mpeg_utils_imagetompeg.sh is part of a group of unix shell scripts to aid in converting a group
+# of still-frame images to an mpeg-1 animation.
+# More information can be found at http://marc.me.utexas.edu/mpeg_tools.html.
+#
+# There is very little error handling.  Incorrect inputs are likley to cause errors.
+#
+# This script acts as a main script that calls other scripts to automate the following
+# typical animation steps:
+#  (1) convert images from their native format to ppm or yuv with:
+#         ./mpeg_utils_imagetoppm.sh ./images/scenario1*.tif
+#         ./mpeg_utils_imagetoyuv.sh ./images/scenario1*.tif
+#  (2) make the encoder parameter file with:
+#         ./mpeg_utils_make_mpeg2encode_parfile.sh ./images/scenario1*.ppm (use ppm images here to get image info properly in case padding was required)
+#         ./mpeg_utils_make_mpeg2encode_parfile.sh ./images/scenario1*.tif (use tif images here if using yuv's to get image info properly)
+#  (3) run the encoder with:
+#         mpeg2encode mpeg2encode.par scenario1.mpg 
+#
+#
+# This script relies upon:
+#       convert                  (from ImageMagick, http://www.imagemagick.org)
+#       identify                 (from ImageMagick, http://www.imagemagick.org)
+#	mpeg2encode              (from http://www.mpeg.org/MSSG/)
+#	./mpeg_utils_imagetoppm.sh               (from http://marc.me.utexas.edu/tmp/mpeg_encoding_solution/)
+#       pnmpad                   (from the netpbm-progs rpm)
+#	./mpeg_utils_make_mpeg2encode_parfile.sh (from http://marc.me.utexas.edu/tmp/mpeg_encoding_solution/)
+#	awk
+#	bash
+#
+# usage:
+#          ./mpeg_utils_imagetompeg.sh mpegname imagenames
+#
+# examples: ./mpeg_utils_imagetompeg.sh sequence1.mpg /tmp/sequence_1*.tif
+#           ./mpeg_utils_imagetompeg.sh test.mpg      /tmp/frames*.bmp  
+#           ./mpeg_utils_imagetompeg.sh my_movie.mpg /tmp/images/movie_frame000*.gif
+#	
+# limitations:
+#  - Valid imput image formats are limited by ImageMajick's convert utility.
+#  - Input files must end with an extemsion seprated by a '.', however awk's split() function
+#    allows them to contain the '.' character elsewhere in the filename.
+#
+# Marc Compere
+# CompereM at asme.org
+# created : 01 October 2001
+# modified: 05 April 2002
+
+#echo $*
+
+
+# pick apart the first filename to make sure it's the name of an mpeg
+# -----------------------------------------------------
+   # this awk script provides the capability to correctly determine the filename extension 
+   # including the possibile case where there are multiple occurrences of the "." character
+   # in the filename before the extension.
+   names=(`echo $1 | awk '{num_fields=split($1,fields,".")}
+                                     {basename=fields[1]}
+                                     {for (i=2; i<num_fields; i++)
+                                        {basename=basename "." fields[i]}
+                                     }
+                                     {exten=fields[i]}
+                                     {print basename}{print exten}'`)
+
+   # note:
+   #   awk's array indicies are 1-based
+   #   bash's array indicies are 0-based
+   basename=${names[0]}
+   exten=${names[1]}
+# -----------------------------------------------------
+
+# set ext_ok=1 if any of the following conditions are matched
+ext_ok=`[ "$exten" = "mpg" -o "$exten" = "mpeg" -o "$exten" = "MPG" -o "$exten" = "MPEG" ] && echo 1`
+#echo $ext_ok
+#echo $exten
+
+if [ "$1" = "" -o "$ext_ok" = "" ]; # bad input arguments
+then
+   echo
+   echo "You must specifiy the resulting mpeg filename and a sequence of image files"
+   echo
+   echo "Usage:    ./mpeg_utils_imagetompeg.sh animation.mpg images"
+   echo
+   echo "examples: ./mpeg_utils_imagetompeg.sh sequence1.mpg /tmp/sequence_1*.tif"
+   echo "          ./mpeg_utils_imagetompeg.sh test.mpg      /tmp/frames*.bmp"
+   echo "          ./mpeg_utils_imagetompeg.sh my_movie.mpg /tmp/images/movie_frame000*.gif" $'\n\n'
+else
+
+mpeg_filename=$1
+sequence_name=(${*:2})
+#echo ${sequence_name[*]}
+
+
+# pick apart the filename from the sequence:
+# -----------------------------------------------------
+   # this awk script provides the capability to correctly determine the filename extension 
+   # including the possibile case where there are multiple occurrences of the "." character
+   # in the filename before the extension.
+   names=(`echo ${sequence_name[0]} | awk '{num_fields=split($1,fields,".")}
+                                     {basename=fields[1]}
+                                     {for (i=2; i<num_fields; i++)
+                                        {basename=basename "." fields[i]}
+                                     }
+                                     {exten=fields[i]}
+                                     {print basename}{print exten}'`)
+
+   # note:
+   #   awk's array indicies are 1-based
+   #   bash's array indicies are 0-based
+   basename=${names[0]}
+   exten=${names[1]}
+   basename_length=`echo $basename | awk '{print length}'`
+   # pick off all the numeric characters at the end of $basename
+   let cnt=basename_length-1
+   while [[ "${basename:$cnt:1}" == [0-9] ]] ; do
+    #echo ${basename:$cnt:1}
+    let cnt=cnt-1
+    #echo $cnt ;
+   done
+   let numeric_string_length=$basename_length-$cnt-1 #; echo $numeric_string_length
+   
+   seq_numeric_portion=${basename:$cnt+1:$numeric_string_length} #; echo $seq_numeric_portion
+   seq_string_portion=${basename:0:$cnt+1} #; echo $seq_string_portion
+
+   # convert from a string to a number
+   seq_starting_number=`builtin printf "%0.f" "$seq1_numeric_portion"`
+   #echo $seq_starting_number
+# -----------------------------------------------------
+
+
+maxnumchars=`echo $seq_numeric_portion | awk '{print length()}'`
+#echo "maxnumchars = " $maxnumchars
+
+
+# make the ppm filename array
+#frame_num=0
+#for i in ${sequence_name[*]}
+#do
+#   char_frame_number=`builtin printf "%0$maxnumchars""i" "$frame_num"` #; echo $char_frame_number
+#   let frame_num=frame_num+1
+#   ppm_sequence_name[frame_num]=$seq_string_portion$char_frame_number.ppm # ; echo ${ppm_sequence_name[frame_num]}
+#done
+#echo ${ppm_sequence_name[*]}
+
+
+# Do the schmack:
+
+# (1) convert images from their native format to ppm or yuv with:
+intermediate_format=yuv
+# be sure to set ipff in './mpeg_utils_make_mpeg2encode_parfile.sh' to match this setting.
+# ipff=1 for yuv
+# ipff=2 for ppm (the ppm option is mysteriously broken on my machine as of 10 January 2002 --> now using yuv)
+ if [ "$intermediate_format" = "yuv" ]; # use './mpeg_utils_imagetoyuv.sh'
+ then
+    echo $0: "going to use ./mpeg_utils_imagetoyuv.sh"
+    ./mpeg_utils_imagetoyuv.sh ${sequence_name[*]}
+ else # use './mpeg_utils_imagetoppm.sh'
+    echo $0: "going to use ./mpeg_utils_imagetoppm.sh"
+
+    echo $0: " The ppm option is broken for some reason...(?)"
+    echo $0: " It produces a core dump."
+    echo $0: " MDC, 10 January 2002"
+
+    ./mpeg_utils_imagetoppm.sh ${sequence_name[*]}
+ fi
+
+# (2) make the encoder parameter file with:
+./mpeg_utils_make_mpeg2encode_parfile.sh ${sequence_name[*]}
+
+# (3) run the encoder with:
+mpeg2encode mpeg2encode.par $mpeg_filename
+
+
+# intentionally leave the mpeg encoder parameter file
+#rm mpeg2encode.par
+
+fi
+
+
+
+
+
+
+
+
+
+
+


Property changes on: unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_imagestompeg.sh
___________________________________________________________________
Name: svn:executable
   + 

Added: unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_imagetoppm.sh
===================================================================
--- unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_imagetoppm.sh	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_imagetoppm.sh	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,139 @@
+#!/bin/bash
+#
+# This is a script to convert a group of still-frame images to .ppm files suitable
+# for use with mpeg2encode (via Imagemagick's "convert" front-end).
+#
+# ./mpeg_utils_./mpeg_utils_imagetoppm.sh.sh is part of a group of unix shell scripts to aid in converting a group
+# of still-frame images to an mpeg-1 animation.
+# More information can be found at http://marc.me.utexas.edu/mpeg_tools.html.
+#
+# It ensures both horizontal and vertical dimensions are even-numbered by adding a 1-pixel
+# black border if necessary with 'pbmpad'.
+#
+# ImageMagick's 'convert' utility along with mpeg2encode is able to convert
+# a bunch of still-frames directly to an mpeg (or mpg) movie.  However, for many frames
+# (i.e. over 200 or 300) you may run out of RAM or swapfile space for the conversion directly
+# from tif to yuv3 or ppm, then into the mpg.  This script acts as an intermediate step to individually
+# convert images in a sequence to a ppm sequence that avoids running out of RAM or swapfile space.
+#
+# It relies upon:
+#       /bin/sh
+#       awk
+#       convert  (from ImageMagick, http://www.imagemagick.org)
+#       identify  (from ImageMagick, http://www.imagemagick.org)
+#       (possibly) pnmpad (from the netpbm-progs rpm)
+#
+#
+# usage:
+#          ./mpeg_utils_imagetoppm.sh images
+#
+# where 'images' is both the directory and image names of the original images to convert.
+#
+# examples: ./mpeg_utils_imagetoppm.sh ./tmp/*gif
+#           ./mpeg_utils_imagetoppm.sh ./sequence1_*.jpg
+#           ./mpeg_utils_imagetoppm.sh /tmp/images/movie_frame000*.tif
+#	
+# limitations:
+#  - Valid imput image formats are limited by ImageMajick's convert utility.
+#  - Input files must end with an extemsion seprated by a '.', however awk's split() function
+#    allows them to contain the '.' character elsewhere in the filename.
+#
+# Script comments:
+# Loop variable i successively becomes the name of image files in the specified directory.
+# awk -Ftif says to separate text fields with the string '.' and that is
+# how it extracts the base filename minus the extension.
+#
+# Marc Compere
+# CompereM at asme.org
+# created : 17 September 2001
+# mofidied: 05 April 2002
+
+#echo $*
+
+
+if [ "$1" = "" ]; # no input arguments
+then
+   echo
+   echo "You must specifiy a directory name."
+   echo
+   echo "Usage:   ./mpeg_utils_imagetoppm.sh images"
+   echo "example: ./mpeg_utils_imagetoppm.sh /tmp/sequence_1*.tif" $'\n\n'
+   echo
+   echo "TYPICAL ANIMATION STEPS:"
+   echo " (1) convert images from their native format to ppm or yuv with:"
+   echo "        ./mpeg_utils_imagetoppm.sh ./images/scenario1*.tif"
+   echo "        ./mpeg_utils_imagetoyuv.sh ./images/scenario1*.tif"
+   echo " (2) make the encoder parameter file with:"
+   echo "        ./mpeg_utils_make_mpeg2encode_parfile.sh ./images/scenario1*.ppm (use ppm images here to get image info properly in case padding was required)"
+   echo "        ./mpeg_utils_make_mpeg2encode_parfile.sh ./images/scenario1*.tif (use tif images here if using yuv's to get image info properly)" 
+   echo " (3) run the encoder with:"
+   echo "        mpeg2encode mpeg2encode.par scenario1.mpg" $'\n\n'
+else
+
+   filelist=($*)
+   #echo ${filelist[*]}
+
+   for i in ${filelist[*]};
+   do
+      # this awk script provides the capability to correctly determine the filename extension 
+      # including the possibile case where there are multiple occurrences of the "." character
+      # in the filename before the extension.
+      name=(`echo $i | awk '{num_fields=split($1,fields,".")}
+                     {basename=fields[1]}
+                     {for (i=2; i<num_fields; i++)
+                        {basename=basename "." fields[i]}
+                     }
+                     {exten=fields[i]}
+                     {print basename}{print exten}'`)
+      # note:
+      #   awk's array indicies are 1-based
+      #   bash's array indicies are 0-based
+
+      #echo "name[0]=${name[0]}" # basename
+      #echo "name[1]=${name[1]}" # exten
+      echo "./mpeg_utils_imagetoppm.sh: converting ${name[0]}.${name[1]} --> ${name[0]}.ppm..."
+      convert ${name[0]}.${name[1]} ${name[0]}.ppm
+
+      # place hsize and vsize in ${sizes[0]} and ${sizes[1]}
+      info=(`identify -ping ${name[0]}.ppm`) # use ImageMagick's identify command
+      #echo ${info[*]}
+      sizes=(`echo ${info[1]} | awk -Fx '{print $1}{print $2}'`)
+      hsize=${sizes[0]}
+      vsize=${sizes[1]}
+
+      # determine if either size is an even or odd number...
+      hsize_odd=$(( $(( hsize % 2)) ? 1 : 0 ))
+      vsize_odd=$(( $(( vsize % 2)) ? 1 : 0 ))
+
+      # ... if so, correct it by adding a 1-pixel pad to prevent mpeg2encode from complaining.
+      # (actally, add a border, but don't use 'pnmmargin' because it's a script that appears to
+      #  be quite inefficient by using several temporary files)
+      # (see notes in ./mpeg_utils_make_mpeg2encode_parfile.sh for more info)
+      if [ "$hsize_odd" = "1" ];
+      then
+         echo "./mpeg_utils_imagetoppm.sh: padding horizontal dimension..."
+	 pnmpad -black -r1 ${name[0]}.ppm > ${name[0]}_tmp.ppm
+         mv ${name[0]}_tmp.ppm ${name[0]}.ppm
+      fi
+       
+      if [ "$vsize_odd" = "1" ];
+      then
+         echo "./mpeg_utils_imagetoppm.sh: padding vertical dimension..."
+	 pnmpad -black -b1 ${name[0]}.ppm > ${name[0]}_tmp.ppm
+         mv ${name[0]}_tmp.ppm ${name[0]}.ppm
+      fi
+
+   done
+
+fi
+
+
+
+
+
+
+
+
+
+
+


Property changes on: unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_imagetoppm.sh
___________________________________________________________________
Name: svn:executable
   + 

Added: unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_imagetoyuv.sh
===================================================================
--- unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_imagetoyuv.sh	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_imagetoyuv.sh	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,154 @@
+#!/bin/bash
+#
+# This is a script to convert a group of still-frame images to .ppm files suitable
+# for use with mpeg2encode (via Imagemagick's "convert" front-end).
+#
+# imagestoyuv is part of a group of unix shell scripts to aid in converting a group
+# of still-frame images to an mpeg-1 animation.
+# More information can be found at http://marc.me.utexas.edu/mpeg_tools.html.
+#
+# ImageMagick's 'convert' utility along with mpeg2encode is able to convert
+# a bunch of still-frames directly to an mpeg (or mpg) movie.  However, for many frames
+# (i.e. over 200 or 300) you may run out of RAM or swapfile space for the conversion directly
+# from tif to yuv3 or ppm, then into the mpg.  This script acts as an intermediate step to individually
+# convert images in a sequence to a ppm sequence that avoids running out of RAM or swapfile space.
+#
+# It relies upon:
+#       /bin/sh
+#       awk
+#       convert  (from ImageMagick, http://www.imagemagick.org)
+#
+# usage:
+#          ./mpeg_utils_imagetoppm.sh images
+#
+# where 'images' is both the directory and image names of the original images to convert.
+#
+# examples: ./mpeg_utils_imagetoppm.sh ./tmp/*gif
+#           ./mpeg_utils_imagetoppm.sh ./sequence1_*.jpg
+#           ./mpeg_utils_imagetoppm.sh /tmp/images/movie_frame000*.tif
+#	
+# limitations:
+#  - Valid imput image formats are limited by ImageMajick's convert utility.
+#  - Input files must end with an extemsion seprated by a '.', however awk's split() function
+#    allows them to contain the '.' character elsewhere in the filename.
+#
+# Script comments:
+# Loop variable i successively becomes the name of image files in the specified directory.
+# awk -Ftif says to separate text fields with the string '.' and that is
+# how it extracts the base filename minus the extension.
+#
+# Marc Compere
+# CompereM at asme.org
+# created : 17 September 2001
+# mofidied: 05 April 2002
+
+#echo $*
+
+
+if [ "$1" = "" ]; # no input arguments
+then 
+   echo
+   echo "You must specifiy a directory name."
+   echo
+   echo "Usage:   ./mpeg_utils_imagetoyuv.sh images"
+   echo "example: ./mpeg_utils_imagetoyuv.sh /tmp/sequence_1*.tif" $'\n\n'
+   echo
+   echo "TYPICAL ANIMATION STEPS:"
+   echo " (1) convert images from their native format to ppm or yuv with:"
+   echo "        ./mpeg_utils_imagetoyuv.sh ./images/scenario1*.tif"
+   echo " (2) make the encoder parameter file with:"
+   echo "        ./mpeg_utils_make_mpeg2encode_parfile.sh ./images/scenario1*.tif"
+   echo "     note: provide this script with the *source* filenames (not the yuv filenames)"
+   echo "     for 'identify' to work properly"
+   echo " (3) run the encoder with:"
+   echo "        mpeg2encode mpeg2encode.par scenario1.mpg" $'\n\n'
+else
+
+   filelist=($*)
+   #echo ${filelist[*]}
+
+   for i in ${filelist[*]};
+   do
+      # this awk script provides the capability to correctly determine the filename extension 
+      # including the possibile case where there are multiple occurrences of the "." character
+      # in the filename before the extension.
+      name=(`echo $i | awk '{num_fields=split($1,fields,".")}
+                     {basename=fields[1]}
+                     {for (i=2; i<num_fields; i++)
+                        {basename=basename "." fields[i]}
+                     }
+                     {exten=fields[i]}
+                     {print basename}{print exten}'`)
+      # note:
+      #   awk's array indicies are 1-based
+      #   bash's array indicies are 0-based
+
+      #echo ${name[*]}
+      #echo "name[0]=${name[0]}" # basename
+      #echo "name[1]=${name[1]}" # exten
+
+      # determine if either size is an odd number...
+	 # (fortunately, conversion to the yuv format automagically includes
+	 #  a conversion to even horizontal and vertical dimensions so there's
+         #  no need for optional padding or size adjustment if the hsize or vsize
+         #  is an odd number the way ./mpeg_utils_imagetoppm.sh does.)
+
+      #echo "name[0]=${name[0]}"
+      #echo "name[1]=${name[1]}"  $'\n\n\n'
+      echo "./mpeg_utils_imagetoppm.sh: converting ${name[0]}.${name[1]} --> ${name[0]}.yuv..."
+      convert ${name[0]}.${name[1]} ${name[0]}.yuv
+   done
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+


Property changes on: unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_imagetoyuv.sh
___________________________________________________________________
Name: svn:executable
   + 

Added: unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_make_mpeg2encode_parfile.sh
===================================================================
--- unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_make_mpeg2encode_parfile.sh	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_make_mpeg2encode_parfile.sh	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,280 @@
+#!/bin/sh
+#
+# This shell script generates a parameter file suitable for use
+# with mpeg2encode from http://www.mpeg.org/MSSG/.
+#
+# ./mpeg_utils_make_mpeg2encode_parfile.sh is part of a group of unix shell scripts to aid in converting a group
+# of still-frame images to an mpeg-1 animation.
+# More information can be found at http://marc.me.utexas.edu/mpeg_tools.html.
+#
+# There is no error checking. It is basic but functional.
+# It relies upon:
+#       /bin/sh
+#       awk
+#       identify  (from ImageMagick, http://www.imagemagick.org)
+#
+# Usage:
+#         ./mpeg_utils_make_mpeg2encode_parfile.sh filelist
+#
+# where required arguemnts are:
+#
+#         filelist - filenames, including directory, where the still frame images reside
+#
+#
+# Examples:
+#         ./mpeg_utils_make_mpeg2encode_parfile.sh /tmp/images/*
+#         ./mpeg_utils_make_mpeg2encode_parfile.sh /tmp/images/scenarioA*.tif
+#
+# where the /tmp/images directory contains files something like:
+#
+#	frame.00001.tif
+#	frame.00002.tif
+#	frame.00003.tif
+#	...
+#	frame.00486.tif
+#
+# The individual frames do not have to be tiff's; they can be any format 'convert' handles.
+# See notes within the './mpeg_utils_imagetoppm.sh' or './mpeg_utils_imagetoyuv.sh' scripts at
+# http://marc.me.utexas.edu/mpeg_tools.html.
+#
+# Result: mpeg2encode.par left in current working directory
+#
+#
+# Next possible steps to make a movie:
+#   (1) ensure the images are converted from whatever format into either ppm or yuv with:
+#         ./mpeg_utils_imagetoppm.sh ./images/*.tif
+#       or
+#         ./mpeg_utils_imagetoyuv.sh ./images/*.gif
+#
+#   (2) run the encoder with:
+#         mpeg2encode mpeg2encode.par movie.mpg
+#
+# For tips on how to combine 2 or more sequences of images into one mpeg, see the
+# 'renumber_sequence' script at http://marc.me.utexas.edu/mpeg_tools.html.
+# or use the 'rename' command and see http://www.tux.org/~mayer/linux/book.pdf.
+#
+#
+# Marc Compere
+# CompereM at asme.org
+# created : 18 September 2001
+# modified: 20 January 2002
+
+# development arg setup:
+#    filelist=(`ls still_frames/test*ppm`) ; echo ${filelist[*]}
+
+
+parameter_set=2 # the PAL (-->2) parameter set is ImageMagick's default, but NTSC (-->1) seems to make
+                # smaller mpeg's with similar playback quality
+
+if [ "$1" = "" ];
+then 
+   echo " Usage:"
+   echo "         ./mpeg_utils_make_mpeg2encode_parfile.sh <ppm|yuv> filelist"
+   echo
+   echo " where the 'ppm' or 'yuv' string indicates which intermediate format to specify for mpeg2encode to use,"
+   echo " and where filelist is the list of filenames, including the directory, where the still frame images reside."
+   echo
+   echo " Examples:"
+   echo "         ./mpeg_utils_make_mpeg2encode_parfile.sh /tmp/images/*"
+   echo "         ./mpeg_utils_make_mpeg2encode_parfile.sh /tmp/images/scenarioA*.ppm"
+   echo " or"
+   echo "         ./mpeg_utils_make_mpeg2encode_parfile.sh yuv /tmp/images/*"
+   echo "         ./mpeg_utils_make_mpeg2encode_parfile.sh ppm /tmp/images/scenarioA*.tif"
+   echo
+   echo
+   echo "TYPICAL ANIMATION STEPS:"
+   echo " (1) convert images from their native format to ppm or yuv with:"
+   echo "        ./mpeg_utils_imagetoppm.sh ./images/scenario1*.tif"
+   echo "        ./mpeg_utils_imagetoyuv.sh ./images/scenario1*.tif"
+   echo " (2) make the encoder parameter file with:"
+   echo "        ./mpeg_utils_make_mpeg2encode_parfile.sh ./images/scenario1*.ppm (use ppm images here to get image info properly in case padding was required)"
+   echo "        ./mpeg_utils_make_mpeg2encode_parfile.sh ./images/scenario1*.tif (use tif images here if using yuv's to get image info properly)" 
+   echo " (3) run the encoder with:"
+   echo "        mpeg2encode mpeg2encode.par scenario1.mpg" $'\n\n'
+else
+
+filelist=(${*}) # assign input filename arglist
+
+if [ "$parameter_set" = "1" ];
+then
+   # set variables for NTSC
+   fps=30         # specifying frames per second (this actually comes from frc spec and is only used in the comment string)
+   Ngop=15        # 15 for NTSC
+   frc=5          # 5 for NTSC
+   vidfmt=2       # video format = 1->PAL, 2->NTSC
+   Nmatcoef=4     # 5->PAL, 4->NTSC
+elif [ "$parameter_set" = "2" ];
+then
+   # set variables for PAL
+   fps=25         # specifying frames per second (this actually comes from frc spec and is only used in the comment string)
+   Ngop=12        # 12 for NTSC
+   frc=3          # 3 for NTSC
+   vidfmt=1       # video format = 1->PAL, 2->NTSC
+   Nmatcoef=5     # 5->PAL, 4->NTSC
+else
+ echo "mpeg2encode_preproc: invalid parameter_set number",$parameter_set
+ echo "mpeg2encode_preproc: parameter_set should be 1 (for NTSC) or 2 (for PAL)"
+ echo "mpeg2encode_preproc: exiting...." $'\n\n\n'
+fi
+   
+
+# Set the rest of input parameters to write_parfile()
+parfile="mpeg2encode.par"     # output parameter file
+statfile="/dev/null"       # may be '-' for stdout or /dev/null (default) 
+ipff=1             # input picture file format (only 1->yuv3 or 2->ppm used here)
+                   # note: using ipff=2 for ppm's seems to create skewed animations that appear to have the aspect
+                   # ratio way off, but changing the aspect ratio in the parameter file seems to do nothing...
+                   # --> use yuv's as the input file format to mpeg2encode (yuv is the 'convert' default)
+# note: ipff was set at 2 which means using the .ppm image format, but now that option
+#       fails and causes mpeg2encode to crash.  (?) Go figure.  I'm now using the .yuv image format.
+#       10 January 2002
+
+
+#bitrate=1152000.0  # default was 5000000.0 (bits/sec), but 1152000.0 is mo'bettah
+#bitrate=576000.0  # default was 5000000.0 (bits/sec), but 1152000.0 is mo'bettah
+bitrate=480000.0  # default was 5000000.0 (bits/sec), but 1152000.0 is mo'bettah
+
+
+# find Nframes
+Nframes=0
+for i in ${filelist[*]}
+do
+   let Nframes=Nframes+1
+done
+#echo $Nframes
+
+
+# find the common file (and directory name) prefix string to all image files:
+filenamelength=`echo ${filelist[0]} | awk '{print length}'`
+all_match=1
+char_cnt=0
+str1=(${filelist[0]})
+str2=(${filelist[${Nframes}-1]})
+while [ "${all_match}" = "1" -a "${char_cnt}" -le "${filenamelength}" ] ; do
+   if [ "${str1:$char_cnt:1}" = "${str2:$char_cnt:1}" ] ; # compare the characters in the first and last filenames
+   then
+      #echo "characters in element $char_cnt match" ;
+      let char_cnt=char_cnt+1
+   else
+      all_match=0
+      #echo "characters in element $char_cnt DO NOT match, exiting..." ;
+   fi
+done
+basefilename=${str1:0:$char_cnt}
+restofthefilename=${str1:$char_cnt}
+
+first_num=`echo ${restofthefilename} | awk -F. '{print $1}'` # this assumes the filename has an extension, ".something"
+maxnumchars=`echo $first_num | awk '{print length()}'`
+
+#  note:
+#    awk's array indicies are 1-based
+#    bash's array indicies are 0-based
+
+
+# place hsize and vsize in ${sizes[0]} and ${sizes[1]}
+info=(`identify -ping ${filelist[0]}`) # use ImageMagick's identify command
+sizes=(`echo ${info[2]} | awk -Fx '{print $1}{print $2}'`)
+hsize=${sizes[0]}
+vsize=${sizes[1]}
+
+# determine if hsize is an even number or not...
+hsize_odd=$(( $(( hsize % 2)) ? 1 : 0 ))
+vsize_odd=$(( $(( vsize % 2)) ? 1 : 0 ))
+
+# ... if so, correct it by adding one (mpeg2encode seems to complain otherwise)
+# note: this is *only* useful if you are trying to convert a seqence of odd horizonal- or
+#       vertical-sized yuv images.  A mismatch in specified yuv image sizes and the actual size
+#       used to create the yuv (i.e. from the original tif or gif or whatever) will generate a reasonably
+#       acceptable mpeg.  However, if ppm images require size-adjustment in the mpeg2encode.par
+#       file then you're in touble --> this means the ppm image has been 'identify'ed as an odd-sized image
+#       in either it's horizonal or vertical dimension and specifying a different number in the parameter
+#       file will generate a bad mpeg.  Use ./mpeg_utils_imagetoppm.sh to convert the original file into a ppm and, in the
+#       process, if hsize or vsize is not even-numbered, ./mpeg_utils_imagetoppm.sh will pad the image with 'pnmpad' such
+#       that this script will not require adjustment to get even-numbered hzize and vsizes.
+if [ "$hsize_odd" = "1" ];
+then
+   let hsize=hsize+1
+fi
+if [ "$vsize_odd" = "1" ];
+then
+   let vsize=vsize+1
+fi
+
+# variable descriptions:
+#    fps		- frame rate code, specifying frames per second
+#    parfile		- output parameter file
+#    basefilename	- text-string common to each filename (not including and leading directory names)
+#    maxnumchars	- number of characters in the largest number in the sequence, e.g. 2 for 10-99 frames, 3 for 100-999 frames, etc.
+#    statfile		- may be '-' for stdout (default=/dev/null)
+#    ipff		- input picture file format (only 1->yuv3 or 2->ppm used here)
+#    Nframes		- total number of frames (image files) within the sequence
+#    Ngop		- 12 or 15, number of frames within a Group Of Frames (GOP)
+#    hsize		- horizonal images size, from ImageMagick's identify command
+#    vsize		- horizonal images size, from ImageMagick's identify command
+#    frc		- framerate code, 1,2,3,4, or 5, see mpeg2encode documentation
+#    bitrate		- bits/sec, see mpeg2encode documentation
+#    vidfmt		- video format = 1->PAL, 2->NTSC, see mpeg2encode documentation
+#    Nmatcoef		- 5->PAL, 4->NTSC, see mpeg2encode documentation
+
+echo $'\t' "./mpeg_utils_make_mpeg2encode_parfile.sh: writing $parfile."
+      echo "MPEG-1, $fps frames/sec, `date`, parameter file generated by ./mpeg_utils_make_mpeg2encode_parfile.sh" > $parfile
+      echo "$basefilename%0$maxnumchars""d    /* name of source files */" >> $parfile
+      echo "-         /* name of reconstructed images (\"-\": dont store) */" >> $parfile
+      echo "-         /* name of intra quant matrix file     (\"-\": default matrix) */" >> $parfile
+      echo "-         /* name of non intra quant matrix file (\"-\": default matrix) */" >> $parfile
+      echo "$statfile         /* name of statistics file (\"-\": stdout ) */" >> $parfile
+      echo "$ipff         /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */" >> $parfile
+      echo "$Nframes       /* number of frames */" >> $parfile
+      echo "0         /* number of first frame */" >> $parfile
+      echo "00:00:00:00 /* timecode of first frame */" >> $parfile
+      echo "$Ngop        /* N (# of frames in GOP) */" >> $parfile
+      echo "3         /* M (I/P frame distance) */" >> $parfile
+      echo "1         /* ISO/IEC 11172-2 stream (0=MPEG-2, 1=MPEG-1)*/" >> $parfile
+      echo "0         /* 0:frame pictures, 1:field pictures */" >> $parfile
+      echo "${hsize}   /* horizontal_size */" >> $parfile
+      echo "${vsize}  /* vertical_size */" >> $parfile
+      echo "8         /* aspect_ratio_information 1=square pel, 2=4:3, 3=16:9, 4=2.11:1 */" >> $parfile
+      echo "$frc         /* frame_rate_code 1=23.976, 2=24, 3=25, 4=29.97, 5=30 frames/sec. */" >> $parfile
+      echo "$bitrate /* bit_rate (bits/s) */" >> $parfile
+      echo "20       /* vbv_buffer_size (in multiples of 16 kbit) */" >> $parfile
+      echo "0         /* low_delay  */" >> $parfile
+      echo "1         /* constrained_parameters_flag */" >> $parfile
+      echo "4         /* Profile ID: Simple = 5, Main = 4, SNR = 3, Spatial = 2, High = 1 */" >> $parfile
+      echo "8         /* Level ID:   Low = 10, Main = 8, High 1440 = 6, High = 4	  */" >> $parfile
+      echo "1         /* progressive_sequence */" >> $parfile
+      echo "1         /* chroma_format: 1=4:2:0, 2=4:2:2, 3=4:4:4 */" >> $parfile
+      echo "$vidfmt         /* video_format: 0=comp., 1=PAL, 2=NTSC, 3=SECAM, 4=MAC, 5=unspec. */" >> $parfile
+      echo "5         /* color_primaries */" >> $parfile
+      echo "5         /* transfer_characteristics */" >> $parfile
+      echo "$Nmatcoef         /* matrix_coefficients */" >> $parfile
+      echo "$hsize       /* display_horizontal_size */" >> $parfile
+      echo "$vsize       /* display_vertical_size */" >> $parfile
+      echo "0         /* intra_dc_precision (0: 8 bit, 1: 9 bit, 2: 10 bit, 3: 11 bit */" >> $parfile
+      echo "0         /* top_field_first */" >> $parfile
+      echo "1 1 1     /* frame_pred_frame_dct (I P B) */" >> $parfile
+      echo "0 0 0     /* concealment_motion_vectors (I P B) */" >> $parfile
+      echo "0 0 0     /* q_scale_type  (I P B) */" >> $parfile
+      echo "0 0 0     /* intra_vlc_format (I P B)*/" >> $parfile
+      echo "0 0 0     /* alternate_scan (I P B) */" >> $parfile
+      echo "0         /* repeat_first_field */" >> $parfile
+      echo "1         /* progressive_frame */" >> $parfile
+      echo "0         /* P distance between complete intra slice refresh */" >> $parfile
+      echo "0         /* rate control: r (reaction parameter) */" >> $parfile
+      echo "0         /* rate control: avg_act (initial average activity) */" >> $parfile
+      echo "0         /* rate control: Xi (initial I frame global complexity measure) */" >> $parfile
+      echo "0         /* rate control: Xp (initial P frame global complexity measure) */" >> $parfile
+      echo "0         /* rate control: Xb (initial B frame global complexity measure) */" >> $parfile
+      echo "0         /* rate control: d0i (initial I frame virtual buffer fullness) */" >> $parfile
+      echo "0         /* rate control: d0p (initial P frame virtual buffer fullness) */" >> $parfile
+      echo "0         /* rate control: d0b (initial B frame virtual buffer fullness) */" >> $parfile
+      echo "2 2 11 11 /* P:  forw_hor_f_code forw_vert_f_code search_width/height */" >> $parfile
+      echo "1 1 3  3  /* B1: forw_hor_f_code forw_vert_f_code search_width/height */" >> $parfile
+      echo "1 1 7  7  /* B1: back_hor_f_code back_vert_f_code search_width/height */" >> $parfile
+      echo "1 1 7  7  /* B2: forw_hor_f_code forw_vert_f_code search_width/height */" >> $parfile
+      echo "1 1 3  3  /* B2: back_hor_f_code back_vert_f_code search_width/height */"  >> $parfile ;
+
+
+
+fi # end "if [ "$1" = "" ];" approximately on line 69
+
+


Property changes on: unstable/liquidwar/branches/upstream/current/misc/mpeg_utils_make_mpeg2encode_parfile.sh
___________________________________________________________________
Name: svn:executable
   + 

Added: unstable/liquidwar/branches/upstream/current/src/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,7 @@
+base.h
+Makefile
+Makefile.dep
+*.o
+liquidwar
+liquidwar-server
+liquidwar-mapgen

Added: unstable/liquidwar/branches/upstream/current/src/Makefile.dep.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/Makefile.dep.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/Makefile.dep.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1 @@
+#This a dummy file, required for the first call to make

Added: unstable/liquidwar/branches/upstream/current/src/Makefile.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/Makefile.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/Makefile.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,305 @@
+
+prefix =          @prefix@
+exec_prefix =     @exec_prefix@
+datadir =         @datadir@
+
+DATADIR =         $(datadir)/games/liquidwar
+GAMEDIR =         $(exec_prefix)/games
+
+TARGET_OPT =      @TARGET_OPT@
+STATIC =          @STATIC@
+SNPRINTF =        @SNPRINTF@
+ALCFLAGS =        @ALCFLAGS@
+ALLIBS =          @ALLIBS@
+ASM =             @ASM@
+DEBUG =           @DEBUG@
+EFENCE =          @EFENCE@
+PTHREAD =         @PTHREAD@
+
+ifeq ($(TARGET_OPT),yes)
+	TARGET =          @target@
+	TARGET_CPU =      @target_cpu@
+	TARGET_CPU_CC =   "-mcpu=@target_cpu@"
+else
+	TARGET =          default
+	TARGET_CPU =      default
+	TARGET_CPU_CC =
+endif
+
+# -mcpu=x86_64 doesn't work, here's a workarround
+ifeq ("@target_cpu@","x86_64")
+	TARGET_CPU_CC =   "-m64"
+endif
+
+
+ifeq ($(DEBUG),yes)
+	DEBUG_FLAGS =   -g3
+	DEBUG_OPTIONS = -DDEBUG
+	ALLEGRO_LIBRARY = debug
+else
+	DEBUG_FLAGS =   -O3
+	DEBUG_OPTIONS =
+	ALLEGRO_LIBRARY = release
+endif
+
+ifeq ($(EFENCE),yes)
+	EFENCE_LIBRARY = -lefence
+else
+	EFENCE_LIBRARY = 
+endif
+
+ifeq ($(SNPRINTF),yes)
+	SNPRINTF_NAMES =
+	SNPRINTF_OPTIONS =
+	SNPRINTF_MODE = "using system library"
+else
+	SNPRINTF_NAMES = ../utils/snprintf/snprintf
+	SNPRINTF_OPTIONS = -DSNPRINTF
+	SNPRINTF_MODE = "using Mark Martinec's implementation" 
+endif
+
+ifeq ($(ASM),yes)
+	ASM_NAMES = glouglou monster spread
+	ASM_OPTIONS = -DASM
+else
+	ASM_NAMES =
+	ASM_OPTIONS =
+endif
+
+OBJ_NAMES = \
+	about \
+	advanced \
+	alleg2 \
+	area \
+	army \
+	asm \
+	autoplay \
+	back \
+	basicopt \
+	bigdata \
+	capture \
+	chat \
+	checksum \
+	code \
+	config \
+	connect \
+	controls \
+	cursor \
+	decal \
+	dialog \
+	disk \
+	disp \
+	distor \
+	dnsutil \
+	error \
+	exec2 \
+	exit \
+	fighter \
+	game \
+	gfxmode \
+	grad \
+	graphics \
+	help \
+	httputil \
+	info \
+	init \
+	internet \
+	joystick \
+	keyboard \
+	keyexch \
+	lang \
+	langde \
+	langdk \
+	langen \
+	langfr \
+	language \
+	level \
+	logcli \
+	main \
+	map \
+	maptex \
+	menu \
+	mesh \
+	message \
+	mouse \
+	move \
+	music \
+	mutxunix \
+	netconf \
+	netgame \
+	netkey \
+	netmap \
+	netmess \
+	netplay \
+	network \
+	options \
+	palette \
+	parser \
+	path \
+	ping \
+	pion \
+	play \
+	profile \
+	protocol \
+	random \
+	rules \
+	score \
+	serial \
+	sock2cli \
+	sockex \
+	sockunix \
+	sound \
+	speeds \
+	startinf \
+	startup \
+	team \
+	texture \
+	thrdunix \
+	ticker \
+	time \
+	viewport \
+	volume \
+	watchdog \
+	wave \
+	wwwcli \
+	$(SNPRINTF_NAMES) \
+	$(ASM_NAMES)
+
+OBJ_NAMES_SRV = \
+	basicopt \
+	chat \
+	dnsutil \
+	execunix \
+	httputil \
+	logsrv \
+	netconf \
+	netkey \
+	netmap \
+	netmess \
+	parser \
+	serial \
+	server \
+	sock2srv \
+	sockex \
+	sockunix \
+	srvchan \
+	srvcont \
+	srvteam \
+	srvtime \
+	startinf \
+	thrdunix \
+	wwwsrv \
+	$(SNPRINTF_NAMES)
+
+OBJ_NAMES_MAPGEN = \
+	../utils/lwmapgen/big_quad \
+	../utils/lwmapgen/boxes \
+	../utils/lwmapgen/bubbles \
+	../utils/lwmapgen/circles \
+	../utils/lwmapgen/circuit \
+	../utils/lwmapgen/cut \
+	../utils/lwmapgen/func \
+	../utils/lwmapgen/hole \
+	../utils/lwmapgen/lines \
+	../utils/lwmapgen/main \
+	../utils/lwmapgen/map \
+	../utils/lwmapgen/map_generator \
+	../utils/lwmapgen/misc \
+	../utils/lwmapgen/rand_box \
+	../utils/lwmapgen/rand_func \
+	../utils/lwmapgen/rand_poly \
+	../utils/lwmapgen/rand_poly_cut \
+	../utils/lwmapgen/street \
+	../utils/lwmapgen/worms 
+
+OBJ_FILES = $(addsuffix .o, $(OBJ_NAMES))
+OBJ_FILES_SRV = $(addsuffix .o, $(OBJ_NAMES_SRV))
+OBJ_FILES_MAPGEN = $(addsuffix .o, $(OBJ_NAMES_MAPGEN))
+
+EXE_FILES = liquidwar liquidwar-server liquidwar-mapgen
+
+ifeq ($(STATIC),yes)
+    LINK_OPTIONS = --static
+    EXTERN_LIBS = `allegro-config --static $(ALLEGRO_LIBRARY)` $(EFENCE_LIBRARY)
+else
+    LINK_OPTIONS = 
+    EXTERN_LIBS = `allegro-config --libs $(ALLEGRO_LIBRARY)` $(EFENCE_LIBRARY)
+endif
+
+CONFIG_OPTIONS = \
+	-DCONFIG_UNIX_CFG=\".liquidwarrc\" \
+	-DCONFIG_UNIX_DAT=\"$(DATADIR)/liquidwar.dat\" \
+	-DCONFIG_UNIX_MAP=\"$(DATADIR)/map/\" \
+	-DCONFIG_UNIX_TEX=\"$(DATADIR)/texture/\" \
+	-DCONFIG_UNIX_MID=\"$(DATADIR)/music/\" \
+	-DCONFIG_UNIX_SRV=\"$(GAMEDIR)/liquidwar-server\" \
+	-DCONFIG_UNIX_GEN=\"$(GAMEDIR)/liquidwar-mapgen\"
+
+CMD_CC = $(CC) $(CFLAGS) $(ALCFLAGS) -c $(DEBUG_FLAGS) -Wall -W $(TARGET_CPU_CC) $(CONFIG_OPTIONS) $(DEBUG_OPTIONS) $(SPRINTF_OPTIONS) $(ASM_OPTIONS) -DUNIX -D_THREAD_SAFE
+CMD_AS = $(AS) $(ASFLAGS) --32
+
+all: $(EXE_FILES)
+
+liquidwar: $(OBJ_FILES)
+	@echo "Linking $@ (target=$(TARGET), debug=$(DEBUG), static=$(STATIC), asm=$(ASM))"
+	@$(CC) $(LDFLAGS) $(LINK_OPTIONS) -o $@ $(OBJ_FILES) $(PTHREAD) $(EXTERN_LIBS) 
+
+liquidwar-server: $(OBJ_FILES_SRV)
+	@echo "Linking $@ (target=$(TARGET), debug=$(DEBUG), static=$(STATIC))"
+	@$(CC) $(LDFLAGS) $(LINK_OPTIONS) -o $@ $(OBJ_FILES_SRV) $(PTHREAD)
+
+liquidwar-mapgen: $(OBJ_FILES_MAPGEN)
+	@echo "Linking $@ (target=$(TARGET), debug=$(DEBUG), static=$(STATIC))"
+	@$(CC) $(LDFLAGS) $(LINK_OPTIONS) -o $@ $(OBJ_FILES_MAPGEN) $(PTHREAD) $(EXTERN_LIBS) 
+
+dep:
+	@find .\
+	-name '*.c' | \
+	grep "\.c" | \
+	sed "s/^.\///;" | \
+	xargs $(CMD_CC) -M | \
+	sed "s/\(.*\.o:\)/\1/g;" > Makefile.dep
+
+clean: 
+	@rm -f *.o *.obj
+	@rm -f $(OBJ_FILES) $(OBJ_FILES_SRV) $(OBJ_FILES_MAPGEN)
+	@rm -f $(EXE_FILES)
+
+distclean:
+	@rm -f Makefile Makefile.dep base.h
+
+%.o: %.c
+	@echo "Compiling $< (cpu=$(TARGET_CPU), debug=$(DEBUG), asm=$(ASM))"
+	@$(CMD_CC) $< -o $@
+
+%.o: %.s
+	@echo "Assembling" $<
+	@$(CMD_AS) $< -o $@
+
+config: print_config print_cmd_cc print_cmd_as
+	@true
+
+check:
+	@find . -name "*.[c|h]" -a ! -path "*32*" -exec indent {} \;
+	@find . -name "*.[c|h]" -a ! -path "*32*" -exec splint {} \;
+
+print_config:
+	@echo "The configuration options to generate binaries are:"
+	@echo "Target      :" $(TARGET)
+	@echo "Debug       :" $(DEBUG)
+	@echo "Static link :" $(STATIC)
+	@echo "Assembly    :" $(ASM)
+	@echo "Snprintf    :" $(SNPRINTF_MODE)
+
+print_cmd_cc:
+	@echo "The command line to compile .c files in this directory is:"
+	@echo $(CMD_CC)
+
+print_cmd_as:
+	@echo "The command line to compile .s files in this directory is:"
+	@echo $(CMD_AS)
+
+include Makefile.dep
+
+
+

Added: unstable/liquidwar/branches/upstream/current/src/about.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/about.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/about.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,140 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : about.c                                          */
+/* content       : about menu                                       */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+
+#include "back.h"
+#include "base.h"
+#include "config.h"
+#include "decal.h"
+#include "dialog.h"
+#include "disk.h"
+#include "graphics.h"
+#include "help.h"
+#include "menu.h"
+#include "options.h"
+#include "lang.h"
+#include "about.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+lw_about (void)
+{
+  DIALOG d[9];
+  int i, choix = 4, retour = 0;
+
+  memset (d, 0, sizeof (d));
+
+  while (retour == 0)
+    {
+      for (i = 0; i < 4; ++i)
+	standard_button (d + i + 4, 0, i, 1, 4);
+
+      quick_buttons (d);
+      d[4].dp = lw_lang_string (LW_LANG_STRING_ABOUT_CREDITS);
+      d[5].dp = lw_lang_string (LW_LANG_STRING_ABOUT_COPYRIGHT);
+      d[6].dp = lw_lang_string (LW_LANG_STRING_ABOUT_LICENSE);
+      d[7].dp = lw_lang_string (LW_LANG_STRING_ABOUT_VERSION);
+      d[8].proc = 0;
+
+      choix = my_do_dialog (d, choix);
+      switch (choix)
+	{
+	case -1:
+	case MENU_QUICK_BACK:
+	  retour = 1;
+	  break;
+	case MENU_QUICK_MAIN:
+	  retour = MENU_TOP;
+	  break;
+	case MENU_QUICK_QUIT:
+	  if (confirm_quit ())
+	    retour = MENU_EXIT;
+	  else
+	    display_back_image ();
+	  break;
+	case MENU_QUICK_PLAY:
+	  retour = MENU_PLAY;
+	  break;
+	case 4:
+	  retour =
+	    display_help (lw_lang_string (LW_LANG_STRING_HELP_CREDITS));
+	  break;
+	case 5:
+	  retour =
+	    display_help (lw_lang_string (LW_LANG_STRING_HELP_COPYRIGHT));
+	  break;
+	case 6:
+	  retour =
+	    display_help (lw_lang_string (LW_LANG_STRING_HELP_LICENSE));
+	  break;
+	case 7:
+	  retour =
+	    display_help (lw_lang_string (LW_LANG_STRING_HELP_VERSION));
+	  break;
+	}
+    }
+
+  if (retour > 0)
+    retour--;
+
+  return retour;
+}

Added: unstable/liquidwar/branches/upstream/current/src/about.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/about.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/about.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,67 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : about.h                                          */
+/* contenu       : about menu                                       */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_ABOUT
+#define LIQUID_WAR_INCLUDE_ABOUT
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int lw_about (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/advanced.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/advanced.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/advanced.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,224 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : advanced.c                                       */
+/* contenu       : choix des options de jeu avancees                */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+
+#include "advanced.h"
+#include "config.h"
+#include "dialog.h"
+#include "disk.h"
+#include "help.h"
+#include "time.h"
+#include "menu.h"
+#include "log.h"
+#include "lang.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static char *
+get_asm_algorithm_str (void)
+{
+  if (CONFIG_ASM_ALGORITHM)
+    return (lw_lang_string (LW_LANG_STRING_ADVANCED_ASSEMBLY));
+  else
+    return (lw_lang_string (LW_LANG_STRING_ADVANCED_STANDARDC));
+}
+
+/*------------------------------------------------------------------*/
+static char *
+get_cpu_vs_human_str (void)
+{
+  char *result = "";
+
+  switch (CONFIG_CPU_VS_HUMAN)
+    {
+    case CONFIG_CPU_VS_HUMAN_ALWAYS:
+      result = (lw_lang_string (LW_LANG_STRING_ADVANCED_ALWAYS));
+      break;
+    case CONFIG_CPU_VS_HUMAN_NEVER:
+      result = (lw_lang_string (LW_LANG_STRING_ADVANCED_NEVER));
+      break;
+    default:
+      result = (lw_lang_string (LW_LANG_STRING_ADVANCED_RANDOM));
+      break;
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+static char *
+get_allow_network_bots_str (void)
+{
+  if (CONFIG_ALLOW_NETWORK_BOTS)
+    return (lw_lang_string (LW_LANG_STRING_ADVANCED_YES));
+  else
+    return (lw_lang_string (LW_LANG_STRING_ADVANCED_NO));
+}
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+advanced_options (void)
+{
+  int *temp;
+  DIALOG d[21];
+  int i, retour = 0, choix = 4;
+  static int y_pos[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
+
+  memset (d, 0, sizeof (d));
+
+  for (i = 0; i < 8; ++i)
+    {
+      standard_button (d + i + 4, 0, y_pos[i], 2, 8);
+      d[i + 4].proc = my_textbox_proc;
+    }
+  for (i = 0; i < 8; ++i)
+    {
+      standard_button (d + i + 12, 1, y_pos[i], 2, 8);
+      d[i + 12].proc = my_slider_proc;
+    }
+  d[17].proc = d[18].proc = d[19].proc = my_button_proc;
+
+  quick_buttons (d);
+  d[4].dp = lw_lang_string (LW_LANG_STRING_ADVANCED_ATTACK);
+  d[5].dp = lw_lang_string (LW_LANG_STRING_ADVANCED_DEFENSE);
+  d[6].dp = lw_lang_string (LW_LANG_STRING_ADVANCED_BASEHEALTH);
+  d[7].dp = lw_lang_string (LW_LANG_STRING_ADVANCED_WINNERHELP);
+  d[8].dp = lw_lang_string (LW_LANG_STRING_ADVANCED_CPUSTRENGTH);
+  d[9].dp = lw_lang_string (LW_LANG_STRING_ADVANCED_CPUVSHUMAN);
+  d[10].dp = lw_lang_string (LW_LANG_STRING_ADVANCED_ALLOWNETWORKBOTS);
+  d[11].dp = lw_lang_string (LW_LANG_STRING_ADVANCED_ASMALGORITHM);
+  d[12].d1 = d[13].d1 = d[14].d1 = d[15].d1 = 16;
+  d[16].d1 = 4;
+  d[12].dp3 = &CONFIG_FIGHTER_ATTACK;
+  d[13].dp3 = &CONFIG_FIGHTER_DEFENSE;
+  d[14].dp3 = &CONFIG_FIGHTER_NEW_HEALTH;
+  d[15].dp3 = &CONFIG_NUMBER_INFLUENCE;
+  d[16].dp3 = &CONFIG_CPU_ADVANTAGE;
+  d[17].dp = get_cpu_vs_human_str ();
+  d[18].dp = get_allow_network_bots_str ();
+  d[19].dp = get_asm_algorithm_str ();
+  for (i = 12; i < 17; ++i)
+    {
+      d[i].dp = NULL;
+      d[i].dp2 = slider_int;
+      temp = d[i].dp3;
+      d[i].d2 = *temp;
+    }
+
+#ifndef ASM
+  /*
+   * If no assembly code has been compiled, we disable the button
+   */
+  d[10].flags = D_HIDDEN;
+  d[18].flags = D_HIDDEN;
+#endif
+
+  d[20].proc = 0;
+
+  while (retour == 0)
+    {
+      choix = my_do_dialog (d, choix);
+      switch (choix)
+	{
+	case -1:
+	case MENU_QUICK_BACK:
+	  retour = 1;
+	  break;
+	case MENU_QUICK_MAIN:
+	  retour = MENU_TOP;
+	  break;
+	case MENU_QUICK_QUIT:
+	  if (confirm_quit ())
+	    retour = MENU_EXIT;
+	  break;
+	case MENU_QUICK_PLAY:
+	  retour = MENU_PLAY;
+	  break;
+	case 17:
+	  CONFIG_CPU_VS_HUMAN = (CONFIG_CPU_VS_HUMAN + 1) % 3;
+	  d[17].dp = get_cpu_vs_human_str ();
+	  scare_mouse ();
+	  my_button_proc (MSG_DRAW, d + 17, 0);
+	  unscare_mouse ();
+	  break;
+	case 18:
+	  CONFIG_ALLOW_NETWORK_BOTS = CONFIG_ALLOW_NETWORK_BOTS ? 0 : 1;
+	  d[18].dp = get_allow_network_bots_str ();
+	  scare_mouse ();
+	  my_button_proc (MSG_DRAW, d + 18, 0);
+	  unscare_mouse ();
+	  break;
+	case 19:
+	  CONFIG_ASM_ALGORITHM = CONFIG_ASM_ALGORITHM ? 0 : 1;
+	  d[19].dp = get_asm_algorithm_str ();
+	  scare_mouse ();
+	  my_button_proc (MSG_DRAW, d + 19, 0);
+	  unscare_mouse ();
+	  break;
+	}
+    }
+
+  if (retour > 0)
+    retour--;
+
+  return retour;
+}

Added: unstable/liquidwar/branches/upstream/current/src/advanced.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/advanced.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/advanced.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,68 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : advanced.h                                       */
+/* contenu       : choix des options de jeu avancees                */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_ADVANCED
+#define LIQUID_WAR_INCLUDE_ADVANCED
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int advanced_options (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/alleg2.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/alleg2.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/alleg2.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,1656 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : alleg2.c                                         */
+/* contenu       : reprogrammation de qq fonctions d'allegro        */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+
+#include "alleg2.h"
+#include "exit.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/* typedef for the listbox callback functions */
+typedef char *(*my_getfuncptr) (int, int *);
+
+/*==================================================================*/
+/* variables statiques                                              */
+/*==================================================================*/
+extern void _draw_scrollable_frame (DIALOG * d,
+				    int listsize, int offset, int height,
+				    int fg_color, int bg);
+extern int isspace (int c);
+
+static void my_handle_scrollable_scroll_click (DIALOG * d, int listsize,
+					       int *offset, int height);
+static void my_handle_scrollable_scroll (DIALOG * d, int listsize, int *index,
+					 int *offset);
+static void my_handle_listbox_click (DIALOG * d);
+
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/* utilitaires                                                      */
+/*------------------------------------------------------------------*/
+
+/* dotted_rect:
+ *  Draws a dotted rectangle, for showing an object has the input focus.
+ */
+static void
+my_dotted_rect (int x1, int y1, int x2, int y2, int fg, int bg)
+{
+  BITMAP *gui_bmp = gui_get_screen ();
+  int x = ((x1 + y1) & 1) ? 1 : 0;
+  int c;
+
+  /* two loops to avoid bank switches */
+  for (c = x1; c <= x2; c++)
+    putpixel (gui_bmp, c, y1, (((c + y1) & 1) == x) ? fg : bg);
+  for (c = x1; c <= x2; c++)
+    putpixel (gui_bmp, c, y2, (((c + y2) & 1) == x) ? fg : bg);
+
+  for (c = y1 + 1; c < y2; c++)
+    {
+      putpixel (gui_bmp, x1, c, (((c + x1) & 1) == x) ? fg : bg);
+      putpixel (gui_bmp, x2, c, (((c + x2) & 1) == x) ? fg : bg);
+    }
+}
+
+/* _draw_textbox:
+ *  Helper function to draw a textbox object.
+ */
+static void
+my_draw_textbox (char *thetext, int *listsize, int draw, int offset,
+		 int wword, int tabsize, int x, int y, int w, int h,
+		 int disabled, int fore, int deselect, int disable)
+{
+  BITMAP *gui_bmp = gui_get_screen ();
+  int fg = fore;
+  int y1 = y + 4;
+  int x1;
+  int len;
+  int ww = w - 6;
+  char s[16];
+  char text[16];
+  char space[16];
+  char *printed = text;
+  char *scanned = text;
+  char *oldscan = text;
+  char *ignore = NULL;
+  char *tmp, *ptmp;
+  int width;
+  int line = 0;
+  int i = 0;
+  int noignore;
+
+  usetc (s + usetc (s, '.'), 0);
+  usetc (text + usetc (text, ' '), 0);
+  usetc (space + usetc (space, ' '), 0);
+
+  /* find the correct text */
+  if (thetext != NULL)
+    {
+      printed = thetext;
+      scanned = thetext;
+    }
+
+  /* do some drawing setup */
+  if (draw)
+    {
+      /* initial start blanking at the top */
+      rectfill (gui_bmp, x + 2, y + 2, x + w - 3, y1 - 1, deselect);
+    }
+
+  /* choose the text color */
+  if (disabled)
+    fg = disable;
+
+  /* loop over the entire string */
+  while (1)
+    {
+      width = 0;
+
+      /* find the next break */
+      while (ugetc (scanned))
+	{
+	  /* check for a forced break */
+	  if (ugetc (scanned) == '\n')
+	    {
+	      scanned += uwidth (scanned);
+
+	      /* we are done parsing the line end */
+	      break;
+	    }
+
+	  /* the next character length */
+	  usetc (s + usetc (s, ugetc (scanned)), 0);
+	  len = text_length (font, s);
+
+	  /* modify length if its a tab */
+	  if (ugetc (s) == '\t')
+	    len = tabsize * text_length (font, space);
+
+	  /* check for the end of a line by excess width of next char */
+	  if (width + len >= ww)
+	    {
+	      /* we have reached end of line do we go back to find start */
+	      if (wword)
+		{
+		  /* remember where we were */
+		  oldscan = scanned;
+		  noignore = FALSE;
+
+		  /* go backwards looking for start of word */
+		  while (!uisspace (ugetc (scanned)))
+		    {
+		      /* don't wrap too far */
+		      if (scanned == printed)
+			{
+			  /* the whole line is filled, so stop here */
+			  tmp = ptmp = scanned;
+			  while (ptmp != oldscan)
+			    {
+			      ptmp = tmp;
+			      tmp += uwidth (tmp);
+			    }
+			  scanned = ptmp;
+			  noignore = TRUE;
+			  break;
+			}
+		      /* look further backwards to wrap */
+		      tmp = ptmp = printed;
+		      while (tmp < scanned)
+			{
+			  ptmp = tmp;
+			  tmp += uwidth (tmp);
+			}
+		      scanned = ptmp;
+		    }
+		  /* put the space at the end of the line */
+		  if (!noignore)
+		    {
+		      ignore = scanned;
+		      scanned += uwidth (scanned);
+		    }
+		  else
+		    ignore = NULL;
+
+		  /* check for endline at the convenient place */
+		  if (ugetc (scanned) == '\n')
+		    scanned += uwidth (scanned);
+		}
+	      /* we are done parsing the line end */
+	      break;
+	    }
+
+	  /* the character can be added */
+	  scanned += uwidth (scanned);
+	  width += len;
+	}
+
+      /* check if we are to print it */
+      //if ((draw) && (line >= offset)
+      //          && (y1 + text_height (font) < (y + h - 3)))
+      if ((draw) && (line >= offset) && (((y1 + text_height (font) < (y + h - 3))) || (line == 0)))	// ufoot
+	{
+	  x1 = x + 4;
+
+	  /* the initial blank bit */
+	  rectfill (gui_bmp, x + 2, y1, x1 - 1, y1 + text_height (font),
+		    deselect);
+
+	  /* print up to the marked character */
+	  while (printed != scanned)
+	    {
+	      /* do special stuff for each charater */
+	      switch (ugetc (printed))
+		{
+
+		case '\r':
+		case '\n':
+		  /* don't print endlines in the text */
+		  break;
+
+		  /* possibly expand the tabs */
+		case '\t':
+		  for (i = 0; i < tabsize; i++)
+		    {
+		      usetc (s + usetc (s, ' '), 0);
+		      //textout_ex(gui_bmp, font, s, x1, y1, fg, deselect);
+		      textout_ex (gui_bmp, font, s, x1, y1, -1, deselect);	// ufoot
+		      x1 += text_length (font, s);
+		    }
+		  break;
+
+		  /* print a normal character */
+		default:
+		  if (printed != ignore)
+		    {
+		      usetc (s + usetc (s, ugetc (printed)), 0);
+		      //textout_ex(gui_bmp, font, s, x1, y1, fg, deselect);
+		      textout_ex (gui_bmp, font, s, x1, y1, -1, deselect);	// ufoot
+		      x1 += text_length (font, s);
+		    }
+		}
+
+	      /* goto the next character */
+	      printed += uwidth (printed);
+	    }
+	  /* the last blank bit */
+	  if (x1 <= x + w - 3)
+	    rectfill (gui_bmp, x1, y1, x + w - 3, y1 + text_height (font) - 1,
+		      deselect);
+
+	  /* print the line end */
+	  y1 += text_height (font);
+	}
+      printed = scanned;
+
+      /* we have done a line */
+      line++;
+
+      /* check if we are at the end of the string */
+      if (!ugetc (printed))
+	{
+	  /* the under blank bit */
+	  if (draw)
+	    rectfill (gui_bmp, x + 1, y1, x + w - 3, y + h - 1, deselect);
+
+	  /* tell how many lines we found */
+	  *listsize = line;
+	  return;
+	}
+    }
+
+}
+
+/* d_textbox_proc:
+ *  A text box object. The dp field points to a char * which is the text
+ *  to be displayed in the text box. If the text is long, there will be
+ *  a vertical scrollbar on the right hand side of the object which can
+ *  be used to scroll through the text. The default is to print the text
+ *  with word wrapping, but if the D_SELECTED flag is set, the text will
+ *  be printed with character wrapping. The d1 field is used internally
+ *  to store the number of lines of text, and d2 is used to store how far
+ *  it has scrolled through the text.
+ */
+int
+my_textbox_proc (int msg, DIALOG * d, int c)
+{
+  int height, bar, ret = D_O_K;
+  int start, top, bottom, l;
+  int used, delta;
+  int fg_color;
+  ASSERT (d);
+
+  fg_color = (d->flags & D_DISABLED) ? gui_mg_color : d->fg;
+  /* calculate the actual height */
+  height = (d->h - 8) / text_height (font);
+
+  switch (msg)
+    {
+
+    case MSG_START:
+      /* measure how many lines of text we contain */
+      my_draw_textbox (d->dp, &d->d1, 0,	/* DONT DRAW anything */
+		       d->d2, !(d->flags & D_SELECTED), 8,
+		       d->x, d->y, d->w, d->h,
+		       (d->flags & D_DISABLED), 0, 0, 0);
+      break;
+
+    case MSG_DRAW:
+      /* tell the object to sort of draw, but only calculate the listsize */
+      my_draw_textbox (d->dp, &d->d1, 0,	/* DONT DRAW anything */
+		       d->d2, !(d->flags & D_SELECTED), 8,
+		       d->x, d->y, d->w, d->h,
+		       (d->flags & D_DISABLED), 0, 0, 0);
+
+      if (d->d1 > height && d->d1 > 1)	// ufoot
+	{
+	  bar = 12;
+	}
+      else
+	{
+	  bar = 0;
+	  d->d2 = 0;
+	}
+
+      if (d->d1 <= 1)
+	{
+	  rectfill (screen, d->x, d->y, d->x + d->w, d->y + d->h, d->bg);	// ufoot
+	}
+
+      /* now do the actual drawing */
+      my_draw_textbox (d->dp, &d->d1, 1, d->d2,
+		       !(d->flags & D_SELECTED), 8,
+		       d->x, d->y, d->w - bar, d->h,
+		       (d->flags & D_DISABLED),
+		       fg_color, d->bg, gui_mg_color);
+
+      if (d->d1 <= 1)
+	{
+	  /*
+	   * If there's only one line, skip the scroll bar. Patched
+	   * for LW by ufoot, to handle 320x240 in a nicer way.
+	   */
+	  rect (screen, d->x, d->y, d->x + d->w, d->y + d->h, fg_color);	// ufoot
+	}
+      else
+	{
+	  /* draw the frame around */
+	  _draw_scrollable_frame (d, d->d1, d->d2, height, fg_color, d->bg);
+	}
+      break;
+
+    case MSG_CLICK:
+      /* figure out if it's on the text or the scrollbar */
+      bar = (d->d1 > height);
+
+      if ((!bar) || (gui_mouse_x () < d->x + d->w - 13))
+	{
+	  /* clicked on the text area */
+	  ret = D_O_K;
+	}
+      else
+	{
+	  /* clicked on the scroll area */
+	  my_handle_scrollable_scroll_click (d, d->d1, &d->d2, height);
+	}
+      break;
+
+    case MSG_CHAR:
+      start = d->d2;
+      used = D_USED_CHAR;
+
+      if (d->d1 > 0)
+	{
+	  if (d->d2 > 0)
+	    top = d->d2 + 1;
+	  else
+	    top = 0;
+
+	  l = (d->h - 8) / text_height (font);
+
+	  bottom = d->d2 + l - 1;
+	  if (bottom >= d->d1 - 1)
+	    bottom = d->d1 - 1;
+	  else
+	    bottom--;
+
+	  if ((c >> 8) == KEY_UP)
+	    d->d2--;
+	  else if ((c >> 8) == KEY_DOWN)
+	    d->d2++;
+	  else if ((c >> 8) == KEY_HOME)
+	    d->d2 = 0;
+	  else if ((c >> 8) == KEY_END)
+	    d->d2 = d->d1 - l;
+	  else if ((c >> 8) == KEY_PGUP)
+	    d->d2 -= (bottom - top) ? bottom - top : 1;
+	  else if ((c >> 8) == KEY_PGDN)
+	    d->d2 += (bottom - top) ? bottom - top : 1;
+	  else
+	    used = D_O_K;
+
+	  /* make sure that the list stays in bounds */
+	  if (d->d2 > d->d1 - l)
+	    d->d2 = d->d1 - l;
+	  if (d->d2 < 0)
+	    d->d2 = 0;
+	}
+      else
+	used = D_O_K;
+
+      /* if we changed something, better redraw... */
+      if (d->d2 != start)
+	d->flags |= D_DIRTY;
+
+      ret = used;
+      break;
+
+    case MSG_WHEEL:
+      l = (d->h - 8) / text_height (font);
+      delta = (l > 3) ? 3 : 1;
+
+      /* scroll, making sure that the list stays in bounds */
+      start = d->d2;
+      d->d2 =
+	(c > 0) ? MAX (0, d->d2 - delta) : MIN (d->d1 - l, d->d2 + delta);
+
+      /* if we changed something, better redraw... */
+      if (d->d2 != start)
+	d->flags |= D_DIRTY;
+
+      ret = D_O_K;
+      break;
+
+    case MSG_WANTFOCUS:
+      /* if we don't have a scrollbar we can't do anything with the focus */
+      if (d->d1 > height)
+	ret = D_WANTFOCUS;
+      break;
+
+    default:
+      ret = D_O_K;
+    }
+
+  return ret;
+}
+
+/* d_button_proc:
+ *  A button object (the dp field points to the text string). This object
+ *  can be selected by clicking on it with the mouse or by pressing its 
+ *  keyboard shortcut. If the D_EXIT flag is set, selecting it will close 
+ *  the dialog, otherwise it will toggle on and off.
+ */
+int
+my_button_proc (int msg, DIALOG * d, int c)
+{
+  BITMAP *gui_bmp;
+  int state1, state2;
+  int black;
+  int swap;
+  int g;
+  ASSERT (d);
+
+  LW_MACRO_NOP (c);		// ufoot
+
+  gui_bmp = gui_get_screen ();
+
+  switch (msg)
+    {
+
+    case MSG_DRAW:
+      if (d->flags & D_SELECTED)
+	{
+	  g = 1;
+	  state1 = d->bg;
+	  state2 = (d->flags & D_DISABLED) ? gui_mg_color : d->fg;
+	}
+      else
+	{
+	  g = 0;
+	  state1 = (d->flags & D_DISABLED) ? gui_mg_color : d->fg;
+	  state2 = d->bg;
+	}
+
+      rectfill (gui_bmp, d->x + 1 + g, d->y + 1 + g, d->x + d->w - 3 + g,
+		d->y + d->h - 3 + g, state2);
+      rect (gui_bmp, d->x + g, d->y + g, d->x + d->w - 2 + g,
+	    d->y + d->h - 2 + g, state1);
+      //gui_textout_ex(gui_bmp, d->dp, d->x+d->w/2+g, d->y+d->h/2-text_height(font)/2+g, state1, -1, TRUE);
+      gui_textout_ex (gui_bmp, d->dp, d->x + d->w / 2 + g, d->y + d->h / 2 - text_height (font) / 2 + g, -1, -1, TRUE);	// ufoot
+
+      if (d->flags & D_SELECTED)
+	{
+	  vline (gui_bmp, d->x, d->y, d->y + d->h - 2, d->bg);
+	  hline (gui_bmp, d->x, d->y, d->x + d->w - 2, d->bg);
+	}
+      else
+	{
+	  black = makecol (0, 0, 0);
+	  vline (gui_bmp, d->x + d->w - 1, d->y + 1, d->y + d->h - 2, black);
+	  hline (gui_bmp, d->x + 1, d->y + d->h - 1, d->x + d->w - 1, black);
+	}
+      if ((d->flags & D_GOTFOCUS) &&
+	  (!(d->flags & D_SELECTED) || !(d->flags & D_EXIT)))
+	my_dotted_rect (d->x + 1 + g, d->y + 1 + g, d->x + d->w - 3 + g,
+			d->y + d->h - 3 + g, state1, state2);
+      break;
+
+    case MSG_WANTFOCUS:
+      return D_WANTFOCUS;
+
+    case MSG_KEY:
+      /* close dialog? */
+      if (d->flags & D_EXIT)
+	{
+	  return D_CLOSE;
+	}
+
+      /* or just toggle */
+      d->flags ^= D_SELECTED;
+      object_message (d, MSG_DRAW, 0);
+      break;
+
+    case MSG_CLICK:
+      /* what state was the button originally in? */
+      state1 = d->flags & D_SELECTED;
+      if (d->flags & D_EXIT)
+	swap = FALSE;
+      else
+	swap = state1;
+
+      /* track the mouse until it is released */
+      while (gui_mouse_b ())
+	{
+	  state2 = ((gui_mouse_x () >= d->x) && (gui_mouse_y () >= d->y) &&
+		    (gui_mouse_x () < d->x + d->w)
+		    && (gui_mouse_y () < d->y + d->h));
+	  if (swap)
+	    state2 = !state2;
+
+	  /* redraw? */
+	  if (((state1) && (!state2)) || ((state2) && (!state1)))
+	    {
+	      d->flags ^= D_SELECTED;
+	      state1 = d->flags & D_SELECTED;
+	      object_message (d, MSG_DRAW, 0);
+	    }
+
+	  /* let other objects continue to animate */
+	  broadcast_dialog_message (MSG_IDLE, 0);
+	}
+
+      /* should we close the dialog? */
+      if ((d->flags & D_SELECTED) && (d->flags & D_EXIT))
+	{
+	  d->flags ^= D_SELECTED;
+	  return D_CLOSE;
+	}
+      break;
+    }
+
+  return D_O_K;
+}
+
+
+/* d_text_proc:
+ *  Simple dialog procedure: draws the text string which is pointed to by dp.
+ */
+int
+my_text_proc (int msg, DIALOG * d, int c)
+{
+  LW_MACRO_NOP (c);		// ufoot
+
+  ASSERT (d);
+  if (msg == MSG_DRAW)
+    {
+      //int fg = (d->flags & D_DISABLED) ? gui_mg_color : d->fg; // ufoot
+      FONT *oldfont = font;
+
+      if (d->dp2)
+	font = d->dp2;
+
+      //gui_textout_ex(gui_get_screen(), d->dp, d->x, d->y, fg, d->bg, FALSE);
+      gui_textout_ex (gui_get_screen (), d->dp, d->x, d->y, -1, d->bg, FALSE);	// ufoot
+
+      font = oldfont;
+    }
+
+  return D_O_K;
+}
+
+/* d_ctext_proc:
+ *  Simple dialog procedure: draws the text string which is pointed to by dp,
+ *  centering it around the object's x coordinate.
+ */
+int
+my_ctext_proc (int msg, DIALOG * d, int c)
+{
+  LW_MACRO_NOP (c);		// ufoot
+
+  ASSERT (d);
+  if (msg == MSG_DRAW)
+    {
+      // int fg = (d->flags & D_DISABLED) ? gui_mg_color : d->fg; // ufoot
+      FONT *oldfont = font;
+
+      if (d->dp2)
+	font = d->dp2;
+
+      //gui_textout_ex(gui_get_screen(), d->dp, d->x + d->w/2, d->y, fg, d->bg, TRUE);
+      gui_textout_ex (gui_get_screen (), d->dp, d->x + d->w / 2, d->y, -1, d->bg, TRUE);	// ufoot
+
+      font = oldfont;
+    }
+
+  return D_O_K;
+}
+
+
+/* d_slider_proc:
+ *  A slider control object. This object returns a value in d2, in the
+ *  range from 0 to d1. It will display as a vertical slider if h is
+ *  greater than or equal to w; otherwise, it will display as a horizontal
+ *  slider. dp can contain an optional bitmap to use for the slider handle; 
+ *  dp2 can contain an optional callback function, which is called each 
+ *  time d2 changes. The callback function should have the following
+ *  prototype:
+ *
+ *  int function(void *dp3, int d2);
+ *
+ *  The d_slider_proc object will return the value of the callback function.
+ */
+int
+my_slider_proc (int msg, DIALOG * d, int c)
+{
+  BITMAP *gui_bmp = gui_get_screen ();
+  BITMAP *slhan = NULL;
+  int oldpos, newpos;
+  int sfg;			/* slider foreground color */
+  int vert = TRUE;		/* flag: is slider vertical? */
+  int hh = 7;			/* handle height (width for horizontal sliders) */
+  int hmar;			/* handle margin */
+  int slp;			/* slider position */
+  int mp;			/* mouse position */
+  int irange;
+  int slx, sly, slh, slw;
+  int msx, msy;
+  int retval = D_O_K;
+  int upkey, downkey;
+  int pgupkey, pgdnkey;
+  int homekey, endkey;
+  int delta;
+  fixed slratio, slmax, slpos;
+  int (*proc) (void *cbpointer, int d2value);
+  int oldval;
+  ASSERT (d);
+
+  /* check for slider direction */
+  if (d->h < d->w)
+    vert = FALSE;
+
+  /* set up the metrics for the control */
+  if (d->dp != NULL)
+    {
+      slhan = (BITMAP *) d->dp;
+      if (vert)
+	hh = slhan->h;
+      else
+	hh = slhan->w;
+    }
+
+  hmar = hh / 2;
+  irange = (vert) ? d->h : d->w;
+  slmax = itofix (irange - hh);
+  slratio = slmax / (d->d1);
+  slpos = slratio * d->d2;
+  slp = fixtoi (slpos);
+
+  switch (msg)
+    {
+
+    case MSG_DRAW:
+      sfg = (d->flags & D_DISABLED) ? gui_mg_color : d->fg;
+
+      if (vert)
+	{
+	  rectfill (gui_bmp, d->x, d->y, d->x + d->w / 2 - 2, d->y + d->h - 1,
+		    d->bg);
+	  rectfill (gui_bmp, d->x + d->w / 2 - 1, d->y, d->x + d->w / 2 + 1,
+		    d->y + d->h - 1, sfg);
+	  rectfill (gui_bmp, d->x + d->w / 2 + 2, d->y, d->x + d->w - 1,
+		    d->y + d->h - 1, d->bg);
+	}
+      else
+	{
+	  rectfill (gui_bmp, d->x, d->y, d->x + d->w - 1, d->y + d->h / 2 - 2,
+		    d->bg);
+	  rectfill (gui_bmp, d->x, d->y + d->h / 2 - 1, d->x + d->w - 1,
+		    d->y + d->h / 2 + 1, sfg);
+	  rectfill (gui_bmp, d->x, d->y + d->h / 2 + 2, d->x + d->w - 1,
+		    d->y + d->h - 1, d->bg);
+	}
+
+      /*
+       * Following line added to draw a box arround the slider
+       */
+      rect (screen, d->x, d->y, d->x + d->w, d->y + d->h, sfg);	// ufoot
+
+      /* okay, background and slot are drawn, now draw the handle */
+      if (slhan)
+	{
+	  if (vert)
+	    {
+	      slx = d->x + (d->w / 2) - (slhan->w / 2);
+	      sly = d->y + (d->h - 1) - (hh + slp);
+	    }
+	  else
+	    {
+	      slx = d->x + slp;
+	      sly = d->y + (d->h / 2) - (slhan->h / 2);
+	    }
+	  draw_sprite (gui_bmp, slhan, slx, sly);
+	}
+      else
+	{
+	  /* draw default handle */
+	  if (vert)
+	    {
+	      slx = d->x;
+	      sly = d->y + (d->h) - (hh + slp);
+	      slw = d->w - 1;
+	      slh = hh - 1;
+	    }
+	  else
+	    {
+	      slx = d->x + slp;
+	      sly = d->y;
+	      slw = hh - 1;
+	      slh = d->h - 1;
+	    }
+
+	  /* draw body */
+	  rectfill (gui_bmp, slx + 2, sly, slx + (slw - 2), sly + slh, sfg);
+	  vline (gui_bmp, slx + 1, sly + 1, sly + slh - 1, sfg);
+	  vline (gui_bmp, slx + slw - 1, sly + 1, sly + slh - 1, sfg);
+	  vline (gui_bmp, slx, sly + 2, sly + slh - 2, sfg);
+	  vline (gui_bmp, slx + slw, sly + 2, sly + slh - 2, sfg);
+	  vline (gui_bmp, slx + 1, sly + 2, sly + slh - 2, d->bg);
+	  hline (gui_bmp, slx + 2, sly + 1, slx + slw - 2, d->bg);
+	  putpixel (gui_bmp, slx + 2, sly + 2, d->bg);
+	}
+
+      if (d->flags & D_GOTFOCUS)
+	// my_dotted_rect(d->x, d->y, d->x+d->w-1, d->y+d->h-1, sfg, d->bg);
+	my_dotted_rect (d->x + 1, d->y + 1, d->x + d->w - 1, d->y + d->h - 1, sfg, d->bg);	// ufoot
+      break;
+
+    case MSG_WANTFOCUS:
+    case MSG_LOSTFOCUS:
+      return D_WANTFOCUS;
+
+    case MSG_KEY:
+      if (!(d->flags & D_GOTFOCUS))
+	return D_WANTFOCUS;
+      else
+	return D_O_K;
+
+    case MSG_CHAR:
+      /* handle movement keys to move slider */
+      c >>= 8;
+
+      if (vert)
+	{
+	  upkey = KEY_UP;
+	  downkey = KEY_DOWN;
+	  pgupkey = KEY_PGUP;
+	  pgdnkey = KEY_PGDN;
+	  homekey = KEY_END;
+	  endkey = KEY_HOME;
+	}
+      else
+	{
+	  upkey = KEY_RIGHT;
+	  downkey = KEY_LEFT;
+	  pgupkey = KEY_PGDN;
+	  pgdnkey = KEY_PGUP;
+	  homekey = KEY_HOME;
+	  endkey = KEY_END;
+	}
+
+      if (c == upkey)
+	delta = 1;
+      else if (c == downkey)
+	delta = -1;
+      else if (c == pgdnkey)
+	delta = -d->d1 / 16;
+      else if (c == pgupkey)
+	delta = d->d1 / 16;
+      else if (c == homekey)
+	delta = -d->d2;
+      else if (c == endkey)
+	delta = d->d1 - d->d2;
+      else
+	delta = 0;
+
+      if (delta)
+	{
+	  oldpos = slp;
+	  oldval = d->d2;
+
+	  while (1)
+	    {
+	      d->d2 = d->d2 + delta;
+	      slpos = slratio * d->d2;
+	      slp = fixtoi (slpos);
+	      if ((slp != oldpos) || (d->d2 <= 0) || (d->d2 >= d->d1))
+		break;
+	    }
+
+	  if (d->d2 < 0)
+	    d->d2 = 0;
+	  if (d->d2 > d->d1)
+	    d->d2 = d->d1;
+
+	  retval = D_USED_CHAR;
+
+	  if (d->d2 != oldval)
+	    {
+	      /* call callback function here */
+	      if (d->dp2)
+		{
+		  proc = d->dp2;
+		  retval |= (*proc) (d->dp3, d->d2);
+		}
+
+	      object_message (d, MSG_DRAW, 0);
+	    }
+	}
+      break;
+
+    case MSG_WHEEL:
+      oldval = d->d2;
+      d->d2 = MID (0, d->d2 + c, d->d1);
+      if (d->d2 != oldval)
+	{
+	  /* call callback function here */
+	  if (d->dp2)
+	    {
+	      proc = d->dp2;
+	      retval |= (*proc) (d->dp3, d->d2);
+	    }
+
+	  object_message (d, MSG_DRAW, 0);
+	}
+      break;
+
+    case MSG_CLICK:
+      /* track the mouse until it is released */
+      mp = slp;
+
+      while (gui_mouse_b ())
+	{
+	  msx = gui_mouse_x ();
+	  msy = gui_mouse_y ();
+	  oldval = d->d2;
+	  if (vert)
+	    mp = (d->y + d->h - hmar) - msy;
+	  else
+	    mp = msx - (d->x + hmar);
+	  if (mp < 0)
+	    mp = 0;
+	  if (mp > irange - hh)
+	    mp = irange - hh;
+	  slpos = itofix (mp);
+	  slmax = fixdiv (slpos, slratio);
+	  newpos = fixtoi (slmax);
+	  if (newpos != oldval)
+	    {
+	      d->d2 = newpos;
+
+	      /* call callback function here */
+	      if (d->dp2 != NULL)
+		{
+		  proc = d->dp2;
+		  retval |= (*proc) (d->dp3, d->d2);
+		}
+
+	      object_message (d, MSG_DRAW, 0);
+	    }
+
+	  /* let other objects continue to animate */
+	  broadcast_dialog_message (MSG_IDLE, 0);
+	}
+      break;
+    }
+
+  return retval;
+}
+
+
+/* d_edit_proc:
+ *  An editable text object (the dp field points to the string). When it
+ *  has the input focus (obtained by clicking on it with the mouse), text
+ *  can be typed into this object. The d1 field specifies the maximum
+ *  number of characters that it will accept, and d2 is the text cursor 
+ *  position within the string.
+ */
+int
+my_edit_proc (int msg, DIALOG * d, int c)
+{
+  static int ignore_next_uchar = FALSE;
+  BITMAP *gui_bmp;
+  int last_was_space, new_pos, i, k;
+  int f, l, p, w, x, fg, b, scroll;
+  char buf[16];
+  char *s, *t;
+  ASSERT (d);
+
+  gui_bmp = gui_get_screen ();
+
+  s = d->dp;
+  l = ustrlen (s);
+  if (d->d2 > l)
+    d->d2 = l;
+
+  /* calculate maximal number of displayable characters */
+  if (d->d2 == l)
+    {
+      usetc (buf + usetc (buf, ' '), 0);
+      x = text_length (font, buf);
+    }
+  else
+    x = 0;
+
+  b = 0;
+
+  for (p = d->d2; p >= 0; p--)
+    {
+      usetc (buf + usetc (buf, ugetat (s, p)), 0);
+      x += text_length (font, buf);
+      b++;
+      if (x > d->w)
+	break;
+    }
+
+  if (x <= d->w)
+    {
+      b = l;
+      scroll = FALSE;
+    }
+  else
+    {
+      b--;
+      scroll = TRUE;
+    }
+
+  switch (msg)
+    {
+
+    case MSG_START:
+      d->d2 = l;
+      break;
+
+    case MSG_DRAW:
+      fg = (d->flags & D_DISABLED) ? gui_mg_color : d->fg;
+      x = 0;
+
+      if (scroll)
+	{
+	  p = d->d2 - b + 1;
+	  b = d->d2;
+	}
+      else
+	p = 0;
+
+      for (; p <= b; p++)
+	{
+	  f = ugetat (s, p);
+	  usetc (buf + usetc (buf, (f) ? f : ' '), 0);
+	  w = text_length (font, buf);
+	  if (x + w > d->w)
+	    break;
+	  f = ((p == d->d2) && (d->flags & D_GOTFOCUS));
+	  //textout_ex(gui_bmp, font, buf, d->x+x, d->y, (f) ? d->bg : fg, (f) ? fg : d->bg);
+	  textout_ex (gui_bmp, font, buf, d->x + x, d->y, -1, (f) ? d->fg : d->bg);	// ufoot
+	  x += w;
+	}
+      if (x < d->w)
+	rectfill (gui_bmp, d->x + x, d->y, d->x + d->w - 1,
+		  d->y + text_height (font) - 1, d->bg);
+      break;
+
+    case MSG_CLICK:
+      x = d->x;
+
+      if (scroll)
+	{
+	  p = d->d2 - b + 1;
+	  b = d->d2;
+	}
+      else
+	p = 0;
+
+      for (; p < b; p++)
+	{
+	  usetc (buf + usetc (buf, ugetat (s, p)), 0);
+	  x += text_length (font, buf);
+	  if (x > gui_mouse_x ())
+	    break;
+	}
+      d->d2 = MID (0, p, l);
+      object_message (d, MSG_DRAW, 0);
+      break;
+
+    case MSG_WANTFOCUS:
+    case MSG_LOSTFOCUS:
+    case MSG_KEY:
+      return D_WANTFOCUS;
+
+    case MSG_CHAR:
+      ignore_next_uchar = FALSE;
+
+      if ((c >> 8) == KEY_LEFT)
+	{
+	  if (d->d2 > 0)
+	    {
+	      if (key_shifts & KB_CTRL_FLAG)
+		{
+		  last_was_space = TRUE;
+		  new_pos = 0;
+		  t = s;
+		  for (i = 0; i < d->d2; i++)
+		    {
+		      k = ugetx (&t);
+		      if (uisspace (k))
+			last_was_space = TRUE;
+		      else if (last_was_space)
+			{
+			  last_was_space = FALSE;
+			  new_pos = i;
+			}
+		    }
+		  d->d2 = new_pos;
+		}
+	      else
+		d->d2--;
+	    }
+	}
+      else if ((c >> 8) == KEY_RIGHT)
+	{
+	  if (d->d2 < l)
+	    {
+	      if (key_shifts & KB_CTRL_FLAG)
+		{
+		  t = s + uoffset (s, d->d2);
+		  for (k = ugetx (&t); uisspace (k); k = ugetx (&t))
+		    d->d2++;
+		  for (; k && !uisspace (k); k = ugetx (&t))
+		    d->d2++;
+		}
+	      else
+		d->d2++;
+	    }
+	}
+      else if ((c >> 8) == KEY_HOME)
+	{
+	  d->d2 = 0;
+	}
+      else if ((c >> 8) == KEY_END)
+	{
+	  d->d2 = l;
+	}
+      else if ((c >> 8) == KEY_DEL)
+	{
+	  if (d->d2 < l)
+	    uremove (s, d->d2);
+	}
+      else if ((c >> 8) == KEY_BACKSPACE)
+	{
+	  if (d->d2 > 0)
+	    {
+	      d->d2--;
+	      uremove (s, d->d2);
+	    }
+	}
+      else if ((c >> 8) == KEY_ENTER)
+	{
+	  if (d->flags & D_EXIT)
+	    {
+	      object_message (d, MSG_DRAW, 0);
+	      return D_CLOSE;
+	    }
+	  else
+	    return D_O_K;
+	}
+      else if ((c >> 8) == KEY_TAB)
+	{
+	  ignore_next_uchar = TRUE;
+	  return D_O_K;
+	}
+      else
+	{
+	  /* don't process regular keys here: MSG_UCHAR will do that */
+	  break;
+	}
+      object_message (d, MSG_DRAW, 0);
+      return D_USED_CHAR;
+
+    case MSG_UCHAR:
+      // if ((c >= ' ') && (uisok (c)) && (!ignore_next_uchar))
+      if ((c >= ' ') && (c < 128) && (uisok (c)) && (!ignore_next_uchar))	// ufoot
+	{
+	  if (l < d->d1)
+	    {
+	      uinsert (s, d->d2, c);
+	      d->d2++;
+
+	      object_message (d, MSG_DRAW, 0);
+	    }
+	  return D_USED_CHAR;
+	}
+      break;
+    }
+
+  return D_O_K;
+}
+
+
+
+/* _handle_scrollable_click:
+ *  Helper to process a click on a scrollable object.
+ */
+static void
+my_handle_scrollable_scroll_click (DIALOG * d, int listsize, int *offset,
+				   int height)
+{
+  int xx, yy;
+  int hh = d->h - 5;
+
+  while (gui_mouse_b ())
+    {
+      int i = (hh * height + listsize / 2) / listsize;
+      int len = (hh * (*offset) + listsize / 2) / listsize + 2;
+
+      if ((gui_mouse_y () >= d->y + len)
+	  && (gui_mouse_y () <= d->y + len + i))
+	{
+	  xx = gui_mouse_y () - len + 2;
+	  while (gui_mouse_b ())
+	    {
+	      yy = (listsize * (gui_mouse_y () - xx) + hh / 2) / hh;
+	      if (yy > listsize - height)
+		yy = listsize - height;
+
+	      if (yy < 0)
+		yy = 0;
+
+	      if (yy != *offset)
+		{
+		  *offset = yy;
+		  object_message (d, MSG_DRAW, 0);
+		}
+
+	      /* let other objects continue to animate */
+	      broadcast_dialog_message (MSG_IDLE, 0);
+	    }
+	}
+      else
+	{
+	  if (gui_mouse_y () <= d->y + len)
+	    yy = *offset - height;
+	  else
+	    yy = *offset + height;
+
+	  if (yy > listsize - height)
+	    yy = listsize - height;
+
+	  if (yy < 0)
+	    yy = 0;
+
+	  if (yy != *offset)
+	    {
+	      *offset = yy;
+	      object_message (d, MSG_DRAW, 0);
+	    }
+	}
+
+      /* let other objects continue to animate */
+      broadcast_dialog_message (MSG_IDLE, 0);
+    }
+}
+
+
+/* _handle_scrollable_scroll:
+ *  Helper function to scroll through a scrollable object.
+ */
+static void
+my_handle_scrollable_scroll (DIALOG * d, int listsize, int *index,
+			     int *offset)
+{
+  int height = (d->h - 4) / text_height (font);
+
+  if (listsize <= 0)
+    {
+      *index = *offset = 0;
+      return;
+    }
+
+  /* check selected item */
+  if (*index < 0)
+    *index = 0;
+  else if (*index >= listsize)
+    *index = listsize - 1;
+
+  /* check scroll position */
+  while ((*offset > 0) && (*offset + height > listsize))
+    (*offset)--;
+
+  if (*offset >= *index)
+    {
+      if (*index < 0)
+	*offset = 0;
+      else
+	*offset = *index;
+    }
+  else
+    {
+      while ((*offset + height - 1) < *index)
+	(*offset)++;
+    }
+}
+
+
+
+/* idle_cb:
+ *  rest_callback() routine to keep dialogs animating nice and smoothly.
+ */
+static void
+my_idle_cb (void)
+{
+  broadcast_dialog_message (MSG_IDLE, 0);
+}
+
+
+/* _handle_listbox_click:
+ *  Helper to process a click on a listbox, doing hit-testing and moving
+ *  the selection.
+ */
+static void
+my_handle_listbox_click (DIALOG * d)
+{
+  char *sel = d->dp2;
+  int listsize, height;
+  int i, j;
+
+  (*(my_getfuncptr) d->dp) (-1, &listsize);
+  if (!listsize)
+    return;
+
+  height = (d->h - 4) / text_height (font);
+
+  i = MID (0, ((gui_mouse_y () - d->y - 2) / text_height (font)),
+	   ((d->h - 4) / text_height (font) - 1));
+  i += d->d2;
+  if (i < d->d2)
+    i = d->d2;
+  else
+    {
+      if (i > d->d2 + height - 1)
+	i = d->d2 + height - 1;
+      if (i >= listsize)
+	i = listsize - 1;
+    }
+
+  if (gui_mouse_y () <= d->y)
+    i = MAX (i - 1, 0);
+  else if (gui_mouse_y () >= d->y + d->h - 1)
+    i = MIN (i + 1, listsize - 1);
+
+  if (i != d->d1)
+    {
+      if (sel)
+	{
+	  if (key_shifts & (KB_SHIFT_FLAG | KB_CTRL_FLAG))
+	    {
+	      if ((key_shifts & KB_SHIFT_FLAG) || (d->flags & D_INTERNAL))
+		{
+		  for (j = MIN (i, d->d1); j <= MAX (i, d->d1); j++)
+		    sel[j] = TRUE;
+		}
+	      else
+		sel[i] = !sel[i];
+	    }
+	  else
+	    sel[i] = TRUE;
+	}
+
+      d->d1 = i;
+      i = d->d2;
+      my_handle_scrollable_scroll (d, listsize, &d->d1, &d->d2);
+
+      d->flags |= D_DIRTY;
+
+      if (i != d->d2)
+	rest_callback (MID (10, text_height (font) * 16 - d->h - 1, 100),
+		       my_idle_cb);
+    }
+  else
+    {
+      if (!(d->flags & D_INTERNAL))
+	{
+	  if (sel)
+	    {
+	      if ((key_shifts & KB_CTRL_FLAG))
+		sel[i] = !sel[i];
+	      else
+		sel[i] = TRUE;
+
+	      d->flags |= D_DIRTY;
+	    }
+	}
+    }
+}
+
+
+
+/* draw_listbox:
+ *  Helper function to draw a listbox object.
+ */
+static void
+my_draw_listbox (DIALOG * d)
+{
+  BITMAP *gui_bmp = gui_get_screen ();
+  int height, listsize, i, len, bar, x, y, w;
+  int fg_color, fg, bg;
+  char *sel = d->dp2;
+  char s[1024];
+
+  (*(my_getfuncptr) d->dp) (-1, &listsize);
+  height = (d->h - 4) / text_height (font);
+  bar = (listsize > height);
+  w = (bar ? d->w - 15 : d->w - 3);
+  fg_color = (d->flags & D_DISABLED) ? gui_mg_color : d->fg;
+
+  /* draw box contents */
+  for (i = 0; i < height; i++)
+    {
+      if (d->d2 + i < listsize)
+	{
+	  if (sel)
+	    {
+	      if ((sel[d->d2 + i]) && (d->d2 + i == d->d1))
+		{
+		  fg = d->bg;
+		  bg = fg_color;
+		}
+	      else if (sel[d->d2 + i])
+		{
+		  fg = d->bg;
+		  bg = gui_mg_color;
+		}
+	      else
+		{
+		  fg = fg_color;
+		  bg = d->bg;
+		}
+	    }
+	  else if (d->d2 + i == d->d1)
+	    {
+	      fg = d->bg;
+	      bg = fg_color;
+	    }
+	  else
+	    {
+	      fg = fg_color;
+	      bg = d->bg;
+	    }
+	  ustrzcpy (s, sizeof (s),
+		    (*(my_getfuncptr) d->dp) (i + d->d2, NULL));
+	  x = d->x + 2;
+	  y = d->y + 2 + i * text_height (font);
+	  rectfill (gui_bmp, x, y, x + 7, y + text_height (font) - 1, bg);
+	  x += 8;
+	  len = ustrlen (s);
+	  while (text_length (font, s) >= MAX (d->w - 1 - (bar ? 22 : 10), 1))
+	    {
+	      len--;
+	      usetat (s, len, 0);
+	    }
+	  //textout_ex(gui_bmp, font, s, x, y, fg, bg);
+	  textout_ex (gui_bmp, font, s, x, y, -1, bg);	// ufoot
+	  x += text_length (font, s);
+	  if (x <= d->x + w)
+	    rectfill (gui_bmp, x, y, d->x + w, y + text_height (font) - 1,
+		      bg);
+	  if (d->d2 + i == d->d1)
+	    my_dotted_rect (d->x + 1, y, d->x + d->w - (bar ? 12 : 0),
+			    y + text_height (font) - 1, d->fg, d->bg);
+	}
+      else
+	{
+	  rectfill (gui_bmp, d->x + 2, d->y + 2 + i * text_height (font),
+		    d->x + w, d->y + 1 + (i + 1) * text_height (font), d->bg);
+	}
+    }
+
+  if (d->y + 2 + i * text_height (font) <= d->y + d->h - 3)
+    rectfill (gui_bmp, d->x + 2, d->y + 2 + i * text_height (font),
+	      d->x + w, d->y + d->h - 3, d->bg);
+
+  /* draw frame, maybe with scrollbar */
+  _draw_scrollable_frame (d, listsize, d->d2, height, fg_color, d->bg);
+}
+
+
+/* d_list_proc:
+ *  A list box object. The dp field points to a function which it will call
+ *  to obtain information about the list. This should follow the form:
+ *     const char *<list_func_name> (int index, int *list_size);
+ *  If index is zero or positive, the function should return a pointer to
+ *  the string which is to be displayed at position index in the list. If
+ *  index is  negative, it should return null and list_size should be set
+ *  to the number of items in the list. The list box object will allow the
+ *  user to scroll through the list and to select items list by clicking
+ *  on them, and if it has the input focus also by using the arrow keys. If 
+ *  the D_EXIT flag is set, double clicking on a list item will cause it to 
+ *  close the dialog. The index of the selected item is held in the d1 
+ *  field, and d2 is used to store how far it has scrolled through the list.
+ */
+int
+my_list_proc (int msg, DIALOG * d, int c)
+{
+  int listsize, i, bottom, height, bar, orig;
+  char *sel = d->dp2;
+  int redraw = FALSE;
+  ASSERT (d);
+
+  switch (msg)
+    {
+
+    case MSG_START:
+      (*(my_getfuncptr) d->dp) (-1, &listsize);
+      my_handle_scrollable_scroll (d, listsize, &d->d1, &d->d2);
+      break;
+
+    case MSG_DRAW:
+      my_draw_listbox (d);
+      break;
+
+    case MSG_CLICK:
+      (*(my_getfuncptr) d->dp) (-1, &listsize);
+      height = (d->h - 4) / text_height (font);
+      bar = (listsize > height);
+      if ((!bar) || (gui_mouse_x () < d->x + d->w - 13))
+	{
+	  if ((sel) && (!(key_shifts & KB_CTRL_FLAG)))
+	    {
+	      for (i = 0; i < listsize; i++)
+		{
+		  if (sel[i])
+		    {
+		      redraw = TRUE;
+		      sel[i] = FALSE;
+		    }
+		}
+	      if (redraw)
+		object_message (d, MSG_DRAW, 0);
+	    }
+	  my_handle_listbox_click (d);
+	  while (gui_mouse_b ())
+	    {
+	      broadcast_dialog_message (MSG_IDLE, 0);
+	      d->flags |= D_INTERNAL;
+	      my_handle_listbox_click (d);
+	      d->flags &= ~D_INTERNAL;
+	    }
+	}
+      else
+	{
+	  my_handle_scrollable_scroll_click (d, listsize, &d->d2, height);
+	}
+      break;
+
+    case MSG_DCLICK:
+      (*(my_getfuncptr) d->dp) (-1, &listsize);
+      height = (d->h - 4) / text_height (font);
+      bar = (listsize > height);
+      if ((!bar) || (gui_mouse_x () < d->x + d->w - 13))
+	{
+	  if (d->flags & D_EXIT)
+	    {
+	      if (listsize)
+		{
+		  i = d->d1;
+		  object_message (d, MSG_CLICK, 0);
+		  if (i == d->d1)
+		    return D_CLOSE;
+		}
+	    }
+	}
+      break;
+
+    case MSG_WHEEL:
+      (*(my_getfuncptr) d->dp) (-1, &listsize);
+      height = (d->h - 4) / text_height (font);
+      if (height < listsize)
+	{
+	  int delta = (height > 3) ? 3 : 1;
+	  if (c > 0)
+	    i = MAX (0, d->d2 - delta);
+	  else
+	    i = MIN (listsize - height, d->d2 + delta);
+	  if (i != d->d2)
+	    {
+	      d->d2 = i;
+	      object_message (d, MSG_DRAW, 0);
+	    }
+	}
+      break;
+
+    case MSG_KEY:
+      (*(my_getfuncptr) d->dp) (-1, &listsize);
+      if ((listsize) && (d->flags & D_EXIT))
+	return D_CLOSE;
+      break;
+
+    case MSG_WANTFOCUS:
+      return D_WANTFOCUS;
+
+    case MSG_CHAR:
+      (*(my_getfuncptr) d->dp) (-1, &listsize);
+
+      if (listsize)
+	{
+	  c >>= 8;
+
+	  bottom = d->d2 + (d->h - 4) / text_height (font) - 1;
+	  if (bottom >= listsize - 1)
+	    bottom = listsize - 1;
+
+	  orig = d->d1;
+
+	  if (c == KEY_UP)
+	    d->d1--;
+	  else if (c == KEY_DOWN)
+	    d->d1++;
+	  else if (c == KEY_HOME)
+	    d->d1 = 0;
+	  else if (c == KEY_END)
+	    d->d1 = listsize - 1;
+	  else if (c == KEY_PGUP)
+	    {
+	      if (d->d1 > d->d2)
+		d->d1 = d->d2;
+	      else
+		d->d1 -= (bottom - d->d2) ? bottom - d->d2 : 1;
+	    }
+	  else if (c == KEY_PGDN)
+	    {
+	      if (d->d1 < bottom)
+		d->d1 = bottom;
+	      else
+		d->d1 += (bottom - d->d2) ? bottom - d->d2 : 1;
+	    }
+	  else
+	    return D_O_K;
+
+	  if (sel)
+	    {
+	      if (!(key_shifts & (KB_SHIFT_FLAG | KB_CTRL_FLAG)))
+		{
+		  for (i = 0; i < listsize; i++)
+		    sel[i] = FALSE;
+		}
+	      else if (key_shifts & KB_SHIFT_FLAG)
+		{
+		  for (i = MIN (orig, d->d1); i <= MAX (orig, d->d1); i++)
+		    {
+		      if (key_shifts & KB_CTRL_FLAG)
+			sel[i] = (i != d->d1);
+		      else
+			sel[i] = TRUE;
+		    }
+		}
+	    }
+
+	  /* if we changed something, better redraw... */
+	  my_handle_scrollable_scroll (d, listsize, &d->d1, &d->d2);
+	  d->flags |= D_DIRTY;
+	  return D_USED_CHAR;
+	}
+      break;
+    }
+
+  return D_O_K;
+}
+
+/*------------------------------------------------------------------*/
+BITMAP *
+my_create_bitmap (int w, int h)
+{
+  BITMAP *bmp;
+
+  bmp = create_bitmap (w, h);
+  if (bmp == NULL)
+    my_exit (EXIT_CODE_MEM_TROUBLE);
+
+  return bmp;
+}

Added: unstable/liquidwar/branches/upstream/current/src/alleg2.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/alleg2.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/alleg2.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,77 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : alleg2.h                                         */
+/* contenu       : reprogrammation de qq fonctions d'allegro        */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_ALLEG2
+#define LIQUID_WAR_INCLUDE_ALLEG2
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int my_textbox_proc (int, DIALOG *, int c);
+int my_button_proc (int, DIALOG *, int c);
+int my_text_proc (int msg, DIALOG * d, int c);
+int my_ctext_proc (int msg, DIALOG * d, int c);
+int my_slider_proc (int msg, DIALOG * d, int c);
+int my_edit_proc (int msg, DIALOG * d, int c);
+int my_list_proc (int msg, DIALOG * d, int c);
+BITMAP *my_create_bitmap (int w, int h);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/area.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/area.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/area.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,114 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : area.c                                           */
+/* contenu       : creation de l'aire de jeu                        */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "area.h"
+#include "bigdata.h"
+#include "grad.h"
+#include "mesh.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+PLACE *CURRENT_AREA = NULL;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+void
+reset_game_area (void)
+{
+  int i, k;
+
+  for (i = 0; i < CURRENT_MESH_SIZE; ++i)
+    for (k = 0; k < NB_TEAMS; ++k)
+      CURRENT_MESH[i].info[k].state.grad = AREA_START_GRADIENT;
+
+  for (i = 0; i < CURRENT_AREA_W * CURRENT_AREA_H; ++i)
+    CURRENT_AREA[i].fighter = NULL;
+}
+
+/*------------------------------------------------------------------*/
+int
+create_game_area (void)
+{
+  int x, y, i, test;
+
+  CURRENT_AREA = malloc_in_big_data_bottom
+    (CURRENT_AREA_W * CURRENT_AREA_H * sizeof (PLACE));
+
+  if (CURRENT_AREA && CURRENT_MESH)
+    {
+      i = 0;
+      for (y = 0; y < CURRENT_AREA_H; ++y)
+	for (x = 0; x < CURRENT_AREA_W; ++x)
+	  {
+	    CURRENT_AREA[i].mesh = NULL;
+	    CURRENT_AREA[i].fighter = NULL;
+	    i++;
+	  }
+      for (i = 0; i < CURRENT_MESH_SIZE; ++i)
+	for (y = 0; y < CURRENT_MESH[i].side.size; ++y)
+	  for (x = 0; x < CURRENT_MESH[i].side.size; ++x)
+	    {
+	      CURRENT_AREA[(CURRENT_MESH[i].y + y) * CURRENT_AREA_W
+			   + CURRENT_MESH[i].x + x].mesh = CURRENT_MESH + i;
+	      test = CURRENT_MESH[i].info[0].state.grad;
+	    }
+    }
+
+  return (CURRENT_AREA ? 0 : -1);
+}

Added: unstable/liquidwar/branches/upstream/current/src/area.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/area.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/area.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,95 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : area.h                                           */
+/* contenu       : creation de l'aire de jeu                        */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_AREA
+#define LIQUID_WAR_INCLUDE_AREA
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "mesh.h"
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+typedef struct
+{
+  short x;
+  short y;
+  short health;
+  char team;
+  char last_dir;
+}
+FIGHTER;
+
+typedef struct
+{
+  MESH *mesh;
+  FIGHTER *fighter;
+}
+PLACE;
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+extern PLACE *CURRENT_AREA;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void reset_game_area (void);
+int create_game_area (void);
+
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/army.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/army.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/army.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,296 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : army.c                                           */
+/* contenu       : placement des armees                             */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+
+#include "area.h"
+#include "army.h"
+#include "bigdata.h"
+#include "config.h"
+#include "cursor.h"
+#include "mesh.h"
+#include "decal.h"
+#include "network.h"
+#include "log.h"
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+FIGHTER *CURRENT_ARMY = NULL;
+int CURRENT_ARMY_SIZE = 0;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static int
+get_battle_room (void)
+{
+  int i, n;
+
+  n = 0;
+  for (i = 0; i < CURRENT_MESH_SIZE; ++i)
+    n += CURRENT_MESH[i].side.size * CURRENT_MESH[i].side.size;
+
+  return n;
+}
+
+/*------------------------------------------------------------------*/
+static int
+add_fighter (FIGHTER * f, int team, int x, int y, int health)
+{
+  int j;
+
+  j = y * CURRENT_AREA_W + x;
+
+  if (CURRENT_AREA[j].mesh && (!CURRENT_AREA[j].fighter))
+    {
+      CURRENT_AREA[j].fighter = f;
+      f->health = health;
+      f->team = team;
+      f->x = x;
+      f->y = y;
+      f->last_dir = j % NB_DIRS;
+      return 1;
+    }
+  else
+    return 0;
+}
+
+/*------------------------------------------------------------------*/
+static void
+place_team (int part, int team)
+{
+  int placed, x, y, x_min, y_min, x_max, y_max;
+  int fighters;
+  int health;
+  FIGHTER *pos;
+
+  fighters = CURRENT_ARMY_SIZE / PLAYING_TEAMS;
+  ACTIVE_FIGHTERS[team] = 0;
+  health = MAX_FIGHTER_HEALTH - 1;
+
+  switch (part)
+    {
+    case 0:
+      x = CURRENT_AREA_W / 6;
+      y = CURRENT_AREA_H / 4;
+      break;
+    case 1:
+      x = CURRENT_AREA_W / 2;
+      y = CURRENT_AREA_H / 4;
+      break;
+    case 2:
+      x = (5 * CURRENT_AREA_W) / 6;
+      y = CURRENT_AREA_H / 4;
+      break;
+    case 3:
+      x = CURRENT_AREA_W / 6;
+      y = (3 * CURRENT_AREA_H) / 4;
+      break;
+    case 4:
+      x = CURRENT_AREA_W / 2;
+      y = (3 * CURRENT_AREA_H) / 4;
+      break;
+    default:
+      x = (5 * CURRENT_AREA_W) / 6;
+      y = (3 * CURRENT_AREA_H) / 4;
+      break;
+    }
+  x_min = x_max = x;
+  y_min = y_max = y;
+
+  pos = CURRENT_ARMY + team;
+  placed = 0;
+  while (placed < fighters)
+    {
+      for (x = x_min; x <= x_max && placed < fighters; ++x)
+	placed += add_fighter
+	  (pos + placed * PLAYING_TEAMS, team, x, y_min, health);
+      if (x_max < CURRENT_AREA_W - 2)
+	++x_max;
+
+      for (y = y_min; y <= y_max && placed < fighters; ++y)
+	placed += add_fighter
+	  (pos + placed * PLAYING_TEAMS, team, x_max, y, health);
+      if (y_max < CURRENT_AREA_H - 2)
+	++y_max;
+
+      for (x = x_max; x >= x_min && placed < fighters; --x)
+	placed += add_fighter
+	  (pos + placed * PLAYING_TEAMS, team, x, y_max, health);
+      if (x_min > 1)
+	--x_min;
+
+      for (y = y_max; y >= y_min && placed < fighters; --y)
+	placed += add_fighter
+	  (pos + placed * PLAYING_TEAMS, team, x_min, y, health);
+      if (y_min > 1)
+	--y_min;
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+place_all_team (void)
+{
+  int i, j, n;
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      ACTIVE_FIGHTERS[i] = 0;
+    }
+
+  n = 0;
+  if (LW_NETWORK_ON)
+    {
+      /*
+       * In this case, we *must* place the teams in the same order
+       * or the behavior would not be the same on all the computers.
+       */
+      for (j = 0; j < NB_TEAMS && n < NB_TEAMS; ++j)
+	{
+	  for (i = 0; i < NB_TEAMS && n < NB_TEAMS; ++i)
+	    {
+	      if (LW_NETWORK_INFO[i].active && LW_NETWORK_INFO[i].part == j)
+		{
+		  place_team (LW_NETWORK_INFO[i].part,
+			      LW_NETWORK_INFO[i].server_id);
+		  auto_cursor (i,
+			       LW_NETWORK_INFO[i].server_id,
+			       LW_NETWORK_INFO[i].name);
+		  n++;
+		}
+	    }
+	}
+    }
+  else
+    {
+      for (i = 0; i < NB_TEAMS && n < NB_TEAMS; ++i)
+	{
+	  if (CONFIG_CONTROL_TYPE[i] != CONFIG_CONTROL_TYPE_OFF)
+	    {
+	      place_team (i, n);
+	      auto_cursor (i, n, CONFIG_PLAYER_NAME[i]);
+	      n++;
+	    }
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+test_army (void)
+{
+  int i, k, test, x, y;
+  FIGHTER f;
+  FIGHTER *fp;
+  MESH *m;
+
+  for (i = 0; i < CURRENT_ARMY_SIZE; ++i)
+    {
+      test = f.team = CURRENT_ARMY[i].team;
+      x = f.x = CURRENT_ARMY[i].x;
+      y = f.y = CURRENT_ARMY[i].y;
+      test = f.health = CURRENT_ARMY[i].health;
+      k = y * CURRENT_AREA_W + x;
+      fp = CURRENT_AREA[k].fighter;
+      m = CURRENT_AREA[k].mesh;
+      if (m)
+	test = m->info[0].state.grad;
+    }
+}
+
+/*------------------------------------------------------------------*/
+int
+create_army (void)
+{
+  int ret = -1, i;
+  int fill_table[33] = { 1, 2, 3, 4, 5, 6, 8, 9,
+    10, 12, 14, 16, 18, 20, 22, 24,
+    25, 27, 29, 31, 33, 36, 40, 45,
+    50, 55, 60, 65, 70, 75, 80, 90,
+    99
+  };
+
+  CURRENT_ARMY_SIZE = (get_battle_room () *
+		       fill_table[LW_CONFIG_CURRENT_RULES.fighter_number]) /
+    100;
+
+  CURRENT_ARMY_SIZE /= PLAYING_TEAMS;
+  if (CURRENT_ARMY_SIZE < 1)
+    CURRENT_ARMY_SIZE = 1;
+  CURRENT_ARMY_SIZE *= PLAYING_TEAMS;
+  if ((CURRENT_ARMY
+       = malloc_in_big_data_bottom
+       (CURRENT_ARMY_SIZE * sizeof (FIGHTER))) != 0)
+    {
+      for (i = 0; i < CURRENT_ARMY_SIZE; ++i)
+	{
+	  CURRENT_ARMY[i].health = 0;
+	  CURRENT_ARMY[i].team = -1;
+	  CURRENT_ARMY[i].x = 0;
+	  CURRENT_ARMY[i].y = 0;
+	  CURRENT_ARMY[i].last_dir = 0;
+	}
+      ret = 0;
+    }
+  return ret;
+}

Added: unstable/liquidwar/branches/upstream/current/src/army.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/army.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/army.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,81 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : army.h                                           */
+/* contenu       : placement des armees                             */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_ARMY
+#define LIQUID_WAR_INCLUDE_ARMY
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+#define MAX_FIGHTER_HEALTH 16384
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "area.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+extern FIGHTER *CURRENT_ARMY;
+extern int CURRENT_ARMY_SIZE;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void place_all_team (void);
+void test_army (void);
+int create_army (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/asm.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/asm.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/asm.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,143 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : asm.h                                            */
+/* contenu       : assembly language related stuff                  */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+#include "asm.h"
+#include "area.h"
+#include "log.h"
+#include "startup.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_ASM_OFFSET_BITMAP_LINE   64
+
+typedef void *ptr;
+#define LW_ASM_SIZEOF_int            4
+#define LW_ASM_SIZEOF_short          2
+#define LW_ASM_SIZEOF_char           1
+#define LW_ASM_SIZEOF_ptr            4
+
+#define LW_ASM_SIZEOF_MESH_UPDATE    4
+#define LW_ASM_SIZEOF_MESH_STATE     4
+#define LW_ASM_SIZEOF_MESH_INFO      8
+#define LW_ASM_SIZEOF_MESH_SIDE      4
+#define LW_ASM_SIZEOF_MESH         104
+#define LW_ASM_SIZEOF_FIGHTER        8
+#define LW_ASM_SIZEOF_PLACE          8
+
+#define LW_ASM_CHECK_SIZEOF(S) \
+if (sizeof(S)!=LW_ASM_SIZEOF_ ## S) \
+{ \
+result=0; \
+log_print_str("Error: " #S " size is "); \
+log_print_int(sizeof(S)); \
+log_print_str(" and should be "); \
+log_println_int(LW_ASM_SIZEOF_ ## S); \
+}
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+lw_asm_check_struct_align (void)
+{
+  int result = 1;
+
+#ifdef ASM
+  {
+    BITMAP *bmp = NULL;
+    int offset_bitmap_line;
+
+    LW_ASM_CHECK_SIZEOF (int);
+    LW_ASM_CHECK_SIZEOF (short);
+    LW_ASM_CHECK_SIZEOF (char);
+    LW_ASM_CHECK_SIZEOF (ptr);
+
+    LW_ASM_CHECK_SIZEOF (MESH_UPDATE);
+    LW_ASM_CHECK_SIZEOF (MESH_STATE);
+    LW_ASM_CHECK_SIZEOF (MESH_INFO);
+    LW_ASM_CHECK_SIZEOF (MESH_SIDE);
+    LW_ASM_CHECK_SIZEOF (MESH);
+    LW_ASM_CHECK_SIZEOF (FIGHTER);
+    LW_ASM_CHECK_SIZEOF (PLACE);
+
+    offset_bitmap_line = ((char *) &(bmp->line)) - ((char *) bmp);
+    if (offset_bitmap_line != LW_ASM_OFFSET_BITMAP_LINE)
+      {
+	result = 0;
+
+	log_print_str ("Error: offset for BITMAP->line is ");
+	log_print_int (offset_bitmap_line);
+	log_print_str (" and should be ");
+	log_println_int (LW_ASM_OFFSET_BITMAP_LINE);
+
+	STARTUP_ASM = 0;
+      }
+  }
+#endif
+
+  if (!result)
+    {
+      log_println_str ("WARNING!!!");
+      log_println_str
+	("Liquid War might crash unexpectedly... Please read previous error messages.");
+      log_println ();
+    }
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/asm.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/asm.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/asm.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,78 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : asm.h                                            */
+/* contenu       : assembly language related stuff                  */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_ASM
+#define LIQUID_WAR_INCLUDE_ASM
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+/*==================================================================*/
+/* macros                                                           */
+/*==================================================================*/
+
+#ifdef WIN32
+#define LW_ASM_FUNC __cdecl
+#else
+/* seems useless... #define LW_ASM_FUNC __attribute__((cdecl)) */
+#define LW_ASM_FUNC
+#endif
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+extern int lw_asm_check_struct_align (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/autoplay.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/autoplay.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/autoplay.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,302 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : autoplay.c                                       */
+/* contenu       : l'ordino joue tout seul                          */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdlib.h>
+
+#include "army.h"
+#include "autoplay.h"
+#include "cursor.h"
+#include "fighter.h"
+#include "mesh.h"
+#include "move.h"
+#include "time.h"
+#include "config.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_AUTOPLAY_RANDOM_LIMIT 10000
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+static char COMPUTER_PATH_KEYS[NB_TEAMS][COMPUTER_PATH_MAX];
+static int COMPUTER_PATH_SIZE[NB_TEAMS];
+static int COMPUTER_PATH_WAIT[NB_TEAMS];
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static void
+calculate_computer_path (int dst_x, int dst_y, int cursor)
+{
+  int team, src_x, src_y, pos, dir, x, y, dx, dy;
+  MESH *path_mesh, *src_mesh;
+  int sens, start;
+  int table;
+
+  table = GLOBAL_CLOCK % 2;
+
+  team = CURRENT_CURSOR[cursor].team;
+
+  src_x = CURRENT_CURSOR[cursor].x;
+  src_y = CURRENT_CURSOR[cursor].y;
+  src_mesh = CURRENT_AREA[src_y * CURRENT_AREA_W + src_x].mesh;
+
+  x = dst_x;
+  y = dst_y;
+  path_mesh = CURRENT_AREA[y * CURRENT_AREA_W + x].mesh;
+  pos = sens = start = 0;
+  while (pos < COMPUTER_PATH_MAX && path_mesh != 0 && path_mesh != src_mesh)
+    {
+      dir = get_main_dir (path_mesh, team, sens, start);
+
+      x += (dx = FIGHTER_MOVE_X[table][dir][0]);
+      y += (dy = FIGHTER_MOVE_Y[table][dir][0]);
+
+      path_mesh = CURRENT_AREA[y * CURRENT_AREA_W + x].mesh;
+      if (path_mesh)
+	{
+	  COMPUTER_PATH_KEYS[cursor][pos] = 0;
+	  if (dy > 0)
+	    COMPUTER_PATH_KEYS[cursor][pos] += CURSOR_KEY_UP;
+	  if (dx < 0)
+	    COMPUTER_PATH_KEYS[cursor][pos] += CURSOR_KEY_RIGHT;
+	  if (dy < 0)
+	    COMPUTER_PATH_KEYS[cursor][pos] += CURSOR_KEY_DOWN;
+	  if (dx > 0)
+	    COMPUTER_PATH_KEYS[cursor][pos] += CURSOR_KEY_LEFT;
+	  pos++;
+	}
+      start++;
+      if (start == NB_DIRS)
+	{
+	  start = 0;
+	  sens = !sens;
+	}
+    }
+
+  if (path_mesh == src_mesh)
+    {
+      while (pos < COMPUTER_PATH_MAX && (x != src_x || y != src_y))
+	{
+	  COMPUTER_PATH_KEYS[cursor][pos] = 0;
+
+	  if (y < src_y)
+	    {
+	      y++;
+	      COMPUTER_PATH_KEYS[cursor][pos] += CURSOR_KEY_UP;
+	    }
+	  if (x > src_x)
+	    {
+	      x--;
+	      COMPUTER_PATH_KEYS[cursor][pos] += CURSOR_KEY_RIGHT;
+	    }
+	  if (y > src_y)
+	    {
+	      y--;
+	      COMPUTER_PATH_KEYS[cursor][pos] += CURSOR_KEY_DOWN;
+	    }
+	  if (x < src_x)
+	    {
+	      x++;
+	      COMPUTER_PATH_KEYS[cursor][pos] += CURSOR_KEY_LEFT;
+	    }
+	  pos++;
+	}
+      COMPUTER_PATH_SIZE[cursor] = pos;
+    }
+  else
+    COMPUTER_PATH_SIZE[cursor] = 0;
+
+  COMPUTER_PATH_WAIT[cursor] = COMPUTER_PATH_SIZE[cursor];
+}
+
+/*------------------------------------------------------------------*/
+void
+reset_computer_path (void)
+{
+  int i;
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      COMPUTER_PATH_SIZE[i] = 0;
+      COMPUTER_PATH_WAIT[i] = 0;
+    }
+}
+
+/*------------------------------------------------------------------*/
+static int
+random_free_xy_by_control_type (int *x, int *y, int team, int control_type)
+{
+  int i, found = 0, foundable = 0;
+  int control_type_array[NB_TEAMS];
+  int random_limit;
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      control_type_array[i] = CONFIG_CONTROL_TYPE_OFF;
+    }
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      if ((CURRENT_CURSOR[i].control_type == control_type
+	   || control_type == CONFIG_CONTROL_TYPE_OFF)
+	  && CURRENT_CURSOR[i].active)
+	{
+	  control_type_array[CURRENT_CURSOR[i].team] = control_type;
+	}
+    }
+
+  for (i = 0; i < CURRENT_ARMY_SIZE && !foundable; ++i)
+    {
+      foundable |= ((CURRENT_ARMY[i].team != team) &&
+		    (control_type_array[(int) (CURRENT_ARMY[i].team)] ==
+		     control_type
+		     || control_type == CONFIG_CONTROL_TYPE_OFF));
+    }
+
+  if (foundable)
+    {
+      random_limit = 0;
+
+      while ((!found) && random_limit < LW_AUTOPLAY_RANDOM_LIMIT)
+	{
+	  i = random () % CURRENT_ARMY_SIZE;
+	  found = ((CURRENT_ARMY[i].team != team) &&
+		   (control_type_array[(int) (CURRENT_ARMY[i].team)] ==
+		    control_type || control_type == CONFIG_CONTROL_TYPE_OFF));
+	  random_limit++;
+	}
+    }
+
+  if (!found)
+    {
+      /*
+       * OK, we found nothing, we a default random value
+       */
+      i = random () % CURRENT_ARMY_SIZE;
+    }
+
+  (*x) = CURRENT_ARMY[i].x;
+  (*y) = CURRENT_ARMY[i].y;
+
+  return found;
+}
+
+/*------------------------------------------------------------------*/
+static void
+random_free_xy_different_team (int *x, int *y, int team)
+{
+  int control_type = 0;
+
+  switch (LW_CONFIG_CURRENT_RULES.cpu_vs_human)
+    {
+    case CONFIG_CPU_VS_HUMAN_ALWAYS:
+      control_type = CONFIG_CONTROL_TYPE_HUMAN;
+      break;
+    case CONFIG_CPU_VS_HUMAN_NEVER:
+      control_type = CONFIG_CONTROL_TYPE_CPU;
+      break;
+    default:
+      control_type = CONFIG_CONTROL_TYPE_OFF;
+      break;
+    }
+
+  if (!random_free_xy_by_control_type (x, y, team, control_type))
+    {
+      /*
+       * We found nobody in the right category, we fallback
+       * on the the default search.
+       */
+      random_free_xy_by_control_type (x, y, team, CONFIG_CONTROL_TYPE_OFF);
+    }
+}
+
+/*------------------------------------------------------------------*/
+char
+get_computer_next_move (int cursor)
+{
+  FIGHTER *f;
+  char key_info;
+  int x, y;
+  int meme_equipe, team;
+
+  if (COMPUTER_PATH_SIZE[cursor] > 0)
+    {
+      key_info = COMPUTER_PATH_KEYS[cursor][--COMPUTER_PATH_SIZE[cursor]];
+    }
+  else
+    {
+      key_info = 0;
+      team = CURRENT_CURSOR[cursor].team;
+      f = CURRENT_AREA[CURRENT_CURSOR[cursor].y * CURRENT_AREA_W
+		       + CURRENT_CURSOR[cursor].x].fighter;
+      if (f)
+	meme_equipe = (f->team == team);
+      else
+	meme_equipe = 1;
+      if ((--COMPUTER_PATH_WAIT[cursor]) < 0 || meme_equipe)
+	{
+	  random_free_xy_different_team (&x, &y, team);
+	  calculate_computer_path (x, y, cursor);
+	}
+    }
+
+  return key_info;
+}

Added: unstable/liquidwar/branches/upstream/current/src/autoplay.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/autoplay.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/autoplay.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,75 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : autoplay.h                                       */
+/* contenu       : l'ordino joue tout seul                          */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_AUTOPLAY
+#define LIQUID_WAR_INCLUDE_AUTOPLAY
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+#define COMPUTER_PATH_MAX 1024
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void reset_computer_path (void);
+char get_computer_next_move (int cursor);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/back.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/back.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/back.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,86 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : back.c                                           */
+/* contenu       : utilitaire de gestion de fond d'ecran            */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+#include "back.h"
+#include "disk.h"
+#include "palette.h"
+#include "viewport.h"
+#include "dialog.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+void
+display_a_back_image (BITMAP * bmp)
+{
+  scare_mouse ();
+  stretch_blit (bmp, screen, 0, 0, bmp->w, bmp->h,
+		0, PAGE_FLIP_H, SCREEN_W, SCREEN_H);
+  unscare_mouse ();
+}
+
+/*------------------------------------------------------------------*/
+void
+display_back_image (void)
+{
+  display_a_back_image (BACK_IMAGE);
+}

Added: unstable/liquidwar/branches/upstream/current/src/back.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/back.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/back.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,71 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : back.h                                           */
+/* contenu       : utilitaires de gestion de l'arriere plan         */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_BACK
+#define LIQUID_WAR_INCLUDE_BACK
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void display_a_back_image (BITMAP * bmp);
+void display_back_image (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/base.h.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/base.h.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/base.h.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,98 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : base.h                                           */
+/* contenu       : global application-wide constants, macros, etc...*/
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_BASE
+#define LIQUID_WAR_INCLUDE_BASE
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+#define NB_TEAMS 6
+#define NB_DIRS 12
+
+#define DIR_NNE 0
+#define DIR_NE 1
+#define DIR_ENE 2
+#define DIR_ESE 3
+#define DIR_SE 4
+#define DIR_SSE 5
+#define DIR_SSW 6
+#define DIR_SW 7
+#define DIR_WSW 8
+#define DIR_WNW 9
+#define DIR_NW 10
+#define DIR_NNW 11
+
+#define LW_PROGRAM               "liquidwar"
+#define LW_VERSION               "@VERSION@"
+
+#define NAME_SIZE 10
+#define PASSWORD_SIZE 20
+#define COMMENT_SIZE 100
+#define URL_SIZE 300    
+
+/*
+ * On windows there are problems linking with random() so we use
+ * rand() instead, which does pretty much the same thing. Still
+ * we keep on using random() on UNIX for it's supposed to provid
+ * "more random" values than rand(). This is particularly noticeable
+ * on FreeBSD.
+ */
+#ifdef WIN32
+#define random rand
+#define srandom srand
+#endif
+
+#endif
+

Added: unstable/liquidwar/branches/upstream/current/src/basicopt.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/basicopt.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/basicopt.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,156 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : basicopt.c                                       */
+/* content       : handles basic options                            */
+/* last update   : April 18th 2001                                  */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdio.h>
+#include <string.h>
+
+#include "base.h"
+#include "basicopt.h"
+#include "log.h"
+#include "parser.h"
+#include "sockgen.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+lw_basicopt_process (char *name)
+{
+  int result = 1;
+
+  /*
+   * "-v" prints the version number
+   */
+  if (exist_argument ("v") || exist_argument ("-version"))
+    {
+      result = 0;
+      log_println_str (LW_VERSION);
+    }
+
+  /*
+   * "-v" or "-h" gives a short description & copyright information
+   */
+  if (exist_argument ("h") ||
+      exist_argument ("-help") || exist_argument ("?"))
+    {
+      result = 0;
+      lw_basicopt_legal_info (name);
+      log_println ();
+      log_println_str
+	("Documentation is available in HTML, ascii text, PostScript, PDF... Read it 8-)");
+    }
+
+  /*
+   * "-netlog" forces the socket messages to be traced
+   */
+  if (exist_argument ("netlog"))
+    {
+      LW_SOCK_LOG = 1;
+    }
+
+  /*
+   * "-nobeep" disables the console beeps
+   */
+  if (exist_argument ("nobeep"))
+    {
+      LW_LOG_BEEP = 0;
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_basicopt_legal_info (char *name)
+{
+  log_println ();
+  log_println_str (name);
+  log_println ();
+  log_println_str ("v" LW_VERSION " compiled on " __DATE__ " at " __TIME__);
+  log_println_str ("Copyright (C) 1998-2005 Christian Mauduit");
+  log_println ();
+  log_println_str
+    ("This program is free software; you can redistribute it and/or modify");
+  log_println_str
+    ("it under the terms of the GNU General Public License as published by");
+  log_println_str
+    ("the Free Software Foundation; either version 2 of the License, or");
+  log_println_str ("(at your option) any later version.");
+  log_println ();
+
+  log_println_str
+    ("This program is distributed in the hope that it will be useful,");
+  log_println_str
+    ("but WITHOUT ANY WARRANTY; without even the implied warranty of");
+  log_println_str
+    ("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the");
+  log_println_str ("GNU General Public License for more details.");
+
+  log_println ();
+  log_println_str
+    ("You should have received a copy of the GNU General Public License");
+  log_println_str
+    ("along with this program; if not, write to the Free Software");
+  log_println_str
+    ("Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA");
+  log_println ();
+  log_println_str ("Liquid War homepage : http://www.ufoot.org/liquidwar");
+  log_println_str ("Contact author      : ufoot at ufoot.org");
+}

Added: unstable/liquidwar/branches/upstream/current/src/basicopt.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/basicopt.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/basicopt.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,69 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : basicopt.h                                       */
+/* content       : handles basic options                            */
+/* last update   : April 18th 2001                                  */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_BASICOPT
+#define LIQUID_WAR_INCLUDE_BASICOPT
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+int lw_basicopt_process (char *name);
+void lw_basicopt_legal_info (char *name);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/bigdata.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/bigdata.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/bigdata.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,231 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : bigdata.c                                        */
+/* contenu       : gestion de la "grosse" zone de memoire           */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdlib.h>
+#include <allegro.h>
+#include <string.h>
+
+#include "alleg2.h"
+#include "bigdata.h"
+#include "exit.h"
+#include "log.h"
+#include "startup.h"
+#include "init.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#define BIG_DATA_NUMBER 64
+#define MEMORY_TO_LEAVE 1024
+
+static void *BIG_DATA_PTR = 0;
+static int BIG_DATA_SIZE = 0;
+static int BIG_DATA_BOTTOM = 0;
+static int BIG_DATA_TOP = BIG_DATA_NUMBER - 1;
+static int BIG_DATA_TABLE[BIG_DATA_NUMBER];
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/* mecanisme d'allocation des grandes zones                         */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+void
+reset_big_data (void)
+{
+  BIG_DATA_BOTTOM = 0;
+  BIG_DATA_TOP = BIG_DATA_NUMBER - 1;
+  BIG_DATA_TABLE[BIG_DATA_BOTTOM] = 0;
+  BIG_DATA_TABLE[BIG_DATA_TOP] = BIG_DATA_SIZE;
+
+  if (BIG_DATA_PTR)
+    {
+      memset (BIG_DATA_PTR, 0, BIG_DATA_SIZE);
+    }
+}
+
+/*------------------------------------------------------------------*/
+void *
+malloc_big_data (void)
+{
+  int nb_try = 0;
+
+  log_print_str ("Allocating ");
+  log_print_int (STARTUP_BIG_DATA);
+  log_print_str (" Mb");
+  log_flush ();
+
+  if (BIG_DATA_PTR)
+    {
+      free (BIG_DATA_PTR);
+      BIG_DATA_PTR = NULL;
+    }
+
+  STARTUP_BIG_DATA++;
+
+  while (STARTUP_BIG_DATA >= 2 &&
+	 BIG_DATA_PTR == NULL && (STARTUP_AUTO || nb_try == 0))
+    {
+      nb_try++;
+      STARTUP_BIG_DATA--;
+      BIG_DATA_SIZE = STARTUP_BIG_DATA * 1024 * 1024;
+      BIG_DATA_PTR = malloc (BIG_DATA_SIZE);
+    }
+
+  if (nb_try > 1)
+    {
+      log_print_str ("Last try with ");
+      log_print_int (STARTUP_BIG_DATA);
+      log_print_str (" Mb");
+    }
+
+  if (BIG_DATA_PTR == NULL)
+    BIG_DATA_SIZE = 0;
+
+  display_success (BIG_DATA_SIZE);
+  reset_big_data ();
+
+  return (BIG_DATA_PTR);
+}
+
+/*------------------------------------------------------------------*/
+void *
+malloc_in_big_data_bottom (int size)
+{
+  char *ptr;
+  int bottom, top, new_offset;
+
+  bottom = BIG_DATA_TABLE[BIG_DATA_BOTTOM];
+  top = BIG_DATA_TABLE[BIG_DATA_TOP];
+  new_offset = ((bottom + size + 15) / 16) * 16;
+  if (new_offset < top && BIG_DATA_BOTTOM < (BIG_DATA_TOP - 1))
+    {
+      ptr = BIG_DATA_PTR;
+      ptr += bottom;
+      BIG_DATA_TABLE[++BIG_DATA_BOTTOM] = new_offset;
+
+      /*
+       * This is theorically not needed, but in case there's a
+       * bug in the assembly code for instance, this will increase
+       * the chances that things behave the same on every computer
+       */
+      memset (ptr, 0, size);
+    }
+  else
+    ptr = NULL;
+
+  return ptr;
+}
+
+/*------------------------------------------------------------------*/
+void *
+malloc_in_big_data_top (int size)
+{
+  char *ptr;
+  int bottom, top, new_offset;
+
+  bottom = BIG_DATA_TABLE[BIG_DATA_BOTTOM];
+  top = BIG_DATA_TABLE[BIG_DATA_TOP];
+  new_offset = ((top - size) / 16) * 16;
+  if (new_offset >= bottom && BIG_DATA_BOTTOM < (BIG_DATA_TOP - 1))
+    {
+      ptr = BIG_DATA_PTR;
+      ptr += new_offset;
+      BIG_DATA_TABLE[--BIG_DATA_TOP] = new_offset;
+
+      /*
+       * This is theorically not needed, but in case there's a
+       * bug in the assembly code for instance, this will increase
+       * the chances that things behave the same on every computer
+       */
+      memset (ptr, 0, size);
+    }
+  else
+    ptr = NULL;
+
+  return ptr;
+}
+
+/*------------------------------------------------------------------*/
+void
+free_last_big_data_bottom (void)
+{
+  if (BIG_DATA_BOTTOM > 0)
+    BIG_DATA_BOTTOM--;
+}
+
+/*------------------------------------------------------------------*/
+void
+free_last_big_data_top (void)
+{
+  if (BIG_DATA_TOP < BIG_DATA_NUMBER - 1)
+    BIG_DATA_TOP++;
+}
+
+/*------------------------------------------------------------------*/
+int
+check_free_memory (void)
+{
+  BITMAP *result;
+
+  result = my_create_bitmap (MEMORY_TO_LEAVE / 2, 1024);
+  if (result)
+    destroy_bitmap (result);
+
+  return result != NULL;
+}

Added: unstable/liquidwar/branches/upstream/current/src/bigdata.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/bigdata.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/bigdata.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,76 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : bigdata.h                                        */
+/* contenu       : gestion de la "grosse" zone de memoire           */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_BIG_DATA
+#define LIQUID_WAR_INCLUDE_BIG_DATA
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "bigdata.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void *malloc_big_data (void);
+void reset_big_data (void);
+void *malloc_in_big_data_bottom (int size);
+void *malloc_in_big_data_top (int size);
+void free_last_big_data_bottom (void);
+void free_last_big_data_top (void);
+int check_free_memory (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/capture.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/capture.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/capture.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,211 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : capture.c                                        */
+/* content       : capture the video output and dump it on the disk */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+#include <stdio.h>
+
+#include <allegro.h>
+
+#include "capture.h"
+#include "viewport.h"
+#include "log.h"
+#include "init.h"
+#include "palette.h"
+#include "config.h"
+#include "ticker.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_CAPTURE_FILENAME_FORMAT_STRING "lw%06d.bmp"
+#define LW_CAPTURE_FILENAME_BUFFER_SIZE   100
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+static int LW_CAPTURE_MODE = 0;
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Returns the capture mode
+ */
+int
+lw_capture_get_mode ()
+{
+  return LW_CAPTURE_MODE;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Sets the capture mode
+ */
+void
+lw_capture_set_mode (int mode)
+{
+  LW_CAPTURE_MODE = mode;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Dumps the current video output on the disk, but performs some
+ * checks which make it adapted to a menu context, such as not
+ * calling the function "too often".
+ */
+int
+lw_capture_dump_menu ()
+{
+  int result = 1;
+  static int last_dump_time = 0;
+  int dummy;
+
+  /*
+   * We don't dump stuff if the last dump is too recent.
+   * To determine "how often" we may dump, we use the
+   * same settings than the in-game "frame per sec" limit.
+   */
+  if (get_ticker () >= last_dump_time +
+      DISPLAY_DELAY_MIN[CONFIG_FRAMES_PER_SEC_LIMIT])
+    {
+      last_dump_time = get_ticker ();
+
+      /*
+       * We do nothing if we're not in capture mode
+       */
+      if (LW_CAPTURE_MODE)
+	{
+	  lw_capture_dump_game ();
+	}
+    }
+
+  /*
+   * Now we check manually for F9 for there's no way
+   * to do it easily within the generic menu code.
+   */
+  if (key[KEY_F9])
+    {
+      while (key[KEY_F9])
+	{
+	  /*
+	   * Force a all to poll_keyboard if needed
+	   */
+	  dummy = keypressed ();
+
+	  rest (10);
+	}
+      LW_CAPTURE_MODE = !LW_CAPTURE_MODE;
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Dumps the current video output on the disk
+ */
+int
+lw_capture_dump_game ()
+{
+  int result = 1;
+  char buffer[LW_CAPTURE_FILENAME_BUFFER_SIZE];
+  static int frame_number = 0;
+  BITMAP *screenshot;
+
+  /*
+   * We do nothing if we're not in capture mode
+   */
+  if (LW_CAPTURE_MODE)
+    {
+      /*
+       * Prepare a nice filename
+       */
+      LW_MACRO_SPRINTF1 (buffer, LW_CAPTURE_FILENAME_FORMAT_STRING,
+			 frame_number++);
+
+      /*
+       * Log on the console
+       */
+      log_print_str ("Dumping video output to \"");
+      log_print_str (buffer);
+      log_print_str ("\"");
+
+      /*
+       * Create a sub-bitmap with the right size
+       */
+      screenshot =
+	create_sub_bitmap (screen, 0, PAGE_FLIP_H, SCREEN_W, SCREEN_H);
+
+      if (screenshot)
+	{
+	  /*
+	   * Write to disk
+	   */
+	  result = !save_bitmap (buffer, screenshot, GLOBAL_PALETTE);
+	  destroy_bitmap (screenshot);
+	}
+      else
+	{
+	  result = 0;
+	}
+
+      display_success (result);
+    }
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/capture.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/capture.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/capture.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,71 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : capture.h                                        */
+/* content       : capture the video output and dump it on the disk */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_CAPTURE
+#define LIQUID_WAR_INCLUDE_CAPTURE
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+extern int lw_capture_get_mode ();
+extern void lw_capture_set_mode (int mode);
+extern int lw_capture_dump_menu ();
+extern int lw_capture_dump_game ();
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/chat.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/chat.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/chat.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,149 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : chat.c                                           */
+/* content       : functions to handle chat messages                */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "chat.h"
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Resets the LW_CHAT_HISTORY struct
+ */
+void
+lw_chat_reset (LW_CHAT_HISTORY * history)
+{
+  memset (history, 0, sizeof (LW_CHAT_HISTORY));
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Pushes a message in the message list
+ */
+void
+lw_chat_push (LW_CHAT_HISTORY * history, char *author, char *content)
+{
+  LW_CHAT_MESSAGE temp;
+
+  /* 
+   * We remove old messages if there's not enough room
+   */
+  while (history->n >= LW_CHAT_HISTORY_SIZE)
+    {
+      lw_chat_pop (history, &temp);
+    }
+
+  strncpy (history->messages[history->n].author, author, NAME_SIZE);
+  history->messages[history->n].author[NAME_SIZE] = '\0';
+  strncpy (history->messages[history->n].content, content,
+	   LW_CHAT_MESSAGE_SIZE);
+  history->messages[history->n].content[LW_CHAT_MESSAGE_SIZE] = '\0';
+
+  history->n++;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Gets and removes a message from the message list (FIFO style)
+ */
+int
+lw_chat_pop (LW_CHAT_HISTORY * history, LW_CHAT_MESSAGE * message)
+{
+  int result = 0;
+  int i;
+
+  memset (message, 0, sizeof (LW_CHAT_MESSAGE));
+
+  if (history->n > 0)
+    {
+      memcpy (message, &(history->messages[0]), sizeof (LW_CHAT_MESSAGE));
+
+      for (i = 1; i < history->n; ++i)
+	{
+	  memcpy (&(history->messages[i - 1]),
+		  &(history->messages[i]), sizeof (LW_CHAT_MESSAGE));
+	}
+
+      history->n--;
+
+      result = 1;
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Gets a message from the message list without removing it
+ */
+int
+lw_chat_get (LW_CHAT_HISTORY * history, LW_CHAT_MESSAGE * message, int i)
+{
+  int result = 0;
+
+  memset (message, 0, sizeof (LW_CHAT_MESSAGE));
+
+  if (i >= 0 && i < history->n)
+    {
+      memcpy (message, &(history->messages[i]), sizeof (LW_CHAT_MESSAGE));
+
+      result = 1;
+    }
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/chat.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/chat.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/chat.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,94 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : chat.h                                           */
+/* content       : functions to handle chat messages                */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_CHAT
+#define LIQUID_WAR_INCLUDE_CHAT
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "base.h"
+
+/*==================================================================*/
+/* defines                                                          */
+/*==================================================================*/
+
+#define LW_CHAT_MESSAGE_SIZE 80
+#define LW_CHAT_HISTORY_SIZE 20
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+
+typedef struct
+{
+  char author[NAME_SIZE + 1];
+  char content[LW_CHAT_MESSAGE_SIZE + 1];
+}
+LW_CHAT_MESSAGE;
+
+typedef struct
+{
+  int n;
+  LW_CHAT_MESSAGE messages[LW_CHAT_HISTORY_SIZE];
+}
+LW_CHAT_HISTORY;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void lw_chat_reset (LW_CHAT_HISTORY * history);
+void lw_chat_push (LW_CHAT_HISTORY * history, char *author, char *content);
+int lw_chat_pop (LW_CHAT_HISTORY * history, LW_CHAT_MESSAGE * message);
+int lw_chat_get (LW_CHAT_HISTORY * history, LW_CHAT_MESSAGE * message, int i);
+
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/checksum.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/checksum.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/checksum.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,119 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : checksum.c                                       */
+/* content       : utilities to calculate a checksum from a map     */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "mesh.h"
+#include "area.h"
+#include "time.h"
+#include "log.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+/*
+ * We calculate the checksum once every 100 moves, should be
+ * largely enough though, since it's only for "bug-finding"
+ */
+#define LW_CHECKSUM_PERIOD 100
+
+#define LW_CHECKSUM_CONST_RVAL 55665
+#define LW_CHECKSUM_CONST_CST1 52845
+#define LW_CHECKSUM_CONST_CST2 22719
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/* initializes the string tables                                    */
+/*------------------------------------------------------------------*/
+int
+lw_checksum_calc (FIGHTER * army, int army_size)
+{
+  unsigned int checksum = 0;
+  int i;
+  unsigned short rval = LW_CHECKSUM_CONST_RVAL;
+  unsigned short cst1 = LW_CHECKSUM_CONST_CST1;
+  unsigned short cst2 = LW_CHECKSUM_CONST_CST2;
+  unsigned char cipher;
+  unsigned char value;
+  FIGHTER *f;
+
+  /*
+   * We do not _always_ calculate the checksum, it would be a CPU
+   * waste...
+   */
+  if (!(GLOBAL_CLOCK % LW_CHECKSUM_PERIOD))
+    {
+      for (i = 0; i < army_size; ++i)
+	{
+	  f = army + i;
+
+	  value = (0xFF &
+		   (((unsigned int) f->x) +
+		    ((unsigned int) f->y) +
+		    ((unsigned int) f->health) +
+		    ((unsigned int) f->team) + ((unsigned int) f->last_dir)));
+
+	  /*
+	   * Got this algorithm in old notes I had taken long time
+	   * ago when I was at school.
+	   */
+	  cipher = (value ^ (rval >> 8));
+	  rval = (cipher + rval) * cst1 + cst2;
+	  checksum += cipher;
+	}
+    }
+
+  return checksum;
+}

Added: unstable/liquidwar/branches/upstream/current/src/checksum.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/checksum.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/checksum.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,70 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : checksum.h                                       */
+/* content       : utilities to calculate a checksum from a map     */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_CHECKSUM
+#define LIQUID_WAR_INCLUDE_CHECKSUM
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "army.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+extern int lw_checksum_calc (FIGHTER * army, int army_size);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/code.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/code.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/code.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,270 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : code.c                                           */
+/* contenu       : codes et touches pendant le jeu                  */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+#include <allegro.h>
+
+#include "config.h"
+#include "decal.h"
+#include "message.h"
+#include "profile.h"
+#include "code.h"
+#include "watchdog.h"
+#include "lang.h"
+#include "capture.h"
+#include "network.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+#define LW_CODE_KEYWORD_SPEED "speed"
+#define LW_CODE_KEYWORD_GRADN "gradn"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+int GRAD_TO_DISP = 0;
+int PAUSE_ON = 0;
+int CHANGED_INFO_BAR = 0;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static void
+display_special_info (void)
+{
+  int global, spread, move, disp, flip;
+
+  if (WATCHDOG_SCANCODE[KEY_F5])
+    {
+      global = get_profile (GLOBAL_PROFILE);
+      if (global <=0)
+	global = 1;
+      message_str_int (lw_lang_string (LW_LANG_STRING_CODE_FPS),
+		       1000 / global);
+    }
+
+  if (WATCHDOG_SCANCODE[KEY_F6])
+    {
+      global = get_logic_rate ();
+      if (global <=0)
+	global = 1;
+      message_str_int (lw_lang_string (LW_LANG_STRING_CODE_RPS),
+		       1000 / global);
+    }
+
+  if (WATCHDOG_SCANCODE[KEY_F7])
+    {
+      global = get_profile (GLOBAL_PROFILE);
+      spread = get_profile (SPREAD_PROFILE);
+      move = get_profile (MOVE_PROFILE);
+      if (global <=0)
+	global = 1;
+      message_str_int (lw_lang_string (LW_LANG_STRING_CODE_PERCENTCALC),
+		       (100 * (spread + move)) / global);
+    }
+
+  if (WATCHDOG_SCANCODE[KEY_F8])
+    {
+      global = get_profile (GLOBAL_PROFILE);
+      disp = get_profile (DISP_PROFILE);
+      flip = get_profile (FLIP_PROFILE);
+      if (global <=0)
+	global = 1;
+      message_str_int (lw_lang_string (LW_LANG_STRING_CODE_PERCENTDISPLAY),
+		       (100 * (disp + flip)) / global);
+    }
+
+  if (watchdog_is_keyword (LW_CODE_KEYWORD_SPEED))
+    {
+      global = get_profile (GLOBAL_PROFILE);
+      spread = get_profile (SPREAD_PROFILE);
+      move = get_profile (MOVE_PROFILE);
+      disp = get_profile (DISP_PROFILE);
+      flip = get_profile (FLIP_PROFILE);
+
+      message_str_int (lw_lang_string (LW_LANG_STRING_CODE_SPREADGRADTIME),
+		       spread);
+      message_str_int (lw_lang_string (LW_LANG_STRING_CODE_MOVEARMYTIME),
+		       move);
+      message_str_int (lw_lang_string (LW_LANG_STRING_CODE_DISPLAYTIME),
+		       disp);
+      message_str_int (lw_lang_string (LW_LANG_STRING_CODE_FLIPTIME), flip);
+      message_str_int (lw_lang_string (LW_LANG_STRING_CODE_OTHERCALCTIME),
+		       global -spread - move - disp - flip);
+      message_str_int (lw_lang_string (LW_LANG_STRING_CODE_GLOBALTIME),
+		       global);
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+check_grad_to_disp (void)
+{
+  char grad_codes[6];
+  int i, old;
+
+  LW_MACRO_STRCPY (grad_codes, LW_CODE_KEYWORD_GRADN);
+  old = GRAD_TO_DISP;
+  for (i = 0; i <= 8; ++i)
+    {
+      grad_codes[4] = '0' + i;
+      if (watchdog_is_keyword (grad_codes))
+	GRAD_TO_DISP = i;
+    }
+  if (GRAD_TO_DISP > 0 && GRAD_TO_DISP <= 6 && GRAD_TO_DISP > PLAYING_TEAMS)
+    GRAD_TO_DISP = 0;
+
+  if (old != GRAD_TO_DISP)
+    switch (GRAD_TO_DISP)
+      {
+      case 0:
+	message_str (lw_lang_string (LW_LANG_STRING_CODE_STANDARDDISPLAY));
+	break;
+      case 1:
+	message_str (lw_lang_string (LW_LANG_STRING_CODE_GRADIENT1));
+	break;
+      case 2:
+	message_str (lw_lang_string (LW_LANG_STRING_CODE_GRADIENT2));
+	break;
+      case 3:
+	message_str (lw_lang_string (LW_LANG_STRING_CODE_GRADIENT3));
+	break;
+      case 4:
+	message_str (lw_lang_string (LW_LANG_STRING_CODE_GRADIENT4));
+	break;
+      case 5:
+	message_str (lw_lang_string (LW_LANG_STRING_CODE_GRADIENT5));
+	break;
+      case 6:
+	message_str (lw_lang_string (LW_LANG_STRING_CODE_GRADIENT6));
+	break;
+      case 7:
+	message_str (lw_lang_string (LW_LANG_STRING_CODE_MESHSIZE));
+	break;
+      case 8:
+	message_str (lw_lang_string (LW_LANG_STRING_CODE_MESHSTRUCTURE));
+	break;
+      }
+}
+
+/*------------------------------------------------------------------*/
+static void
+check_boolean_codes (void)
+{
+  /*
+   * If we press F3 and we're not in network mode -> toggle pause mode
+   */
+  if (WATCHDOG_SCANCODE[KEY_F3] && !LW_NETWORK_ON)
+    {
+      if (PAUSE_ON)
+	{
+	  PAUSE_ON = 0;
+	  message_str (lw_lang_string (LW_LANG_STRING_CODE_PAUSEOFF));
+	}
+      else
+	{
+	  PAUSE_ON = 1;
+	  message_str (lw_lang_string (LW_LANG_STRING_CODE_PAUSEON));
+	}
+    }
+  if (WATCHDOG_SCANCODE[KEY_F4])
+    {
+      if (CONFIG_WAVE_ON)
+	{
+	  CONFIG_WAVE_ON = 0;
+	  message_str (lw_lang_string (LW_LANG_STRING_CODE_WAVEEFFECTSOFF));
+	}
+      else
+	{
+	  CONFIG_WAVE_ON = 1;
+	  message_str (lw_lang_string (LW_LANG_STRING_CODE_WAVEEFFECTSON));
+	}
+    }
+  if (WATCHDOG_SCANCODE[KEY_F9])
+    {
+      if (lw_capture_get_mode ())
+	{
+	  lw_capture_set_mode (0);
+	  message_str (lw_lang_string (LW_LANG_STRING_CODE_CAPTUREOFF));
+	}
+      else
+	{
+	  lw_capture_set_mode (1);
+	  message_str (lw_lang_string (LW_LANG_STRING_CODE_CAPTUREON));
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+reset_code (void)
+{
+  GRAD_TO_DISP = 0;
+  PAUSE_ON = 0;
+}
+
+/*------------------------------------------------------------------*/
+void
+check_code (void)
+{
+  display_special_info ();
+  check_grad_to_disp ();
+  check_boolean_codes ();
+}

Added: unstable/liquidwar/branches/upstream/current/src/code.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/code.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/code.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,68 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : code.h                                           */
+/* contenu       : codes et touches pendant le jeu                  */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_CODE
+#define LIQUID_WAR_INCLUDE_CODE
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+extern int GRAD_TO_DISP;
+extern int PAUSE_ON;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void reset_code (void);
+void check_code (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/config.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/config.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/config.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,644 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : config.c                                         */
+/* contenu       : tout ce qui se rattache a la config              */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+#include <string.h>
+
+#include "config.h"
+#include "disk.h"
+#include "joystick.h"
+#include "keyboard.h"
+#include "mouse.h"
+#include "palette.h"
+#include "startup.h"
+#include "server.h"
+#include "lang.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#define DUMMY_VALUE 5003000
+
+#define LABEL_MAIN "MAIN"
+#define LABEL_DUMMY "DUMMY"
+#define LABEL_GFX_GAME "GFX_GAME"
+#define LABEL_GFX_MENU "GFX_MENU"
+#define LABEL_FULLSCREEN "FULLSCREEN"
+#define LABEL_VIEWPORT_SIZE "VIEWPORT_SIZE"
+#define LABEL_WAVE_NUMBER "WAVE_NUMBER"
+#define LABEL_WAVE_AMPLI "WAVE_AMPLI"
+#define LABEL_WAVE_SPEED "WAVE_SPEED"
+#define LABEL_BRIGHTNESS "BRIGHTNESS"
+#define LABEL_CURSOR_INCREASE_SPEED "CURSOR_INCREASE_SPEED"
+#define LABEL_FIGHTER_ATTACK "FIGHTER_ATTACK"
+#define LABEL_FIGHTER_DEFENSE "FIGHTER_DEFENSE"
+#define LABEL_FIGHTER_NEW_HEALTH "FIGHTER_NEW_HEALTH"
+#define LABEL_NUMBER_INFLUENCE "NUMBER_INFLUENCE"
+#define LABEL_SFX_VOLUME "SFX_VOLUME"
+#define LABEL_CLICK_VOLUME "CLICK_VOLUME"
+#define LABEL_WATER_VOLUME_MENU "WATER_VOLUME_MENU"
+#define LABEL_WATER_VOLUME_GAME "WATER_VOLUME_GAME"
+#define LABEL_MUSIC_VOLUME "MUSIC_VOLUME"
+#define LABEL_LEVEL_MAP "LEVEL_MAP"
+#define LABEL_LEVEL_FG "LEVEL_FG"
+#define LABEL_LEVEL_BG "LEVEL_BG"
+#define LABEL_FIGHTER_NUMBER "FIGHTER_NUMBER"
+#define LABEL_KEY_UP "KEY_UP"
+#define LABEL_KEY_LEFT "KEY_LEFT"
+#define LABEL_KEY_DOWN "KEY_DOWN"
+#define LABEL_KEY_RIGHT "KEY_RIGHT"
+#define LABEL_TEAM_COLOR "TEAM_COLOR"
+#define LABEL_CONTROL_TYPE "CONTROL_TYPE"
+#define LABEL_PLAYER_NAME "PLAYER_NAME"
+#define LABEL_GAME_TIME "GAME_TIME"
+#define LABEL_INFO_BAR "INFO_BAR"
+#define LABEL_MOUSE_GAP "MOUSE_GAP"
+#define LABEL_JOYSTICK_ON "JOYSTICK_ON"
+#define LABEL_CPU_ADVANTAGE "CPU_ADVANTAGE"
+#define LABEL_CPU_VS_HUMAN "CPU_VS_HUMAN"
+#define LABEL_PAGE_FLIP "PAGE_FLIP"
+#define LABEL_LANGUAGE "LANGUAGE"
+#define LABEL_WAVE_ON "WAVE_ON"
+#define LABEL_FRAMES_PER_SEC_LIMIT "FRAMES_PER_SEC_LIMIT"
+#define LABEL_ROUNDS_PER_SEC_LIMIT "ROUNDS_PER_SEC_LIMIT"
+#define LABEL_SERVER_ADDRESS "SERVER_ADDRESS"
+#define LABEL_SERVER_PORT "SERVER_PORT"
+#define LABEL_ASM_ALGORITHM "ASM_ALGORITHM"
+#define LABEL_PASSWORD "PASSWORD"
+#define LABEL_MIN_MAP_RES "MIN_MAP_RES"
+#define LABEL_USE_DEFAULT_TEXTURE "USE_DEFAULT_TEXTURE"
+#define LABEL_ALLOW_NETWORK_BOTS "ALLOW_NETWORK_BOTS"
+
+int CONFIG_GFX_GAME;
+int CONFIG_GFX_MENU;
+int CONFIG_FULLSCREEN;
+int CONFIG_VIEWPORT_SIZE;
+int CONFIG_WAVE_NUMBER[4];
+int CONFIG_WAVE_AMPLI[4];
+int CONFIG_WAVE_SPEED[4];
+int CONFIG_BRIGHTNESS;
+int CONFIG_CURSOR_INCREASE_SPEED;
+int CONFIG_FIGHTER_ATTACK;
+int CONFIG_FIGHTER_DEFENSE;
+int CONFIG_FIGHTER_NEW_HEALTH;
+int CONFIG_NUMBER_INFLUENCE;
+int CONFIG_SFX_VOLUME;
+int CONFIG_CLICK_VOLUME;
+int CONFIG_WATER_VOLUME_MENU;
+int CONFIG_WATER_VOLUME_GAME;
+int CONFIG_MUSIC_VOLUME;
+int CONFIG_LEVEL_MAP;
+int CONFIG_LEVEL_FG;
+int CONFIG_LEVEL_BG;
+int CONFIG_FIGHTER_NUMBER;
+int CONFIG_KEY_UP[NB_TEAMS];
+int CONFIG_KEY_LEFT[NB_TEAMS];
+int CONFIG_KEY_DOWN[NB_TEAMS];
+int CONFIG_KEY_RIGHT[NB_TEAMS];
+int CONFIG_TEAM_COLOR[NB_TEAMS];
+int CONFIG_CONTROL_TYPE[NB_TEAMS];
+char CONFIG_PLAYER_NAME[NB_TEAMS][NAME_SIZE + 1];
+int CONFIG_GAME_TIME;
+int CONFIG_INFO_BAR;
+int CONFIG_MOUSE_GAP;
+int CONFIG_JOYSTICK_ON;
+int CONFIG_CPU_ADVANTAGE;
+int CONFIG_CPU_VS_HUMAN;
+int CONFIG_PAGE_FLIP;
+int CONFIG_LANGUAGE;
+int CONFIG_WAVE_ON;
+int CONFIG_FRAMES_PER_SEC_LIMIT;
+int CONFIG_ROUNDS_PER_SEC_LIMIT;
+char CONFIG_SERVER_ADDRESS[SERVER_ADDRESS_SIZE + 1];
+int CONFIG_SERVER_PORT;
+int CONFIG_ASM_ALGORITHM;
+char CONFIG_PASSWORD[PASSWORD_SIZE + 1];
+int CONFIG_MIN_MAP_RES;
+int CONFIG_USE_DEFAULT_TEXTURE;
+int CONFIG_ALLOW_NETWORK_BOTS;
+
+LW_NETCONF LW_CONFIG_CURRENT_RULES;
+
+/*==================================================================*/
+/* constantes globales                                              */
+/*==================================================================*/
+
+int DISPLAY_DELAY_MIN[9] = { 0, 10, 15, 20, 25,
+  33, 40, 55, 100
+};
+int LOGIC_DELAY_MIN[9] = { 0, 1, 2, 5, 10,
+  15, 20, 33, 50
+};
+int MIN_MAP_RES_W[9] = { 0, 80, 120, 160, 200, 240, 320, 480, 640 };
+int MIN_MAP_RES_H[9] = { 0, 60, 90, 120, 150, 180, 240, 360, 480 };
+
+/*------------------------------------------------------------------*/
+/* fonctions de gestion des parametres de configuration             */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+void
+load_default_options (void)
+{
+#ifdef DOS
+  CONFIG_GFX_GAME = 0;
+  CONFIG_GFX_MENU = 2;
+#else
+  CONFIG_GFX_GAME = 2;
+  CONFIG_GFX_MENU = 2;
+#endif
+#ifdef UNIX
+  /*
+   * Under UNIX/X11, we default to windowed mode since
+   * fullscreen modes under Xfree86 can be unconfigured and/or
+   * buggy depending on window manager and other stuff
+   */
+  CONFIG_FULLSCREEN = 0;
+#else
+  CONFIG_FULLSCREEN = 1;
+#endif
+  CONFIG_VIEWPORT_SIZE = 6;
+
+  CONFIG_WAVE_NUMBER[0] = 2;
+  CONFIG_WAVE_NUMBER[1] = 2;
+  CONFIG_WAVE_NUMBER[2] = 2;
+  CONFIG_WAVE_NUMBER[3] = 2;
+
+  CONFIG_WAVE_AMPLI[0] = 8;
+  CONFIG_WAVE_AMPLI[1] = 8;
+  CONFIG_WAVE_AMPLI[2] = 8;
+  CONFIG_WAVE_AMPLI[3] = 8;
+
+  CONFIG_WAVE_SPEED[0] = 6;
+  CONFIG_WAVE_SPEED[1] = 7;
+  CONFIG_WAVE_SPEED[2] = 8;
+  CONFIG_WAVE_SPEED[3] = 9;
+
+  CONFIG_BRIGHTNESS = 8;
+  CONFIG_SFX_VOLUME = 12;
+  CONFIG_CLICK_VOLUME = 8;
+  CONFIG_WATER_VOLUME_MENU = 6;
+  CONFIG_WATER_VOLUME_GAME = 10;
+  CONFIG_MUSIC_VOLUME = 12;
+  CONFIG_LEVEL_MAP = 0;
+  CONFIG_LEVEL_FG = 135;
+  CONFIG_LEVEL_BG = 131;
+
+  CONFIG_KEY_UP[0] = KEY_UP;
+  CONFIG_KEY_DOWN[0] = KEY_DOWN;
+  CONFIG_KEY_LEFT[0] = KEY_LEFT;
+  CONFIG_KEY_RIGHT[0] = KEY_RIGHT;
+  CONFIG_TEAM_COLOR[0] = 0;
+  CONFIG_CONTROL_TYPE[0] = CONFIG_CONTROL_TYPE_HUMAN;
+  LW_MACRO_STRCPY (CONFIG_PLAYER_NAME[0], "Napoleon");
+
+  CONFIG_KEY_UP[1] = KEY_I;
+  CONFIG_KEY_DOWN[1] = KEY_K;
+  CONFIG_KEY_LEFT[1] = KEY_J;
+  CONFIG_KEY_RIGHT[1] = KEY_L;
+  CONFIG_TEAM_COLOR[1] = 4;
+  CONFIG_CONTROL_TYPE[1] = CONFIG_CONTROL_TYPE_OFF;
+  LW_MACRO_STRCPY (CONFIG_PLAYER_NAME[1], "Clovis");
+
+  CONFIG_KEY_UP[2] = KEY_UP;
+  CONFIG_KEY_DOWN[2] = KEY_DOWN;
+  CONFIG_KEY_LEFT[2] = KEY_LEFT;
+  CONFIG_KEY_RIGHT[2] = KEY_RIGHT;
+  CONFIG_TEAM_COLOR[2] = 8;
+  CONFIG_CONTROL_TYPE[2] = CONFIG_CONTROL_TYPE_OFF;
+  LW_MACRO_STRCPY (CONFIG_PLAYER_NAME[2], "Henri IV");
+
+  CONFIG_KEY_UP[3] = KEY_Q;
+  CONFIG_KEY_DOWN[3] = KEY_A;
+  CONFIG_KEY_LEFT[3] = KEY_Z;
+  CONFIG_KEY_RIGHT[3] = KEY_X;
+  CONFIG_TEAM_COLOR[3] = 6;
+  CONFIG_CONTROL_TYPE[3] = CONFIG_CONTROL_TYPE_OFF;
+  LW_MACRO_STRCPY (CONFIG_PLAYER_NAME[3], "Cesar");
+
+  CONFIG_KEY_UP[4] = KEY_8_PAD;
+  CONFIG_KEY_DOWN[4] = KEY_5_PAD;
+  CONFIG_KEY_LEFT[4] = KEY_4_PAD;
+  CONFIG_KEY_RIGHT[4] = KEY_6_PAD;
+  CONFIG_TEAM_COLOR[4] = 10;
+  CONFIG_CONTROL_TYPE[4] = CONFIG_CONTROL_TYPE_OFF;
+  LW_MACRO_STRCPY (CONFIG_PLAYER_NAME[4], "Geronimo");
+
+  CONFIG_KEY_UP[5] = KEY_MOUSE_UP;
+  CONFIG_KEY_DOWN[5] = KEY_MOUSE_DOWN;
+  CONFIG_KEY_LEFT[5] = KEY_MOUSE_LEFT;
+  CONFIG_KEY_RIGHT[5] = KEY_MOUSE_RIGHT;
+  CONFIG_TEAM_COLOR[5] = 3;
+  CONFIG_CONTROL_TYPE[5] = CONFIG_CONTROL_TYPE_CPU;
+  LW_MACRO_STRCPY (CONFIG_PLAYER_NAME[5], "Attila");
+
+  CONFIG_INFO_BAR = 1;
+  CONFIG_MOUSE_GAP = 4;
+  CONFIG_JOYSTICK_ON = 1;
+  CONFIG_PAGE_FLIP = 0;
+  CONFIG_LANGUAGE = LW_LANG_LANGUAGE_AUTO;
+#ifdef ASM
+  /*
+   * We activate waves only if assembly code is available,
+   * else it's not a good idea for it's too slow.
+   */
+  CONFIG_WAVE_ON = STARTUP_ASM ? 1 : 0;
+#else
+  CONFIG_WAVE_ON = 0;
+#endif
+
+  CONFIG_FRAMES_PER_SEC_LIMIT = 6;
+  CONFIG_ROUNDS_PER_SEC_LIMIT = 4;
+
+  LW_MACRO_STRCPY (CONFIG_SERVER_ADDRESS, LW_SERVER_DEFAULT_ADDRESS);
+  CONFIG_SERVER_PORT = LW_SERVER_DEFAULT_PORT;
+
+  LW_MACRO_STRCPY (CONFIG_PASSWORD, "toto");
+
+  CONFIG_USE_DEFAULT_TEXTURE = 1;
+
+  load_default_rules ();
+}
+
+/*------------------------------------------------------------------*/
+void
+load_default_rules (void)
+{
+  CONFIG_CURSOR_INCREASE_SPEED = 0;
+  CONFIG_FIGHTER_ATTACK = 8;
+  CONFIG_FIGHTER_DEFENSE = 8;
+  CONFIG_FIGHTER_NEW_HEALTH = 8;
+  CONFIG_NUMBER_INFLUENCE = 8;
+  CONFIG_FIGHTER_NUMBER = 16;
+  CONFIG_GAME_TIME = 8;
+  CONFIG_CPU_ADVANTAGE = 0;
+  CONFIG_CPU_VS_HUMAN = CONFIG_CPU_VS_HUMAN_RANDOM;
+  CONFIG_ASM_ALGORITHM = 1;
+  CONFIG_MIN_MAP_RES = 4;
+  CONFIG_ALLOW_NETWORK_BOTS = 0;
+}
+
+/*------------------------------------------------------------------*/
+static int
+load_disk_options (void)
+{
+  char number_string[2] = { '0', 0 };
+  int i;
+
+  load_default_options ();
+
+  set_config_file (STARTUP_CFG_PATH);
+  if (get_config_int (LABEL_MAIN, LABEL_DUMMY, 0) == DUMMY_VALUE)
+    {
+      CONFIG_GFX_GAME =
+	get_config_int (LABEL_MAIN, LABEL_GFX_GAME, CONFIG_GFX_GAME);
+      CONFIG_GFX_MENU =
+	get_config_int (LABEL_MAIN, LABEL_GFX_MENU, CONFIG_GFX_MENU);
+      CONFIG_FULLSCREEN =
+	get_config_int (LABEL_MAIN, LABEL_FULLSCREEN, CONFIG_FULLSCREEN);
+      CONFIG_VIEWPORT_SIZE =
+	get_config_int (LABEL_MAIN, LABEL_VIEWPORT_SIZE,
+			CONFIG_VIEWPORT_SIZE);
+
+      for (i = 0; i < 4; ++i)
+	{
+	  number_string[0] = '0' + i;
+
+	  CONFIG_WAVE_NUMBER[i] =
+	    get_config_int (LABEL_WAVE_NUMBER, number_string,
+			    CONFIG_WAVE_NUMBER[i]);
+	  CONFIG_WAVE_AMPLI[i] =
+	    get_config_int (LABEL_WAVE_AMPLI, number_string,
+			    CONFIG_WAVE_AMPLI[i]);
+	  CONFIG_WAVE_SPEED[i] =
+	    get_config_int (LABEL_WAVE_SPEED, number_string,
+			    CONFIG_WAVE_SPEED[i]);
+	}
+
+      CONFIG_BRIGHTNESS =
+	get_config_int (LABEL_MAIN, LABEL_BRIGHTNESS, CONFIG_BRIGHTNESS);
+      CONFIG_CURSOR_INCREASE_SPEED =
+	get_config_int (LABEL_MAIN, LABEL_CURSOR_INCREASE_SPEED,
+			CONFIG_CURSOR_INCREASE_SPEED);
+      CONFIG_FIGHTER_ATTACK =
+	get_config_int (LABEL_MAIN, LABEL_FIGHTER_ATTACK,
+			CONFIG_FIGHTER_ATTACK);
+      CONFIG_FIGHTER_DEFENSE =
+	get_config_int (LABEL_MAIN, LABEL_FIGHTER_DEFENSE,
+			CONFIG_FIGHTER_DEFENSE);
+      CONFIG_FIGHTER_NEW_HEALTH =
+	get_config_int (LABEL_MAIN, LABEL_FIGHTER_NEW_HEALTH,
+			CONFIG_FIGHTER_NEW_HEALTH);
+      CONFIG_NUMBER_INFLUENCE =
+	get_config_int (LABEL_MAIN, LABEL_NUMBER_INFLUENCE,
+			CONFIG_NUMBER_INFLUENCE);
+      CONFIG_SFX_VOLUME =
+	get_config_int (LABEL_MAIN, LABEL_SFX_VOLUME, CONFIG_SFX_VOLUME);
+      CONFIG_CLICK_VOLUME =
+	get_config_int (LABEL_MAIN, LABEL_CLICK_VOLUME, CONFIG_CLICK_VOLUME);
+      CONFIG_WATER_VOLUME_MENU =
+	get_config_int (LABEL_MAIN, LABEL_WATER_VOLUME_MENU,
+			CONFIG_WATER_VOLUME_MENU);
+      CONFIG_WATER_VOLUME_GAME =
+	get_config_int (LABEL_MAIN, LABEL_WATER_VOLUME_GAME,
+			CONFIG_WATER_VOLUME_GAME);
+      CONFIG_MUSIC_VOLUME =
+	get_config_int (LABEL_MAIN, LABEL_MUSIC_VOLUME, CONFIG_MUSIC_VOLUME);
+
+      CONFIG_LEVEL_MAP =
+	get_config_int (LABEL_MAIN, LABEL_LEVEL_MAP, CONFIG_LEVEL_MAP);
+      CONFIG_LEVEL_FG =
+	get_config_int (LABEL_MAIN, LABEL_LEVEL_FG, CONFIG_LEVEL_FG);
+      CONFIG_LEVEL_BG =
+	get_config_int (LABEL_MAIN, LABEL_LEVEL_BG, CONFIG_LEVEL_BG);
+
+      CONFIG_FIGHTER_NUMBER =
+	get_config_int (LABEL_MAIN, LABEL_FIGHTER_NUMBER,
+			CONFIG_FIGHTER_NUMBER);
+
+      for (i = 0; i < 6; ++i)
+	{
+	  number_string[0] = '0' + i;
+
+	  CONFIG_KEY_UP[i] =
+	    get_config_int (LABEL_KEY_UP, number_string, CONFIG_KEY_UP[i]);
+	  CONFIG_KEY_LEFT[i] =
+	    get_config_int (LABEL_KEY_LEFT, number_string,
+			    CONFIG_KEY_LEFT[i]);
+	  CONFIG_KEY_DOWN[i] =
+	    get_config_int (LABEL_KEY_DOWN, number_string,
+			    CONFIG_KEY_DOWN[i]);
+	  CONFIG_KEY_RIGHT[i] =
+	    get_config_int (LABEL_KEY_RIGHT, number_string,
+			    CONFIG_KEY_RIGHT[i]);
+	  CONFIG_TEAM_COLOR[i] =
+	    get_config_int (LABEL_TEAM_COLOR, number_string,
+			    CONFIG_TEAM_COLOR[i]);
+	  CONFIG_CONTROL_TYPE[i] =
+	    get_config_int (LABEL_CONTROL_TYPE, number_string,
+			    CONFIG_CONTROL_TYPE[i]);
+	  strncpy (CONFIG_PLAYER_NAME[i],
+		   get_config_string (LABEL_PLAYER_NAME, number_string,
+				      CONFIG_PLAYER_NAME[i]), NAME_SIZE);
+	  CONFIG_PLAYER_NAME[i][NAME_SIZE] = '\0';
+	}
+
+      CONFIG_GAME_TIME =
+	get_config_int (LABEL_MAIN, LABEL_GAME_TIME, CONFIG_GAME_TIME);
+      CONFIG_INFO_BAR =
+	get_config_int (LABEL_MAIN, LABEL_INFO_BAR, CONFIG_INFO_BAR);
+      CONFIG_MOUSE_GAP =
+	get_config_int (LABEL_MAIN, LABEL_MOUSE_GAP, CONFIG_MOUSE_GAP);
+      CONFIG_JOYSTICK_ON =
+	get_config_int (LABEL_MAIN, LABEL_JOYSTICK_ON, CONFIG_JOYSTICK_ON);
+      CONFIG_CPU_ADVANTAGE =
+	get_config_int (LABEL_MAIN, LABEL_CPU_ADVANTAGE,
+			CONFIG_CPU_ADVANTAGE);
+      CONFIG_CPU_VS_HUMAN =
+	get_config_int (LABEL_MAIN, LABEL_CPU_VS_HUMAN, CONFIG_CPU_VS_HUMAN);
+      CONFIG_PAGE_FLIP =
+	get_config_int (LABEL_MAIN, LABEL_PAGE_FLIP, CONFIG_PAGE_FLIP);
+      CONFIG_LANGUAGE =
+	get_config_int (LABEL_MAIN, LABEL_LANGUAGE, CONFIG_LANGUAGE);
+      CONFIG_WAVE_ON =
+	get_config_int (LABEL_MAIN, LABEL_WAVE_ON, CONFIG_WAVE_ON);
+      CONFIG_FRAMES_PER_SEC_LIMIT =
+	get_config_int (LABEL_MAIN, LABEL_FRAMES_PER_SEC_LIMIT,
+			CONFIG_FRAMES_PER_SEC_LIMIT);
+      CONFIG_ROUNDS_PER_SEC_LIMIT =
+	get_config_int (LABEL_MAIN, LABEL_ROUNDS_PER_SEC_LIMIT,
+			CONFIG_ROUNDS_PER_SEC_LIMIT);
+
+      strncpy (CONFIG_SERVER_ADDRESS,
+	       get_config_string (LABEL_MAIN, LABEL_SERVER_ADDRESS,
+				  CONFIG_SERVER_ADDRESS),
+	       sizeof (CONFIG_SERVER_ADDRESS));
+      CONFIG_SERVER_ADDRESS[sizeof (CONFIG_SERVER_ADDRESS) - 1] = '\0';
+
+      CONFIG_SERVER_PORT =
+	get_config_int (LABEL_MAIN, LABEL_SERVER_PORT, CONFIG_SERVER_PORT);
+
+      CONFIG_ASM_ALGORITHM =
+	get_config_int (LABEL_MAIN, LABEL_ASM_ALGORITHM,
+			CONFIG_ASM_ALGORITHM);
+
+      strncpy (CONFIG_PASSWORD,
+	       get_config_string (LABEL_MAIN, LABEL_PASSWORD,
+				  CONFIG_PASSWORD), sizeof (CONFIG_PASSWORD));
+      CONFIG_PASSWORD[sizeof (CONFIG_PASSWORD) - 1] = '\0';
+
+      CONFIG_MIN_MAP_RES =
+	get_config_int (LABEL_MAIN, LABEL_MIN_MAP_RES, CONFIG_MIN_MAP_RES);
+      CONFIG_USE_DEFAULT_TEXTURE =
+	get_config_int (LABEL_MAIN, LABEL_USE_DEFAULT_TEXTURE,
+			CONFIG_USE_DEFAULT_TEXTURE);
+      CONFIG_ALLOW_NETWORK_BOTS =
+	get_config_int (LABEL_MAIN, LABEL_ALLOW_NETWORK_BOTS,
+			CONFIG_ALLOW_NETWORK_BOTS);
+
+      return 1;
+    }
+  else
+    {
+      return 0;
+    }
+}
+
+/*------------------------------------------------------------------*/
+int
+load_config_options (void)
+{
+  int result;
+
+  result = load_disk_options ();
+
+  /*
+   * Any special hack can go here 8-)
+   */
+  lw_config_set_current_rules_to_default ();
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+save_config_options (void)
+{
+  char number_string[2] = { '0', 0 };
+  int i;
+
+  set_config_file (STARTUP_CFG_PATH);
+
+  set_config_int (LABEL_MAIN, LABEL_DUMMY, DUMMY_VALUE);
+
+  set_config_int (LABEL_MAIN, LABEL_GFX_GAME, CONFIG_GFX_GAME);
+  set_config_int (LABEL_MAIN, LABEL_GFX_MENU, CONFIG_GFX_MENU);
+  set_config_int (LABEL_MAIN, LABEL_FULLSCREEN, CONFIG_FULLSCREEN);
+  set_config_int (LABEL_MAIN, LABEL_VIEWPORT_SIZE, CONFIG_VIEWPORT_SIZE);
+
+  for (i = 0; i < 4; ++i)
+    {
+      number_string[0] = '0' + i;
+
+      set_config_int (LABEL_WAVE_NUMBER, number_string,
+		      CONFIG_WAVE_NUMBER[i]);
+      set_config_int (LABEL_WAVE_AMPLI, number_string, CONFIG_WAVE_AMPLI[i]);
+      set_config_int (LABEL_WAVE_SPEED, number_string, CONFIG_WAVE_SPEED[i]);
+    }
+
+  set_config_int (LABEL_MAIN, LABEL_BRIGHTNESS, CONFIG_BRIGHTNESS);
+  set_config_int (LABEL_MAIN, LABEL_CURSOR_INCREASE_SPEED,
+		  CONFIG_CURSOR_INCREASE_SPEED);
+  set_config_int (LABEL_MAIN, LABEL_FIGHTER_ATTACK, CONFIG_FIGHTER_ATTACK);
+  set_config_int (LABEL_MAIN, LABEL_FIGHTER_DEFENSE, CONFIG_FIGHTER_DEFENSE);
+  set_config_int (LABEL_MAIN, LABEL_FIGHTER_NEW_HEALTH,
+		  CONFIG_FIGHTER_NEW_HEALTH);
+  set_config_int (LABEL_MAIN, LABEL_NUMBER_INFLUENCE,
+		  CONFIG_NUMBER_INFLUENCE);
+  set_config_int (LABEL_MAIN, LABEL_SFX_VOLUME, CONFIG_SFX_VOLUME);
+  set_config_int (LABEL_MAIN, LABEL_CLICK_VOLUME, CONFIG_CLICK_VOLUME);
+  set_config_int (LABEL_MAIN, LABEL_WATER_VOLUME_MENU,
+		  CONFIG_WATER_VOLUME_MENU);
+  set_config_int (LABEL_MAIN, LABEL_WATER_VOLUME_GAME,
+		  CONFIG_WATER_VOLUME_GAME);
+  set_config_int (LABEL_MAIN, LABEL_MUSIC_VOLUME, CONFIG_MUSIC_VOLUME);
+
+  set_config_int (LABEL_MAIN, LABEL_LEVEL_MAP, CONFIG_LEVEL_MAP);
+  set_config_int (LABEL_MAIN, LABEL_LEVEL_FG, CONFIG_LEVEL_FG);
+  set_config_int (LABEL_MAIN, LABEL_LEVEL_BG, CONFIG_LEVEL_BG);
+
+  set_config_int (LABEL_MAIN, LABEL_FIGHTER_NUMBER, CONFIG_FIGHTER_NUMBER);
+
+  for (i = 0; i < 6; ++i)
+    {
+      number_string[0] = '0' + i;
+
+      set_config_int (LABEL_KEY_UP, number_string, CONFIG_KEY_UP[i]);
+      set_config_int (LABEL_KEY_LEFT, number_string, CONFIG_KEY_LEFT[i]);
+      set_config_int (LABEL_KEY_DOWN, number_string, CONFIG_KEY_DOWN[i]);
+      set_config_int (LABEL_KEY_RIGHT, number_string, CONFIG_KEY_RIGHT[i]);
+      set_config_int (LABEL_TEAM_COLOR, number_string, CONFIG_TEAM_COLOR[i]);
+      set_config_int (LABEL_CONTROL_TYPE, number_string,
+		      CONFIG_CONTROL_TYPE[i]);
+      set_config_string (LABEL_PLAYER_NAME, number_string,
+			 CONFIG_PLAYER_NAME[i]);
+    }
+
+  set_config_int (LABEL_MAIN, LABEL_GAME_TIME, CONFIG_GAME_TIME);
+  set_config_int (LABEL_MAIN, LABEL_INFO_BAR, CONFIG_INFO_BAR);
+  set_config_int (LABEL_MAIN, LABEL_MOUSE_GAP, CONFIG_MOUSE_GAP);
+  set_config_int (LABEL_MAIN, LABEL_JOYSTICK_ON, CONFIG_JOYSTICK_ON);
+  set_config_int (LABEL_MAIN, LABEL_CPU_ADVANTAGE, CONFIG_CPU_ADVANTAGE);
+  set_config_int (LABEL_MAIN, LABEL_CPU_VS_HUMAN, CONFIG_CPU_VS_HUMAN);
+  set_config_int (LABEL_MAIN, LABEL_PAGE_FLIP, CONFIG_PAGE_FLIP);
+  set_config_int (LABEL_MAIN, LABEL_LANGUAGE, CONFIG_LANGUAGE);
+  set_config_int (LABEL_MAIN, LABEL_WAVE_ON, CONFIG_WAVE_ON);
+
+  set_config_int (LABEL_MAIN, LABEL_FRAMES_PER_SEC_LIMIT,
+		  CONFIG_FRAMES_PER_SEC_LIMIT);
+  set_config_int (LABEL_MAIN, LABEL_ROUNDS_PER_SEC_LIMIT,
+		  CONFIG_ROUNDS_PER_SEC_LIMIT);
+
+  set_config_string (LABEL_MAIN, LABEL_SERVER_ADDRESS, CONFIG_SERVER_ADDRESS);
+  set_config_int (LABEL_MAIN, LABEL_SERVER_PORT, CONFIG_SERVER_PORT);
+
+  set_config_int (LABEL_MAIN, LABEL_ASM_ALGORITHM, CONFIG_ASM_ALGORITHM);
+
+  set_config_string (LABEL_MAIN, LABEL_PASSWORD, CONFIG_PASSWORD);
+
+  set_config_int (LABEL_MAIN, LABEL_MIN_MAP_RES, CONFIG_MIN_MAP_RES);
+  set_config_int (LABEL_MAIN, LABEL_USE_DEFAULT_TEXTURE,
+		  CONFIG_USE_DEFAULT_TEXTURE);
+  set_config_int (LABEL_MAIN, LABEL_ALLOW_NETWORK_BOTS,
+		  CONFIG_ALLOW_NETWORK_BOTS);
+
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+void
+check_config_range (void)
+{
+  if (CONFIG_LEVEL_MAP > RAW_MAP_NUMBER - 1)
+    CONFIG_LEVEL_MAP = (RAW_MAP_NUMBER - 1) / 2;
+  if (CONFIG_LEVEL_FG > RAW_TEXTURE_NUMBER + CHOOSE_COLOR_NUMBER - 1)
+    CONFIG_LEVEL_FG = CHOOSE_COLOR_WHITE;
+  if (CONFIG_LEVEL_BG > RAW_TEXTURE_NUMBER + CHOOSE_COLOR_NUMBER - 1)
+    CONFIG_LEVEL_BG = CHOOSE_COLOR_BLACK;
+
+  lw_netconf_check (&LW_CONFIG_CURRENT_RULES);
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_config_set_current_rules_to_default (void)
+{
+  LW_NETCONF *config;
+
+  config = &LW_CONFIG_CURRENT_RULES;
+
+  config->cursor_increase_speed = CONFIG_CURSOR_INCREASE_SPEED;
+  config->fighter_attack = CONFIG_FIGHTER_ATTACK;
+  config->fighter_defense = CONFIG_FIGHTER_DEFENSE;
+  config->fighter_new_health = CONFIG_FIGHTER_NEW_HEALTH;
+  config->number_influence = CONFIG_NUMBER_INFLUENCE;
+  config->fighter_number = CONFIG_FIGHTER_NUMBER;
+  config->game_time = CONFIG_GAME_TIME;
+  config->cpu_advantage = CONFIG_CPU_ADVANTAGE;
+  config->cpu_vs_human = CONFIG_CPU_VS_HUMAN;
+  config->asm_algorithm = CONFIG_ASM_ALGORITHM && STARTUP_ASM;
+  config->min_map_res = CONFIG_MIN_MAP_RES;
+}

Added: unstable/liquidwar/branches/upstream/current/src/config.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/config.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/config.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,149 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : config.h                                         */
+/* contenu       : chargement des donnees de configuration          */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_CONFIG
+#define LIQUID_WAR_INCLUDE_CONFIG
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "base.h"
+#include "netconf.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/* variables du fichier de configuration                            */
+/*------------------------------------------------------------------*/
+
+#define SERVER_ADDRESS_SIZE 50
+
+extern int CONFIG_GFX_GAME;
+extern int CONFIG_GFX_MENU;
+extern int CONFIG_FULLSCREEN;
+extern int CONFIG_VIEWPORT_SIZE;
+extern int CONFIG_WAVE_NUMBER[4];
+extern int CONFIG_WAVE_AMPLI[4];
+extern int CONFIG_WAVE_SPEED[4];
+extern int CONFIG_BRIGHTNESS;
+extern int CONFIG_CURSOR_INCREASE_SPEED;
+extern int CONFIG_FIGHTER_ATTACK;
+extern int CONFIG_FIGHTER_DEFENSE;
+extern int CONFIG_FIGHTER_NEW_HEALTH;
+extern int CONFIG_NUMBER_INFLUENCE;
+extern int CONFIG_SFX_VOLUME;
+extern int CONFIG_CLICK_VOLUME;
+extern int CONFIG_WATER_VOLUME_MENU;
+extern int CONFIG_WATER_VOLUME_GAME;
+extern int CONFIG_MUSIC_VOLUME;
+extern int CONFIG_LEVEL_MAP;
+extern int CONFIG_LEVEL_FG;
+extern int CONFIG_LEVEL_BG;
+extern int CONFIG_FIGHTER_NUMBER;
+extern int CONFIG_KEY_UP[NB_TEAMS];
+extern int CONFIG_KEY_LEFT[NB_TEAMS];
+extern int CONFIG_KEY_DOWN[NB_TEAMS];
+extern int CONFIG_KEY_RIGHT[NB_TEAMS];
+extern int CONFIG_TEAM_COLOR[NB_TEAMS];
+extern int CONFIG_CONTROL_TYPE[NB_TEAMS];
+extern char CONFIG_PLAYER_NAME[NB_TEAMS][NAME_SIZE + 1];
+extern int CONFIG_GAME_TIME;
+extern int CONFIG_INFO_BAR;
+extern int CONFIG_MOUSE_GAP;
+extern int CONFIG_JOYSTICK_ON;
+extern int CONFIG_CPU_ADVANTAGE;
+extern int CONFIG_CPU_VS_HUMAN;;
+extern int CONFIG_PAGE_FLIP;
+extern int CONFIG_LANGUAGE;
+extern int CONFIG_WAVE_ON;
+extern int CONFIG_FRAMES_PER_SEC_LIMIT;
+extern int CONFIG_ROUNDS_PER_SEC_LIMIT;
+extern char CONFIG_SERVER_ADDRESS[SERVER_ADDRESS_SIZE + 1];
+extern int CONFIG_SERVER_PORT;
+extern int CONFIG_ASM_ALGORITHM;
+extern char CONFIG_PASSWORD[PASSWORD_SIZE + 1];
+extern int CONFIG_MIN_MAP_RES;
+extern int CONFIG_USE_DEFAULT_TEXTURE;
+extern int CONFIG_ALLOW_NETWORK_BOTS;
+
+#define CONFIG_CONTROL_TYPE_OFF    0
+#define CONFIG_CONTROL_TYPE_HUMAN  1
+#define CONFIG_CONTROL_TYPE_CPU    2
+
+#define CONFIG_CPU_VS_HUMAN_ALWAYS 0
+#define CONFIG_CPU_VS_HUMAN_RANDOM 1
+#define CONFIG_CPU_VS_HUMAN_NEVER  2
+
+extern LW_NETCONF LW_CONFIG_CURRENT_RULES;
+
+/*==================================================================*/
+/* constantes globales                                              */
+/*==================================================================*/
+
+extern int DISPLAY_DELAY_MIN[9];
+extern int LOGIC_DELAY_MIN[9];
+extern int MIN_MAP_RES_W[9];
+extern int MIN_MAP_RES_H[9];
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void load_default_options (void);
+void load_default_rules (void);
+int load_config_options (void);
+int save_config_options (void);
+void check_config_range (void);
+void lw_config_set_current_rules_to_default (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/connect.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/connect.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/connect.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,579 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : connect.c                                        */
+/* contenu       : connect menu, the list of connected players      */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdio.h>
+#include <string.h>
+
+#include "back.h"
+#include "base.h"
+#include "config.h"
+#include "decal.h"
+#include "dialog.h"
+#include "help.h"
+#include "menu.h"
+#include "play.h"
+#include "disk.h"
+#include "protocol.h"
+#include "sockgen.h"
+#include "server.h"
+#include "network.h"
+#include "error.h"
+#include "internet.h"
+#include "connect.h"
+#include "lang.h"
+#include "mouse.h"
+#include "log.h"
+#include "thrdgen.h"
+#include "chat.h"
+#include "netmess.h"
+#include "sound.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define CONNECT_BUF_SIZE 200
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+
+typedef struct
+{
+  int sock;
+  LW_TEAMSTARTINFO team_start_info[NB_TEAMS];
+  int waited_teams;
+  int start;
+  int force_start;
+  int thread_running;
+  int result;
+  int finished;
+  char chat_buffer[LW_CHAT_MESSAGE_SIZE + 1];
+  LW_CHAT_HISTORY chat_history;
+  int chat_send;
+}
+LW_CONNECT_DATA;
+
+LW_CONNECT_DATA GLOBAL_CONNECT_DATA;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+static void connect_on_server_keepalive (void *args);
+static int update_connect_menu (DIALOG * d,
+				int waited_teams,
+				LW_TEAMSTARTINFO * team_start_info,
+				LW_CHAT_HISTORY * chat_history,
+				int *connected_teams_prev);
+static void position_players_list (DIALOG * d);
+static void position_chat_history (DIALOG * d);
+
+/*------------------------------------------------------------------*/
+int
+lw_connect_menu (int sock)
+{
+  DIALOG d[12];
+  DIALOG_PLAYER *dp;
+  int choix = 4, retour = 0;
+  char buf_waited_teams[CONNECT_BUF_SIZE];
+  char buf_connected_players[NB_TEAMS * CONNECT_BUF_SIZE];
+  char buf_chat_history[LW_CHAT_HISTORY_SIZE * CONNECT_BUF_SIZE];
+  char buf_chat_message[LW_CHAT_MESSAGE_SIZE + 1];
+  int first_display = 1;
+  int first_getinfo = 1;
+  LW_CONNECT_DATA *data;
+  int network_error = 0;
+  int hide_start_button = 0;
+  int connected_teams_prev = -1;
+
+  memset (d, 0, sizeof (d));
+  buf_waited_teams[0] = '\0';
+  buf_connected_players[0] = '\0';
+  buf_chat_history[0] = '\0';
+  buf_chat_message[0] = '\0';
+
+  data = &GLOBAL_CONNECT_DATA;
+  memset (data, 0, sizeof (LW_CONNECT_DATA));
+  data->sock = sock;
+  data->waited_teams = NB_TEAMS;
+
+  LW_NETWORK_ON = 1;
+
+  while (retour == 0)
+    {
+      standard_button (d + 4, 1, 0, 2, 10);
+      standard_button (d + 6, 1, 5, 2, 10);
+      standard_button (d + 8, 1, 7, 2, 10);
+      standard_button (d + 9, 1, 7, 2, 10);
+      standard_button (d + 10, 1, 8, 2, 10);
+
+      quick_buttons (d);
+
+      d[4].proc = my_textbox_proc;
+      d[5].proc = my_textbox_proc;
+      d[7].proc = my_textbox_proc;
+      d[8].proc = d_box_proc;
+      d[9].proc = my_edit_proc;
+
+      position_players_list (d + 5);
+      position_chat_history (d + 7);
+      d[4].w = d[7].w;
+      d[8].w = d[7].w;
+      d[9].w = d[7].w;
+      d[9].x++;
+      d[9].y++;
+      d[9].w -= 2;
+      d[9].h -= 2;
+
+      d[4].dp = buf_waited_teams;
+      d[5].dp = buf_connected_players;
+      d[6].dp = lw_lang_string (LW_LANG_STRING_CONNECT_STARTNOW);
+      d[7].dp = buf_chat_history;
+      d[9].dp = buf_chat_message;
+      d[9].d1 = LW_CHAT_MESSAGE_SIZE;
+      d[9].flags = D_EXIT;
+      d[10].dp = lw_lang_string (LW_LANG_STRING_CONNECT_SENDMESSAGE);
+
+      if (hide_start_button)
+	{
+	  /*
+	   * We disactivate these buttons. If we did not do it
+	   * it would lead to network errors if someone would
+	   * press them twice.
+	   */
+	  d[6].proc = my_textbox_proc;
+	  d[6].dp = lw_lang_string (LW_LANG_STRING_CONNECT_WAITING);
+	  d[MENU_QUICK_PLAY].flags = D_HIDDEN;
+	}
+
+      d[11].proc = 0;
+
+      if (first_display)
+	{
+	  display_back_image ();
+	  first_display = 0;
+	}
+      dp = my_init_dialog (d, choix);
+      while (my_update_dialog (dp) && !data->finished)
+	{
+	  show_mouse (screen);
+	  if (!data->thread_running && !data->finished)
+	    {
+	      if (!first_getinfo)
+		{
+		  if (data->result == 0)
+		    {
+		      network_error = 1;
+		    }
+		  else
+		    {
+		      update_connect_menu (d,
+					   data->waited_teams,
+					   data->team_start_info,
+					   &(data->chat_history),
+					   &connected_teams_prev);
+		    }
+		}
+	      data->thread_running = 1;
+	      if (lw_thread_start (connect_on_server_keepalive, data))
+		{
+		  first_getinfo = 0;
+		}
+	      else
+		{
+		  data->thread_running = 0;
+		}
+	    }
+	  rest (10);
+	}
+      choix = shutdown_dialog (dp);
+
+      if (network_error)
+	{
+	  error_network_problem ();
+	  lw_sock_close (&(data->sock));
+	  retour = 1;
+	}
+      else
+	{
+	  /*
+	   * If 0 teams are waited for, then the game must start, so
+	   * we simulate a key press on the "start" button.
+	   */
+	  if (data->waited_teams == 0)
+	    {
+	      retour = MENU_OK;
+	    }
+	  else
+	    {
+	      switch (choix)
+		{
+		case -1:
+		case MENU_QUICK_BACK:
+		  lw_sock_close (&(data->sock));
+		  retour = 1;
+		  break;
+		case MENU_QUICK_MAIN:
+		  lw_sock_close (&(data->sock));
+		  retour = MENU_TOP;
+		  break;
+		case MENU_QUICK_QUIT:
+		  lw_sock_close (&(data->sock));
+		  if (confirm_quit ())
+		    retour = MENU_EXIT;
+		  else
+		    display_back_image ();
+		  break;
+		case MENU_QUICK_PLAY:
+		  /*
+		   * Pressing Play or Start has the same effect here
+		   * so there's no "break;"
+		   */
+		case 6:
+		  if (data->waited_teams > 0)
+		    {
+		      data->force_start = 1;
+		      hide_start_button = 1;
+		      display_back_image ();
+		    }
+		  break;
+		case 9:
+		case 10:
+		  if (strlen (d[9].dp) && !data->chat_send)
+		    {
+		      data->chat_send = 1;
+
+		      strncpy (data->chat_buffer, d[9].dp,
+			       LW_CHAT_MESSAGE_SIZE);
+		      data->chat_buffer[LW_CHAT_MESSAGE_SIZE] = '\0';
+		      ((char *) (d[9].dp))[0] = '\0';
+		      d[9].d2 = 0;
+		      d[9].proc (MSG_DRAW, d + 9, 0);
+		    }
+		  break;
+		}
+	    }
+	}
+    }
+
+  while (data->thread_running)
+    {
+      /*
+       * Here, we wait until the thread is over, it shouldn't be very 
+       * long since we just wait for the server's answer
+       */
+      rest (100);
+    }
+
+  if (retour > 0)
+    retour--;
+
+  return retour;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Updates the fields of the menu
+ */
+static int
+update_connect_menu (DIALOG * d,
+		     int waited_teams,
+		     LW_TEAMSTARTINFO * team_start_info,
+		     LW_CHAT_HISTORY * chat_history,
+		     int *connected_teams_prev)
+{
+  int result = 0;
+  int i;
+  char *sep;
+  char buf[CONNECT_BUF_SIZE];
+  LW_CHAT_MESSAGE chat_mess;
+  static int old_chat_length = 0;
+  int chat_length;
+  int l;
+  int connected_teams = 0;
+
+  LW_MACRO_SNPRINTF3 ((char *) d[4].dp,
+		      CONNECT_BUF_SIZE,
+		      "%s%d%s",
+		      lw_lang_string (LW_LANG_STRING_CONNECT_WAITINGFOR),
+		      waited_teams,
+		      lw_lang_string (LW_LANG_STRING_CONNECT_TEAMS));
+
+  ((char *) (d[5].dp))[0] = '\0';
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      if (team_start_info[i].active)
+	{
+	  if (team_start_info[i].start)
+	    {
+	      sep = "*";
+	    }
+	  else
+	    {
+	      sep = "-";
+	    }
+
+	  LW_MACRO_SPRINTF3 (buf, "%d %s %s\n",
+			     i + 1, sep, team_start_info[i].name);
+
+	  LW_MACRO_STRNCAT ((char *) d[5].dp, buf,
+			    NB_TEAMS * CONNECT_BUF_SIZE);
+
+	  connected_teams++;
+	}
+    }
+
+  ((char *) (d[7].dp))[0] = '\0';
+  for (i = 0; lw_chat_get (chat_history, &chat_mess, i); ++i)
+    {
+      LW_MACRO_SPRINTF2 (buf, "%s: %s\n",
+			 chat_mess.author, chat_mess.content);
+      LW_MACRO_STRNCAT ((char *) d[7].dp, buf,
+			LW_CHAT_HISTORY_SIZE * CONNECT_BUF_SIZE);
+    }
+  /*
+   * Now if the length of the string has changed, we
+   * scroll to the end of the list. The "string length"
+   * test is not 100% safe, but its purpose is just to
+   * scroll through the list when a message is sent.
+   * if it fails sometimes, it's not _that_ bad.
+   */
+  chat_length = strlen (d[7].dp);
+  if (chat_length != old_chat_length)
+    {
+      old_chat_length = chat_length;
+
+      l = (d[7].h - 8) / text_height (font);
+      d[7].d2 = MAX (0, d[7].d1 - l);
+    }
+
+  scare_mouse ();
+  d[4].proc (MSG_DRAW, d + 4, 0);
+  d[5].proc (MSG_DRAW, d + 5, 0);
+  d[7].proc (MSG_DRAW, d + 7, 0);
+  unscare_mouse ();
+
+  show_mouse (screen);
+
+  /*
+   * If there are more teams connected than last times, we're likely
+   * to announce it with a sound
+   */
+  if (connected_teams > 0 && connected_teams > *connected_teams_prev)
+    {
+      /*
+       * We check if this is not the first time 
+       * (*connected_teams_prev==-1) and in this case we play 
+       * nothing
+       */
+      if ((*connected_teams_prev) >= 0)
+	{
+	  play_connect ();
+	}
+      (*connected_teams_prev) = connected_teams;
+    }
+  else
+    {
+      /*
+       * We updated the numner of connected teams, but take care
+       * note to overwrite it if it's -1
+       */
+      if ((*connected_teams_prev) >= 0)
+	{
+	  (*connected_teams_prev) = connected_teams;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Retrieves informations from the server once all players are
+ * connected. Also displays information in a dialog box.
+ */
+static void
+connect_on_server_keepalive (void *arg)
+{
+  int result = 1;
+  int i;
+  LW_CONNECT_DATA *data;
+
+  data = (LW_CONNECT_DATA *) arg;
+
+  if (!data->finished)
+    {
+      if (result == 1)
+	{
+	  if (!lw_protocol_waiting (&data->sock, &(data->waited_teams)))
+	    {
+	      result = 0;
+	    }
+	}
+
+      if (result == 1)
+	{
+	  if (data->waited_teams > 0)
+	    {
+	      /*
+	       * We are still waiting for teams
+	       */
+	      for (i = 0; i < NB_TEAMS; ++i)
+		{
+		  if (result == 1)
+		    {
+		      if (!lw_protocol_ask_teamstartinfo (&data->sock, i,
+							  &(data->
+							    team_start_info
+							    [i])))
+			{
+			  result = 0;
+			}
+		    }
+		}
+
+	      if (result == 1 && data->chat_send)
+		{
+		  lw_netmess_cleanup_arg (data->chat_buffer);
+
+		  if (!lw_protocol_chat_talk (&data->sock, data->chat_buffer))
+		    {
+		      result = 0;
+		    }
+
+		  data->chat_send = 0;
+		}
+
+	      if (result == 1)
+		{
+		  if (!lw_protocol_chat_listen
+		      (&data->sock, &(data->chat_history)))
+		    {
+		      result = 0;
+		    }
+		}
+
+	      if (result == 1 && data->force_start)
+		{
+		  if (!lw_protocol_force_start (&data->sock))
+		    {
+		      result = 0;
+		    }
+		  /*
+		   * It's useless to keep on sending the START message, once is
+		   * just enough, let's save bandwidth!
+		   */
+		  data->force_start = 0;
+		}
+
+	      if (result == 1)
+		{
+		  if (!lw_protocol_next (&data->sock))
+		    {
+		      result = 0;
+		    }
+		}
+	    }
+	  else
+	    {
+	      /*
+	       * No more teams waited, we say we're ready
+	       */
+	      if (result == 1)
+		{
+		  if (!lw_protocol_i_am_ready (&data->sock))
+		    {
+		      result = 0;
+		    }
+		  data->finished = 1;
+		}
+	    }
+	}
+    }
+
+  data->result = result;
+  data->thread_running = 0;
+}
+
+/*------------------------------------------------------------------*/
+static void
+position_players_list (DIALOG * d)
+{
+  d->x = (MENU_VIRTUAL_W + MENU_W_SPACE) / 2;
+  d->y =
+    (MENU_VIRTUAL_H - MENU_H_INTERNET_LIST) / 2 + MENU_H_STANDARD +
+    MENU_H_SPACE;
+  d->w = (MENU_W_STANDARD + MENU_W_INTERNET_LIST) / 2;
+  d->h = 4 * MENU_H_STANDARD + 3 * MENU_H_SPACE;
+
+  color_one_dialog (d);
+  menu_real_coord (d);
+}
+
+/*------------------------------------------------------------------*/
+static void
+position_chat_history (DIALOG * d)
+{
+  d->x = (MENU_VIRTUAL_W - MENU_W_SPACE) / 2 - MENU_W_INTERNET_LIST;
+  d->y = (MENU_VIRTUAL_H - MENU_H_INTERNET_LIST) / 2;
+  d->w = MENU_W_INTERNET_LIST;
+  d->h = MENU_H_INTERNET_LIST;
+
+  color_one_dialog (d);
+  menu_real_coord (d);
+  d->key = 0;
+  d->dp = "";
+  d->flags = D_EXIT;
+}

Added: unstable/liquidwar/branches/upstream/current/src/connect.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/connect.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/connect.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,63 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : connect.h                                        */
+/* contenu       : connect menu, the list of connected players      */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_CONNECT
+#define LIQUID_WAR_INCLUDE_CONNECT
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int lw_connect_menu (int sock);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/controls.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/controls.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/controls.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,171 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : controls.c                                       */
+/* content       : controls menu                                    */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+
+#include "back.h"
+#include "base.h"
+#include "config.h"
+#include "dialog.h"
+#include "menu.h"
+#include "options.h"
+#include "lang.h"
+#include "controls.h"
+#include "mouse.h"
+#include "sound.h"
+#include "joystick.h"
+#include "log.h"
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static int
+slider_mouse (void *dp3, int d2)
+{
+  int *val;
+
+  val = dp3;
+  *val = d2;
+
+  lw_mouse_reset_control ();
+
+  play_click ();
+
+  return 0;
+}
+
+
+/*------------------------------------------------------------------*/
+int
+controls_options (void)
+{
+  DIALOG d[9];
+  int choix = 4, retour = 0;
+
+  memset (d, 0, sizeof (d));
+
+  while (retour == 0)
+    {
+      standard_button (d + 4, 0, 0, 2, 4);
+      standard_button (d + 5, 1, 0, 2, 4);
+      standard_big_button (d + 6, 0, 2, 1, 4);
+      standard_button (d + 7, 0, 3, 1, 4);
+
+      quick_buttons (d);
+
+      d[4].proc = my_textbox_proc;
+      d[4].dp = lw_lang_string (LW_LANG_STRING_CONTROLS_JOYSTICK);
+
+      switch (CONFIG_JOYSTICK_ON)
+	{
+	case 1:
+	  d[5].dp = lw_lang_string (LW_LANG_STRING_CONTROLS_2JOYSTICKS);
+	  break;
+	case 2:
+	  d[5].dp = lw_lang_string (LW_LANG_STRING_CONTROLS_4BUTTONS);
+	  break;
+	case 3:
+	  d[5].dp = lw_lang_string (LW_LANG_STRING_CONTROLS_STANDARD);
+	  break;
+	default:
+	  d[5].dp = lw_lang_string (LW_LANG_STRING_CONTROLS_OFF);
+	  break;
+	}
+
+      d[6].proc = my_textbox_proc;
+      d[6].dp = lw_lang_string (LW_LANG_STRING_CONTROLS_MOUSESENSIB);
+
+      d[7].proc = my_slider_proc;
+      d[7].dp = NULL;
+      d[7].d1 = 8;
+      d[7].d2 = CONFIG_MOUSE_GAP;
+      d[7].dp2 = slider_mouse;
+      d[7].dp3 = &CONFIG_MOUSE_GAP;
+
+      d[8].proc = 0;
+
+      choix = my_do_dialog (d, choix);
+      switch (choix)
+	{
+	case -1:
+	case MENU_QUICK_BACK:
+	  retour = 1;
+	  break;
+	case MENU_QUICK_MAIN:
+	  retour = MENU_TOP;
+	  break;
+	case MENU_QUICK_QUIT:
+	  if (confirm_quit ())
+	    retour = MENU_EXIT;
+	  else
+	    display_back_image ();
+	  break;
+	case MENU_QUICK_PLAY:
+	  retour = MENU_PLAY;
+	  break;
+	case 5:
+	  CONFIG_JOYSTICK_ON++;
+	  if (CONFIG_JOYSTICK_ON > 3)
+	    CONFIG_JOYSTICK_ON = 0;
+	  my_initialise_joystick ();
+	  break;
+	}
+    }
+
+  if (retour > 0)
+    retour--;
+
+  return retour;
+}

Added: unstable/liquidwar/branches/upstream/current/src/controls.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/controls.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/controls.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,67 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : controls.h                                       */
+/* contenu       : controls menu                                    */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_CONTROLS
+#define LIQUID_WAR_INCLUDE_CONTROLS
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int controls_options (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/cursor.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/cursor.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/cursor.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,297 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : cursor.c                                         */
+/* contenu       : placement et initialisation des curseurs         */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+#include <stdlib.h>
+
+#include "army.h"
+#include "grad.h"
+#include "cursor.h"
+#include "mesh.h"
+#include "palette.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*
+ * globals holding all the cursors of the game
+ * I first wanted to have several cursors per team, for LW's 
+ * core algorithm can handle that easily, but I gave up since
+ * it would have represented too much work with cursor & teams
+ * associations and also with the GUI
+ */
+CURSOR CURRENT_CURSOR[NB_TEAMS];
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * inactivate all cursors
+ */
+void
+reset_all_cursor (void)
+{
+  int i;
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      memset (&(CURRENT_CURSOR[i]), 0, sizeof (CURSOR));
+    }
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * initialization of a cursor, done at each new game
+ */
+static void
+init_cursor (int index, int team, int x, int y, char *name)
+{
+  /*
+   * we activate the cursor and set up user parameters
+   */
+  CURRENT_CURSOR[index].active = 1;
+  CURRENT_CURSOR[index].team = team;
+  CURRENT_CURSOR[index].x = x;
+  CURRENT_CURSOR[index].y = y;
+  /*
+   * the following line reveals an important point of LW's algorithm
+   * at game start, one has to set up the value of the cursor with
+   * a great value, since it will be decremented at each game cycle.
+   * the reason is the following: 
+   * on one hand, since I move my cursor of let's say
+   * 1 pixel, I can not assume that the points on the map have kept
+   * the same distance with the cursor. In the worst case, any point
+   * on the map is 1 pixel farer from the cursor than before. I could
+   * increment the distance of every single point of the map, but it
+   * goes much faster just to decrement the value of the cursor 8-D
+   * on the other hand, the value must be a lot smaller than the value
+   * we have initialized the whole map with, since by default we have
+   * no idea of how far the points are, so we must consider they are
+   * "very" far
+   * so that's why I use AREA_START_GRADIENT/2
+   */
+  CURRENT_CURSOR[index].val = AREA_START_GRADIENT / 2;
+  /*
+   * default values...
+   */
+  CURRENT_CURSOR[index].loose_time = -1;
+  CURRENT_CURSOR[index].score_order = 0;
+  /*
+   * the colors allocated for fighters start at 128 in the palette
+   * and the COLORS_PER_TEAM value gives how much color per team
+   * are available
+   */
+  CURRENT_CURSOR[index].color_entry = 128 + team * COLORS_PER_TEAM;
+  /*
+   * Now we set up the cursor name
+   */
+  strncpy (CURRENT_CURSOR[index].name, name, NAME_SIZE);
+  CURRENT_CURSOR[index].name[NAME_SIZE] = '\0';
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * this is where the cursor is "blitted" on the map, algorythmically
+ * speaking, ie the map acknowledges the position of the cursor
+ */
+void
+apply_all_cursor (void)
+{
+  int i, x, y;
+  MESH *temp;
+
+  /*
+   * loop for all the active cursors
+   */
+  for (i = 0; i < NB_TEAMS; ++i)
+    if (CURRENT_CURSOR[i].active)
+      {
+	/*
+	 * x and y hold the position of the cursor
+	 */
+	x = CURRENT_CURSOR[i].x;
+	y = CURRENT_CURSOR[i].y;
+	/*
+	 * sanity check, in case the cursor is not on a valid part
+	 * of the map. It should not happen but I hate protection
+	 * faults!
+	 */
+	if ((temp = CURRENT_AREA[y * CURRENT_AREA_W + x].mesh) != NULL)
+	  /*
+	   * we just poke the value of the cursor into its
+	   * corresponding position in the map
+	   * very simple, eh?
+	   */
+	  temp->info[CURRENT_CURSOR[i].team].state.grad
+	    = CURRENT_CURSOR[i].val;
+      }
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * the purpose of this function is to place the cursor automatically
+ * on the map, knowing that we can give a fixed position for each
+ * team since all maps are potentially different. 
+ */
+void
+auto_cursor (int index, int team, char *name)
+{
+  int i, x, y, x_min, x_max, y_min, y_max, ok, x0, y0, n;
+
+  x = y = n = 0;
+  /*
+   * loop for all the fighters of all teams
+   */
+  for (i = 0; i < CURRENT_ARMY_SIZE; ++i)
+    /*
+     * we exclude fighters who do not belong to the team we want
+     */
+    if (CURRENT_ARMY[i].team == team)
+      {
+	/*
+	 * the following totals will be used to get the center
+	 * of all the fighters belonging to this army
+	 * of course it implies fighters have been placed
+	 */
+	x += CURRENT_ARMY[i].x;
+	y += CURRENT_ARMY[i].y;
+	n++;
+      }
+
+  /*
+   * x0 and y0 should now be right in the middle of our fichters
+   */
+  x0 = x_max = x_min = (x /= n);
+  y0 = y_max = y_min = (y /= n);
+
+  ok = 0;
+  /*
+   * loop as long as no correct position has been found
+   * we can't admit a random placing for network consideration, so we follow
+   * "spiral" arround a default position and chose the first working
+   * position (ie without a wall)
+   * the starting point of the spiral is x0,y0
+   */
+  while (!ok)
+    {
+      /* 
+       * try and find a good spot going right
+       */
+      for (x = x_min; x <= x_max && !ok; ++x)
+	if (CURRENT_AREA[y * CURRENT_AREA_W + x].mesh != NULL)
+	  {
+	    ok = 1;
+	    x0 = x;
+	    y0 = y;
+	  }
+      /*
+       * if we did not touch the right side yet, let's increase the limit
+       */
+      if (x_max < CURRENT_AREA_W - 1)
+	++x_max;
+
+      /* 
+       * try and find a good spot going down
+       */
+      for (y = y_min; y <= y_max && !ok; ++y)
+	if (CURRENT_AREA[y * CURRENT_AREA_W + x].mesh != NULL)
+	  {
+	    ok = 1;
+	    x0 = x;
+	    y0 = y;
+	  }
+      /*
+       * if we did not touch the bottom side yet, let's increase the limit
+       */
+      if (y_max < CURRENT_AREA_H - 1)
+	++y_max;
+
+      /* 
+       * try and find a good spot going left
+       */
+      for (x = x_max; x >= x_min && !ok; --x)
+	if (CURRENT_AREA[y * CURRENT_AREA_W + x].mesh != NULL)
+	  {
+	    ok = 1;
+	    x0 = x;
+	    y0 = y;
+	  }
+      /*
+       * if we did not touch the left side yet, let's decrease the limit
+       */
+      if (x_min > 0)
+	--x_min;
+
+      /* 
+       * try and find a good spot going up 
+       */
+      for (y = y_max; y >= y_min && !ok; --y)
+	if (CURRENT_AREA[y * CURRENT_AREA_W + x].mesh != NULL)
+	  {
+	    ok = 1;
+	    x0 = x;
+	    y0 = y;
+	  }
+      /*
+       * if we did not touch the top side yet, let's decrease the limit
+       */
+      if (y_min > 0)
+	--y_min;
+    }
+
+  init_cursor (index, team, x0, y0, name);
+}

Added: unstable/liquidwar/branches/upstream/current/src/cursor.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/cursor.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/cursor.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,137 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : cursor.h                                         */
+/* contenu       : placement et initialisation des curseurs         */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_CURSOR
+#define LIQUID_WAR_INCLUDE_CURSOR
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "base.h"
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+typedef struct
+{
+  /*
+   * value which will be used when the
+   * will be put into the map. this  
+   * value decreases at each round.  
+   */
+  int val;
+  /* x position of the cursor         */
+  int x;
+  /* y position of the cursor         */
+  int y;
+  /* 
+   * true if the player who owns this 
+   * cursor is playing with it        
+   */
+  int active;
+  /* team the cursor belongs to       */
+  int team;
+  /* 
+   * time at which this cursor has    
+   * lost. it seems that the diff     
+   * between cursor and team is not   
+   * well defined 8-(                 
+   */
+  int loose_time;
+  /* wether you are 1st or 2nd...     */
+  int score_order;
+  /* 
+   * first color used by this cursor  
+   * in the 256 color palette. again  
+   * a cursor is associated to a team 
+   */
+  int color_entry;
+  /* 
+   *      this value holds the state of all
+   * the keys associated to the cursor
+   * it is a logical or between   
+   * - CURSOR_KEY_UP    
+   * - CURSOR_KEY_RIGHT 
+   * - CURSOR_KEY_DOWN  
+   * - CURSOR_KEY_LEFT  
+   * which are defined in move.h      
+   */
+  int key_state;
+  /* true if the player is a computer */
+  int control_type;
+  /* 
+   * true if the player is located on 
+   * a remote machine                 
+   */
+  int from_network;
+  /*
+   * the name of the player
+   */
+  char name[NAME_SIZE + 1];
+}
+CURSOR;
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+extern CURSOR CURRENT_CURSOR[NB_TEAMS];
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void reset_all_cursor (void);
+void apply_all_cursor (void);
+void auto_cursor (int index, int team, char *name);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/decal.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/decal.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/decal.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,124 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : decal.c                                          */
+/* contenu       : gestion du decalage equipe jouantes/curseurs     */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "cursor.h"
+#include "mesh.h"
+#include "army.h"
+#include "decal.h"
+#include "time.h"
+#include "log.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+int PLAYING_TEAMS = 0;
+int ACTIVE_FIGHTERS[NB_TEAMS];
+int COLOR_FIRST_ENTRY[NB_TEAMS];
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+get_cursor_from_team (int team)
+{
+  int i, cursor = -1;
+
+  for (i = 0; i < NB_TEAMS && cursor < 0; ++i)
+    if (team == CURRENT_CURSOR[i].team)
+      cursor = i;
+
+  return i;
+}
+
+/*------------------------------------------------------------------*/
+int
+eliminate_team (int team)
+{
+  int i, j;
+
+  if (PLAYING_TEAMS > 0)
+    {
+      PLAYING_TEAMS--;
+      for (i = 0; i < NB_TEAMS; ++i)
+	if (CURRENT_CURSOR[i].team == team && CURRENT_CURSOR[i].active)
+	  {
+	    CURRENT_CURSOR[i].active = 0;
+	    CURRENT_CURSOR[i].loose_time = TIME_ELAPSED;
+	    CURRENT_CURSOR[i].score_order = PLAYING_TEAMS + 1;
+	  }
+      for (i = 0; i < NB_TEAMS; ++i)
+	if (CURRENT_CURSOR[i].team > team)
+	  CURRENT_CURSOR[i].team--;
+      for (i = 0; i < CURRENT_ARMY_SIZE; ++i)
+	if (CURRENT_ARMY[i].team > team)
+	  CURRENT_ARMY[i].team--;
+      for (j = team; j < PLAYING_TEAMS; ++j)
+	{
+	  ACTIVE_FIGHTERS[j] = ACTIVE_FIGHTERS[j + 1];
+	  COLOR_FIRST_ENTRY[j] = COLOR_FIRST_ENTRY[j + 1];
+
+	  for (i = 0; i < CURRENT_MESH_SIZE; ++i)
+	    {
+	      CURRENT_MESH[i].info[j] = CURRENT_MESH[i].info[j + 1];
+	    }
+	}
+
+      return 0;
+    }
+  else
+    return 1;
+}

Added: unstable/liquidwar/branches/upstream/current/src/decal.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/decal.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/decal.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,75 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : decal.h                                          */
+/* contenu       : gestion du decalage equipes jouantes/curseurs    */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_DECAL
+#define LIQUID_WAR_INCLUDE_DECAL
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "base.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+extern int PLAYING_TEAMS;
+extern int ACTIVE_FIGHTERS[NB_TEAMS];
+extern int COLOR_FIRST_ENTRY[NB_TEAMS];
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int get_cursor_from_team (int team);
+int eliminate_team (int team);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/dialog.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/dialog.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/dialog.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,364 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : dialog.c                                         */
+/* contenu       : utilitaires gui                                  */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+#ifdef UNIX
+#include <unistd.h>
+#endif
+
+#include "dialog.h"
+#include "sound.h"
+#include "back.h"
+#include "lang.h"
+#include "exit.h"
+#include "keyboard.h"
+#include "capture.h"
+#include "joystick.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+menu_real_x (int x)
+{
+  return ((x * SCREEN_W) / MENU_VIRTUAL_W);
+}
+
+/*------------------------------------------------------------------*/
+int
+menu_real_y (int y)
+{
+  return ((y * SCREEN_H) / MENU_VIRTUAL_H);
+}
+
+/*------------------------------------------------------------------*/
+void
+menu_real_coord (DIALOG * d)
+{
+  d->x = menu_real_x (d->x);
+  d->y = menu_real_y (d->y);
+  d->w = menu_real_x (d->w);
+  d->h = menu_real_y (d->h);
+}
+
+/*------------------------------------------------------------------*/
+/* gestion generique des menus                                      */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+int
+find_center (int pos, int num, int space, int size)
+{
+  int center;
+
+  center = (size - num * space) / 2;
+  center += pos * space + space / 2;
+
+  return center;
+}
+
+/*------------------------------------------------------------------*/
+void
+color_one_dialog (DIALOG * d)
+{
+  d->fg = MENU_FG;
+  d->bg = MENU_BG;
+}
+
+/*------------------------------------------------------------------*/
+void
+center_one_dialog (DIALOG * d, int x, int y, int w, int h)
+{
+  d->x = x - w / 2;
+  d->y = y - h / 2;
+  d->w = w;
+  d->h = h;
+}
+
+/*------------------------------------------------------------------*/
+void
+quick_buttons (DIALOG * d)
+{
+  int i;
+
+  d[MENU_QUICK_QUIT].dp = lw_lang_string (LW_LANG_STRING_DIALOG_QUIT);
+  d[MENU_QUICK_BACK].dp = lw_lang_string (LW_LANG_STRING_DIALOG_BACK);
+  d[MENU_QUICK_PLAY].dp = lw_lang_string (LW_LANG_STRING_DIALOG_PLAY);
+  d[MENU_QUICK_MAIN].dp = lw_lang_string (LW_LANG_STRING_DIALOG_MAIN);
+  d[MENU_QUICK_QUIT].key = 'q';
+  d[MENU_QUICK_BACK].key = 'b';
+  d[MENU_QUICK_PLAY].key = 'h';
+  d[MENU_QUICK_MAIN].key = 'm';
+
+  d[MENU_QUICK_BACK].x = d[MENU_QUICK_QUIT].x = MENU_W_SPACE / 2;
+  d[MENU_QUICK_PLAY].x =
+    d[MENU_QUICK_MAIN].x = MENU_VIRTUAL_W - 1
+    - MENU_W_SPACE / 2 - MENU_W_QUICK;
+  d[MENU_QUICK_BACK].y = d[MENU_QUICK_PLAY].y = MENU_H_SPACE / 2;
+  d[MENU_QUICK_QUIT].y =
+    d[MENU_QUICK_MAIN].y = MENU_VIRTUAL_H - 1
+    - MENU_H_SPACE / 2 - MENU_H_QUICK;
+  for (i = 0; i < 4; ++i)
+    {
+      d[i].proc = my_button_proc;
+      d[i].flags = D_EXIT;
+      d[i].h = MENU_H_QUICK;
+      d[i].w = MENU_W_QUICK;
+      color_one_dialog (d + i);
+      menu_real_coord (d + i);
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+standard_button (DIALOG * d, int x_pos, int y_pos, int x_num, int y_num)
+{
+  d->proc = my_button_proc;
+
+  center_one_dialog (d,
+		     find_center (x_pos, x_num,
+				  MENU_W_STANDARD + MENU_W_SPACE,
+				  MENU_VIRTUAL_W), find_center (y_pos, y_num,
+								MENU_H_STANDARD
+								+
+								MENU_H_SPACE,
+								MENU_VIRTUAL_H),
+		     MENU_W_STANDARD, MENU_H_STANDARD);
+  color_one_dialog (d);
+  menu_real_coord (d);
+  d->key = 0;
+  d->dp = "";
+  d->flags = D_EXIT;
+}
+
+/*------------------------------------------------------------------*/
+void
+standard_small_button (DIALOG * d, int x_pos, int y_pos, int x_num, int y_num)
+{
+  d->proc = my_button_proc;
+
+  center_one_dialog (d,
+		     find_center (x_pos, x_num,
+				  MENU_W_STANDARD / 2 + MENU_W_SPACE,
+				  MENU_VIRTUAL_W), find_center (y_pos, y_num,
+								MENU_H_STANDARD
+								+
+								MENU_H_SPACE,
+								MENU_VIRTUAL_H),
+		     MENU_W_STANDARD / 2, MENU_H_STANDARD);
+  color_one_dialog (d);
+  menu_real_coord (d);
+  d->key = 0;
+  d->dp = "";
+  d->flags = D_EXIT;
+}
+
+/*------------------------------------------------------------------*/
+void
+standard_big_button (DIALOG * d, int x_pos, int y_pos, int x_num, int y_num)
+{
+  d->proc = my_button_proc;
+
+  center_one_dialog (d,
+		     find_center (x_pos, x_num,
+				  MENU_W_STANDARD * 2 + MENU_W_SPACE,
+				  MENU_VIRTUAL_W), find_center (y_pos, y_num,
+								MENU_H_STANDARD
+								+
+								MENU_H_SPACE,
+								MENU_VIRTUAL_H),
+		     MENU_W_STANDARD * 2, MENU_H_STANDARD);
+  color_one_dialog (d);
+  menu_real_coord (d);
+  d->key = 0;
+  d->dp = "";
+  d->flags = D_EXIT;
+}
+
+/*------------------------------------------------------------------*/
+void
+main_message (DIALOG * d, char *str)
+{
+  standard_big_button (d, 0, 0, 1, 1);
+
+  d->dp = str;
+  d->key = 0;
+  d->proc = my_textbox_proc;
+  d->flags = 0;
+}
+
+/*------------------------------------------------------------------*/
+void
+main_info (DIALOG * d, char *str)
+{
+  color_one_dialog (d);
+  d->proc = my_textbox_proc;
+  d->dp = str;
+  d->key = 0;
+  d->flags = 0;
+}
+
+/*------------------------------------------------------------------*/
+DIALOG_PLAYER *
+my_init_dialog (DIALOG * d, int f)
+{
+  DIALOG_PLAYER *dp;
+
+  lw_keyboard_reset_hack ();
+
+  dp = init_dialog (d, f);
+
+  return dp;
+}
+
+/*------------------------------------------------------------------*/
+int
+my_do_dialog_no_clear (DIALOG * d, int f)
+{
+  int result;
+  void *player;
+
+  player = my_init_dialog (d, f);
+
+  while (my_update_dialog (player))
+    {
+      /*
+       * Nothing here...
+       */
+    }
+
+  result = shutdown_dialog (player);
+
+  play_click ();
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+my_do_dialog (DIALOG * d, int f)
+{
+  int result;
+
+  display_back_image ();
+  result = my_do_dialog_no_clear (d, f);
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+my_update_dialog (DIALOG_PLAYER * player)
+{
+  int result;
+
+  result = update_dialog (player);
+  lw_capture_dump_menu ();
+  my_poll_joystick ();
+  my_exit_poll ();
+
+#ifdef UNIX
+  /*
+   * The usleep calls prevents the game from eating 100% of the
+   * CPU time on UNIX platforms.
+   */
+  usleep (100);
+#endif
+  //yield_timeslice (); deprecated
+  rest (0);
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+void
+display_center_message (char *str)
+{
+  DIALOG d[2];
+  DIALOG_PLAYER *dp;
+
+  memset (d, 0, sizeof (d));
+
+  display_back_image ();
+  main_message (d, str);
+  d[1].proc = 0;
+  dp = my_init_dialog (d, 0);
+  my_update_dialog (dp);
+  shutdown_dialog (dp);
+
+  /*
+   * We wait a little bit, so that the player can see the message
+   */
+  //rest(100);
+}
+
+/*------------------------------------------------------------------*/
+int
+slider_int (void *dp3, int d2)
+{
+  int *val;
+
+  val = dp3;
+  *val = d2;
+
+  play_click ();
+
+  return 0;
+}

Added: unstable/liquidwar/branches/upstream/current/src/dialog.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/dialog.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/dialog.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,122 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : dialog.h                                         */
+/* contenu       : utilitaires gui                                  */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_DIALOG
+#define LIQUID_WAR_INCLUDE_DIALOG
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+#include "alleg2.h"
+#include "palette.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#define BUFFER_EDIT_NUMBER 33
+
+#define MENU_TOP -1
+#define MENU_EXIT -2
+#define MENU_PLAY -3
+#define MENU_OK -4
+
+#define MENU_QUICK_QUIT 0
+#define MENU_QUICK_PLAY 1
+#define MENU_QUICK_MAIN 2
+#define MENU_QUICK_BACK 3
+
+#define MENU_VIRTUAL_W 320
+#define MENU_VIRTUAL_H 240
+
+#define MENU_H_STANDARD 15
+#define MENU_H_QUICK 15
+#define MENU_H_SPACE 3
+#define MENU_H_LEVEL 15
+#define MENU_H_SAMPLE 120
+#define MENU_H_TEAM 90
+#define MENU_H_INTERNET_LIST 175
+#define MENU_W_STANDARD 100
+#define MENU_W_QUICK 60
+#define MENU_W_SPACE 3
+#define MENU_W_LEVEL 40
+#define MENU_W_SAMPLE 160
+#define MENU_W_TEAM 75
+#define MENU_W_INTERNET_LIST 150
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int menu_real_x (int x);
+int menu_real_y (int y);
+void menu_real_coord (DIALOG * d);
+int find_center (int pos, int num, int space, int size);
+void color_one_dialog (DIALOG * d);
+void center_one_dialog (DIALOG * d, int x, int y, int w, int h);
+void quick_buttons (DIALOG * d);
+void standard_button (DIALOG * d, int x_pos, int y_pos, int x_num, int y_num);
+void standard_small_button (DIALOG * d, int x_pos, int y_pos,
+			    int x_num, int y_num);
+void standard_big_button (DIALOG * d, int x_pos, int y_pos,
+			  int x_num, int y_num);
+void main_message (DIALOG * d, char *str);
+void main_info (DIALOG * d, char *str);
+DIALOG_PLAYER *my_init_dialog (DIALOG * d, int f);
+int my_do_dialog_no_clear (DIALOG * d, int f);
+int my_do_dialog (DIALOG * d, int f);
+int my_update_dialog (DIALOG_PLAYER * d);
+void display_center_message (char *str);
+int slider_int (void *dp3, int d2);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/disk.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/disk.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/disk.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,644 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : disk.c                                           */
+/* contenu       : lecture des donnees du fichier .dat              */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+#include <allegro.h>
+
+#include "alleg2.h"
+#include "init.h"
+#include "disk.h"
+#include "log.h"
+#include "map.h"
+#include "palette.h"
+#include "startup.h"
+#include "texture.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* defines                                                          */
+/*==================================================================*/
+
+#define SAMPLE_SFX_NUMBER  6
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+int SAMPLE_WATER_NUMBER = 0;
+int RAW_TEXTURE_NUMBER = 0;
+int RAW_MAPTEX_NUMBER = 0;
+int RAW_MAP_NUMBER = 0;
+int MIDI_MUSIC_NUMBER = 0;
+
+int LOADED_BACK = 0;
+int LOADED_TEXTURE = 0;
+int LOADED_MAPTEX = 0;
+int LOADED_SFX = 0;
+int LOADED_WATER = 0;
+int LOADED_MUSIC = 0;
+
+SAMPLE *SAMPLE_SFX_TIME = NULL;
+SAMPLE *SAMPLE_SFX_WIN = NULL;
+SAMPLE *SAMPLE_SFX_GO = NULL;
+SAMPLE *SAMPLE_SFX_CLICK = NULL;
+SAMPLE *SAMPLE_SFX_LOOSE = NULL;
+SAMPLE *SAMPLE_SFX_CONNECT = NULL;
+
+SAMPLE *SAMPLE_WATER[SAMPLE_WATER_MAX_NUMBER];
+void *RAW_MAP[RAW_MAP_MAX_NUMBER];
+void *RAW_MAP_ORDERED[RAW_MAP_MAX_NUMBER];
+void *RAW_TEXTURE[RAW_TEXTURE_MAX_NUMBER];
+void *RAW_MAPTEX[RAW_TEXTURE_MAX_NUMBER];
+MIDI *MIDI_MUSIC[MIDI_MUSIC_MAX_NUMBER];
+
+BITMAP *BACK_IMAGE = NULL;
+
+FONT *BIG_FONT = NULL;
+FONT *SMALL_FONT = NULL;
+BITMAP *BIG_MOUSE_CURSOR = NULL;
+BITMAP *SMALL_MOUSE_CURSOR = NULL;
+BITMAP *INVISIBLE_MOUSE_CURSOR = NULL;
+
+static RGB *FONT_PALETTE = NULL;
+static RGB *BACK_PALETTE = NULL;
+
+static int CUSTOM_TEXTURE_OK = 0;
+static int CUSTOM_MAP_OK = 0;
+static int CUSTOM_MUSIC_OK = 0;
+
+/*------------------------------------------------------------------*/
+/* chargement des effets sonores                                    */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+static void
+lock_sound (SAMPLE * smp)
+{
+  LOCK_VARIABLE (*smp);
+#ifdef DOS
+  _go32_dpmi_lock_data (smp->data, (smp->bits / 8) * smp->len);
+#else
+  LW_MACRO_NOP (smp);
+#endif
+}
+
+/*------------------------------------------------------------------*/
+static void
+read_sfx_dat (DATAFILE * df)
+{
+  SAMPLE *list[SAMPLE_SFX_NUMBER];
+  int i;
+
+  /*
+   * First, we associate the _first_ sound of the sub datafile
+   * to all sounds. This will operate as default value which
+   * will prevent the game from segfaulting if we use it with
+   * an outdated or too recent datafile
+   */
+  for (i = 0; i < SAMPLE_SFX_NUMBER && df[i].type != DAT_END; ++i)
+    {
+      list[i] = df[0].dat;
+    }
+
+  /*
+   * Now we associate the real sounds, provided that they exist...
+   */
+  for (i = 0; i < 6 && df[i].type != DAT_END; ++i)
+    {
+      list[i] = df[i].dat;
+      lock_sound (list[i]);
+    }
+
+  SAMPLE_SFX_TIME = list[0];
+  SAMPLE_SFX_WIN = list[1];
+  SAMPLE_SFX_CONNECT = list[2];
+  SAMPLE_SFX_GO = list[3];
+  SAMPLE_SFX_CLICK = list[4];
+  SAMPLE_SFX_LOOSE = list[5];
+}
+
+/*------------------------------------------------------------------*/
+static void
+read_water_dat (DATAFILE * df)
+{
+  int i;
+
+  for (i = 0; i < SAMPLE_WATER_DAT_NUMBER && df[i].type != DAT_END; ++i)
+    {
+      SAMPLE_WATER[i] = df[i].dat;
+      lock_sound (SAMPLE_WATER[i]);
+      SAMPLE_WATER_NUMBER++;
+    }
+}
+
+/*------------------------------------------------------------------*/
+/* chargement des autres donnees                                    */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+static void
+read_texture_dat (DATAFILE * df)
+{
+  int i;
+
+  RAW_TEXTURE_NUMBER = 0;
+  for (i = 0; i < RAW_TEXTURE_DAT_NUMBER && df[i].type != DAT_END; ++i)
+    {
+      RAW_TEXTURE[i] = df[i].dat;
+      RAW_TEXTURE_NUMBER++;
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+read_maptex_dat (DATAFILE * df)
+{
+  int i;
+
+  RAW_MAPTEX_NUMBER = 0;
+  for (i = 0; i < RAW_TEXTURE_DAT_NUMBER && df[i].type != DAT_END; ++i)
+    {
+      RAW_MAPTEX[i] = df[i].dat;
+      RAW_MAPTEX_NUMBER++;
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+read_map_dat (DATAFILE * df)
+{
+  int i;
+
+  RAW_MAP_NUMBER = 0;
+  for (i = 0; i < RAW_MAP_DAT_NUMBER && df[i].type != DAT_END; ++i)
+    {
+      RAW_MAP[i] = df[i].dat;
+      RAW_MAP_NUMBER++;
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+read_back_dat (DATAFILE * df)
+{
+  int i, x, y;
+
+  BACK_PALETTE = df[1].dat;
+  BACK_IMAGE = df[0].dat;
+
+  /*
+   * strange, with Allegro 4.0, the liquidwarcol utility
+   * and the datafile compiler do not work so well together,
+   * and so the palette stored in the datafile always
+   * start at color 0, which explains the "18 shift"
+   */
+
+  for (i = 0; i <= 45; ++i)
+    GLOBAL_PALETTE[i + 18] = BACK_PALETTE[i];
+
+  for (x = 0; x < BACK_IMAGE->w; ++x)
+    for (y = 0; y < BACK_IMAGE->w; ++y)
+      {
+	putpixel (BACK_IMAGE, x, y, getpixel (BACK_IMAGE, x, y) + 18);
+      }
+}
+
+/*------------------------------------------------------------------*/
+static void
+create_default_back (void)
+{
+  static RGB back_coul;
+
+  memset (&back_coul, 0, sizeof (RGB));
+  back_coul.r = 1;
+  back_coul.g = 1;
+  back_coul.b = 8;
+
+  BACK_IMAGE = my_create_bitmap (1, 1);
+  putpixel (BACK_IMAGE, 0, 0, 18);
+  GLOBAL_PALETTE[18] = back_coul;
+}
+
+/*------------------------------------------------------------------*/
+static void
+read_font_dat (DATAFILE * df)
+{
+  int i;
+
+  FONT_PALETTE = df[4].dat;
+  SMALL_FONT = df[0].dat;
+  BIG_FONT = df[1].dat;
+  SMALL_MOUSE_CURSOR = df[2].dat;
+  BIG_MOUSE_CURSOR = df[3].dat;
+  INVISIBLE_MOUSE_CURSOR = df[5].dat;
+
+  for (i = 1; i <= 17; ++i)
+    GLOBAL_PALETTE[i] = FONT_PALETTE[i];
+}
+
+/*------------------------------------------------------------------*/
+static void
+read_music_dat (DATAFILE * df)
+{
+  int i;
+
+  MIDI_MUSIC_NUMBER = 0;
+  for (i = 0; i < MIDI_MUSIC_DAT_NUMBER && df[i].type != DAT_END; ++i)
+    {
+      MIDI_MUSIC[i] = df[i].dat;
+      MIDI_MUSIC_NUMBER++;
+    }
+}
+
+/*------------------------------------------------------------------*/
+int
+load_dat (void)
+{
+  int result = 1;
+  int loadable;
+  DATAFILE *df;
+
+  log_print_str ("Loading data from \"");
+  log_print_str (STARTUP_DAT_PATH);
+  log_print_str ("\"");
+
+#ifdef DOS
+  loadable = 1;
+#else
+  loadable = exists (STARTUP_DAT_PATH);
+#endif
+
+  display_success (loadable);
+
+  if (loadable)
+    {
+      log_print_str ("Loading fonts");
+      log_flush ();
+      df = load_datafile_object (STARTUP_DAT_PATH, "font_dat");
+      if (result &= (df != NULL))
+	read_font_dat (df[0].dat);
+      display_success (df != NULL);
+    }
+  if (loadable)
+    {
+      log_print_str ("Loading maps");
+      log_flush ();
+      df = load_datafile_object (STARTUP_DAT_PATH, "map_dat");
+      if (result &= (df != NULL))
+	read_map_dat (df[0].dat);
+      display_success (df != NULL);
+    }
+
+  if (loadable && STARTUP_BACK_STATE)
+    {
+      log_print_str ("Loading background bitmap");
+      log_flush ();
+      df = load_datafile_object (STARTUP_DAT_PATH, "back_dat");
+      if (df != NULL)
+	{
+	  read_back_dat (df[0].dat);
+	  LOADED_BACK = 1;
+	}
+      else
+	{
+	  create_default_back ();
+	  result &= !STARTUP_CHECK;
+	}
+      display_success (df != NULL);
+    }
+  else
+    create_default_back ();
+  if (loadable && STARTUP_SFX_STATE)
+    {
+      log_print_str ("Loading sound fx");
+      log_flush ();
+      df = load_datafile_object (STARTUP_DAT_PATH, "sfx_dat");
+      if (df != NULL)
+	{
+	  read_sfx_dat (df[0].dat);
+	  LOADED_SFX = 1;
+	}
+      else
+	result &= !STARTUP_CHECK;
+      display_success (df != NULL);
+    }
+  if (loadable && STARTUP_TEXTURE_STATE)
+    {
+      log_print_str ("Loading textures");
+      log_flush ();
+      df = load_datafile_object (STARTUP_DAT_PATH, "texture_dat");
+      if (df != NULL)
+	{
+	  read_texture_dat (df[0].dat);
+	  LOADED_TEXTURE = 1;
+	}
+      else
+	result &= !STARTUP_CHECK;
+      display_success (df != NULL);
+
+      log_print_str ("Loading map textures");
+      log_flush ();
+      df = load_datafile_object (STARTUP_DAT_PATH, "maptex_dat");
+      if (df != NULL)
+	{
+	  read_maptex_dat (df[0].dat);
+	  LOADED_MAPTEX = 1;
+	}
+      else
+	result &= !STARTUP_CHECK;
+      display_success (df != NULL);
+    }
+
+  if (loadable && STARTUP_WATER_STATE)
+    {
+      log_print_str ("Loading water sounds");
+      log_flush ();
+      df = load_datafile_object (STARTUP_DAT_PATH, "water_dat");
+      if (df != NULL)
+	{
+	  read_water_dat (df[0].dat);
+	  LOADED_WATER = 1;
+	}
+      else
+	result &= !STARTUP_CHECK;
+      display_success (df != NULL);
+    }
+
+  if (loadable && STARTUP_MUSIC_STATE)
+    {
+      log_print_str ("Loading midi music");
+      log_flush ();
+      df = load_datafile_object (STARTUP_DAT_PATH, "music_dat");
+      if (df != NULL)
+	{
+	  read_music_dat (df[0].dat);
+	  LOADED_MUSIC = 1;
+	}
+      else
+	result &= !STARTUP_CHECK;
+      display_success (df != NULL);
+    }
+
+  return loadable && result;
+}
+
+/*------------------------------------------------------------------*/
+static int
+load_custom_texture_callback (const char *file, int mode, void *unused)
+{
+  void *pointeur;
+
+  LW_MACRO_NOP (mode);
+  LW_MACRO_NOP (unused);
+
+  if ((pointeur = lw_texture_archive_raw (file)) != NULL)
+    {
+      RAW_TEXTURE[RAW_TEXTURE_NUMBER++] = pointeur;
+      log_print_str ("+");
+      CUSTOM_TEXTURE_OK = 1;
+    }
+  else
+    {
+      log_print_str ("-");
+    }
+  log_flush ();
+
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+static int
+load_custom_texture (void)
+{
+  int result = 1;
+  char buf[512];
+
+  LW_MACRO_SPRINTF1 (buf, "%s\\*.*", STARTUP_TEX_PATH);
+
+  fix_filename_case (buf);
+  fix_filename_slashes (buf);
+
+  CUSTOM_TEXTURE_OK = 0;
+  for_each_file_ex (buf, 0, FA_DIREC, load_custom_texture_callback, NULL);
+  result = CUSTOM_TEXTURE_OK;
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+static int
+load_custom_map_callback (const char *file, int mode, void *unused)
+{
+  void *pointeur;
+
+  LW_MACRO_NOP (mode);
+  LW_MACRO_NOP (unused);
+
+  if ((pointeur = lw_map_archive_raw (file)) != NULL)
+    {
+      RAW_MAP[RAW_MAP_NUMBER++] = pointeur;
+      log_print_str ("+");
+      CUSTOM_MAP_OK = 1;
+    }
+  else
+    {
+      log_print_str ("-");
+    }
+
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+static int
+load_custom_map (void)
+{
+  int result = 1;
+  char buf[512];
+
+  LW_MACRO_SPRINTF1 (buf, "%s\\*.*", STARTUP_MAP_PATH);
+
+  fix_filename_case (buf);
+  fix_filename_slashes (buf);
+
+  CUSTOM_MAP_OK = 0;
+  for_each_file_ex (buf, 0, FA_DIREC, load_custom_map_callback, NULL);
+  result = CUSTOM_MAP_OK;
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+static int
+load_custom_music_callback (const char *file, int mode, void *unused)
+{
+  void *pointeur;
+
+  LW_MACRO_NOP (mode);
+  LW_MACRO_NOP (unused);
+
+  if ((pointeur = load_midi (file)) != NULL)
+    {
+      MIDI_MUSIC[MIDI_MUSIC_NUMBER++] = pointeur;
+      log_print_str ("+");
+      CUSTOM_MUSIC_OK = 1;
+    }
+  else
+    {
+      log_print_str ("-");
+    }
+  log_flush ();
+
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+static int
+load_custom_music (void)
+{
+  int result = 1;
+  char buf[512];
+
+  LW_MACRO_SPRINTF1 (buf, "%s\\*.*", STARTUP_MID_PATH);
+
+  fix_filename_case (buf);
+  fix_filename_slashes (buf);
+
+  CUSTOM_MUSIC_OK = 0;
+  for_each_file_ex (buf, 0, FA_DIREC, load_custom_music_callback, NULL);
+  result = CUSTOM_MUSIC_OK;
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+load_custom (void)
+{
+  int success, result = 1;
+
+  if (STARTUP_TEXTURE_STATE && STARTUP_CUSTOM_STATE)
+    {
+      log_print_str ("Loading custom textures from \"");
+      log_print_str (STARTUP_TEX_PATH);
+      log_print_str ("\" ");
+      log_flush ();
+      success = load_custom_texture ();
+      if (!success)
+	result &= !STARTUP_CHECK;
+      display_success (success);
+    }
+
+  if (STARTUP_CUSTOM_STATE)
+    {
+      log_print_str ("Loading custom maps from \"");
+      log_print_str (STARTUP_MAP_PATH);
+      log_print_str ("\" ");
+      log_flush ();
+      success = load_custom_map ();
+      if (!success)
+	result &= !STARTUP_CHECK;
+      display_success (success);
+    }
+
+  if (STARTUP_CUSTOM_STATE && STARTUP_MUSIC_STATE)
+    {
+      log_print_str ("Loading custom musics from \"");
+      log_print_str (STARTUP_MID_PATH);
+      log_print_str ("\" ");
+      log_flush ();
+      success = load_custom_music ();
+      if (!success)
+	result &= !STARTUP_CHECK;
+      display_success (success);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+void
+order_map (void)
+{
+  int incorrect_order = 1;
+  int i;
+
+
+  char name1[LW_MAP_READABLE_NAME_SIZE + 1];
+  char name2[LW_MAP_READABLE_NAME_SIZE + 1];
+  void *temp;
+
+  for (i = 0; i < RAW_MAP_NUMBER; ++i)
+    {
+      RAW_MAP_ORDERED[i] = RAW_MAP[i];
+    }
+
+  while (incorrect_order)
+    {
+      incorrect_order = 0;
+
+      for (i = 0; i < RAW_MAP_NUMBER - 1; ++i)
+	{
+	  LW_MACRO_STRCPY (name1, lw_map_get_readable_name (i, 0, 0));
+	  LW_MACRO_STRCPY (name2, lw_map_get_readable_name (i + 1, 0, 0));
+	  if (strcmp (name1, name2) > 0)
+	    {
+	      incorrect_order = 1;
+
+	      temp = RAW_MAP_ORDERED[i];
+	      RAW_MAP_ORDERED[i] = RAW_MAP_ORDERED[i + 1];
+	      RAW_MAP_ORDERED[i + 1] = temp;
+	    }
+	}
+    }
+}

Added: unstable/liquidwar/branches/upstream/current/src/disk.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/disk.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/disk.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,122 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : disk.h                                           */
+/* contenu       : chargement des donnees du fichier .dat           */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_DISK
+#define LIQUID_WAR_INCLUDE_DISK
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+#define SAMPLE_WATER_MAX_NUMBER  32
+#define SAMPLE_WATER_DAT_NUMBER  32
+
+#define RAW_MAP_MAX_NUMBER     1024
+#define RAW_MAP_DAT_NUMBER      512
+
+#define RAW_TEXTURE_MAX_NUMBER 1024
+#define RAW_TEXTURE_DAT_NUMBER  512
+
+#define MIDI_MUSIC_MAX_NUMBER   256
+#define MIDI_MUSIC_DAT_NUMBER   128
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+extern int SAMPLE_WATER_NUMBER;
+extern int RAW_TEXTURE_NUMBER;
+extern int RAW_MAPTEX_NUMBER;
+extern int RAW_MAP_NUMBER;
+extern int MIDI_MUSIC_NUMBER;
+
+extern int LOADED_BACK;
+extern int LOADED_TEXTURE;
+extern int LOADED_MAPTEX;
+extern int LOADED_SFX;
+extern int LOADED_WATER;
+
+extern SAMPLE *SAMPLE_SFX_TIME;
+extern SAMPLE *SAMPLE_SFX_WIN;
+extern SAMPLE *SAMPLE_SFX_GO;
+extern SAMPLE *SAMPLE_SFX_CLICK;
+extern SAMPLE *SAMPLE_SFX_LOOSE;
+extern SAMPLE *SAMPLE_SFX_CONNECT;
+
+extern SAMPLE *SAMPLE_WATER[SAMPLE_WATER_MAX_NUMBER];
+extern void *RAW_MAP[RAW_MAP_MAX_NUMBER];
+extern void *RAW_MAP_ORDERED[RAW_MAP_MAX_NUMBER];
+extern void *RAW_TEXTURE[RAW_TEXTURE_MAX_NUMBER];
+extern void *RAW_MAPTEX[RAW_TEXTURE_MAX_NUMBER];
+extern MIDI *MIDI_MUSIC[MIDI_MUSIC_MAX_NUMBER];
+
+extern BITMAP *BACK_IMAGE;
+
+extern FONT *BIG_FONT;
+extern FONT *SMALL_FONT;
+extern BITMAP *BIG_MOUSE_CURSOR;
+extern BITMAP *SMALL_MOUSE_CURSOR;
+extern BITMAP *INVISIBLE_MOUSE_CURSOR;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int load_dat (void);
+int load_custom (void);
+void order_map (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/disp.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/disp.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/disp.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,120 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : disp.c                                           */
+/* contenu       : affichage de l'aire de jeu                       */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "area.h"
+#include "config.h"
+#include "disp.h"
+#include "grad.h"
+#include "viewport.h"
+#include "wave.h"
+#include "distor.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static void
+disp_stretch_area (void)
+{
+  stretch_blit (CURRENT_AREA_DISP, NEXT_SCREEN, 0, 0,
+		CURRENT_AREA_W, CURRENT_AREA_H,
+		0, 0, NEXT_SCREEN->w, NEXT_SCREEN->h);
+}
+
+/*------------------------------------------------------------------*/
+void
+display_area (void)
+{
+  if ((CONFIG_WAVE_AMPLI[0]
+       || CONFIG_WAVE_AMPLI[1]
+       || CONFIG_WAVE_AMPLI[2] || CONFIG_WAVE_AMPLI[3]) && CONFIG_WAVE_ON)
+    disp_distorted_area ();
+  else
+    disp_stretch_area ();
+}
+
+/*------------------------------------------------------------------*/
+void
+display_gradient (int i)
+{
+  BITMAP *bmp;
+
+  bmp = create_gradient_bitmap (i);
+  if (bmp)
+    {
+      stretch_blit (bmp, NEXT_SCREEN, 0, 0, bmp->w, bmp->h,
+		    0, 0, NEXT_SCREEN->w, NEXT_SCREEN->h);
+      destroy_bitmap (bmp);
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+display_mesh (int i)
+{
+  BITMAP *bmp;
+
+  bmp = create_mesh_bitmap (i);
+  if (bmp)
+    {
+      stretch_blit (bmp, NEXT_SCREEN, 0, 0, bmp->w, bmp->h,
+		    0, 0, NEXT_SCREEN->w, NEXT_SCREEN->h);
+      destroy_bitmap (bmp);
+    }
+}

Added: unstable/liquidwar/branches/upstream/current/src/disp.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/disp.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/disp.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,66 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : disp.h                                           */
+/* contenu       : affichage de l'aire de jeu                       */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_DISP
+#define LIQUID_WAR_INCLUDE_DISP
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void display_area (void);
+void display_gradient (int i);
+void display_mesh (int i);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/distor.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/distor.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/distor.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,394 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : distor.c                                         */
+/* contenu       : affichage avec des effets de vague               */
+/* date de modif : 31 Juillet 99                                    */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "alleg2.h"
+#include "area.h"
+#include "config.h"
+#include "distor.h"
+#include "gfxmode.h"
+#include "glouglou.h"
+#include "profile.h"
+#include "startup.h"
+#include "time.h"
+#include "viewport.h"
+#include "log.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#define PI_1024 3217
+
+#define DISTORSION_PRECISION 4096
+#define WAVE_SIZE_SCALE 4
+#define DISTORSION_MAX 10
+#define WAVE_MIN_LENGTH 64
+
+static int DISTORSION_W;
+static int DISTORSION_H;
+
+static BITMAP *DISTORSION_TARGET = NULL;
+
+static int WAVE_SHAPE_WX[MAX_W_DISPLAY];
+static int WAVE_SHAPE_WY[DISTORSION_MAX + 2][MAX_W_DISPLAY];
+
+static int *WAVE_SHAPE_X_CORRES[MAX_W_DISPLAY];
+
+static int WAVE_SHAPE_HY[MAX_H_DISPLAY];
+static int WAVE_SHAPE_HX[DISTORSION_MAX + 2][MAX_H_DISPLAY];
+
+static int *WAVE_SHAPE_Y_CORRES[MAX_H_DISPLAY];
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static void
+init_distorsion_target (void)
+{
+  if (DISTORSION_TARGET == NULL)
+    {
+      DISTORSION_TARGET = my_create_bitmap (NEXT_SCREEN->w, NEXT_SCREEN->h);
+    }
+  else
+    {
+      if (DISTORSION_TARGET->w != NEXT_SCREEN->w ||
+	  DISTORSION_TARGET->h != NEXT_SCREEN->h)
+	{
+	  destroy_bitmap (DISTORSION_TARGET);
+	  DISTORSION_TARGET = my_create_bitmap (NEXT_SCREEN->w,
+						NEXT_SCREEN->h);
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+init_distorsion_displayer (void)
+{
+  int x, y, w, h;
+
+  init_distorsion_target ();
+
+  w = DISTORSION_TARGET->w;
+  h = DISTORSION_TARGET->h;
+
+  DISTORSION_W = (CONFIG_WAVE_AMPLI[0] + CONFIG_WAVE_AMPLI[3])
+    / WAVE_SIZE_SCALE + 1;
+  DISTORSION_H = (CONFIG_WAVE_AMPLI[1] + CONFIG_WAVE_AMPLI[2])
+    / WAVE_SIZE_SCALE + 1;
+
+  for (x = 0; x < DISTORSION_W + 1; ++x)
+    WAVE_SHAPE_X_CORRES[x] = WAVE_SHAPE_HX[x];
+
+  for (x = DISTORSION_W; x < w - DISTORSION_W - 2; ++x)
+    WAVE_SHAPE_X_CORRES[x] = WAVE_SHAPE_HX[DISTORSION_W + 1];
+
+  for (x = w - DISTORSION_W - 2; x < w - 1; ++x)
+    WAVE_SHAPE_X_CORRES[x] = WAVE_SHAPE_HX[w - x - 2];
+
+  WAVE_SHAPE_X_CORRES[w - 1] = WAVE_SHAPE_HX[0];
+
+  for (y = 0; y < DISTORSION_H + 1; ++y)
+    WAVE_SHAPE_Y_CORRES[y] = WAVE_SHAPE_WY[y];
+
+  for (y = DISTORSION_H; y < h - DISTORSION_H - 2; ++y)
+    WAVE_SHAPE_Y_CORRES[y] = WAVE_SHAPE_WY[DISTORSION_H + 1];
+
+  for (y = h - DISTORSION_H - 2; y < h - 1; ++y)
+    WAVE_SHAPE_Y_CORRES[y] = WAVE_SHAPE_WY[h - y - 2];
+
+  WAVE_SHAPE_Y_CORRES[h - 1] = WAVE_SHAPE_WY[0];
+}
+
+
+/*------------------------------------------------------------------*/
+static void
+create_wave_line (int *buffer,
+		  int length, int number, int ampli, int speed, int sens)
+{
+  int i, period, period2, cycle_tmp;
+  int ampli_cst, ampli_cos, freq_coef, cycle_coef;
+  int f0, fp0x0, alphax03, betax02;
+  int temp;
+  int first_entry, last_entry, real_length;
+  int *buffer2;
+
+  length--;
+  do
+    {
+      period = length / (number + 1);
+      number--;
+    }
+  while (number >= 0 && period < WAVE_MIN_LENGTH);
+
+  period2 = period / 2;
+  if (period2 <= 0)
+    {
+      period2 = 1;
+    }
+  period = period2 * 2;
+  real_length = period * (number + 1);
+  first_entry = (length - real_length) / 2;
+  last_entry = first_entry + real_length;
+  buffer2 = buffer + first_entry;
+
+  freq_coef = 16777216 / period;
+  ampli_cst = (ampli * DISTORSION_PRECISION) / period2;
+  ampli_cos = (ampli_cst * PI_1024) / 1024;
+  cycle_tmp = 65536;
+  while (speed > 0)
+    {
+      cycle_tmp /= 2;
+      speed--;
+    }
+  cycle_tmp = fsqrt (fsqrt (cycle_tmp)) / 2;
+  cycle_tmp /= SCREEN_W;
+  cycle_tmp *= period;
+  if (cycle_tmp <= 0)
+    {
+      cycle_tmp = 1;
+    }
+  cycle_coef = sens * 256 * (itofix (GLOBAL_TICKER % cycle_tmp) / cycle_tmp);
+
+  f0 = fsin (cycle_coef + freq_coef * period2);
+  fp0x0 = (PI_1024 * fcos (cycle_coef + freq_coef * period2)) / 1024;
+
+  alphax03 = (ampli_cst / 256) * ((fp0x0 - 2 * f0) / 256);
+  betax02 = (ampli_cst / 256) * ((-fp0x0 + 3 * f0) / 256);
+
+  for (i = 0; i < period2; ++i)
+    {
+      temp = (3 * alphax03 * i) / period2 + 2 * betax02;
+      temp = (temp * i) / period2;
+      buffer2[i] = temp / WAVE_SIZE_SCALE;
+    }
+  for (i = period2; i < real_length - period2; ++i)
+    {
+      temp = ((ampli_cos) / 256) * (fcos (cycle_coef + freq_coef * i) / 256);
+      buffer2[i] = temp / WAVE_SIZE_SCALE;
+    }
+
+  alphax03 = (ampli_cst / 256) * ((-fp0x0 - 2 * f0) / 256);
+  betax02 = (ampli_cst / 256) * ((fp0x0 + 3 * f0) / 256);
+
+  for (i = 0; i < period2; ++i)
+    {
+      temp = (3 * alphax03 * i) / period2 + 2 * betax02;
+      temp = (-temp * i) / period2;
+      buffer2[real_length - 1 - i] = temp / WAVE_SIZE_SCALE;
+    }
+
+  for (i = 0; i < first_entry; ++i)
+    buffer[i] = 0;
+  for (i = last_entry; i < length; ++i)
+    buffer[i] = 0;
+  buffer[length] = 0;
+}
+
+/*------------------------------------------------------------------*/
+void
+prepare_wave_shapes (void)
+{
+  int w, h, x, y, i;
+
+  w = DISTORSION_TARGET->w;
+  h = DISTORSION_TARGET->h;
+
+  create_wave_line (WAVE_SHAPE_WX, w,
+		    CONFIG_WAVE_NUMBER[0],
+		    CONFIG_WAVE_AMPLI[0] * CURRENT_AREA_W,
+		    CONFIG_WAVE_SPEED[0], +1);
+  create_wave_line (WAVE_SHAPE_HY, h,
+		    CONFIG_WAVE_NUMBER[1],
+		    CONFIG_WAVE_AMPLI[1] * CURRENT_AREA_H,
+		    CONFIG_WAVE_SPEED[1], +1);
+
+  create_wave_line (WAVE_SHAPE_WY[DISTORSION_H + 1], w,
+		    CONFIG_WAVE_NUMBER[2],
+		    CONFIG_WAVE_AMPLI[2] * CURRENT_AREA_H,
+		    CONFIG_WAVE_SPEED[2], +1);
+  create_wave_line (WAVE_SHAPE_HX[DISTORSION_W + 1], h,
+		    CONFIG_WAVE_NUMBER[3],
+		    CONFIG_WAVE_AMPLI[3] * CURRENT_AREA_W,
+		    CONFIG_WAVE_SPEED[3], +1);
+
+  for (x = 0; x < w; ++x)
+    {
+      WAVE_SHAPE_WX[x] += CURRENT_AREA_W * DISTORSION_PRECISION;
+      WAVE_SHAPE_WY[0][x] = 0;
+      WAVE_SHAPE_WY[1][x] = WAVE_SHAPE_WY[DISTORSION_H + 1][x] / DISTORSION_H;
+      for (i = 1; i < DISTORSION_H; ++i)
+	WAVE_SHAPE_WY[i + 1][x] = WAVE_SHAPE_WY[i][x] + WAVE_SHAPE_WY[1][x];
+    }
+
+  for (y = 0; y < h; ++y)
+    {
+      WAVE_SHAPE_HY[y] += CURRENT_AREA_H * DISTORSION_PRECISION;
+      WAVE_SHAPE_HX[0][y] = 0;
+      WAVE_SHAPE_HX[1][y] = WAVE_SHAPE_HX[DISTORSION_W + 1][y] / DISTORSION_W;
+      for (i = 1; i < DISTORSION_W; ++i)
+	WAVE_SHAPE_HX[i + 1][y] = WAVE_SHAPE_HX[i][y] + WAVE_SHAPE_HX[1][y];
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+disp_distorted_area (void)
+{
+  char *src;
+  int x, y, w, h, lim_w, lim_h, init_w, init_h;
+  int *y_corres;
+  int fp_x, ip_x, fp_y, ip_y, fp_y0, ip_y0;
+  int fp_x0[MAX_W_DISPLAY];
+  int reste_x;
+  int temp = 0;
+  int bmp_color_depth;
+  int bmp_linear;
+  int bmp_memory;
+
+  bmp_color_depth = bitmap_color_depth (DISTORSION_TARGET);
+  bmp_linear = is_linear_bitmap (DISTORSION_TARGET);
+  bmp_memory = is_memory_bitmap (DISTORSION_TARGET);
+
+  w = DISTORSION_TARGET->w;
+  h = DISTORSION_TARGET->h;
+  lim_w = DISTORSION_PRECISION * w;
+  lim_h = DISTORSION_PRECISION * h;
+  init_w = (CURRENT_AREA_W * DISTORSION_PRECISION) / 2;
+  init_h = (CURRENT_AREA_H * DISTORSION_PRECISION) / 2;
+
+  prepare_wave_shapes ();
+  for (x = 0; x < w; ++x)
+    fp_x0[x] = 0;
+
+  fp_y0 = init_h;
+  ip_y0 = 0;
+  for (y = 0; y < h; ++y)
+    {
+      fp_y = fp_y0;
+      ip_y = ip_y0;
+      fp_x = init_w;
+      ip_x = 0;
+      src = (char *) CURRENT_AREA_DISP->dat + ip_y0 * CURRENT_AREA_W;
+      y_corres = WAVE_SHAPE_Y_CORRES[y];
+
+#ifdef ASM
+      /*
+       * draw_distor_line works on memory 8-bit bitmaps only
+       */
+      if (STARTUP_ASM && bmp_memory && bmp_color_depth == 8)
+	{
+	  draw_distor_line (DISTORSION_TARGET,
+			    CURRENT_AREA_W,
+			    w,
+			    y,
+			    fp_x,
+			    ip_x,
+			    fp_y,
+			    ip_y,
+			    lim_w,
+			    lim_h,
+			    fp_x0,
+			    y_corres,
+			    WAVE_SHAPE_WX,
+			    WAVE_SHAPE_X_CORRES,
+			    src, temp, temp, temp, temp, temp);
+	}
+      else
+#else
+      temp = 0;
+#endif
+      for (x = 0; x < w; ++x)
+	{
+	  putpixel (DISTORSION_TARGET, x, y, *src);
+
+	  reste_x = fp_x0[x] += WAVE_SHAPE_X_CORRES[x][y];
+	  fp_x += WAVE_SHAPE_WX[x];
+	  while (reste_x < -fp_x)
+	    {
+	      fp_x += lim_w;
+	      src--;
+	    }
+	  while (reste_x + fp_x >= lim_w)
+	    {
+	      fp_x -= lim_w;
+	      src++;
+	    }
+
+	  fp_y += y_corres[x];
+	  while (fp_y < 0)
+	    {
+	      fp_y += lim_h;
+	      src -= CURRENT_AREA_W;
+	    }
+	  while (fp_y >= lim_h)
+	    {
+	      fp_y -= lim_h;
+	      src += CURRENT_AREA_W;
+	    }
+	}
+
+      fp_y0 += WAVE_SHAPE_HY[y];
+      while (fp_y0 >= lim_h)
+	{
+	  fp_y0 -= lim_h;
+	  ip_y0++;
+	}
+    }
+
+  blit (DISTORSION_TARGET, NEXT_SCREEN, 0, 0, 0, 0,
+	DISTORSION_TARGET->w, DISTORSION_TARGET->h);
+}

Added: unstable/liquidwar/branches/upstream/current/src/distor.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/distor.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/distor.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,68 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : distor.h                                         */
+/* contenu       : affichage avec des effets de vague               */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_DISTOR
+#define LIQUID_WAR_INCLUDE_DISTOR
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void init_distorsion_displayer (void);
+void prepare_wave_shapes (void);
+void disp_distorted_area (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/dnsutil.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/dnsutil.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/dnsutil.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,110 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : dnsutil.c                                        */
+/* content       : low level functions to handle dns requests       */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#ifdef WIN32
+#include <winsock.h>
+#endif
+#ifdef UNIX
+#include <sys/types.h>
+#include <netdb.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#endif
+#include <string.h>
+#include <stdio.h>
+
+#include "dnsutil.h"
+#include "log.h"
+#include "sockgen.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+/*==================================================================*/
+/* static functions                                                 */
+/*==================================================================*/
+
+/*==================================================================*/
+/* global functions                                                 */
+/*==================================================================*/
+
+int
+lw_dnsutil_name_to_ip (char *ip, char *name)
+{
+  int result = 0;
+#ifdef DOS
+  memset (ip, 0, LW_SOCK_IP_SIZE);
+#else
+  struct hostent *h;
+  struct in_addr addr;
+
+  memset (ip, 0, LW_SOCK_IP_SIZE);
+  h = gethostbyname (name);
+  if (h && h->h_addrtype == AF_INET && h->h_length >= 4 && h->h_addr_list[0])
+    {
+#ifdef UNIX
+      addr = *((struct in_addr *) (h->h_addr_list[0]));
+#else
+      addr.s_addr = *((u_long *) (h->h_addr_list[0]));
+#endif
+
+      strncpy (ip, inet_ntoa (addr), LW_SOCK_IP_SIZE - 1);
+      ip[LW_SOCK_IP_SIZE - 1] = '\0';
+
+      result = 1;
+    }
+#endif
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/dnsutil.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/dnsutil.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/dnsutil.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,67 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : dnsutil.h                                        */
+/* content       : low level functions to handle dns requests       */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_DNSUTIL
+#define LIQUID_WAR_INCLUDE_DNSUTIL
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int lw_dnsutil_name_to_ip (char *ip, char *name);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/error.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/error.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/error.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,210 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : error.c                                          */
+/* contenu       : messages d'erreur pendant le jeu                 */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+
+#include "dialog.h"
+#include "error.h"
+#include "help.h"
+#include "base.h"
+#include "lang.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static int
+return_d_close (void)
+{
+  return (D_CLOSE);
+}
+
+/*------------------------------------------------------------------*/
+static int
+standard_error (char *str)
+{
+  DIALOG d[3];
+
+  memset (d, 0, sizeof (d));
+
+  color_one_dialog (d);
+  d[0].proc = my_textbox_proc;
+  d[0].d2 = 0;
+  d[0].dp = str;
+  d[0].key = 0;
+  d[0].flags = 0;
+  d[0].x = MENU_VIRTUAL_W / 4;
+  d[0].y = (3 * MENU_VIRTUAL_H) / 8;
+  d[0].w = (MENU_VIRTUAL_W) / 2;
+  d[0].h = (MENU_VIRTUAL_H) / 4;
+  menu_real_coord (d);
+
+  d[1].proc = d_keyboard_proc;
+  d[1].dp = return_d_close;
+  d[1].key = ' ';
+  d[1].d1 = KEY_ENTER;
+  d[1].d2 = KEY_ESC;
+
+  d[2].proc = NULL;
+
+  my_do_dialog (d, 0);
+
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+int
+error_not_enough_teams (void)
+{
+  return (standard_error (lw_lang_string
+			  (LW_LANG_STRING_ERROR_NOTENOUGHTEAMS)));
+}
+
+/*------------------------------------------------------------------*/
+int
+error_not_enough_big_data (void)
+{
+  return (standard_error (lw_lang_string
+			  (LW_LANG_STRING_ERROR_NOTENOUGHBIGDATA)));
+}
+
+/*------------------------------------------------------------------*/
+int
+error_graphics_init_failed (void)
+{
+  return (standard_error (lw_lang_string
+			  (LW_LANG_STRING_ERROR_GRAPHICSINITFAILED)));
+}
+
+/*------------------------------------------------------------------*/
+int
+error_no_network_support (void)
+{
+  return (standard_error (lw_lang_string
+			  (LW_LANG_STRING_ERROR_NONETWORKSUPPORT)));
+}
+
+/*------------------------------------------------------------------*/
+int
+error_unable_to_connect (void)
+{
+  return (standard_error (lw_lang_string
+			  (LW_LANG_STRING_ERROR_UNABLETOCONNECT)));
+}
+
+/*------------------------------------------------------------------*/
+int
+error_not_a_liquidwar_server (void)
+{
+  return (standard_error (lw_lang_string
+			  (LW_LANG_STRING_ERROR_NOTALIQUIDWARSERVER)));
+}
+
+/*------------------------------------------------------------------*/
+int
+error_wrong_version (void)
+{
+  return (standard_error (lw_lang_string
+			  (LW_LANG_STRING_ERROR_WRONGVERSION)));
+}
+
+/*------------------------------------------------------------------*/
+int
+error_network_problem (void)
+{
+  return (standard_error (lw_lang_string
+			  (LW_LANG_STRING_ERROR_NETWORKPROBLEM)));
+}
+
+/*------------------------------------------------------------------*/
+int
+error_cant_send_map (void)
+{
+  return (standard_error (lw_lang_string (LW_LANG_STRING_ERROR_CANTSENDMAP)));
+}
+
+/*------------------------------------------------------------------*/
+int
+error_cant_receive_map (void)
+{
+  return (standard_error (lw_lang_string
+			  (LW_LANG_STRING_ERROR_CANTRECEIVEMAP)));
+}
+
+/*------------------------------------------------------------------*/
+int
+error_server_full (void)
+{
+  return (standard_error (lw_lang_string (LW_LANG_STRING_ERROR_SERVERFULL)));
+}
+
+/*------------------------------------------------------------------*/
+int
+error_bad_password (void)
+{
+  return (standard_error (lw_lang_string (LW_LANG_STRING_ERROR_BADPASSWORD)));
+}
+
+/*------------------------------------------------------------------*/
+int
+error_bad_config_range (void)
+{
+  return (standard_error (lw_lang_string
+			  (LW_LANG_STRING_ERROR_BADCONFIGRANGE)));
+}

Added: unstable/liquidwar/branches/upstream/current/src/error.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/error.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/error.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,80 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : error.h                                          */
+/* contenu       : messages d'erreur pendant le jeu                 */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_ERROR
+#define LIQUID_WAR_INCLUDE_ERROR
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int error_not_enough_teams (void);
+int error_not_enough_big_data (void);
+int error_graphics_init_failed (void);
+int error_no_network_support (void);
+int error_unable_to_connect (void);
+int error_not_a_liquidwar_server (void);
+int error_wrong_version (void);
+int error_network_problem (void);
+int error_cant_send_map (void);
+int error_cant_receive_map (void);
+int error_server_full (void);
+int error_bad_password (void);
+int error_bad_config_range (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/exec2.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/exec2.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/exec2.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,112 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : random.c                                         */
+/* content       : wrapper for the functions in ../utils/lwmpagen/  */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#ifdef WIN32
+#include <windows.h>
+#include <process.h>
+#endif
+
+#include <stdlib.h>
+
+#include "exec2.h"
+
+/*------------------------------------------------------------------*/
+/*
+ * Launches an external program "a la" system(). Point is system() is
+ * unuseable under Windows, for the console pops on the screen...
+ */
+int
+lw_exec2_run (char *file, char *commandline)
+{
+  int result = 0;
+
+  /*
+   * Dummy code to get rid of warnings...
+   */
+  file = file;
+  commandline = commandline;
+
+#ifdef UNIX
+  {
+    int exit_code;
+
+    exit_code = system (commandline);
+    result = (exit_code == EXIT_SUCCESS);
+  }
+#endif
+
+#ifdef WIN32
+  {
+    STARTUPINFO startupinfo;
+    PROCESS_INFORMATION process_information;
+    memset (&startupinfo, 0, sizeof (STARTUPINFO));
+    memset (&process_information, 0, sizeof (PROCESS_INFORMATION));
+    startupinfo.cb = sizeof (STARTUPINFO);
+    startupinfo.dwFlags = STARTF_USESHOWWINDOW;
+    startupinfo.wShowWindow = SW_HIDE;
+    result = CreateProcess (file,	// lpApplicationName
+			    commandline,	// lpCommandLine
+			    NULL,	// lpProcessAttributes
+			    NULL,	// lpThreadAttributes
+			    FALSE,	// bInheritHandles
+			    CREATE_NO_WINDOW,	// dwCreationFlags
+			    NULL,	// lpEnvironment
+			    NULL,	// lpCurrentDirectory
+			    &startupinfo,	// lpStartupInfo
+			    &process_information	// lpProcessInformation
+      );
+  }
+#endif
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/exec2.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/exec2.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/exec2.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,75 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : exec2.h                                          */
+/* content       : code to launch external programs                 */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_EXEC2
+#define LIQUID_WAR_INCLUDE_EXEC2
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int lw_exec2_run (char *file, char *commandline);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/execgen.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/execgen.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/execgen.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,71 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : execgen.h                                        */
+/* content       : code used to launch external programs            */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_EXEC
+#define LIQUID_WAR_INCLUDE_EXEC
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int lw_exec_cmd (char *cmd);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/execunix.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/execunix.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/execunix.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,130 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : execunix.c                                       */
+/* content       : code used to launch external programs under UNIX */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "execgen.h"
+#include "log.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_EXECUNIX_SHELL_CMD  "/bin/sh"
+#define LW_EXECUNIX_SHELL_ARG1 "-c"
+#define LW_EXEC_ERROR_SIZE 1000
+
+/*==================================================================*/
+/* static functions                                                 */
+/*==================================================================*/
+
+/*==================================================================*/
+/* global functions                                                 */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Launches a command line in another process.
+ */
+int
+lw_exec_cmd (char *cmd)
+{
+  int result = 0;
+  pid_t pid;
+  char error_str[LW_EXEC_ERROR_SIZE];
+
+  pid = fork ();
+
+  switch (pid)
+    {
+    case 0:
+      /*
+       * We're in the child
+       */
+      execl (LW_EXECUNIX_SHELL_CMD,
+	     LW_EXECUNIX_SHELL_CMD, LW_EXECUNIX_SHELL_ARG1, cmd, NULL);
+
+      /*
+       * If we get here, it means launching the command failed...
+       */
+      LW_MACRO_SPRINTF5 (error_str,
+			 "Can't execute \"%s %s %s\", error %d: \"%s\"",
+			 LW_EXECUNIX_SHELL_CMD,
+			 LW_EXECUNIX_SHELL_ARG1,
+			 cmd, errno, strerror (errno));
+      log_println_str (error_str);
+      exit (1);
+      break;
+    case -1:
+      /*
+       * Error forking
+       */
+      log_println_str ("Unable to fork new process!");
+      break;
+    default:
+      /*
+       * We're in the parent.
+       */
+      log_print_str ("Forking with pid ");
+      log_println_int (pid);
+
+      result = 1;
+      break;
+    }
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/execw32.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/execw32.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/execw32.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,157 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : execunix.c                                       */
+/* content       : code used to launch external programs on Windows */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#ifdef WIN32
+#include <windows.h>
+#endif
+
+#include "execgen.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_EXEC_ERROR_SIZE 1000
+
+/*==================================================================*/
+/* static functions                                                 */
+/*==================================================================*/
+
+/*==================================================================*/
+/* global functions                                                 */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Launches a command line in another process.
+ */
+int
+lw_exec_cmd (char *cmd)
+{
+  int result = 0;
+  BOOL create_process_ret;
+  STARTUPINFO startup_info;
+  PROCESS_INFORMATION process_info;
+
+  memset (&startup_info, 0, sizeof (STARTUPINFO));
+  memset (&process_info, 0, sizeof (PROCESS_INFORMATION));
+
+  startup_info.cb = sizeof (STARTUPINFO);
+
+  create_process_ret = CreateProcess (NULL,	//lpApplicationName
+				      cmd,	//lpCommandLine
+				      NULL,	//lpProcessAttributes
+				      NULL,	//lpThreadAttributes
+				      FALSE,	//bInheritHandles
+				      0,	//dwCreationFlags
+				      NULL,	//lpEnvironment
+				      NULL,	//lpCurrentDirectory
+				      &startup_info,	//lpStartupInfo
+				      &process_info	//lpProcessInformation
+    );
+
+
+  if (create_process_ret == 0)
+    {
+      int error_int;
+      char error_str[LW_EXEC_ERROR_SIZE];
+      int error_len;
+      int crlf_found;
+      LPVOID message_buf;
+
+      error_int = (int) GetLastError ();
+
+      if (FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, error_int, MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),	// Default language
+			 (LPTSTR) & message_buf, 0, NULL))
+	{
+	  LW_MACRO_SPRINTF2 (error_str, "%d: \"%s", error_int, message_buf);
+	  LocalFree (message_buf);
+
+	  /*
+	   * Now we trim ending CR-LF chars
+	   */
+	  crlf_found = 1;
+	  while (crlf_found)
+	    {
+	      error_len = strlen (error_str);
+	      crlf_found = 0;
+	      if (error_len > 1)
+		{
+		  if (error_str[error_len - 1] == '\n'
+		      || error_str[error_len - 1] == '\r')
+		    {
+		      error_str[error_len - 1] = '\0';
+		      crlf_found = 1;
+		    }
+		}
+	    }
+	  LW_MACRO_STRCAT (error_str, "\"");
+	}
+      else
+	{
+	  LW_MACRO_SPRINTF1 (error_str, "%d", error_int);
+	}
+
+      log_print_str ("Can't execute \"");
+      log_print_str (cmd);
+      log_print_str ("\", error ");
+      log_println_str (error_str);
+    }
+  else
+    {
+      result = 1;
+    }
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/exit.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/exit.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/exit.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,326 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : exit.c                                           */
+/* contenu       : fin d'allero et messages d'adieu                 */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+#ifdef WIN32
+#include "popupgen.h"
+#endif
+
+#include "basicopt.h"
+#include "config.h"
+#include "exit.h"
+#include "log.h"
+#include "sound.h"
+#include "startup.h"
+#include "ticker.h"
+#include "sockgen.h"
+#include "viewport.h"
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+static int LW_EXIT_FORCE_SHUTDOWN = 0;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/* fonction de desinstallation d'allegro                            */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+static void
+exit_all (void)
+{
+  /*
+   * we take a rest before and after calling set_gfx_mode(GFX_TEXT,...)
+   * This is an attempt to get rid of a hideous bug under X-Win,
+   * which said that there was a "bad file descriptor"
+   */
+  rest (10);
+  last_flip ();
+  set_gfx_mode (GFX_TEXT, 0, 0, 0, 0);
+  rest (10);
+
+  log_println ();
+  log_println_str ("Leaving Allegro (http://www.talula.demon.co.uk/allegro)");
+  save_config_options ();
+  stop_water ();
+  stop_ticker ();
+  remove_sound ();
+  remove_mouse ();
+  clear_keybuf ();
+  remove_keyboard ();
+  remove_timer ();
+  allegro_exit ();
+  lw_sock_exit ();
+}
+
+/*------------------------------------------------------------------*/
+static void
+disp_base_message (void)
+{
+  lw_basicopt_legal_info ("Liquid War by U-Foot");
+}
+
+/*------------------------------------------------------------------*/
+static void
+disp_ok_message (void)
+{
+  log_println_str ("Thanks for playing Liquid War, I hope you enjoyed it!");
+}
+
+/*------------------------------------------------------------------*/
+static void
+disp_error_message (void)
+{
+  log_println_str
+    ("Thanks for trying to play, sorry about the trouble Liquid War is causing you.");
+}
+
+/*------------------------------------------------------------------*/
+static void
+disp_init_fail_message (void)
+{
+  log_println_str ("An error occured during the init process.");
+  log_println ();
+  log_println_str ("Try \"lw -silent\" to disable sound management.");
+  log_println_str ("Try \"lw -nojoy\" to disable joystick control.");
+  log_println ();
+  log_print_str ("Try to delete the \"");
+  log_print_str (STARTUP_CFG_PATH);
+  log_println_str ("\" file and restart Liquid War.");
+#ifdef WIN32
+  lw_popup_init_fail ();
+#endif
+}
+
+/*------------------------------------------------------------------*/
+static void
+disp_common_memory_message (void)
+{
+  log_println_str ("Try \"lw -auto\" if you don't want to waste your time.");
+  log_println ();
+  log_println_str
+    ("Try \"lw -mem n\" where 'n' is the number of Mb to be allocated by Liquid War");
+  log_println_str
+    ("to do all his calculus. The lower it is, the safer it is in general, but you");
+  log_println_str
+    ("won't be able to play with all the levels if 'n' is too small.");
+  log_println_str ("'n' can range from 1 to 32, default is 8.");
+  log_println ();
+  log_println_str
+    ("If you run Liquid War from Windows, try and give it more DPMI memory.");
+  log_println ();
+  log_println_str ("Try \"lw -noback\" to skip background image loading.");
+  log_println_str ("Try \"lw -notex\" to skip texture loading.");
+  log_println_str ("Try \"lw -nowater\" to skip water sounds loading.");
+  log_println_str ("Try \"lw -nosfx\" to skip sound fx loading.");
+  log_println ();
+  log_println_str
+    ("Try \"lw -nice\" if \"lw -auto\" doesn't work correctly.");
+  log_println_str ("Try \"lw -safe\" if nothing else works.");
+}
+
+/*------------------------------------------------------------------*/
+static void
+disp_mem_trouble_message (void)
+{
+  log_println_str ("Liquid War is running short of memory for its bitmaps.");
+  log_println ();
+  disp_common_memory_message ();
+#ifdef WIN32
+  lw_popup_mem_trouble ();
+#endif
+}
+
+/*------------------------------------------------------------------*/
+static void
+disp_big_data_message (void)
+{
+  log_println_str
+    ("Liquid War was unable to allocate memory for its calculus.");
+  log_println ();
+  disp_common_memory_message ();
+#ifdef WIN32
+  lw_popup_big_data ();
+#endif
+}
+
+/*------------------------------------------------------------------*/
+static void
+disp_load_fail_message (void)
+{
+  log_println_str ("Liquid War was unable to load its datafile.");
+  log_println ();
+  log_print_str ("Please first check that \"");
+  log_print_str (STARTUP_DAT_PATH);
+  log_print_str ("\" exists.");
+  log_println ();
+  log_println ();
+  disp_common_memory_message ();
+#ifdef WIN32
+  lw_popup_load_fail ();
+#endif
+}
+
+/*------------------------------------------------------------------*/
+static void
+disp_custom_fail_message (void)
+{
+  log_println_str ("Liquid War was unable to load your custom maps.");
+  log_println ();
+  log_println_str ("This can happen when:");
+  log_println ();
+  log_println_str
+    ("The path is wrong, use \"lw -tex path\" or \"lw -map path\".");
+  log_println_str ("Your bitmaps are not correct, just change them.");
+  log_println_str ("You don't have enough memory.");
+#ifdef WIN32
+  lw_popup_custom_fail ();
+#endif
+}
+
+/*------------------------------------------------------------------*/
+static void
+disp_graphics_fail_message (void)
+{
+  log_println_str ("Unable to set up a graphic mode.");
+  log_println ();
+  log_println_str ("Liquid War _needs_ to set up a graphic mode.");
+  log_println_str ("Please check that your config is supported by Allegro.");
+#ifdef WIN32
+  lw_popup_graphics_fail ();
+#endif
+}
+
+/*------------------------------------------------------------------*/
+void
+my_exit_close_button (void)
+{
+  LW_EXIT_FORCE_SHUTDOWN = 1;
+}
+
+/*------------------------------------------------------------------*/
+void
+my_exit_poll ()
+{
+  /*
+   * We exit if the close button has been clicked or
+   * F10 has been pressed
+   */
+  if (LW_EXIT_FORCE_SHUTDOWN || key[KEY_F10])
+    {
+      my_exit (EXIT_CODE_OK);
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+my_exit (int code)
+{
+  exit_all ();
+  if (code == EXIT_CODE_OK)
+    {
+      disp_base_message ();
+      log_println ();
+      disp_ok_message ();
+    }
+  else
+    {
+      log_println ();
+      log_flush ();
+      switch (code)
+	{
+	case EXIT_CODE_INIT_FAIL:
+	  disp_init_fail_message ();
+	  break;
+	case EXIT_CODE_MEM_TROUBLE:
+	  disp_mem_trouble_message ();
+	  break;
+	case EXIT_CODE_BIG_DATA:
+	  disp_big_data_message ();
+	  break;
+	case EXIT_CODE_LOAD_FAIL:
+	  disp_load_fail_message ();
+	  break;
+	case EXIT_CODE_CUSTOM_FAIL:
+	  disp_custom_fail_message ();
+	  break;
+	case EXIT_CODE_GRAPHICS_FAIL:
+	  disp_graphics_fail_message ();
+	  break;
+	}
+#ifdef DOS
+      getch ();
+#endif
+      log_println ();
+      log_println ();
+      log_println ();
+      disp_base_message ();
+      log_println ();
+      disp_error_message ();
+    }
+
+  log_exit ();
+
+  exit (code);
+}

Added: unstable/liquidwar/branches/upstream/current/src/exit.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/exit.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/exit.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,78 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : exit.h                                           */
+/* contenu       : fin d'allegro et messages d'adieu                */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_EXIT
+#define LIQUID_WAR_INCLUDE_EXIT
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+#define EXIT_CODE_OK 0
+#define EXIT_CODE_INIT_FAIL 1
+#define EXIT_CODE_MEM_TROUBLE 2
+#define EXIT_CODE_BIG_DATA 3
+#define EXIT_CODE_LOAD_FAIL 4
+#define EXIT_CODE_CUSTOM_FAIL 5
+#define EXIT_CODE_GRAPHICS_FAIL 6
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void my_exit_close_button (void);
+void my_exit_poll ();
+void my_exit (int code);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/fighter.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/fighter.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/fighter.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,547 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : fighter.c                                        */
+/* contenu       : deplacement des mechants                         */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+#include "army.h"
+#include "config.h"
+#include "cursor.h"
+#include "decal.h"
+#include "grad.h"
+#include "mesh.h"
+#include "fighter.h"
+#include "monster.h"
+#include "palette.h"
+#include "startup.h"
+#include "time.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#define SIDE_ATTACK_FACTOR 4
+/* on divise l'attaque par 2^4 = 16 quand elle se fait sur le cote */
+
+#define NB_SENS_MOVE 2
+#define NB_TRY_MOVE 5
+#define NB_LOCAL_DIRS 16
+
+static int LOCAL_DIR[NB_LOCAL_DIRS * 2];
+
+static int FIGHTER_MOVE_DIR[NB_SENS_MOVE][NB_DIRS][NB_TRY_MOVE] =
+  { {{DIR_NNE, DIR_NE, DIR_NW, DIR_ENE, DIR_WNW},
+     {DIR_NE, DIR_ENE, DIR_NNE, DIR_SE, DIR_NW},
+     {DIR_ENE, DIR_NE, DIR_SE, DIR_NNE, DIR_SSE},
+     {DIR_ESE, DIR_SE, DIR_NE, DIR_SSE, DIR_NNE},
+     {DIR_SE, DIR_SSE, DIR_ESE, DIR_SW, DIR_NE},
+     {DIR_SSE, DIR_SE, DIR_SW, DIR_ESE, DIR_WSW},
+     {DIR_SSW, DIR_SW, DIR_SE, DIR_WSW, DIR_ESE},
+     {DIR_SW, DIR_WSW, DIR_SSW, DIR_NW, DIR_SE},
+     {DIR_WSW, DIR_SW, DIR_NW, DIR_SSW, DIR_NNW},
+     {DIR_WNW, DIR_NW, DIR_SW, DIR_NNW, DIR_SSE},
+     {DIR_NW, DIR_NNW, DIR_WNW, DIR_NE, DIR_SW},
+     {DIR_NNW, DIR_NW, DIR_NE, DIR_WNW, DIR_ENE}},
+
+{{DIR_NNE, DIR_NE, DIR_NW, DIR_ENE, DIR_WNW},
+ {DIR_NE, DIR_NNE, DIR_ENE, DIR_NW, DIR_SE},
+ {DIR_ENE, DIR_NE, DIR_SE, DIR_NNE, DIR_SSE},
+ {DIR_ESE, DIR_SE, DIR_NE, DIR_SSE, DIR_NNE},
+ {DIR_SE, DIR_ESE, DIR_SSE, DIR_NE, DIR_SW},
+ {DIR_SSE, DIR_SE, DIR_SW, DIR_ESE, DIR_WSW},
+ {DIR_SSW, DIR_SW, DIR_SE, DIR_WSW, DIR_ESE},
+ {DIR_SW, DIR_SSW, DIR_WSW, DIR_SE, DIR_NW},
+ {DIR_WSW, DIR_SW, DIR_NW, DIR_SSW, DIR_NNW},
+ {DIR_WNW, DIR_NW, DIR_SW, DIR_NNW, DIR_SSE},
+ {DIR_NW, DIR_WNW, DIR_NNW, DIR_SW, DIR_NE},
+ {DIR_NNW, DIR_NW, DIR_NE, DIR_WNW, DIR_ENE}}
+};
+
+static int FIGHTER_MOVE_X_REF[NB_DIRS] =
+  { 0, 1, 1, 1, 1, 0, 0, -1, -1, -1, -1, 0 };
+
+static int FIGHTER_MOVE_Y_REF[NB_DIRS] =
+  { -1, -1, 0, 0, 1, 1, 1, 1, 0, 0, -1, -1 };
+
+static int FIGHTER_MOVE_OFFSET_ASM[NB_SENS_MOVE][NB_DIRS * NB_TRY_MOVE];
+static int FIGHTER_MOVE_XY_ASM[NB_SENS_MOVE][NB_DIRS * NB_TRY_MOVE];
+
+static int FIGHTER_MOVE_OFFSET[NB_SENS_MOVE][NB_DIRS][NB_TRY_MOVE];
+int FIGHTER_MOVE_X[NB_SENS_MOVE][NB_DIRS][NB_TRY_MOVE];
+int FIGHTER_MOVE_Y[NB_SENS_MOVE][NB_DIRS][NB_TRY_MOVE];
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static void
+erase_fighter (FIGHTER * f)
+{
+  putpixel (CURRENT_AREA_DISP, f->x, f->y,
+	    getpixel (CURRENT_AREA_BACK, f->x, f->y));
+}
+
+/*------------------------------------------------------------------*/
+static void
+disp_fighter (FIGHTER * f)
+{
+  putpixel (CURRENT_AREA_DISP, f->x, f->y,
+	    COLOR_FIRST_ENTRY[(int) (f->team)]
+	    + (f->health * COLORS_PER_TEAM) / MAX_FIGHTER_HEALTH);
+}
+
+/*------------------------------------------------------------------*/
+void
+init_move_fighters (void)
+{
+  int i, j, k, dir;
+
+  for (k = 0; k < NB_SENS_MOVE; ++k)
+    for (i = 0; i < NB_DIRS; ++i)
+      for (j = 0; j < NB_TRY_MOVE; ++j)
+	{
+	  dir = FIGHTER_MOVE_DIR[k][i][j];
+	  FIGHTER_MOVE_X[k][i][j] = FIGHTER_MOVE_X_REF[dir];
+	  FIGHTER_MOVE_Y[k][i][j] = FIGHTER_MOVE_Y_REF[dir];
+
+	  FIGHTER_MOVE_OFFSET[k][i][j] = 0;
+	  if (FIGHTER_MOVE_X[k][i][j] == 1)
+	    ++(FIGHTER_MOVE_OFFSET[k][i][j]);
+	  if (FIGHTER_MOVE_X[k][i][j] == -1)
+	    --(FIGHTER_MOVE_OFFSET[k][i][j]);
+	  if (FIGHTER_MOVE_Y[k][i][j] == 1)
+	    FIGHTER_MOVE_OFFSET[k][i][j] += CURRENT_AREA_W;
+	  if (FIGHTER_MOVE_Y[k][i][j] == -1)
+	    FIGHTER_MOVE_OFFSET[k][i][j] -= CURRENT_AREA_W;
+
+	  FIGHTER_MOVE_OFFSET_ASM[k][i * NB_TRY_MOVE + j] =
+	    FIGHTER_MOVE_OFFSET[k][i][j];
+	  FIGHTER_MOVE_XY_ASM[k][i * NB_TRY_MOVE + j] =
+	    FIGHTER_MOVE_Y[k][i][j] * 65536 + FIGHTER_MOVE_X[k][i][j];
+	}
+
+  for (i = 0; i < CURRENT_ARMY_SIZE; ++i)
+    disp_fighter (CURRENT_ARMY + i);
+
+  /*
+   * note:
+   * NB_LOCAL_DIRS is 16 but it's true that 12 is enough.
+   * However, I find it safer to reserve 16 slots, since
+   * this way all the combinations of 1,2,4 and 8 can
+   * be handled correctly - even if some are impossible.
+   * And it has the advantage to avoid confusion with
+   * the 12 directions represented by NB_DIRS.
+   */
+  for (i = 1; i <= NB_LOCAL_DIRS; ++i)
+    {
+      for (j = 0; j < 2; ++j)
+	{
+	  k = -1;
+	  switch (i)
+	    {
+	    case 1:
+	      k = j ? DIR_NNW : DIR_NNE;
+	      break;
+	    case 3:
+	      k = DIR_NE;
+	      break;
+	    case 2:
+	      k = j ? DIR_ENE : DIR_ESE;
+	      break;
+	    case 6:
+	      k = DIR_SE;
+	      break;
+	    case 4:
+	      k = j ? DIR_SSE : DIR_SSW;
+	      break;
+	    case 12:
+	      k = DIR_SW;
+	      break;
+	    case 8:
+	      k = j ? DIR_WSW : DIR_WNW;
+	      break;
+	    case 9:
+	      k = DIR_NW;
+	      break;
+	    }
+	  LOCAL_DIR[(i - 1) * 2 + j] = k;
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+int
+get_main_dir (MESH * mesh, int team, int sens, int start)
+{
+  int i, dir, dist;
+  MESH *mesh2;
+
+  dist = AREA_START_GRADIENT;
+  dir = -1;
+  i = start;
+
+  if (sens)
+    {
+      do
+	{
+	  if ((mesh2 = mesh->link[i]))
+	    if (mesh2->info[team].state.grad < dist)
+	      {
+		dir = i;
+		dist = mesh2->info[team].state.grad;
+	      }
+	  i = (i < NB_DIRS - 1) ? i + 1 : 0;
+	}
+      while (i != start);
+    }
+  else
+    {
+      do
+	{
+	  if ((mesh2 = mesh->link[i]))
+	    if (mesh2->info[team].state.grad < dist)
+	      {
+		dir = i;
+		dist = mesh2->info[team].state.grad;
+	      }
+	  i = (i > 0) ? i - 1 : NB_DIRS - 1;
+	}
+      while (i != start);
+    }
+
+  if (dir >= 0)
+    return dir;
+  else
+    return (GLOBAL_CLOCK % NB_TEAMS);
+}
+
+/*------------------------------------------------------------------*/
+static int
+get_close_dir (MESH * mesh, FIGHTER * f, int team, int sens, int start)
+{
+  int cursor_x, cursor_y, fighter_x, fighter_y;
+  int code_dir = 0, dir;
+
+  fighter_x = f->x;
+  fighter_y = f->y;
+  cursor_x = mesh->info[team].update.cursor.x;
+  cursor_y = mesh->info[team].update.cursor.y;
+
+  if (cursor_y < fighter_y)
+    code_dir += 1;
+  if (cursor_x > fighter_x)
+    code_dir += 2;
+  if (cursor_y > fighter_y)
+    code_dir += 4;
+  if (cursor_x < fighter_x)
+    code_dir += 8;
+
+  if (code_dir)
+    dir = LOCAL_DIR[(code_dir - 1) * 2 + (sens ? 1 : 0)];
+  else
+    dir = start;
+
+  return dir;
+}
+
+/*------------------------------------------------------------------*/
+void
+move_fighters (void)
+{
+  int attack[NB_TEAMS], defense[NB_TEAMS], new_health[NB_TEAMS];
+  int i, dir, team, coef;
+  FIGHTER *f;
+  PLACE *p, *p0, *p1, *p2, *p3, *p4;
+  int *move_offset, *move_x, *move_y;
+  int sens, start, table;
+  int cpu_influence[NB_TEAMS] = { 0, 0, 0, 0, 0, 0 };
+  int temp = 0;
+
+  sens = 0;
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    if (CURRENT_CURSOR[i].control_type == CONFIG_CONTROL_TYPE_CPU
+	&& CURRENT_CURSOR[i].active)
+      cpu_influence[CURRENT_CURSOR[i].team] =
+	LW_CONFIG_CURRENT_RULES.cpu_advantage;
+
+  for (i = 0; i < PLAYING_TEAMS; ++i)
+    {
+      coef = ACTIVE_FIGHTERS[i] * PLAYING_TEAMS - CURRENT_ARMY_SIZE;
+      coef *= 256;
+      coef /= CURRENT_ARMY_SIZE;
+      if (coef > 256)
+	coef = 256;
+
+      coef *=
+	(LW_CONFIG_CURRENT_RULES.number_influence -
+	 8) * (LW_CONFIG_CURRENT_RULES.number_influence - 8);
+      coef /= 64;
+      if (LW_CONFIG_CURRENT_RULES.number_influence < 8)
+	coef = -coef;
+      if (coef < 0)
+	coef /= 2;
+      coef += 256;
+
+      attack[i] = (coef *
+		   fsqrt (fsqrt (1 << (LW_CONFIG_CURRENT_RULES.fighter_attack
+				       + cpu_influence[i])))) / (256 * 8);
+      if (attack[i] >= MAX_FIGHTER_HEALTH)
+	attack[i] = MAX_FIGHTER_HEALTH - 1;
+      if (attack[i] < 1)
+	attack[i] = 1;
+
+      defense[i] = (coef *
+		    fsqrt (fsqrt
+			   (1 <<
+			    (LW_CONFIG_CURRENT_RULES.fighter_defense +
+			     cpu_influence[i])))) / (256 * 256);
+      if (defense[i] >= MAX_FIGHTER_HEALTH)
+	defense[i] = MAX_FIGHTER_HEALTH - 1;
+      if (defense[i] < 1)
+	defense[i] = 1;
+
+      new_health[i] = (coef *
+		       fsqrt (fsqrt
+			      (1 <<
+			       (LW_CONFIG_CURRENT_RULES.fighter_new_health +
+				cpu_influence[i])))) / (256 * 4);
+      if (new_health[i] >= MAX_FIGHTER_HEALTH)
+	new_health[i] = MAX_FIGHTER_HEALTH - 1;
+      if (new_health[i] < 1)
+	new_health[i] = 1;
+
+      ACTIVE_FIGHTERS[i] = 0;
+    }
+  start = (GLOBAL_CLOCK / 6) % NB_DIRS;
+  table = (GLOBAL_CLOCK / 3) % 2;
+  f = CURRENT_ARMY;
+
+#ifdef ASM
+  if (STARTUP_ASM && LW_CONFIG_CURRENT_RULES.asm_algorithm)
+    boost_move_fighters (CURRENT_ARMY,
+			 CURRENT_ARMY_SIZE,
+			 CURRENT_AREA,
+			 CURRENT_AREA_W,
+			 ACTIVE_FIGHTERS,
+			 attack,
+			 defense,
+			 new_health,
+			 MAX_FIGHTER_HEALTH - 1,
+			 sens,
+			 start,
+			 -GLOBAL_CLOCK,
+			 FIGHTER_MOVE_XY_ASM[table],
+			 FIGHTER_MOVE_OFFSET_ASM[table],
+			 CURRENT_AREA_BACK->dat,
+			 CURRENT_AREA_DISP->dat,
+			 COLOR_FIRST_ENTRY,
+			 COLORS_PER_TEAM,
+			 LOCAL_DIR,
+			 temp, temp, temp, temp, temp, temp, temp, temp);
+  else
+#else
+  temp = 0;
+#endif
+  for (i = 0; i < CURRENT_ARMY_SIZE; ++i)
+    {
+      team = f->team;
+      ACTIVE_FIGHTERS[team]++;
+      start = (start < NB_DIRS - 1) ? start + 1 : 0;
+
+      p = CURRENT_AREA + (f->y * CURRENT_AREA_W + f->x);
+
+      if (p->mesh->info[team].update.time >= 0)
+	{
+	  p->mesh->info[team].state.dir =
+	    get_close_dir (p->mesh, f, team, (sens++) % 2, start);
+	}
+      else if ((-p->mesh->info[team].update.time) < GLOBAL_CLOCK)
+	{
+	  p->mesh->info[team].state.dir =
+	    get_main_dir (p->mesh, team, (sens++) % 2, start);
+	  p->mesh->info[team].update.time = -GLOBAL_CLOCK;
+	}
+
+      dir = p->mesh->info[team].state.dir;
+
+      move_offset = FIGHTER_MOVE_OFFSET[table][dir];
+      move_x = FIGHTER_MOVE_X[table][dir];
+      move_y = FIGHTER_MOVE_Y[table][dir];
+
+      if (((p0 = p + move_offset[0])->mesh) && (!p0->fighter))
+	{
+	  erase_fighter (f);
+	  p0->fighter = f;
+	  p->fighter = NULL;
+	  f->x += move_x[0];
+	  f->y += move_y[0];
+	  disp_fighter (f);
+	}
+      else
+	{
+	  if (((p1 = p + move_offset[1])->mesh) && (!p1->fighter))
+	    {
+	      erase_fighter (f);
+	      p1->fighter = f;
+	      p->fighter = NULL;
+	      f->x += move_x[1];
+	      f->y += move_y[1];
+	      disp_fighter (f);
+	    }
+	  else
+	    {
+	      if (((p2 = p + move_offset[2])->mesh) && (!p2->fighter))
+		{
+		  erase_fighter (f);
+		  p2->fighter = f;
+		  p->fighter = NULL;
+		  f->x += move_x[2];
+		  f->y += move_y[2];
+		  disp_fighter (f);
+		}
+	      else
+		{
+		  if (((p3 = p + move_offset[3])->mesh) && (!p3->fighter))
+		    {
+		      erase_fighter (f);
+		      p3->fighter = f;
+		      p->fighter = NULL;
+		      f->x += move_x[3];
+		      f->y += move_y[3];
+		      disp_fighter (f);
+		    }
+		  else
+		    {
+		      if (((p4 = p + move_offset[4])->mesh) && (!p4->fighter))
+			{
+			  erase_fighter (f);
+			  p4->fighter = f;
+			  p->fighter = NULL;
+			  f->x += move_x[4];
+			  f->y += move_y[4];
+			  disp_fighter (f);
+			}
+		      else
+			{
+			  if (p0->mesh
+			      && p0->fighter && p0->fighter->team != team)
+			    {
+			      p0->fighter->health -= attack[team];
+			      if (p0->fighter->health < 0)
+				{
+				  while (p0->fighter->health < 0)
+				    p0->fighter->health += new_health[team];
+				  p0->fighter->team = team;
+				}
+			      disp_fighter (p0->fighter);
+			    }
+			  else
+			    {
+			      if (p1->mesh
+				  && p1->fighter && p1->fighter->team != team)
+				{
+				  p1->fighter->health -= attack[team]
+				    >> SIDE_ATTACK_FACTOR;
+				  if (p1->fighter->health < 0)
+				    {
+				      while (p1->fighter->health < 0)
+					p1->fighter->health +=
+					  new_health[team];
+				      p1->fighter->team = team;
+				    }
+				  disp_fighter (p1->fighter);
+				}
+			      else
+				{
+				  if (p2->mesh
+				      && p2->fighter
+				      && p2->fighter->team != team)
+				    {
+				      p2->fighter->health -= attack[team]
+					>> SIDE_ATTACK_FACTOR;
+				      if (p2->fighter->health < 0)
+					{
+					  while (p2->fighter->health < 0)
+					    p2->fighter->health +=
+					      new_health[team];
+					  p2->fighter->team = team;
+					}
+				      disp_fighter (p2->fighter);
+				    }
+				  else
+				    {
+				      if (p0->mesh
+					  && p0->fighter
+					  && p0->fighter->team == team)
+					{
+					  p0->fighter->health +=
+					    defense[team];
+					  if (p0->fighter->health >=
+					      MAX_FIGHTER_HEALTH)
+					    p0->fighter->health =
+					      MAX_FIGHTER_HEALTH - 1;
+					  disp_fighter (p0->fighter);
+					}
+				    }
+				}
+			    }
+			}
+		    }
+		}
+	    }
+	}
+      f++;
+    }
+}

Added: unstable/liquidwar/branches/upstream/current/src/fighter.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/fighter.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/fighter.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,74 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : fighter.h                                        */
+/* contenu       : deplacement des mechants                         */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_FIGHTER
+#define LIQUID_WAR_INCLUDE_FIGHTER
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+int FIGHTER_MOVE_X[2][NB_DIRS][5];
+int FIGHTER_MOVE_Y[2][NB_DIRS][5];
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void init_move_fighters (void);
+int get_main_dir (MESH * mesh, int team, int sens, int start);
+void move_fighters (void);
+
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/game.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/game.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/game.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,860 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : game.c                                           */
+/* contenu       : organisation du jeu                              */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdlib.h>
+#ifdef UNIX
+#include <unistd.h>
+#endif
+#include <allegro.h>
+
+#include "area.h"
+#include "autoplay.h"
+#include "back.h"
+#include "army.h"
+#include "bigdata.h"
+#include "config.h"
+#include "cursor.h"
+#include "decal.h"
+#include "disp.h"
+#include "distor.h"
+#include "fighter.h"
+#include "game.h"
+#include "grad.h"
+#include "info.h"
+#include "map.h"
+#include "maptex.h"
+#include "menu.h"
+#include "message.h"
+#include "mouse.h"
+#include "move.h"
+#include "pion.h"
+#include "profile.h"
+#include "code.h"
+#include "sound.h"
+#include "ticker.h"
+#include "time.h"
+#include "viewport.h"
+#include "watchdog.h"
+#include "network.h"
+#include "lang.h"
+#include "exit.h"
+#include "capture.h"
+#include "startup.h"
+#include "random.h"
+
+/*==================================================================*/
+/* definitions de constantes                                        */
+/*==================================================================*/
+
+/*==================================================================*/
+/* definitions de types                                             */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+int LW_GAME_RUNNING = 0;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * this function calculates how many teams will be playing
+ */
+void
+calc_playing_teams (void)
+{
+  int i;
+
+  PLAYING_TEAMS = 0;
+
+  /*
+   * loop for all the possible teams, that's to say each of the
+   * 6 areas in the "teams" menu
+   */
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      if (LW_NETWORK_ON)
+	{
+	  /*
+	   * We're in a network game
+	   */
+	  if (LW_NETWORK_INFO[i].active)
+	    {
+	      PLAYING_TEAMS++;
+	    }
+	}
+      else
+	{
+	  /*
+	   * Not a network game, we only check the local config
+	   */
+	  if (CONFIG_CONTROL_TYPE[i] != CONFIG_CONTROL_TYPE_OFF)
+	    {
+	      PLAYING_TEAMS++;
+	    }
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+/* gestion des actions pendant le jeu                               */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+/* deplacement des curseurs                                         */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+/*
+ * associates a control method to a cursor
+ */
+static void
+init_cursor_control_method (void)
+{
+  int i;
+
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      if (LW_NETWORK_ON)
+	{
+	  CURRENT_CURSOR[i].from_network = LW_NETWORK_INFO[i].network;
+	  CURRENT_CURSOR[i].control_type = LW_NETWORK_INFO[i].control_type;
+	}
+      else
+	{
+	  /*
+	   * local teams
+	   */
+	  CURRENT_CURSOR[i].from_network = 0;
+	  CURRENT_CURSOR[i].control_type = CONFIG_CONTROL_TYPE[i];
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+/* on verifie si des equipes doivent disparaitre                    */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+/*
+ * checks if a team has lost the game, and make it leave the game
+ * if necessary
+ */
+int
+check_loose_team (void)
+{
+  int i = 0, lost = 0;
+
+  /*
+   * loop for all the playing teams. we stop when we first find a
+   * team which has lost. however, if another one has lost, it will
+   * be discovered at the next game round, so it's not a problem
+   * and anyway, teams rarely loose at the same round 8-)
+   */
+  while (i < PLAYING_TEAMS && !lost)
+    {
+      /*
+       * if there are no fighters left, then the game is lost
+       */
+      if (ACTIVE_FIGHTERS[i] == 0)
+	{
+	  /*
+	   * nothing will be calculated for this team anymore
+	   */
+	  eliminate_team (i);
+	  lost = 1;
+	}
+      else
+	++i;
+    }
+  /*
+   * now we check if the previous loop has given some results
+   */
+  if (lost)
+    {
+      /*
+       * sound effect
+       */
+      play_loose ();
+      /*
+       * remove the team from the info bar, so that room if freed for 
+       * other teams
+       */
+      free_info_bar ();
+    }
+
+  return (lost);
+}
+
+/*------------------------------------------------------------------*/
+/* initialisations du jeu                                           */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+/*
+ * initialization of the game, the menu system has been leaved
+ * and the game has to start right away
+ */
+char *
+init_game (void)
+{
+  int i;
+  int big_data;
+  int max_mem_reached = 0;
+  int last_try = 0;
+  int ok = 0;
+
+  /*
+   * this string will be used to display error messages in case
+   * something goes wrong. as long as message is not NULL it
+   * the game can not be launched
+   */
+  char *message = NULL;
+
+  /*
+   * creation of a bitmap which represents the battlefield
+   * this map will be left as is and will never be changed
+   * it is used to "cache" a blank map (by blank we mean with
+   * no fighters drawn on it)
+   */
+  if (!message &&
+      (CURRENT_AREA_BACK = lw_maptex_create_map
+       (CONFIG_LEVEL_MAP,
+	CONFIG_LEVEL_FG,
+	CONFIG_LEVEL_BG,
+	LW_NETWORK_ON,
+	LW_RANDOM_ON,
+	MIN_MAP_RES_W[LW_CONFIG_CURRENT_RULES.min_map_res],
+	MIN_MAP_RES_H[LW_CONFIG_CURRENT_RULES.min_map_res],
+	CONFIG_USE_DEFAULT_TEXTURE)) == NULL)
+    message = lw_lang_string (LW_LANG_STRING_GAME_BACKMEMFAIL);
+
+  /*
+   * creation of the map which will be used for display
+   * operations, it will be changed later, basically fighters
+   * will be drawn on it
+   */
+  if (!message &&
+      (CURRENT_AREA_DISP = lw_maptex_create_map
+       (CONFIG_LEVEL_MAP,
+	CONFIG_LEVEL_FG,
+	CONFIG_LEVEL_BG,
+	LW_NETWORK_ON,
+	LW_RANDOM_ON,
+	MIN_MAP_RES_W[LW_CONFIG_CURRENT_RULES.min_map_res],
+	MIN_MAP_RES_H[LW_CONFIG_CURRENT_RULES.min_map_res],
+	CONFIG_USE_DEFAULT_TEXTURE)) == NULL)
+    message = lw_lang_string (LW_LANG_STRING_GAME_DISPMEMFAIL);
+
+  if (!message)
+    {
+      for (i = 0; !max_mem_reached && !ok; ++i)
+	{
+	  message = NULL;
+	  reset_big_data ();
+
+	  /*
+	   * creation of the mesh, see mesh.c for details
+	   */
+	  if (!message && create_mesh ())
+	    message = lw_lang_string (LW_LANG_STRING_GAME_MESHMEMFAIL);
+
+	  /*
+	   * creation of the game area, see area.c for details
+	   */
+	  if (!message && create_game_area ())
+	    message = lw_lang_string (LW_LANG_STRING_GAME_AREAMEMFAIL);
+
+	  /*
+	   * creation of the armies, see army.c for details
+	   */
+	  if (!message && create_army ())
+	    message = lw_lang_string (LW_LANG_STRING_GAME_ARMYMEMFAIL);
+
+	  if (message)
+	    {
+	      /*
+	       * There's an error.
+	       */
+	      if (last_try)
+		{
+		  /*
+		   * OK, last time we allocated memory, we couldn't
+		   * allocate all we wanted to, and this is not
+		   * enough -> we give up...
+		   */
+		  max_mem_reached = 0;
+		}
+	      else
+		{
+		  /*
+		   * We increase the amount of allocated memory
+		   */
+		  STARTUP_BIG_DATA += LW_STARTUP_MEM_STEP;
+		  if (STARTUP_BIG_DATA > LW_STARTUP_MEM_MAX)
+		    {
+		      last_try = 1;
+		      STARTUP_BIG_DATA = LW_STARTUP_MEM_MAX;
+		    }
+		  big_data = STARTUP_BIG_DATA;
+		  if (malloc_big_data ())
+		    {
+		      if (STARTUP_BIG_DATA != big_data)
+			{
+			  /*
+			   * not all the memory could be
+			   * allocated, we consider this is
+			   * the last try.
+			   */
+			  last_try = 1;
+			}
+		    }
+		  else
+		    {
+		      /*
+		       * memory allocation failed...
+		       */
+		      max_mem_reached = 1;
+		    }
+		}
+	    }
+	  else
+	    {
+	      ok = 1;
+	    }
+	}
+    }
+
+  /*
+   * what to do nothing failed (play!)
+   */
+  if (!message)
+    {
+      /*
+       * these are basically initialization which need to be done 
+       * and should never fail
+       * check each function to know what it does!!!
+       */
+      reset_mesh ();
+      reset_game_area ();
+      reset_all_cursor ();
+      init_cursor_control_method ();
+      place_all_team ();
+      init_move_fighters ();
+      init_disp_cursor ();
+    }
+
+  /*
+   * We set the network error flag to 0, if it becomes non-zero
+   * then the game simply stops...
+   */
+  LW_NETWORK_ERROR_DETECTED = 0;
+
+  return message;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * cleans up things after the game is finished
+ * currently only the bitmaps have to be freed since mesh, maps etc...
+ * are allocated in the "big data" structure (bigdata.c)
+ */
+void
+free_game_memory (void)
+{
+  /*
+   * the info bar allocates bitmaps for its display, get rid of'm
+   */
+  free_info_bar ();
+  /*
+   * the bigdata is not "freed" in the malloc sense, but it's
+   * just clean to tell it to reset itself.it might be usefull
+   * if some day the big data system is implemented in a more
+   * conventional way
+   */
+  reset_big_data ();
+  /*
+   * free the bitmap used for displays if it exists
+   */
+  if (CURRENT_AREA_DISP)
+    {
+      destroy_bitmap (CURRENT_AREA_DISP);
+      CURRENT_AREA_DISP = 0;
+    }
+  /*
+   * free the clean empty bitmap if it exists
+   */
+  if (CURRENT_AREA_BACK)
+    {
+      destroy_bitmap (CURRENT_AREA_BACK);
+      CURRENT_AREA_BACK = 0;
+    }
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * a blank round. but why should one want a blank round?
+ * well, it's usefull to initialize the double-buffer system
+ * if you don't use this function, the display of the game
+ * might be dirty, so we artificially simulate a round
+ * this is just about display, no logic operations
+ */
+int
+blank_round (void)
+{
+  /*
+   * the first call to page flip allocates a bitmap for drawing,
+   * so it might fail...
+   */
+  if (page_flip ())
+    {
+      /*
+       * the distorsion displayer is used for the wave effect
+       */
+      init_distorsion_displayer ();
+      /*
+       * prepares the basic layer for the first buffer
+       */
+      display_back_image ();
+      rect_for_viewport ();
+      /*
+       * displays the map in the previously defined layer
+       */
+      disp_all_cursors ();
+      display_area ();
+      undisp_all_cursors ();
+      /*
+       * we now show what we have done to the player
+       */
+      page_flip ();
+      /*
+       * prepares the basic layer for the second buffer
+       */
+      display_back_image ();
+      rect_for_viewport ();
+      /*
+       * clean up message queue
+       */
+      clear_message ();
+      return 0;
+    }
+  else
+    return -1;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * fills the screen with the right stuff
+ * can display the map or special screens if we are in some
+ * sort of debug mode
+ */
+static void
+fill_next_screen (void)
+{
+  /*
+   * GRAD_TO_DISP is the gradient we want to show
+   * normally no gradient is displayed, so the gradient is 0
+   */
+  if (GRAD_TO_DISP == 0)
+    {
+      /*
+       * we add the cursors to the map, temporary
+       */
+      disp_all_cursors ();
+      /*
+       * physical drawing of the map
+       */
+      display_area ();
+      /*
+       * we remove the cursors, for they might move next time
+       * so they are no longer required
+       */
+      undisp_all_cursors ();
+    }
+
+  /*
+   * GRAD_TO_DISP is between 1 & 6, we display the info concerning
+   * the selected team, this way one can see in real tiem how
+   * the gradient is calculated. for curious guys
+   */
+  if (GRAD_TO_DISP >= 1 && GRAD_TO_DISP <= 6)
+    display_gradient (GRAD_TO_DISP - 1);
+
+  /*
+   * is GRAD_TO_DISP is 7 or 8 we display the plain mesh with
+   * various display options
+   */
+  if (GRAD_TO_DISP >= 7 && GRAD_TO_DISP <= 8)
+    display_mesh (GRAD_TO_DISP - 7);
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * the logic function is the one which moves players, calculates stuff
+ * etc... the more often this function is called, the faster the game
+ * will go. it does nothing such as display, which is an independant
+ * thing. every time this function is called on can consider that
+ * "game round" has ellapsed. indeed, it's here that the global
+ * GLOBAL_CLOCK is incremented 8-)
+ */
+static void
+logic (void)
+{
+  /*
+   * if the game is paused, we do not do everything
+   * this test is done again later
+   */
+  if (!PAUSE_ON)
+    {
+      /*
+       * moves the cursors. this will ask the keyboard module
+       * for information, ask the AI functions what to do...
+       */
+      move_all_cursors ();
+      /*
+       * applying the cursors means that we communicate to
+       * the game area the information about where the cursors are
+       */
+      apply_all_cursor ();
+    }
+  /*
+   * the profile module enables CPU time tracking, so that the player
+   * can now how much time is spent on various tasks
+   */
+  start_profile (SPREAD_PROFILE);
+  if (!PAUSE_ON)
+    {
+      /*
+       * spreads the gradient, ie calculates in the game area how far
+       * each point is from the cursors, this information depends
+       * on where the cursors are, this information being given
+       * by apply_all_cursor
+       */
+      spread_single_gradient ();
+    }
+  /*
+   * this call ends the time tracking associated to the spread function
+   */
+  stop_profile (SPREAD_PROFILE);
+
+  start_profile (MOVE_PROFILE);
+  if (!PAUSE_ON)
+    {
+      /*
+       * now we move the fighters, ie each fighter of each team
+       * will either move, attack his neighbor, die...
+       */
+      move_fighters ();
+    }
+
+  stop_profile (MOVE_PROFILE);
+
+  if (!PAUSE_ON)
+    {
+      /*
+       * we check if a team has lost
+       *
+       * This code used to be in the "display" functions, which
+       * is a very bad idea for it caused network inconsistencies...
+       */
+      check_loose_team ();
+    }
+
+  /*
+   * increments the clock, this way one can know how many game ticks
+   * there has been. there's actually no link between this clock
+   * and the GMT, indeed everything depends on the speed of the
+   * computer where the game is run
+   */
+  GLOBAL_CLOCK++;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * this function is responsible for displaying stuff on the screen
+ * it does nothing such as calculating fighters positions for instance
+ * if this function is called very often, then the game will look
+ * smooth, the wave effect will be nicer, but the cursors won't move
+ * any faster
+ * this function does also other things than display, in fact it does
+ * everything which is not directly linked to a game cycle
+ */
+static void
+display (void)
+{
+  /*
+   * the watchdog waits for secret codes to be entered
+   * 
+   * It's also very important to call this for it will call
+   * keypressed() and so will also automatically call poll_keyboard()
+   * if needed.
+   */
+  watchdog_update ();
+  /*
+   * calls the watchdog module to see if a secret code has been
+   * entered, and does the required stuff if the answer is yes
+   */
+  check_code ();
+  /*
+   * keeps track of how long the mext operation takes
+   */
+  start_profile (DISP_PROFILE);
+  /*
+   * now we call the function that actually draws stuff
+   */
+  fill_next_screen ();
+  stop_profile (DISP_PROFILE);
+
+  /*
+   * like check_code but dedicated to the info mode on/off
+   * ie it detects if F1 has been pressed and decides wether
+   * the info bar must be displayed or not
+   */
+  check_info_state ();
+
+  /*
+   * updates some time values, telling how many weeks this tremendous
+   * liquid war session has been running 8-) 
+   */
+  update_play_time ();
+
+  /*
+   * Now this is a little trick, we change the order of display
+   * depending on the capture mode.
+   */
+  if (lw_capture_get_mode ())
+    {
+      /*
+       * We're in capture mode: we display info before the dump
+       * for we want it to be there but we display the messages
+       * after the dump since they are ugly and useless in a 
+       * video capture.
+       */
+      display_info ();
+      lw_capture_dump_game ();
+      display_message ();
+    }
+  else
+    {
+      /*
+       * We're not in capture mode: we display the messages first,
+       * for displaying them after the info might give them an
+       * ugly blinking look if we're not in double-buffered mode.
+       */
+      display_message ();
+      display_info ();
+    }
+
+  /*
+   * it's interesting to know how much time is wasted on page flips
+   */
+  start_profile (FLIP_PROFILE);
+  /*
+   * switches to the next screen, when page flipping is off,
+   * it does not do much...
+   */
+  page_flip ();
+  stop_profile (FLIP_PROFILE);
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * *THE* main game loop
+ */
+int
+game (void)
+{
+  int retour = 0;
+  int last_display_time = get_ticker ();
+  int last_logic_time = get_ticker ();
+  int lr;
+
+  /*
+   * we initialize the time module telling him that now it's 0
+   * and he it can start recording stuff
+   */
+  start_play_time ();
+  /*
+   * resets the secret code sequences
+   */
+  watchdog_reset ();
+  reset_code ();
+  /*
+   * resets input buffers and control interfaces
+   */
+  lw_mouse_reset_control ();
+  reset_computer_path ();
+  /*
+   * resets profile information, so that they are not affected
+   * by previous games
+   */
+  reset_all_profile ();
+
+  /*
+   * everything's ready, POOOOOOOOOT the game starts and you hear it
+   */
+  play_go ();
+
+  if (1 /*!init_distorsion_displayer() */ )
+    {
+      /*
+       * so we loop (almost) for ever
+       * execptions are
+       * - we have detected a key press on ESCAPE
+       * - there are less than 2 teams playing, ie there's a winner
+       * - the game time is elapsed
+       */
+      while ((!WATCHDOG_SCANCODE[KEY_ESC])
+	     && (PLAYING_TEAMS >= 2)
+	     && (TIME_LEFT > 0) && (!LW_NETWORK_ERROR_DETECTED))
+	{
+	  /*
+	   * global time checking
+	   */
+	  start_profile (GLOBAL_PROFILE);
+
+	  /*
+	   * will contain how mush called to logic have been performed
+	   */
+	  lr = 0;
+	  do
+	    {
+	      /*
+	       * we call logic, calculates stuff, move players etc...
+	       */
+	      logic ();
+
+	      /*
+	       * Now we decide to go idel if it happens that the computer
+	       * is calculating this "too fast". This will enable people
+	       * too play Liquid War even on a very very fast machine
+	       */
+	      while (get_ticker () < last_logic_time
+		     + LOGIC_DELAY_MIN[CONFIG_ROUNDS_PER_SEC_LIMIT])
+		{
+#ifdef UNIX
+		  /*
+		   * The usleep calls prevents the game from eating 100% of the
+		   * CPU time on UNIX platforms.
+		   */
+		  usleep (1000);
+#else
+		  /*
+		   * Rest does not seem to spare CPU time, but at least it
+		   * slows the game down
+		   */
+		  rest (1);
+#endif
+		  //yield_timeslice (); deprecated
+		}
+	      last_logic_time = get_ticker ();
+
+	      lr++;
+	    }
+	  while
+	    /*
+	     * if CONFIG_FPS_LIMIT is 0 we stop right away, ie
+	     * there will be one logic() operation for each display()
+	     * if it is 1, we keep going until we exceed the
+	     * CONFIG_FPS_LIMIT value. this way we avoid drawing 
+	     * 300 frames / second, which is useless
+	     * this method speeds the game on powerfull machines
+	     * for one can limit the display to 20 frames / seconds
+	     * and keep the rest of the CPU for calls to logic()
+	     */
+	    (CONFIG_FRAMES_PER_SEC_LIMIT
+	     && (get_ticker () < last_display_time
+		 + DISPLAY_DELAY_MIN[CONFIG_FRAMES_PER_SEC_LIMIT]));
+	  /*
+	   * tells the profile module about how much logic operations
+	   * have been done for this display
+	   */
+	  update_logic_rate (lr);
+
+	  /*
+	   * we get the information "when has the last call to display() 
+	   * been done"
+	   */
+	  last_display_time = get_ticker ();
+
+	  /*
+	   * now we really display stuff, (takes time...)
+	   */
+	  display ();
+
+	  /*
+	   * Now we check if the "Close" button has been clicked
+	   */
+	  my_exit_poll ();
+
+	  stop_profile (GLOBAL_PROFILE);
+	}
+    }
+  /*
+   * cleans up the double buffer system
+   */
+  last_flip ();
+
+  /*
+   * empties the key buffer
+   */
+  clear_keybuf ();
+
+  return retour;
+}

Added: unstable/liquidwar/branches/upstream/current/src/game.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/game.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/game.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,84 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : game.h                                           */
+/* contenu       : organisation du jeu                              */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_GAME
+#define LIQUID_WAR_INCLUDE_GAME
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+/*==================================================================*/
+/* definitions de constantes                                        */
+/*==================================================================*/
+
+/*==================================================================*/
+/* definitions de types                                             */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+extern int LW_GAME_RUNNING;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+char *init_game (void);
+int blank_round (void);
+int game (void);
+void free_game_memory (void);
+void calc_playing_teams (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/gfxmode.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/gfxmode.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/gfxmode.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,255 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : gfxmode.c                                        */
+/* contenu       : gestion des modes graphiques                     */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+#include "base.h"
+#include "disk.h"
+#include "log.h"
+#include "gfxmode.h"
+#include "startup.h"
+#include "init.h"
+#include "mouse.h"
+#include "exit.h"
+#include "lang.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#ifdef DOS
+int GFX_MODE_W[5] = { 320, 360, 640, 800, 1024 };
+int GFX_MODE_H[5] = { 240, 240, 480, 600, 768 };
+#endif
+
+#ifdef WIN32
+int GFX_MODE_W[5] = { 320, 512, 640, 800, 1024 };
+int GFX_MODE_H[5] = { 240, 384, 480, 600, 768 };
+#endif
+
+#ifdef UNIX
+int GFX_MODE_W[5] = { 320, 512, 640, 800, 1024 };
+int GFX_MODE_H[5] = { 240, 384, 480, 600, 768 };
+#endif
+
+#ifdef DOS
+static int GFX_MODE_TYPE_FULLSCREEN[] = { GFX_MODEX,
+  GFX_MODEX,
+  GFX_VESA2L,
+  GFX_VESA2L,
+  GFX_VESA2L
+};
+static int GFX_MODE_TYPE_WINDOWED[] = { GFX_MODEX,
+  GFX_MODEX,
+  GFX_VESA2L,
+  GFX_VESA2L,
+  GFX_VESA2L
+};
+#endif
+
+#ifdef WIN32
+static int GFX_MODE_TYPE_FULLSCREEN[] = { GFX_DIRECTX,
+  GFX_DIRECTX,
+  GFX_DIRECTX,
+  GFX_DIRECTX,
+  GFX_DIRECTX
+};
+static int GFX_MODE_TYPE_WINDOWED[] = { GFX_DIRECTX_WIN,
+  GFX_DIRECTX_WIN,
+  GFX_DIRECTX_WIN,
+  GFX_DIRECTX_WIN,
+  GFX_DIRECTX_WIN
+};
+#endif
+
+#ifdef UNIX
+static int GFX_MODE_TYPE_FULLSCREEN[] = { GFX_AUTODETECT_FULLSCREEN,
+  GFX_AUTODETECT_FULLSCREEN,
+  GFX_AUTODETECT_FULLSCREEN,
+  GFX_AUTODETECT_FULLSCREEN,
+  GFX_AUTODETECT_FULLSCREEN
+};
+static int GFX_MODE_TYPE_WINDOWED[] = { GFX_AUTODETECT_WINDOWED,
+  GFX_AUTODETECT_WINDOWED,
+  GFX_AUTODETECT_WINDOWED,
+  GFX_AUTODETECT_WINDOWED,
+  GFX_AUTODETECT_WINDOWED
+};
+#endif
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+need_to_change_mode (int res1, int res2, int flip)
+{
+  if (res1 == res2 && !flip)
+    return 0;
+  else
+    return !0;
+}
+
+/*------------------------------------------------------------------*/
+static int
+try_one_mode (int res, int flip, int fullscreen)
+{
+  int ret;
+  int w1, h1, w2, h2;
+
+  w1 = GFX_MODE_W[res];
+  h1 = GFX_MODE_H[res];
+  w2 = GFX_MODE_W[res];
+  h2 = flip ? GFX_MODE_H[res] * 2 : GFX_MODE_H[res];
+
+  log_print_str ("Changing video mode to ");
+  log_print_int (w1);
+  log_print_str ("x");
+  log_print_int (h1);
+  if (fullscreen)
+    log_print_str (", fullscreen");
+  else
+    log_print_str (", windowed");
+  if (flip)
+    log_print_str (", page flipping enabled");
+
+  if (fullscreen)
+    ret = set_gfx_mode (GFX_MODE_TYPE_FULLSCREEN[res], w1, h1, w2, h2);
+  else
+    ret = set_gfx_mode (GFX_MODE_TYPE_WINDOWED[res], w1, h1, w2, h2);
+
+  if (!ret)
+    {
+      display_success_driver ((char *) gfx_driver->ascii_name);
+    }
+  else
+    {
+      display_success (0);
+    }
+
+  return ret;
+}
+
+/*------------------------------------------------------------------*/
+int
+set_resolution (int res, int flip, int fullscreen, int *flip_enabled)
+{
+  int ret = -1;
+  int toggle;
+  int i;
+
+  if (flip_enabled)
+    {
+      *flip_enabled = 0;
+    }
+
+  for (toggle = 0; toggle < 2; ++toggle, fullscreen = !fullscreen)
+    {
+      for (i = res; i >= 0 && ret; --i)
+	{
+	  if (flip)
+	    {
+	      ret = try_one_mode (i, 1, fullscreen);
+	      if (flip_enabled && !ret)
+		{
+		  *flip_enabled = 1;
+		}
+	    }
+	  if (ret)
+	    {
+	      ret = try_one_mode (i, 0, fullscreen);
+	    }
+	}
+      for (i = res + 1; i < 5 && ret; ++i)
+	{
+	  if (flip)
+	    {
+	      ret = try_one_mode (i, 1, fullscreen);
+	      if (flip_enabled && !ret)
+		{
+		  *flip_enabled = 1;
+		}
+	    }
+	  if (ret)
+	    {
+	      ret = try_one_mode (i, 0, fullscreen);
+	    }
+	}
+    }
+
+  if (!ret)
+    {
+      set_palette (black_palette);
+
+      if (SCREEN_W >= 640)
+	{
+	  font = BIG_FONT;
+	}
+      else
+	{
+	  font = SMALL_FONT;
+	}
+
+      lw_mouse_show ();
+
+      set_window_title (lw_lang_string (LW_LANG_STRING_APPNAME));
+    }
+  else
+    {
+      my_exit (EXIT_CODE_GRAPHICS_FAIL);
+    }
+
+  return (ret);
+}

Added: unstable/liquidwar/branches/upstream/current/src/gfxmode.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/gfxmode.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/gfxmode.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,72 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : gfxmode.h                                        */
+/* contenu       : gestion des modes graphiques                     */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_GFXMODE
+#define LIQUID_WAR_INCLUDE_GFXMODE
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+extern int GFX_MODE_W[5];
+extern int GFX_MODE_H[5];
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int need_to_change_mode (int res1, int res2, int flip);
+int set_resolution (int res, int flip, int fullscreen, int *flip_enabled);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/glouglou.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/glouglou.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/glouglou.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,84 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : glouglou.h                                       */
+/* contenu       : affichage avec vagues accelere                   */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_GLOUGLOU
+#define LIQUID_WAR_INCLUDE_GLOUGLOU
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+#include "asm.h"
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+extern void LW_ASM_FUNC draw_distor_line (BITMAP * distorsion_target,
+					  int current_area_w,
+					  int w,
+					  int u,
+					  int fp_x,
+					  int ip_x,
+					  int fp_y,
+					  int ip_y,
+					  int lim_w,
+					  int lim_h,
+					  int *fp_x0,
+					  int *y_corres,
+					  int *WAVE_SHAPE_WX,
+					  int **WAVE_SHAPE_X_CORRES,
+					  char *src,
+					  int temp1,
+					  int temp2,
+					  int temp3, int temp4, int temp5);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/glouglou.s
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/glouglou.s	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/glouglou.s	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,242 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : glouglou.s                                       */
+/* contenu       : affichage avec vagues accelere                   */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+.equ BMP_W,                 0
+.equ BMP_H,                 4
+.equ BMP_CLIP,              8
+.equ BMP_CL,                12
+.equ BMP_CR,                16
+.equ BMP_CT,                20
+.equ BMP_CB,                24
+.equ BMP_VTABLE,            28
+.equ BMP_WBANK,             32
+.equ BMP_RBANK,             36
+.equ BMP_DAT,               40
+.equ BMP_ID,                44
+.equ BMP_EXTRA,             48
+.equ BMP_XOFS,              52
+.equ BMP_YOFS,              56
+.equ BMP_SEG,               60
+.equ BMP_LINE,              64
+
+.equ VTABLE_UNBANK,          8
+
+.equ ARG_DISTORSION_TARGET,            8
+.equ ARG_CURRENT_AREA_W,        12
+.equ ARG_W,                     16
+.equ ARG_Y,                     20
+.equ ARG_FP_X,                  24
+.equ ARG_IP_X,                  28
+.equ ARG_FP_Y,                  32
+.equ ARG_IP_Y,                  36
+.equ ARG_LIM_W,                 40
+.equ ARG_LIM_H,                 44
+.equ ARG_FP_X0,                 48
+.equ ARG_Y_CORRES,              52
+.equ ARG_WAVE_SHAPE_WX,         56
+.equ ARG_WAVE_SHAPE_X_CORRES,   60
+.equ ARG_SRC,                   64
+.equ ARG_TEMP1,                 68            # pointeur debut ligne
+.equ ARG_TEMP2,                 72            # pointeur sur fc aff
+.equ ARG_TEMP3,                 76
+.equ ARG_TEMP4,                 80
+.equ ARG_TEMP5,                 84
+
+.text
+
+
+/*==================================================================*/
+/* affichage de jolies distorsions                                  */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/* void draw_distor_line (BITMAP *distorsion_target,                */
+/*                          int current_area_w,                     */
+/*                          int w,                                  */
+/*                          int y,                                  */
+/*                          int fp_x,                               */
+/*                          int ip_x,                               */
+/*                          int fp_y,                               */
+/*                          int ip_y,                               */
+/*                          int lim_w,                              */
+/*                          int lim_h,                              */
+/*                          int *fp_x0,                             */
+/*                          int *y_corres,                          */
+/*                          int *WAVE_SHAPE_WX,                     */
+/*                          int **WAVE_SHAPE_X_CORRES,              */
+/*                          char *src,                              */
+/*                          int temp1,                              */
+/*                          int temp2,                              */
+/*                          int temp3,                              */
+/*                          int temp4,                              */
+/*                          int temp5);                             */
+/*------------------------------------------------------------------*/
+.globl __draw_distor_line 
+.globl _draw_distor_line
+.globl draw_distor_line
+   .align 4
+__draw_distor_line:
+_draw_distor_line:
+draw_distor_line:
+   pushl %ebp
+   movl %esp, %ebp
+   pushl %eax
+   pushl %ebx
+   pushl %ecx
+   pushl %edx
+   pushl %esi
+   pushl %edi
+   pushw %es
+   pushw %fs
+
+   mov   ARG_SRC(%ebp),%esi
+   mov   ARG_CURRENT_AREA_W(%ebp),%edi
+
+   movl ARG_DISTORSION_TARGET(%ebp), %edx               # edx = bmp
+   movl ARG_Y(%ebp), %eax                               # eax = y
+   movl BMP_LINE(%edx, %eax, 4), %eax
+   movl %eax,ARG_TEMP1(%ebp)               # ARG_TEMP1 = ptr debut ligne
+
+   xor   %ecx,%ecx                # ecx va servir pour stocker x
+main_loop:
+
+   # putpixel (DISTORSION_TARGET, x,y *src)
+	
+   movl %ds:(%esi),%ebx              # bl = color
+   movl ARG_TEMP1(%ebp), %eax
+   movb %bl, %ds:(%eax, %ecx)    # store the pixel
+	
+   mov   ARG_WAVE_SHAPE_X_CORRES(%ebp),%eax #eax=wave_shape_x_corres
+   mov   %ds:(%eax,%ecx,4),%eax   # eax=wave_shape_x_corres[x]
+   mov   ARG_Y(%ebp),%ebx         # ebx=y
+   mov   %ds:(%eax,%ebx,4),%eax   # eax=wave_shape_x_corres[x][y]
+   mov   ARG_FP_X0(%ebp),%ebx     # ebx=arg_fp_x0
+   mov   %ds:(%ebx,%ecx,4),%edx   # edx=arg_fp_x0[x]
+   add   %eax,%edx                # edx+=eax
+   mov   %edx,%ds:(%ebx,%ecx,4)   # on memorise en ram
+   neg   %edx
+
+   # a ce stade edx contient -reste_x
+
+   mov   ARG_FP_X(%ebp),%eax              # eax=fp_x
+   mov   ARG_WAVE_SHAPE_WX(%ebp),%ebx     # ebx=wave_shape_wx
+   add   %ds:(%ebx,%ecx,4),%eax           # fp_x+=wave_shape_wx[x]
+
+   mov   ARG_LIM_W(%ebp),%ebx             # ebx=lim_w
+loop_while_1:
+   cmp   %edx,%eax                        # fp_x<-reste_x
+   jnl   exit_while_1
+   add   %ebx,%eax                        # fp_x+=lim_w
+   dec   %esi	                          # src--
+   jmp   loop_while_1
+exit_while_1:
+
+   add   %ebx,%edx
+loop_while_2:
+   cmp   %edx,%eax                        # fp_x>=-reste_x+lim_w
+   jnge  exit_while_2
+   sub   %ebx,%eax                        # fp_x-=lim_w
+   inc   %esi                             # src++
+   jmp   loop_while_2
+exit_while_2:
+
+   mov   %eax,ARG_FP_X(%ebp)               # on sauve fp_x
+
+   mov   ARG_FP_Y(%ebp),%eax               # eax=fp_y
+   mov   ARG_Y_CORRES(%ebp),%ebx           # ebx=y_corres
+   add   %ds:(%ebx,%ecx,4),%eax            # fp_y+=y_corres[x]
+
+   mov   ARG_LIM_H(%ebp),%ebx             # ebx=lim_h
+loop_while_3:
+   cmp   $0,%eax                          # fp_y<0
+   jnl   exit_while_3
+   add   %ebx,%eax                        # fp_x+=lim_h
+   sub   %edi,%esi                        # src-=current_area_w
+   jmp   loop_while_3
+exit_while_3:
+
+loop_while_4:
+   cmp   %ebx,%eax                        # fp_y>=lim_h
+   jnge  exit_while_4
+   sub   %ebx,%eax                        # fp_y-=lim_h
+   add   %edi,%esi                        # src+=current_area_w
+   jmp   loop_while_4
+exit_while_4:
+
+   mov   %eax,ARG_FP_Y(%ebp)               # on sauve fp_y
+
+/*   mov   ARG_TEMP1(%ebp),%ecx    # ecx=x         */
+   incl  %ecx                    # x++
+   cmp   ARG_W(%ebp),%ecx        # x!=w ?
+   je    the_end
+   jmp   main_loop
+
+the_end:
+
+   popw %fs
+   popw %es
+   popl %edi
+   popl %esi
+   popl %edx
+   popl %ecx
+   popl %ebx
+   popl %eax
+/*   movl %ebp, %esp*/
+   popl %ebp
+   ret                              # retour au c
+
+/*------------------------------------------------------------------*/
+/* affichage pour bitmap lineaire, golee dans allegro               */
+/*------------------------------------------------------------------*/
+linear_putpixel8_for_distor_line:
+
+
+   ret
+

Added: unstable/liquidwar/branches/upstream/current/src/grad.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/grad.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/grad.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,237 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : grad.c                                           */
+/* contenu       : etalement des gradients                          */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "alleg2.h"
+#include "area.h"
+#include "decal.h"
+#include "grad.h"
+#include "mesh.h"
+#include "palette.h"
+#include "spread.h"
+#include "startup.h"
+#include "time.h"
+#include "config.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#define OFFSET_TO_FIRST_LINK 56
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+BITMAP *
+create_gradient_bitmap (int team)
+{
+  BITMAP *result;
+  int x, y, i, color;
+  MESH *temp;
+
+  result = my_create_bitmap (CURRENT_AREA_W, CURRENT_AREA_H);
+
+  if (result)
+    {
+      i = 0;
+      for (y = 0; y < CURRENT_AREA_H; ++y)
+	for (x = 0; x < CURRENT_AREA_W; ++x)
+	  {
+	    if ((temp = CURRENT_AREA[i++].mesh) != NULL)
+	      {
+		color = (temp->info[team].state.grad
+			 + AREA_START_GRADIENT) % COLORS_PER_TEAM;
+		putpixel (result, x, y, color + COLOR_FIRST_ENTRY[team]);
+	      }
+	    else
+	      putpixel (result, x, y, MENU_BG);
+	  }
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+BITMAP *
+create_dir_bitmap (int team)
+{
+  BITMAP *result;
+  int x, y, i;
+  MESH *temp;
+
+  result = my_create_bitmap (CURRENT_AREA_W, CURRENT_AREA_H);
+
+  i = 0;
+  for (y = 0; y < CURRENT_AREA_H; ++y)
+    for (x = 0; x < CURRENT_AREA_W; ++x)
+      {
+	if ((temp = CURRENT_AREA[i++].mesh) != NULL)
+	  putpixel (result, x, y, 134
+		    + (temp->info[team].state.dir / 4) * 42
+		    + (temp->info[team].state.dir % 4) * 10);
+      }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/* etalement des gradients                                          */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+void
+spread_single_gradient (void)
+{
+  int i, new_grad, dir;
+  MESH *pos, *last;
+  MESH *temp;
+
+  dir = (GLOBAL_CLOCK * 7) % NB_DIRS;
+  switch (dir)
+    {
+    case DIR_ENE:
+    case DIR_ESE:
+    case DIR_SE:
+    case DIR_SSE:
+    case DIR_SSW:
+    case DIR_SW:
+      pos = CURRENT_MESH;
+      last = CURRENT_MESH + CURRENT_MESH_SIZE;
+#ifdef ASM
+      if (STARTUP_ASM && LW_CONFIG_CURRENT_RULES.asm_algorithm)
+	switch (PLAYING_TEAMS)
+	  {
+	  case 6:
+	    boost_gradient_down_6
+	      (pos, CURRENT_MESH_SIZE - 1, OFFSET_TO_FIRST_LINK + dir * 4);
+	    break;
+	  case 5:
+	    boost_gradient_down_5
+	      (pos, CURRENT_MESH_SIZE - 1, OFFSET_TO_FIRST_LINK + dir * 4);
+	    break;
+	  case 4:
+	    boost_gradient_down_4
+	      (pos, CURRENT_MESH_SIZE - 1, OFFSET_TO_FIRST_LINK + dir * 4);
+	    break;
+	  case 3:
+	    boost_gradient_down_3
+	      (pos, CURRENT_MESH_SIZE - 1, OFFSET_TO_FIRST_LINK + dir * 4);
+	    break;
+	  default:
+	    boost_gradient_down_2
+	      (pos, CURRENT_MESH_SIZE - 1, OFFSET_TO_FIRST_LINK + dir * 4);
+	    break;
+	  }
+      else
+#endif
+	while (pos != last)
+	  {
+	    for (i = 0; i < PLAYING_TEAMS; ++i)
+	      if ((temp = (pos->link[dir]))
+		  && (temp->info[i].state.grad
+		      > (new_grad =
+			 pos->info[i].state.grad + pos->side.size)))
+		temp->info[i].state.grad = new_grad;
+	    pos++;
+	  }
+      break;
+    case DIR_WSW:
+    case DIR_WNW:
+    case DIR_NW:
+    case DIR_NNW:
+    case DIR_NNE:
+    case DIR_NE:
+      pos = CURRENT_MESH + CURRENT_MESH_SIZE - 1;
+      last = CURRENT_MESH - 1;
+#ifdef ASM
+      if (STARTUP_ASM && LW_CONFIG_CURRENT_RULES.asm_algorithm)
+	switch (PLAYING_TEAMS)
+	  {
+	  case 6:
+	    boost_gradient_up_6
+	      (pos, CURRENT_MESH_SIZE - 1, OFFSET_TO_FIRST_LINK + dir * 4);
+	    break;
+	  case 5:
+	    boost_gradient_up_5
+	      (pos, CURRENT_MESH_SIZE - 1, OFFSET_TO_FIRST_LINK + dir * 4);
+	    break;
+	  case 4:
+	    boost_gradient_up_4
+	      (pos, CURRENT_MESH_SIZE - 1, OFFSET_TO_FIRST_LINK + dir * 4);
+	    break;
+	  case 3:
+	    boost_gradient_up_3
+	      (pos, CURRENT_MESH_SIZE - 1, OFFSET_TO_FIRST_LINK + dir * 4);
+	    break;
+	  default:
+	    boost_gradient_up_2
+	      (pos, CURRENT_MESH_SIZE - 1, OFFSET_TO_FIRST_LINK + dir * 4);
+	    break;
+	  }
+      else
+#endif
+	while (pos != last)
+	  {
+	    for (i = 0; i < PLAYING_TEAMS; ++i)
+	      if ((temp = (pos->link[dir]))
+		  && (temp->info[i].state.grad
+		      > (new_grad =
+			 pos->info[i].state.grad + pos->side.size)))
+		temp->info[i].state.grad = new_grad;
+	    pos--;
+	  }
+      break;
+    }
+}

Added: unstable/liquidwar/branches/upstream/current/src/grad.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/grad.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/grad.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,75 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : grad.h                                           */
+/* contenu       : etalement des gradients                          */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_GRAD
+#define LIQUID_WAR_INCLUDE_GRAD
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+#define AREA_START_GRADIENT 2000000
+#define CURSOR_START_GRADIENT 1000000
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+BITMAP *create_gradient_bitmap (int team);
+BITMAP *create_dir_bitmap (int team);
+void spread_single_gradient (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/graphics.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/graphics.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/graphics.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,372 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : graphics.c                                       */
+/* contenu       : choix des options graphiques                     */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdio.h>
+#include <string.h>
+
+#include "back.h"
+#include "config.h"
+#include "dialog.h"
+#include "disk.h"
+#include "gfxmode.h"
+#include "graphics.h"
+#include "help.h"
+#include "menu.h"
+#include "sound.h"
+#include "wave.h"
+#include "lang.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static char *
+get_game_res_str (void)
+{
+  static char str[30];
+
+  LW_MACRO_SPRINTF3 (str, "%s:%dx%d",
+		     lw_lang_string (LW_LANG_STRING_GRAPHICS_GAME),
+		     GFX_MODE_W[CONFIG_GFX_GAME],
+		     GFX_MODE_H[CONFIG_GFX_GAME]);
+
+  return str;
+}
+
+/*------------------------------------------------------------------*/
+static char *
+get_menu_res_str (void)
+{
+  static char str[30];
+
+  LW_MACRO_SPRINTF3 (str, "%s:%dx%d",
+		     lw_lang_string (LW_LANG_STRING_GRAPHICS_MENU),
+		     GFX_MODE_W[CONFIG_GFX_MENU],
+		     GFX_MODE_H[CONFIG_GFX_MENU]);
+
+  return str;
+}
+
+/*------------------------------------------------------------------*/
+static char *
+get_wave_mode_str (void)
+{
+  if (CONFIG_WAVE_ON)
+    return (lw_lang_string (LW_LANG_STRING_GRAPHICS_ON));
+  else
+    return (lw_lang_string (LW_LANG_STRING_GRAPHICS_OFF));
+}
+
+/*------------------------------------------------------------------*/
+static char *
+get_page_flip_str (void)
+{
+  if (CONFIG_PAGE_FLIP)
+    return (lw_lang_string (LW_LANG_STRING_GRAPHICS_ON));
+  else
+    return (lw_lang_string (LW_LANG_STRING_GRAPHICS_OFF));
+}
+
+/*------------------------------------------------------------------*/
+static char *
+get_fullscreen_str (void)
+{
+  if (CONFIG_FULLSCREEN)
+    return (lw_lang_string (LW_LANG_STRING_GRAPHICS_FULLSCREEN));
+  else
+    return (lw_lang_string (LW_LANG_STRING_GRAPHICS_WINDOWED));
+}
+
+/*------------------------------------------------------------------*/
+static int
+slider_game_res (void *dp3, int d2)
+{
+  int *changed;
+
+  LW_MACRO_NOP (d2);
+
+  play_click ();
+
+  changed = dp3;
+  *changed = 1;
+
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+static int
+slider_menu_res (void *dp3, int d2)
+{
+  int *changed;
+
+  LW_MACRO_NOP (d2);
+
+  play_click ();
+
+  changed = dp3;
+  *changed = 1;
+
+  my_set_palette ();
+
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+static int
+slider_brightness (void *dp3, int d2)
+{
+  LW_MACRO_NOP (dp3);
+  LW_MACRO_NOP (d2);
+
+  play_click ();
+  CONFIG_BRIGHTNESS = d2;
+  my_set_palette ();
+
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+int
+graphic_options (void)
+{
+
+  /* la gestion des paramtres curseur a ete mise en commentaire... */
+
+  int menu_res_changed = 0;
+  int fullscreen_changed = 0;
+  int game_res_changed = 0;
+  DIALOG_PLAYER *dp;
+  DIALOG d[20];
+  int i, choix = 4, retour = 0;
+  static int y_pos[7] = { 0, 1, 3, 4, 5, 6, 8 };
+  int *temp;
+
+  memset (d, 0, sizeof (d));
+
+  display_back_image ();
+  while (retour == 0)
+    {
+      for (i = 0; i < 7; ++i)
+	{
+	  standard_button (d + i + 4, 0, y_pos[i], 2, 10);
+	  d[i + 4].proc = my_textbox_proc;
+	}
+      for (i = 0; i < 7; ++i)
+	{
+	  standard_button (d + i + 11, 1, y_pos[i], 2, 10);
+	  d[i + 11].proc = my_slider_proc;
+	}
+
+      standard_button (d + 18, 0, 9, 1, 10);
+      d[18].dp = lw_lang_string (LW_LANG_STRING_GRAPHICS_ADVANCED);
+
+      quick_buttons (d);
+      d[4].dp = lw_lang_string (LW_LANG_STRING_GRAPHICS_VIDEOMODE);
+      d[5].dp = lw_lang_string (LW_LANG_STRING_GRAPHICS_BRIGHTNESS);
+      d[6].dp = get_menu_res_str ();
+      d[7].dp = get_game_res_str ();
+      d[8].dp = lw_lang_string (LW_LANG_STRING_GRAPHICS_VIEWPORTSIZE);
+      d[9].dp = lw_lang_string (LW_LANG_STRING_GRAPHICS_PAGEFLIPPING);
+      d[10].dp = lw_lang_string (LW_LANG_STRING_GRAPHICS_WAVES);
+      d[11].dp = d[12].dp = d[13].dp = d[14].dp = d[15].dp = d[16].dp =
+	d[17].dp = NULL;
+      d[12].d1 = 18;
+      d[13].d1 = d[14].d1 = 4;
+      d[15].d1 = 8;
+      d[16].d1 = 8;
+      d[15].dp3 = &CONFIG_VIEWPORT_SIZE;
+      for (i = 15; i < 16; ++i)
+	{
+	  d[i].dp = NULL;
+	  d[i].dp2 = slider_int;
+	  temp = d[i].dp3;
+	  d[i].d2 = *temp;
+	}
+      d[12].dp = d[13].dp = d[14].dp = NULL;
+      d[12].d2 = CONFIG_BRIGHTNESS;
+      d[13].d2 = CONFIG_GFX_MENU;
+      d[14].d2 = CONFIG_GFX_GAME;
+      d[12].dp2 = slider_brightness;
+      d[13].dp2 = slider_menu_res;
+      d[14].dp2 = slider_game_res;
+      d[13].dp3 = &menu_res_changed;
+      d[14].dp3 = &game_res_changed;
+
+      d[11].proc = my_button_proc;
+      d[11].dp = get_fullscreen_str ();
+#ifdef DOS
+      /*
+       * Under DOS, fullscreen or windowed makes no sense, so we simply
+       * remove the button to avoid confusion.
+       */
+      d[4].flags |= D_HIDDEN;
+      d[11].flags = D_EXIT | D_HIDDEN;
+#else
+      d[11].flags = D_EXIT;
+#endif
+
+      d[16].proc = my_button_proc;
+      d[16].dp = get_page_flip_str ();
+      d[16].flags = D_EXIT;
+
+      d[17].proc = my_button_proc;
+      d[17].dp = get_wave_mode_str ();
+      d[17].flags = D_EXIT;
+
+      d[19].proc = 0;
+
+      game_res_changed = 0;
+      if (menu_res_changed || fullscreen_changed)
+	{
+	  menu_res_changed = 0;
+	  fullscreen_changed = 0;
+	  display_back_image ();
+	  dp = my_init_dialog (d, choix);
+	  my_fade_in ();
+	}
+      else
+	dp = my_init_dialog (d, choix);
+
+      show_mouse (screen);
+      while ((menu_res_changed == 0) &&
+	     (game_res_changed == 0) && my_update_dialog (dp))
+	;
+      choix = shutdown_dialog (dp);
+
+
+      if (menu_res_changed)
+	{
+	  if (d[13].d2 != CONFIG_GFX_MENU)
+	    {
+	      my_fade_out ();
+	      if (set_resolution (d[13].d2, 0, CONFIG_FULLSCREEN, NULL))
+		CONFIG_GFX_MENU = 0;
+	      else
+		CONFIG_GFX_MENU = d[13].d2;
+	    }
+	  d[13].dp = get_menu_res_str ();
+	}
+      else
+	{
+	  if (game_res_changed)
+	    {
+	      CONFIG_GFX_GAME = d[14].d2;
+	      d[14].dp = get_game_res_str ();
+	      retour = 0;
+	    }
+	  else
+	    {
+	      play_click ();
+	      switch (choix)
+		{
+		case -1:
+		case MENU_QUICK_BACK:
+		  retour = 1;
+		  break;
+		case MENU_QUICK_MAIN:
+		  retour = MENU_TOP;
+		  break;
+		case MENU_QUICK_QUIT:
+		  if (confirm_quit ())
+		    retour = MENU_EXIT;
+		  else
+		    display_back_image ();
+		  break;
+		case MENU_QUICK_PLAY:
+		  retour = MENU_PLAY;
+		  break;
+		case 11:
+		  CONFIG_FULLSCREEN = CONFIG_FULLSCREEN ? 0 : 1;
+		  d[11].dp = get_fullscreen_str ();
+		  scare_mouse ();
+		  my_button_proc (MSG_DRAW, d + 11, 0);
+		  unscare_mouse ();
+		  fullscreen_changed = 1;
+		  my_fade_out ();
+		  set_resolution (d[13].d2, 0, CONFIG_FULLSCREEN, NULL);
+		  break;
+		case 16:
+		  CONFIG_PAGE_FLIP = CONFIG_PAGE_FLIP ? 0 : 1;
+		  d[16].dp = get_page_flip_str ();
+		  scare_mouse ();
+		  my_button_proc (MSG_DRAW, d + 16, 0);
+		  unscare_mouse ();
+		  break;
+		case 17:
+		  CONFIG_WAVE_ON = CONFIG_WAVE_ON ? 0 : 1;
+		  d[17].dp = get_wave_mode_str ();
+		  scare_mouse ();
+		  my_button_proc (MSG_DRAW, d + 17, 0);
+		  unscare_mouse ();
+		  break;
+		case 18:
+		  retour = wave_options ();
+		  display_back_image ();
+		  break;
+		}
+	    }
+	}
+    }
+
+  if (retour > 0)
+    retour--;
+
+  return retour;
+}

Added: unstable/liquidwar/branches/upstream/current/src/graphics.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/graphics.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/graphics.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,68 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : graphics.h                                       */
+/* contenu       : choix des options graphiques                     */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_GRAPHICS
+#define LIQUID_WAR_INCLUDE_GRAPHICS
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int graphic_options (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/help.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/help.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/help.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,130 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : help.c                                           */
+/* contenu       : aide en ligne                                    */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+
+#include "back.h"
+#include "config.h"
+#include "dialog.h"
+#include "disk.h"
+#include "help.h"
+#include "menu.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+void
+prepare_help (DIALOG d[6], char *str)
+{
+  quick_buttons (d);
+
+  color_one_dialog (d + 4);
+  d[4].proc = my_textbox_proc;
+  d[4].d2 = 0;
+  d[4].dp = str;
+  d[4].key = 0;
+  d[4].flags = 0;
+  d[4].x = (MENU_W_SPACE * 3) / 2 + MENU_W_QUICK;
+  d[4].y = (MENU_H_SPACE * 3) / 2 + MENU_H_QUICK;
+  d[4].w = MENU_VIRTUAL_W - MENU_W_SPACE * 3 - MENU_W_QUICK * 2;
+  d[4].h = MENU_VIRTUAL_H - MENU_H_SPACE * 3 - MENU_H_QUICK * 2;
+  menu_real_coord (d + 4);
+
+  d[5].proc = NULL;
+}
+
+/*------------------------------------------------------------------*/
+int
+display_help (char *str)
+{
+  int retour = 0, choix = MENU_QUICK_BACK;
+  DIALOG d[6];
+
+  memset (d, 0, sizeof (d));
+
+  prepare_help (d, str);
+
+  display_back_image ();
+
+  while (retour == 0)
+    {
+      choix = my_do_dialog_no_clear (d, choix);
+      switch (choix)
+	{
+	case -1:
+	case MENU_QUICK_BACK:
+	  retour = 1;
+	  break;
+	case MENU_QUICK_PLAY:
+	  retour = MENU_PLAY;
+	  break;
+	case MENU_QUICK_MAIN:
+	  retour = MENU_TOP;
+	  break;
+	case MENU_QUICK_QUIT:
+	  if (confirm_quit ())
+	    retour = MENU_EXIT;
+	  break;
+	}
+    }
+  if (retour > 0)
+    retour--;
+  return retour;
+}

Added: unstable/liquidwar/branches/upstream/current/src/help.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/help.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/help.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,69 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : help.h                                           */
+/* contenu       : aide en ligne                                    */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_HELP
+#define LIQUID_WAR_INCLUDE_HELP
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void prepare_help (DIALOG d[6], char *str);
+int display_help (char *str);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/httputil.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/httputil.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/httputil.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,266 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : httputil.c                                       */
+/* content       : low level functions to handle http requests      */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdio.h>
+
+#include "httputil.h"
+#include "dnsutil.h"
+#include "log.h"
+#include "sockgen.h"
+#include "sock2gen.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_HTTPUTIL_PORT              80
+#define LW_HTTPUTIL_HOST_SIZE         200
+#define LW_HTTPUTIL_REQUEST_SIZE      1000
+#define LW_HTTPUTIL_EMPTY_LINES_LIMIT 10
+#define LW_HTTPUTIL_MIN_LEN           1
+#define LW_HTTPUTIL_GET_CMD \
+    "GET http://%s HTTP/1.1\x0d\x0a" \
+    "Host: %s\x0d\x0a" \
+    "Connection: close\x0d\x0a"
+/* additional CR+LF supplied by lw_sock_send_str() */
+/*
+ * Note: I replaced the original "\x0d\x0a" that where in the
+ * patch by the equivalent "\r\n". I find it more readable,
+ * that's all 8-) But... ...Roderick Schertler told me that
+ * it was safer to use "\x0d\x0a" for the values for "\r" or 
+ * "\n" are up to the compiler, and might cause problems
+ * especially on Mac platforms.
+ */
+
+/*==================================================================*/
+/* static functions                                                 */
+/*==================================================================*/
+
+/*==================================================================*/
+/* global functions                                                 */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends a request and waits for a response.
+ * If there's an error, the error message is written in "content".
+ * If there's no error, "content" contains the web page.
+ */
+int
+lw_httputil_get_page (char *content, char *url, int size)
+{
+  int result = 0;
+  char ip[LW_SOCK_IP_SIZE];
+  char host[LW_HTTPUTIL_HOST_SIZE + 1];
+  char request[LW_HTTPUTIL_REQUEST_SIZE + 1];
+  char data[LW_SOCK_MESSAGE_SIZE];
+  int data_len;
+  char *search;
+  int sock;
+  int empty_lines = 0;
+
+  memset (content, 0, size);
+
+  LW_MACRO_STRCPY (host, url);
+
+  search = strchr (host, '/');
+  if (search)
+    {
+      (*search) = '\0';
+    }
+
+  LW_MACRO_SPRINTF2 (request, LW_HTTPUTIL_GET_CMD, url, host);
+
+  if (lw_dnsutil_name_to_ip (ip, host))
+    {
+      if (lw_sock_connect (&sock, ip, LW_HTTPUTIL_PORT))
+	{
+	  if (lw_sock_send_str (&sock, request))
+	    {
+	      result = 1;
+	      /* read status line */
+	      if (result && lw_sock_recv_str (&sock, data) != 1)
+		{
+		  result = 0;
+		  LW_MACRO_SNPRINTF0 (content, size,
+				      "Failed to read status line");
+		}
+	      /* make sure status code starts with 2 */
+	      if (result &&
+		  !((search = strchr (data, ' ')) && search[1] == '2'))
+		{
+		  result = 0;
+		  LW_MACRO_SNPRINTF2 (content, size,
+				      "Failure from web server \"%s\": \"%s\"",
+				      host, data);
+		}
+	      if (result)
+		{
+		  /* skip past headers */
+		  while ((result =
+			  (result && (lw_sock_recv_str (&sock, data) == 1)))
+			 && data[0])
+		    {
+		      /* nothing to do here */
+		    }
+
+		  if (result)
+		    {
+		      /* finally, we read the list of servers */
+		      while (lw_sock_recv_str (&sock, data) == 1 &&
+			     empty_lines < LW_HTTPUTIL_EMPTY_LINES_LIMIT)
+			{
+			  data_len = strlen (data);
+			  /*
+			   * If the line is too short, we ignore it,
+			   * in fact, we get many "too short" lines
+			   * such as the size of the file for instance,
+			   * which is shown as an hex number in HTTP 1.1
+			   *
+			   * No "usefull" line should be smaller than 
+			   * LW_HTTPUTIL_MIN_LEN however.
+			   */
+			  if (data_len > LW_HTTPUTIL_MIN_LEN)
+			    {
+			      if ((int) (strlen (content) + data_len) <
+				  size - 2)
+				{
+				  LW_MACRO_STRNCAT (content, data, size);
+				  LW_MACRO_STRNCAT (content, "\n", size);
+				}
+			    }
+			  if (data_len == 0)
+			    {
+			      empty_lines++;
+			    }
+			}
+		    }
+		  else
+		    {
+		      LW_MACRO_SNPRINTF0 (content, size,
+					  "Failed to read headers");
+		    }
+		}
+	    }
+	  else
+	    {
+	      LW_MACRO_SNPRINTF1 (content, size, "Request \"%s\" failed!",
+				  request);
+	    }
+	  lw_sock_close (&sock);
+	}
+      else
+	{
+	  LW_MACRO_SNPRINTF1 (content, size, "Can't connect to \"%s\"!", ip);
+	}
+    }
+  else
+    {
+      LW_MACRO_SNPRINTF1 (content, size, "Unable to find host \"%s\"!", host);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Transforms a text into an URL compatible parameter, ie
+ * " " becomes "%20" for instance.
+ * urlparam must be a buffer of size+1 characters
+ * Note that "_" is transformed into " ", this is to allow more
+ * easily people to submit spaces while using command line arguments
+ * with the server.
+ */
+void
+lw_httputil_text_to_urlparam (char *urlparam, char *text, int size)
+{
+  int i, j;
+  char buffer[33];
+  unsigned char c;
+
+  memset (urlparam, 0, size + 1);
+
+  j = 0;
+  for (i = 0; text[i] && j < size; ++i)
+    {
+      if (text[i] == '_')
+	{
+	  c = ' ';
+	}
+      else
+	{
+	  c = text[i];
+	}
+
+      if (isalnum (c))
+	{
+	  urlparam[j] = c;
+	  j++;
+	}
+      else
+	{
+	  if (j < size - 2)
+	    {
+	      LW_MACRO_SPRINTF1 (buffer, "%X", c);
+	      urlparam[j] = '%';
+	      urlparam[j + 1] = buffer[0];
+	      urlparam[j + 2] = buffer[1];
+	    }
+	  j += 3;
+	}
+    }
+}

Added: unstable/liquidwar/branches/upstream/current/src/httputil.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/httputil.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/httputil.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,68 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : httputil.h                                       */
+/* content       : low level functions to handle http requests      */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_HTTPUTIL
+#define LIQUID_WAR_INCLUDE_HTTPUTIL
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int lw_httputil_get_page (char *content, char *url, int size);
+void lw_httputil_text_to_urlparam (char *urlparam, char *text, int size);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/info.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/info.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/info.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,453 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : info.c                                           */
+/* contenu       : gestion de la barre d'information                */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+#include "alleg2.h"
+#include "army.h"
+#include "back.h"
+#include "config.h"
+#include "info.h"
+#include "decal.h"
+#include "palette.h"
+#include "maptex.h"
+#include "texture.h"
+#include "time.h"
+#include "viewport.h"
+#include "watchdog.h"
+#include "macro.h"
+#include "network.h"
+#include "random.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#define INFO_BAR_W 50
+#define INFO_BAR_H 15
+
+static BITMAP *INFO_BAR_BACK = NULL;
+static BITMAP *INFO_BAR = NULL;
+static int INFO_BAR_POS_X[NB_TEAMS];
+static int INFO_BAR_POS_Y[NB_TEAMS];
+static int INFO_BAR_POS_W;
+static int INFO_BAR_POS_H;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/* on verifie si il y a des changements sur la barre d'etat         */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+int
+init_info_bar (int w, int h, int epaisseur)
+{
+  int i, x, y;
+  BITMAP *front, *back;
+
+  if (INFO_BAR)
+    destroy_bitmap (INFO_BAR);
+  INFO_BAR = my_create_bitmap (w, h);
+  INFO_BAR_BACK = my_create_bitmap (w, h);
+
+  if (INFO_BAR && INFO_BAR_BACK)
+    {
+      if (w > h)
+	{
+	  rectfill (INFO_BAR, 0, 0, epaisseur - 1, h - 1, MENU_BG);
+	  vline (INFO_BAR, epaisseur, 0, h - 1, MENU_FG);
+
+	  front =
+	    lw_maptex_create_fg (CONFIG_LEVEL_MAP, CONFIG_LEVEL_FG,
+				 LW_NETWORK_ON, LW_RANDOM_ON,
+				 CONFIG_USE_DEFAULT_TEXTURE);
+	  back =
+	    lw_maptex_create_bg (CONFIG_LEVEL_MAP, CONFIG_LEVEL_BG,
+				 LW_NETWORK_ON, LW_RANDOM_ON,
+				 CONFIG_USE_DEFAULT_TEXTURE);
+
+	  for (y = 0; y < h; y += front->h)
+	    for (x = epaisseur + 1; x < w; x += front->w)
+	      draw_sprite (INFO_BAR, front, x, y);
+
+	  INFO_BAR_POS_W = w - epaisseur - 5;
+	  INFO_BAR_POS_H = (h - 1) / PLAYING_TEAMS - 1;
+	  for (i = 0; i < PLAYING_TEAMS; ++i)
+	    {
+	      INFO_BAR_POS_X[i] = epaisseur + 3;
+	      INFO_BAR_POS_Y[i] = (h + 1 - PLAYING_TEAMS
+				   * (INFO_BAR_POS_H + 1)) / 2
+		+ i * (INFO_BAR_POS_H + 1);
+
+	      for (y = INFO_BAR_POS_Y[i];
+		   y < INFO_BAR_POS_Y[i] + INFO_BAR_POS_H; y++)
+		for (x = INFO_BAR_POS_X[i];
+		     x < INFO_BAR_POS_X[i] + INFO_BAR_POS_W; x++)
+		  putpixel (INFO_BAR, x, y,
+			    getpixel (back,
+				      (x - epaisseur - 1) % back->w,
+				      y % back->h));
+	    }
+
+	  destroy_bitmap (back);
+	  destroy_bitmap (front);
+	}
+      else
+	{
+	  rectfill (INFO_BAR, 0, 0, w - 1, epaisseur - 1, MENU_BG);
+	  hline (INFO_BAR, 0, epaisseur, w - 1, MENU_FG);
+
+	  front =
+	    lw_maptex_create_fg (CONFIG_LEVEL_MAP, CONFIG_LEVEL_FG,
+				 LW_NETWORK_ON, LW_RANDOM_ON,
+				 CONFIG_USE_DEFAULT_TEXTURE);
+	  back =
+	    lw_maptex_create_bg (CONFIG_LEVEL_MAP, CONFIG_LEVEL_BG,
+				 LW_NETWORK_ON, LW_RANDOM_ON,
+				 CONFIG_USE_DEFAULT_TEXTURE);
+
+	  for (y = epaisseur + 1; y < h; y += front->h)
+	    for (x = 0; x < w; x += front->w)
+	      draw_sprite (INFO_BAR, front, x, y);
+
+	  INFO_BAR_POS_W = (w - 1) / PLAYING_TEAMS - 1;
+	  INFO_BAR_POS_H = h - epaisseur - 5;
+	  for (i = 0; i < PLAYING_TEAMS; ++i)
+	    {
+	      INFO_BAR_POS_X[i] = (w + 1 - PLAYING_TEAMS
+				   * (INFO_BAR_POS_W + 1)) / 2
+		+ i * (INFO_BAR_POS_W + 1);
+	      INFO_BAR_POS_Y[i] = epaisseur + 3;
+
+	      for (y = INFO_BAR_POS_Y[i];
+		   y < INFO_BAR_POS_Y[i] + INFO_BAR_POS_H; y++)
+		for (x = INFO_BAR_POS_X[i];
+		     x < INFO_BAR_POS_X[i] + INFO_BAR_POS_W; x++)
+		  putpixel (INFO_BAR, x, y,
+			    getpixel (back,
+				      x % back->w,
+				      (y - epaisseur - 1) % back->h));
+	    }
+
+	  destroy_bitmap (back);
+	  destroy_bitmap (front);
+	}
+      draw_sprite (INFO_BAR_BACK, INFO_BAR, 0, 0);
+    }
+  return (INFO_BAR && INFO_BAR_BACK);
+}
+
+/*------------------------------------------------------------------*/
+void
+free_info_bar (void)
+{
+  if (INFO_BAR)
+    {
+      destroy_bitmap (INFO_BAR);
+      INFO_BAR = NULL;
+    }
+  if (INFO_BAR_BACK)
+    {
+      destroy_bitmap (INFO_BAR_BACK);
+      INFO_BAR_BACK = NULL;
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+display_time (int x, int y, int w, int h)
+{
+  char buffer[6];
+  int min, sec, time;
+
+  /*
+   * w and h args are ignored for now
+   */
+  LW_MACRO_NOP (w);
+  LW_MACRO_NOP (h);
+
+  time = TIME_LEFT;
+  if (time < 0)
+    time = 0;
+  min = time / 60;
+  sec = time % 60;
+
+  buffer[0] = '0' + min / 10;
+  buffer[1] = '0' + min % 10;
+  buffer[2] = ':';
+  buffer[3] = '0' + sec / 10;
+  buffer[4] = '0' + sec % 10;
+  buffer[5] = 0;
+
+  textout_ex (INFO_BAR, font, buffer, x + 1, y + 1, -1, -1);
+}
+
+/*------------------------------------------------------------------*/
+static void
+display_horizontal_info (int w, int h, int epaisseur)
+{
+  int i, barre_w, barre_x, barre_y;
+
+  /*
+   * w arg is ignored for now
+   */
+  LW_MACRO_NOP (w);
+
+  display_time (0, 0, epaisseur, h);
+
+  for (i = 0; i < PLAYING_TEAMS; ++i)
+    {
+      barre_w = (ACTIVE_FIGHTERS[i] * (INFO_BAR_POS_W - 1))
+	/ CURRENT_ARMY_SIZE + 1;
+      barre_x = INFO_BAR_POS_X[i] + INFO_BAR_POS_W - barre_w;
+      barre_y = INFO_BAR_POS_Y[i];
+      rectfill (INFO_BAR,
+		barre_x,
+		barre_y,
+		barre_x + barre_w - 1,
+		barre_y + INFO_BAR_POS_H - 1,
+		COLOR_FIRST_ENTRY[i] + COLORS_PER_TEAM - 1);
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+display_vertical_info (int w, int h, int epaisseur)
+{
+  int i, barre_h, barre_x, barre_y;
+
+  /*
+   * h arg is ignored for now
+   */
+  LW_MACRO_NOP (h);
+
+  display_time (0, 0, w, epaisseur);
+
+  for (i = 0; i < PLAYING_TEAMS; ++i)
+    {
+      barre_h = (ACTIVE_FIGHTERS[i] * (INFO_BAR_POS_H - 1))
+	/ CURRENT_ARMY_SIZE + 1;
+      barre_y = INFO_BAR_POS_Y[i] + INFO_BAR_POS_H - barre_h;
+      barre_x = INFO_BAR_POS_X[i];
+      rectfill (INFO_BAR,
+		barre_x,
+		barre_y,
+		barre_x + INFO_BAR_POS_W - 1,
+		barre_y + barre_h - 1,
+		COLOR_FIRST_ENTRY[i] + COLORS_PER_TEAM - 1);
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+display_info (void)
+{
+  int x, y, w, h, epaisseur, temp_h, temp_w;
+
+  if (!(CONFIG_INFO_BAR & 4))
+    {
+      temp_w = text_length (font, "00:00") + 2;
+      temp_h = text_height (font) + 2;
+
+      switch (CONFIG_INFO_BAR)
+	{
+	case 0:
+	case 2:
+	  w = SCREEN_W;
+	  h = temp_h;
+	  if (h < 13)
+	    h = 13;
+	  epaisseur = temp_w;
+	  break;
+	case 1:
+	default:
+	  w = temp_w;
+	  if (w < 13)
+	    w = 13;
+	  h = SCREEN_H;
+	  epaisseur = temp_h;
+	  break;
+	}
+
+      if (!INFO_BAR)
+	init_info_bar (w, h, epaisseur);
+
+      draw_sprite (INFO_BAR, INFO_BAR_BACK, 0, 0);
+
+      switch (CONFIG_INFO_BAR)
+	{
+	case 0:
+	  x = 0;
+	  y = PAGE_FLIP_H;
+	  hline (screen, x, y + h, x + w - 1, MENU_FG);
+	  display_horizontal_info (w, h, epaisseur);
+	  break;
+	case 1:
+	  x = SCREEN_W - w;
+	  y = PAGE_FLIP_H;
+	  vline (screen, x - 1, y, y + h - 1, MENU_FG);
+	  display_vertical_info (w, h, epaisseur);
+	  break;
+	case 2:
+	  x = 0;
+	  y = PAGE_FLIP_H + SCREEN_H - h;
+	  hline (screen, x, y - 1, x + w - 1, MENU_FG);
+	  display_horizontal_info (w, h, epaisseur);
+	  break;
+	default:
+	  x = 0;
+	  y = PAGE_FLIP_H;
+	  vline (screen, x + w, y, y + h - 1, MENU_FG);
+	  display_vertical_info (w, h, epaisseur);
+	  break;
+	}
+      draw_sprite (screen, INFO_BAR, x, y);
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_info_get_room_for_viewport (int *x, int *y, int *w, int *h)
+{
+  int temp_h, temp_w;
+
+  if (!(CONFIG_INFO_BAR & 4))
+    {
+      temp_w = text_length (font, "00:00") + 2;
+      temp_h = text_height (font) + 2;
+
+      if (temp_h < 13)
+	{
+	  temp_h = 13;
+	}
+
+      if (temp_w < 13)
+	{
+	  temp_w = 13;
+	}
+
+      switch (CONFIG_INFO_BAR)
+	{
+	case 0:
+	  *x = 0;
+	  *y = temp_h + 1;
+	  *w = SCREEN_W;
+	  *h = SCREEN_H - temp_h - 1;
+	  break;
+	case 1:
+	  *x = 0;
+	  *y = 0;
+	  *w = SCREEN_W - temp_w - 1;
+	  *h = SCREEN_H;
+	  break;
+	case 2:
+	  *x = 0;
+	  *y = 0;
+	  *w = SCREEN_W;
+	  *h = SCREEN_H - temp_h - 1;
+	  break;
+	default:
+	  *x = temp_w + 1;
+	  *y = 0;
+	  *w = SCREEN_W - temp_w - 1;
+	  *h = SCREEN_H;
+	  break;
+	}
+    }
+  else
+    {
+      *x = 0;
+      *y = 0;
+      *w = SCREEN_W;
+      *h = SCREEN_H;
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+check_info_state (void)
+{
+  static int changed;
+
+  if (WATCHDOG_SCANCODE[KEY_F1])
+    {
+      if (CONFIG_INFO_BAR >= 4)
+	CONFIG_INFO_BAR -= 4;
+      else
+	CONFIG_INFO_BAR += 4;
+      free_info_bar ();
+      changed = CONFIG_PAGE_FLIP ? 2 : 1;
+      lw_viewport_register_change (changed);
+    }
+  if (WATCHDOG_SCANCODE[KEY_F2] && CONFIG_INFO_BAR < 4)
+    {
+      CONFIG_INFO_BAR++;
+      if (CONFIG_INFO_BAR == 4)
+	CONFIG_INFO_BAR = 0;
+      if (CONFIG_INFO_BAR == 8)
+	CONFIG_INFO_BAR = 4;
+      free_info_bar ();
+      changed = CONFIG_PAGE_FLIP ? 2 : 1;
+      lw_viewport_register_change (changed);
+    }
+
+  if (changed > 0)
+    {
+      display_back_image ();
+      changed--;
+    }
+}

Added: unstable/liquidwar/branches/upstream/current/src/info.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/info.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/info.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,64 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : info.h                                           */
+/* contenu       : gestion de la barre d'information                */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_INFO
+#define LIQUID_WAR_INCLUDE_INFO
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int init_info_bar (int w, int h, int epaisseur);
+void free_info_bar (void);
+void display_info (void);
+void lw_info_get_room_for_viewport (int *x, int *y, int *w, int *h);
+void check_info_state (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/init.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/init.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/init.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,256 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : init.c                                           */
+/* contenu       : installation d'allegro                           */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+#include <stdlib.h>
+#include <time.h>
+
+#include "base.h"
+#include "config.h"
+#include "gfxmode.h"
+#include "init.h"
+#include "exit.h"
+#include "joystick.h"
+#include "log.h"
+#include "startup.h"
+#include "ticker.h"
+#include "sockgen.h"
+#include "lang.h"
+#include "asm.h"
+#include "capture.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+void
+display_success (int success)
+{
+  if (success)
+    log_println_str (" - success!");
+  else
+    log_println_str (" - failed...");
+
+  log_flush ();
+  /* delay (100); */
+}
+
+/*------------------------------------------------------------------*/
+void
+display_success_driver (char *driver)
+{
+  log_print_str (" (driver=\"");
+  log_print_str (driver);
+  log_println_str ("\") - success!");
+
+  log_flush ();
+  /* delay (100); */
+}
+
+/*------------------------------------------------------------------*/
+int
+init_all ()
+{
+  int result = 0;
+  int assembly = 1, config = 1, timer = 1, keyboard = 1, mouse = 1, sound =
+    1, joystick = 1, network = 1;
+
+  /*
+   * we use srand to garantee that random() won't return the same values
+   * each time the game is run
+   */
+  srandom (time (NULL));
+
+  set_startup ();
+  log_init ();
+  lw_lang_init ();
+  set_uformat (U_ASCII);
+
+  allegro_init ();
+#ifdef DOS
+  set_gfx_mode (GFX_TEXT, 0, 0, 0, 0);
+#endif
+  log_println_str
+    ("Starting Allegro (http://www.talula.demon.co.uk/allegro)");
+  log_println ();
+  log_print_str ("Allegro ID : ");
+  log_println_str (allegro_id);
+  log_println ();
+
+  set_color_depth (8);
+  set_color_conversion (COLORCONV_REDUCE_TO_256);
+
+  /*
+   * We check for potential struct size errors
+   */
+  assembly = lw_asm_check_struct_align ();
+
+  log_print_str ("Loading config options from \"");
+  log_print_str (STARTUP_CFG_PATH);
+  log_print_str ("\"");
+
+  /*
+   * We call this now only (after loading the options), for
+   * options must be loaded for my_exit_close_button to work
+   */
+  //set_window_close_button (TRUE); deprecated
+  //set_window_close_hook (my_exit_close_button); deprecated
+  set_close_button_callback (my_exit_close_button);
+
+  display_success (config = load_config_options ());
+
+  log_print_str ("Installing timer");
+  timer = !install_timer ();
+  if (timer)
+    {
+      display_success_driver ((char *) timer_driver->ascii_name);
+    }
+  else
+    {
+      display_success (0);
+    }
+
+  start_ticker ();
+
+  log_print_str ("Installing keyboard");
+  keyboard = !install_keyboard ();
+  if (keyboard)
+    {
+      display_success_driver ((char *) keyboard_driver->ascii_name);
+    }
+  else
+    {
+      display_success (0);
+    }
+
+  log_print_str ("Installing mouse");
+  mouse = install_mouse () != -1;
+  if (mouse)
+    {
+      display_success_driver ((char *) mouse_driver->ascii_name);
+    }
+  else
+    {
+      display_success (0);
+    }
+
+  if (STARTUP_DIGI_CARD != DIGI_NONE || STARTUP_MIDI_CARD != MIDI_NONE)
+    {
+      log_print_str ("Installing sound");
+      sound = !install_sound (STARTUP_DIGI_CARD, STARTUP_MIDI_CARD, "");
+      if (!sound)
+	{
+	  /*
+	   * OK, first init failed, now we try without the MIDI card, which
+	   * is where problems usually come from, especially under Linux
+	   */
+	  sound = !install_sound (STARTUP_DIGI_CARD, MIDI_NONE, "");
+	}
+      if (sound)
+	{
+	  log_print_str (" (digi=\"");
+	  log_print_str ((char *) digi_driver->ascii_name);
+	  log_print_str ("\", midi=\"");
+	  log_print_str ((char *) midi_driver->ascii_name);
+	  log_print_str ("\")");
+	}
+      display_success (sound);
+    }
+
+  if (STARTUP_JOYSTICK_ON)
+    {
+      log_print_str ("Installing joystick");
+      if (STARTUP_JOYSTICK_ON)
+	joystick = !my_initialise_joystick ();
+      if (joystick)
+	{
+	  display_success_driver ((char *) joystick_driver->ascii_name);
+	}
+      else
+	{
+	  display_success (0);
+	}
+    }
+
+  log_print_str ("Setting up network");
+  display_success (network = lw_sock_init ());
+
+  /*
+   * We update the "capture" mode
+   */
+  lw_capture_set_mode (STARTUP_CAPTURE);
+
+  result = (assembly || !STARTUP_CHECK)
+    && timer
+    && keyboard
+    && mouse && (sound || !STARTUP_CHECK) && (joystick || !STARTUP_CHECK);
+
+  return (result);
+}
+
+/*------------------------------------------------------------------*/
+int
+start_graphic (void)
+{
+  int retour;
+
+  retour = (!set_resolution (CONFIG_GFX_MENU, 0, CONFIG_FULLSCREEN, NULL));
+
+  return retour;
+}

Added: unstable/liquidwar/branches/upstream/current/src/init.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/init.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/init.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,63 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : init.h                                           */
+/* contenu       : installation d'allegro                           */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_INIT
+#define LIQUID_WAR_INCLUDE_INIT
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void display_success (int success);
+void display_success_driver (char *driver);
+int init_all ();
+int start_graphic (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/internet.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/internet.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/internet.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,520 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : internet.c                                       */
+/* content       : menu with the list of current internet games     */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdio.h>
+#include <string.h>
+
+#include "internet.h"
+#include "base.h"
+#include "config.h"
+#include "decal.h"
+#include "dialog.h"
+#include "help.h"
+#include "menu.h"
+#include "play.h"
+#include "disk.h"
+#include "protocol.h"
+#include "sockgen.h"
+#include "server.h"
+#include "network.h"
+#include "keyexch.h"
+#include "error.h"
+#include "back.h"
+#include "wwwcli.h"
+#include "log.h"
+#include "netplay.h"
+#include "lang.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* contants                                                         */
+/*==================================================================*/
+
+#define LW_INTERNET_LIST_SIZE 1000
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+static LW_WWWCLI_DATA *list_data = NULL;
+static int *list_size = NULL;
+static char buffer_ping[50];
+static char buffer_port[50];
+static char buffer_password[50];
+static char buffer_uptime[50];
+static char buffer_comment[COMMENT_SIZE + 1];
+static DIALOG *dialog_list = NULL;
+static DIALOG *dialog_ping = NULL;
+static DIALOG *dialog_port = NULL;
+static DIALOG *dialog_password = NULL;
+static DIALOG *dialog_uptime = NULL;
+static DIALOG *dialog_comment = NULL;
+
+/*==================================================================*/
+/* static functions                                                 */
+/*==================================================================*/
+
+static char *list_callback (int index, int *list_size);
+static void position_list (DIALOG * d);
+static void position_comment (DIALOG * d);
+static void update_text_ping (int i);
+static void update_text_port (int i);
+static void update_text_password (int i);
+static void update_text_uptime (int i);
+static void update_text_comment (int i);
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+internet_find (void)
+{
+  DIALOG d[13];
+  int choix = 4, retour = 0;
+  LW_WWWCLI_DATA data[LW_INTERNET_LIST_SIZE];
+  int size;
+  int cur;
+  int i;
+
+  memset (d, 0, sizeof (d));
+
+  size = LW_INTERNET_LIST_SIZE;
+  lw_wwwcli_get_games (data, &size);
+
+  list_data = data;
+  list_size = &size;
+
+  //  log_println_str(data[0].ip);
+
+  while (retour == 0)
+    {
+      position_list (d + 4);
+
+      standard_button (d + 5, 1, 0, 2, 10);
+      standard_button (d + 6, 1, 1, 2, 10);
+      standard_button (d + 7, 1, 3, 2, 10);
+      standard_button (d + 8, 1, 4, 2, 10);
+      standard_button (d + 9, 1, 5, 2, 10);
+      standard_button (d + 10, 1, 6, 2, 10);
+
+      for (i = 0; i < 6; ++i)
+	{
+	  d[5 + i].w =
+	    menu_real_x ((MENU_W_INTERNET_LIST + MENU_W_STANDARD) / 2);
+	}
+
+      position_comment (d + 11);
+
+      quick_buttons (d);
+
+      d[4].dp = list_callback;
+      d[4].d1 = d[4].d2 = 0;
+      d[4].dp2 = d[4].dp3 = NULL;
+      d[4].proc = my_list_proc;
+
+      d[5].dp = lw_lang_string (LW_LANG_STRING_INTERNET_REFRESH);
+      d[6].dp = lw_lang_string (LW_LANG_STRING_INTERNET_JOINNOW);
+
+      d[7].dp = buffer_ping;
+      d[8].dp = buffer_port;
+      d[9].dp = buffer_password;
+      d[10].dp = buffer_uptime;
+      d[11].dp = buffer_comment;
+      d[7].proc = d[8].proc = d[9].proc = d[10].proc = d[11].proc =
+	my_textbox_proc;
+      d[12].proc = 0;
+
+      dialog_list = d + 4;
+      dialog_ping = d + 7;
+      dialog_port = d + 8;
+      dialog_password = d + 9;
+      dialog_uptime = d + 10;
+      dialog_comment = d + 11;
+
+      update_text_ping (0);
+      update_text_port (0);
+      update_text_password (0);
+      update_text_uptime (0);
+      update_text_comment (0);
+
+      choix = my_do_dialog (d, choix);
+
+      /*
+       * First test to select the current list value if
+       * it exists, and make it the current server.
+       */
+      cur = d[4].d1;
+      if (choix == MENU_QUICK_PLAY || choix == 4 || choix == 6)
+	{
+	  if (cur >= 0 && cur < size)
+	    {
+	      strncpy (CONFIG_SERVER_ADDRESS, data[cur].ip,
+		       SERVER_ADDRESS_SIZE);
+	      CONFIG_SERVER_ADDRESS[SERVER_ADDRESS_SIZE] = '\0';
+	      CONFIG_SERVER_PORT = data[cur].port;
+	    }
+	}
+
+      switch (choix)
+	{
+	case -1:
+	case MENU_QUICK_BACK:
+	  retour = 1;
+	  break;
+	case MENU_QUICK_MAIN:
+	  retour = MENU_TOP;
+	  break;
+	case MENU_QUICK_QUIT:
+	  if (confirm_quit ())
+	    retour = MENU_EXIT;
+	  else
+	    display_back_image ();
+	  break;
+	case MENU_QUICK_PLAY:
+	  retour = netplay_sequence ();
+	  break;
+	case 5:
+	  size = LW_INTERNET_LIST_SIZE;
+	  lw_wwwcli_get_games (data, &size);
+	  break;
+	case 4:
+	case 6:
+	  if (cur >= 0 && cur < size)
+	    {
+	      retour = netplay_sequence ();
+	    }
+	  break;
+	}
+    }
+
+  if (retour > 0)
+    retour--;
+
+  return retour;
+}
+
+/*------------------------------------------------------------------*/
+static void
+position_list (DIALOG * d)
+{
+  d->x = (MENU_VIRTUAL_W - MENU_W_SPACE) / 2 - MENU_W_INTERNET_LIST;
+  d->y = (MENU_VIRTUAL_H - MENU_H_INTERNET_LIST) / 2;
+  d->w = MENU_W_INTERNET_LIST;
+  d->h = MENU_H_INTERNET_LIST;
+
+  color_one_dialog (d);
+  menu_real_coord (d);
+  d->key = 0;
+  d->dp = "";
+  d->flags = D_EXIT;
+}
+
+/*------------------------------------------------------------------*/
+static void
+position_comment (DIALOG * d)
+{
+  d->x = (MENU_VIRTUAL_W + MENU_W_SPACE) / 2;
+  d->y = (MENU_VIRTUAL_H - MENU_H_INTERNET_LIST) / 2 +
+    7 * MENU_H_STANDARD + 7 * MENU_H_SPACE;
+  d->w = MENU_W_INTERNET_LIST;
+  d->h = 3 * MENU_H_STANDARD + (3 * MENU_H_SPACE) / 2;
+
+  color_one_dialog (d);
+  menu_real_coord (d);
+  d->key = 0;
+  d->dp = "";
+  d->flags = D_EXIT;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Callback called for the list by the Allegro GUI engine
+ */
+static char *
+list_callback (int index, int *size)
+{
+  char *result = NULL;
+
+  if (index >= 0)
+    {
+      if (index < *list_size)
+	{
+	  result = list_data[index].label;
+
+	  /*
+	   * Now this _is_ a hack: I wanted the port
+	   * password, uptime and comment fields to
+	   * be updated automatically when selecting
+	   * a line in the list, without even double-clicking
+	   * it. So what I did is that when the list engine
+	   * asks for the label of the current line, I
+	   * automatically recalculate and redraw these fields.
+	   * Since the list engine has to hilight the current
+	   * label, I assume it asks for the current label
+	   * everytime the selection is changed.
+	   */
+	  if (index == dialog_list->d1)
+	    {
+	      update_text_ping (dialog_list->d1);
+	      update_text_port (dialog_list->d1);
+	      update_text_password (dialog_list->d1);
+	      update_text_uptime (dialog_list->d1);
+	      update_text_comment (dialog_list->d1);
+
+	      scare_mouse ();
+	      my_textbox_proc (MSG_DRAW, dialog_ping, 0);
+	      my_textbox_proc (MSG_DRAW, dialog_port, 0);
+	      my_textbox_proc (MSG_DRAW, dialog_password, 0);
+	      my_textbox_proc (MSG_DRAW, dialog_uptime, 0);
+	      my_textbox_proc (MSG_DRAW, dialog_comment, 0);
+	      unscare_mouse ();
+	    }
+	}
+      else
+	{
+	  result = "";
+	}
+    }
+  else
+    {
+      *size = *list_size;
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+static void
+update_text_ping (int i)
+{
+  if (i >= 0)
+    {
+      if (i < *list_size)
+	{
+	  if (list_data[i].ping_delay >= 0)
+	    {
+	      LW_MACRO_SPRINTF3 (buffer_ping, "%s: %d %s",
+				 lw_lang_string
+				 (LW_LANG_STRING_INTERNET_PING),
+				 list_data[i].ping_delay,
+				 lw_lang_string
+				 (LW_LANG_STRING_INTERNET_MSEC));
+	    }
+	  else
+	    {
+	      LW_MACRO_STRCPY (buffer_ping,
+			       lw_lang_string
+			       (LW_LANG_STRING_INTERNET_UNREACHABLE));
+	    }
+	}
+      else
+	{
+	  LW_MACRO_SPRINTF1 (buffer_ping,
+			     "%s:",
+			     lw_lang_string (LW_LANG_STRING_INTERNET_PING));
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+update_text_port (int i)
+{
+  if (i >= 0)
+    {
+      if (i < *list_size)
+	{
+	  LW_MACRO_SPRINTF2 (buffer_port,
+			     "%s: %d",
+			     lw_lang_string
+			     (LW_LANG_STRING_INTERNET_PORT),
+			     list_data[i].port);
+	}
+      else
+	{
+	  LW_MACRO_SPRINTF1 (buffer_port,
+			     "%s:",
+			     lw_lang_string (LW_LANG_STRING_INTERNET_PORT));
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+update_text_password (int i)
+{
+  if (i >= 0)
+    {
+      if (i < *list_size)
+	{
+	  if (list_data[i].password)
+	    {
+	      LW_MACRO_SPRINTF2 (buffer_password,
+				 "%s: %s",
+				 lw_lang_string
+				 (LW_LANG_STRING_INTERNET_PASSWORD),
+				 lw_lang_string
+				 (LW_LANG_STRING_INTERNET_YES));
+	    }
+	  else
+	    {
+	      LW_MACRO_SPRINTF2 (buffer_password,
+				 "%s: %s",
+				 lw_lang_string
+				 (LW_LANG_STRING_INTERNET_PASSWORD),
+				 lw_lang_string (LW_LANG_STRING_INTERNET_NO));
+	    }
+	}
+      else
+	{
+	  LW_MACRO_SPRINTF1 (buffer_password,
+			     "%s:",
+			     lw_lang_string
+			     (LW_LANG_STRING_INTERNET_PASSWORD));
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+update_text_uptime (int i)
+{
+  int days, hours, minutes, seconds;
+  if (i >= 0)
+    {
+      if (i < *list_size)
+	{
+	  seconds = list_data[i].uptime % 60;
+	  minutes = (list_data[i].uptime / 60) % 60;
+	  hours = (list_data[i].uptime / 3600) % 24;
+	  days = (list_data[i].uptime / (24 * 3600));
+	  if (days > 0)
+	    {
+	      if (days > 1)
+		{
+		  LW_MACRO_SPRINTF3 (buffer_uptime,
+				     "%s: %d %s",
+				     lw_lang_string
+				     (LW_LANG_STRING_INTERNET_UPTIME),
+				     days,
+				     lw_lang_string
+				     (LW_LANG_STRING_INTERNET_DAYS));
+		}
+	      else
+		{
+		  LW_MACRO_SPRINTF2 (buffer_uptime,
+				     "%s: 1 %s",
+				     lw_lang_string
+				     (LW_LANG_STRING_INTERNET_UPTIME),
+				     lw_lang_string
+				     (LW_LANG_STRING_INTERNET_DAY));
+		}
+	    }
+	  else if (hours > 0)
+	    {
+	      LW_MACRO_SPRINTF3 (buffer_uptime,
+				 "%s: %d %s",
+				 lw_lang_string
+				 (LW_LANG_STRING_INTERNET_UPTIME),
+				 hours,
+				 lw_lang_string
+				 (LW_LANG_STRING_INTERNET_HOURS));
+	    }
+	  else if (minutes > 0)
+	    {
+	      LW_MACRO_SPRINTF3 (buffer_uptime,
+				 "%s: %d %s",
+				 lw_lang_string
+				 (LW_LANG_STRING_INTERNET_UPTIME),
+				 minutes,
+				 lw_lang_string
+				 (LW_LANG_STRING_INTERNET_MINUTES));
+	    }
+	  else
+	    {
+	      LW_MACRO_SPRINTF3 (buffer_uptime,
+				 "%s: %d %s",
+				 lw_lang_string
+				 (LW_LANG_STRING_INTERNET_UPTIME),
+				 seconds,
+				 lw_lang_string
+				 (LW_LANG_STRING_INTERNET_SECONDS));
+	    }
+	}
+      else
+	{
+	  LW_MACRO_SPRINTF1 (buffer_uptime,
+			     "%s:",
+			     lw_lang_string (LW_LANG_STRING_INTERNET_UPTIME));
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+update_text_comment (int i)
+{
+  if (i >= 0)
+    {
+      if (i < *list_size)
+	{
+	  LW_MACRO_SPRINTF1 (buffer_comment, "%s", list_data[i].comment);
+	}
+      else
+	{
+	  LW_MACRO_SPRINTF0 (buffer_comment, "");
+	}
+    }
+}

Added: unstable/liquidwar/branches/upstream/current/src/internet.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/internet.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/internet.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,63 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : internet.c                                       */
+/* content       : menu with the list of current internet games     */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_INCLUDE
+#define LIQUID_WAR_INCLUDE_INCLUDE
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int internet_find (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/joystick.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/joystick.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/joystick.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,278 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : joystick.c                                       */
+/* contenu       : gestion du joystick                              */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+#include "config.h"
+#include "joystick.h"
+#include "startup.h"
+#include "log.h"
+
+/*==================================================================*/
+/* defines                                                          */
+/*==================================================================*/
+#ifndef MIN
+#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
+#endif
+#ifndef MAX
+#define MAX(a, b)  (((a) > (b)) ? (a) : (b))
+#endif
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+int JOYSTICK_CONTROL_JOY1_UP = 0;
+int JOYSTICK_CONTROL_JOY1_RIGHT = 0;
+int JOYSTICK_CONTROL_JOY1_DOWN = 0;
+int JOYSTICK_CONTROL_JOY1_LEFT = 0;
+int JOYSTICK_CONTROL_JOY1_B1 = 0;
+int JOYSTICK_CONTROL_JOY1_B2 = 0;
+int JOYSTICK_CONTROL_JOY1_B3 = 0;
+int JOYSTICK_CONTROL_JOY1_B4 = 0;
+
+int JOYSTICK_CONTROL_JOY2_UP = 0;
+int JOYSTICK_CONTROL_JOY2_RIGHT = 0;
+int JOYSTICK_CONTROL_JOY2_DOWN = 0;
+int JOYSTICK_CONTROL_JOY2_LEFT = 0;
+int JOYSTICK_CONTROL_JOY2_B1 = 0;
+int JOYSTICK_CONTROL_JOY2_B2 = 0;
+
+/*==================================================================*/
+/* static vars                                                      */
+/*==================================================================*/
+
+static int JOY1_MIN_X = 1000;
+static int JOY1_MID_X = 0;
+static int JOY1_MAX_X = -1000;
+static int JOY1_MIN_Y = 1000;
+static int JOY1_MID_Y = 0;
+static int JOY1_MAX_Y = -1000;
+
+static int JOY2_MIN_X = 1000;
+static int JOY2_MID_X = 0;
+static int JOY2_MAX_X = -1000;
+static int JOY2_MIN_Y = 1000;
+static int JOY2_MID_Y = 0;
+static int JOY2_MAX_Y = -1000;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+my_initialise_joystick (void)
+{
+  int result;
+
+#ifdef DOS
+#define JOY_TYPE0 JOY_TYPE_2PADS
+#define JOY_TYPE1 JOY_TYPE_4BUTTON
+#define JOY_TYPE2 JOY_TYPE_STANDARD
+#endif
+
+#ifdef WIN32
+#define JOY_TYPE0 JOY_TYPE_AUTODETECT
+#define JOY_TYPE1 JOY_TYPE_AUTODETECT
+#define JOY_TYPE2 JOY_TYPE_AUTODETECT
+#endif
+
+#ifdef UNIX
+#define JOY_TYPE0 JOY_TYPE_AUTODETECT
+#define JOY_TYPE1 JOY_TYPE_AUTODETECT
+#define JOY_TYPE2 JOY_TYPE_AUTODETECT
+#endif
+
+  if (STARTUP_JOYSTICK_ON)
+    {
+      int type = JOY_TYPE_AUTODETECT;
+
+      switch (CONFIG_JOYSTICK_ON)
+	{
+	case 1:
+	  type = JOY_TYPE0;
+	  break;
+	case 2:
+	  type = JOY_TYPE1;
+	  break;
+	case 3:
+	  type = JOY_TYPE2;
+	  break;
+	}
+      result = install_joystick (type);
+    }
+  else
+    result = -1;
+
+  /*
+   * Now we set "default" values
+   */
+  if (num_joysticks >= 1)
+    {
+      if (joy[0].num_sticks >= 1)
+	{
+	  if (joy[0].stick[0].num_axis >= 2)
+	    {
+	      JOY1_MIN_X = joy[0].stick[0].axis[0].pos;
+	      JOY1_MID_X = joy[0].stick[0].axis[0].pos;
+	      JOY1_MAX_X = joy[0].stick[0].axis[0].pos;
+	      JOY1_MIN_Y = joy[0].stick[0].axis[1].pos;
+	      JOY1_MID_Y = joy[0].stick[0].axis[1].pos;
+	      JOY1_MAX_Y = joy[0].stick[0].axis[1].pos;
+	    }
+	}
+    }
+  if (num_joysticks >= 2)
+    {
+      if (joy[1].num_sticks >= 1)
+	{
+	  if (joy[1].stick[0].num_axis >= 2)
+	    {
+	      JOY2_MIN_X = joy[1].stick[0].axis[0].pos;
+	      JOY2_MID_X = joy[1].stick[0].axis[0].pos;
+	      JOY2_MAX_X = joy[1].stick[0].axis[0].pos;
+	      JOY2_MIN_Y = joy[1].stick[0].axis[1].pos;
+	      JOY2_MID_Y = joy[1].stick[0].axis[1].pos;
+	      JOY2_MAX_Y = joy[1].stick[0].axis[1].pos;
+	    }
+	}
+    }
+
+  my_poll_joystick ();
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+void
+my_poll_joystick (void)
+{
+  if (CONFIG_JOYSTICK_ON && STARTUP_JOYSTICK_ON)
+    {
+      poll_joystick ();
+
+      if (num_joysticks >= 1)
+	{
+	  if (joy[0].num_sticks >= 1)
+	    {
+	      if (joy[0].stick[0].num_axis >= 2)
+		{
+		  JOY1_MIN_X = MIN (joy[0].stick[0].axis[0].pos, JOY1_MIN_X);
+		  JOY1_MAX_X = MAX (joy[0].stick[0].axis[0].pos, JOY1_MAX_X);
+		  JOY1_MID_X = (JOY1_MIN_X + JOY1_MAX_X) / 2;
+		  JOY1_MIN_Y = MIN (joy[0].stick[0].axis[1].pos, JOY1_MIN_Y);
+		  JOY1_MAX_Y = MAX (joy[0].stick[0].axis[1].pos, JOY1_MAX_Y);
+		  JOY1_MID_Y = (JOY1_MIN_Y + JOY1_MAX_Y) / 2;
+
+		  JOYSTICK_CONTROL_JOY1_UP =
+		    (joy[0].stick[0].axis[1].pos <
+		     (JOY1_MIN_Y + 2 * JOY1_MID_Y) / 3) ? 1 : 0;
+		  JOYSTICK_CONTROL_JOY1_RIGHT =
+		    (joy[0].stick[0].axis[0].pos >
+		     (JOY1_MAX_X + 2 * JOY1_MID_X) / 3) ? 1 : 0;
+		  JOYSTICK_CONTROL_JOY1_DOWN =
+		    (joy[0].stick[0].axis[1].pos >
+		     (JOY1_MAX_Y + 2 * JOY1_MID_Y) / 3) ? 1 : 0;
+		  JOYSTICK_CONTROL_JOY1_LEFT =
+		    (joy[0].stick[0].axis[0].pos <
+		     (JOY1_MIN_X + 2 * JOY1_MID_X) / 3) ? 1 : 0;
+		}
+	    }
+	  if (joy[0].num_buttons >= 2)
+	    {
+	      JOYSTICK_CONTROL_JOY1_B1 = joy[0].button[0].b;
+	      JOYSTICK_CONTROL_JOY1_B2 = joy[0].button[1].b;
+	    }
+	  if (joy[0].num_buttons >= 4)
+	    {
+	      JOYSTICK_CONTROL_JOY1_B3 = joy[0].button[2].b;
+	      JOYSTICK_CONTROL_JOY1_B4 = joy[0].button[3].b;
+	    }
+	}
+      if (num_joysticks >= 2)
+	{
+	  if (joy[1].num_sticks >= 1)
+	    {
+	      if (joy[1].stick[0].num_axis >= 2)
+		{
+		  JOY2_MIN_X = MIN (joy[1].stick[0].axis[0].pos, JOY2_MIN_X);
+		  JOY2_MAX_X = MAX (joy[1].stick[0].axis[0].pos, JOY2_MAX_X);
+		  JOY2_MID_Y = (JOY2_MIN_X + JOY2_MAX_X) / 2;
+		  JOY2_MIN_Y = MIN (joy[1].stick[0].axis[1].pos, JOY2_MIN_Y);
+		  JOY2_MAX_Y = MAX (joy[1].stick[0].axis[1].pos, JOY2_MAX_Y);
+		  JOY2_MID_Y = (JOY2_MIN_Y + JOY2_MAX_Y) / 2;
+
+		  JOYSTICK_CONTROL_JOY2_UP =
+		    (joy[1].stick[0].axis[1].pos <
+		     (JOY2_MIN_Y + 2 * JOY2_MID_Y) / 3) ? 1 : 0;
+		  JOYSTICK_CONTROL_JOY2_RIGHT =
+		    (joy[1].stick[0].axis[0].pos >
+		     (JOY2_MAX_X + 2 * JOY2_MID_X) / 3) ? 1 : 0;
+		  JOYSTICK_CONTROL_JOY2_DOWN =
+		    (joy[1].stick[0].axis[1].pos >
+		     (JOY2_MAX_Y + 2 * JOY2_MID_Y) / 3) ? 1 : 0;
+		  JOYSTICK_CONTROL_JOY2_LEFT =
+		    (joy[1].stick[0].axis[0].pos <
+		     (JOY2_MIN_X + 2 * JOY2_MID_X) / 3) ? 1 : 0;
+		}
+	    }
+	  if (joy[0].num_buttons >= 2)
+	    {
+	      JOYSTICK_CONTROL_JOY2_B1 = joy[1].button[0].b;
+	      JOYSTICK_CONTROL_JOY2_B2 = joy[1].button[1].b;
+	    }
+	}
+    }
+}

Added: unstable/liquidwar/branches/upstream/current/src/joystick.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/joystick.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/joystick.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,101 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : joystick.h                                       */
+/* contenu       : gestion du joystick                              */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_JOYSTICK
+#define LIQUID_WAR_INCLUDE_JOYSTICK
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#define KEY_JOY1_UP    110
+#define KEY_JOY1_RIGHT 111
+#define KEY_JOY1_DOWN  112
+#define KEY_JOY1_LEFT  113
+#define KEY_JOY1_B1    114
+#define KEY_JOY1_B2    115
+#define KEY_JOY1_B3    116
+#define KEY_JOY1_B4    117
+
+#define KEY_JOY2_UP    118
+#define KEY_JOY2_RIGHT 119
+#define KEY_JOY2_DOWN  120
+#define KEY_JOY2_LEFT  121
+#define KEY_JOY2_B1    122
+#define KEY_JOY2_B2    123
+
+extern int JOYSTICK_CONTROL_JOY1_UP;
+extern int JOYSTICK_CONTROL_JOY1_RIGHT;
+extern int JOYSTICK_CONTROL_JOY1_DOWN;
+extern int JOYSTICK_CONTROL_JOY1_LEFT;
+extern int JOYSTICK_CONTROL_JOY1_B1;
+extern int JOYSTICK_CONTROL_JOY1_B2;
+extern int JOYSTICK_CONTROL_JOY1_B3;
+extern int JOYSTICK_CONTROL_JOY1_B4;
+
+extern int JOYSTICK_CONTROL_JOY2_UP;
+extern int JOYSTICK_CONTROL_JOY2_RIGHT;
+extern int JOYSTICK_CONTROL_JOY2_DOWN;
+extern int JOYSTICK_CONTROL_JOY2_LEFT;
+extern int JOYSTICK_CONTROL_JOY2_B1;
+extern int JOYSTICK_CONTROL_JOY2_B2;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int my_initialise_joystick (void);
+void my_poll_joystick (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/keyboard.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/keyboard.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/keyboard.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,294 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : keyboard.c                                       */
+/* contenu       : gestion du clavier                               */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+#include "config.h"
+#include "joystick.h"
+#include "keyboard.h"
+#include "mouse.h"
+#include "ticker.h"
+#include "log.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+/*
+ * 1 second limit when polling the keyboard for "no key pressed"
+ */
+#define LW_KEYBOARD_WAITNOKEY_TICK_LIMIT 1000
+
+/*
+ * 10 seconds limit when polling the keyboard for a key
+ */
+#define LW_KEYBOARD_WAITKEYPRESSED_TICK_LIMIT 10000
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+static char ALLOWED_KEYBOARD_KEY[128] = {
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+is_touched_key (int i)
+{
+  int retval = 0;
+  int found = 0;
+
+  if (CONFIG_JOYSTICK_ON)
+    switch (i)
+      {
+      case KEY_JOY1_UP:
+	found = 1;
+	retval = JOYSTICK_CONTROL_JOY1_UP;
+	break;
+      case KEY_JOY1_RIGHT:
+	found = 1;
+	retval = JOYSTICK_CONTROL_JOY1_RIGHT;
+	break;
+      case KEY_JOY1_DOWN:
+	found = 1;
+	retval = JOYSTICK_CONTROL_JOY1_DOWN;
+	break;
+      case KEY_JOY1_LEFT:
+	found = 1;
+	retval = JOYSTICK_CONTROL_JOY1_LEFT;
+	break;
+
+      case KEY_JOY1_B1:
+	found = 1;
+	retval = JOYSTICK_CONTROL_JOY1_B1;
+	break;
+      case KEY_JOY1_B2:
+	found = 1;
+	retval = JOYSTICK_CONTROL_JOY1_B2;
+	break;
+      case KEY_JOY1_B3:
+	found = 1;
+	retval = JOYSTICK_CONTROL_JOY1_B3;
+	break;
+      case KEY_JOY1_B4:
+	found = 1;
+	retval = JOYSTICK_CONTROL_JOY1_B4;
+	break;
+
+      case KEY_JOY2_UP:
+	found = 1;
+	retval = JOYSTICK_CONTROL_JOY2_UP;
+	break;
+      case KEY_JOY2_RIGHT:
+	found = 1;
+	retval = JOYSTICK_CONTROL_JOY2_RIGHT;
+	break;
+      case KEY_JOY2_DOWN:
+	found = 1;
+	retval = JOYSTICK_CONTROL_JOY2_DOWN;
+	break;
+      case KEY_JOY2_LEFT:
+	found = 1;
+	retval = JOYSTICK_CONTROL_JOY2_LEFT;
+	break;
+
+      case KEY_JOY2_B1:
+	found = 1;
+	retval = JOYSTICK_CONTROL_JOY2_B1;
+	break;
+      case KEY_JOY2_B2:
+	found = 1;
+	retval = JOYSTICK_CONTROL_JOY2_B2;
+	break;
+      }
+
+  if (!found)
+    switch (i)
+      {
+      case KEY_MOUSE_UP:
+	retval = MOUSE_CONTROL_UP;
+	break;
+      case KEY_MOUSE_RIGHT:
+	retval = MOUSE_CONTROL_RIGHT;
+	break;
+      case KEY_MOUSE_DOWN:
+	retval = MOUSE_CONTROL_DOWN;
+	break;
+      case KEY_MOUSE_LEFT:
+	retval = MOUSE_CONTROL_LEFT;
+	break;
+      default:
+
+
+	if (i >= 128)
+	  {
+	    i -= 128;
+	    retval = (key[i] & KB_EXTENDED) && ALLOWED_KEYBOARD_KEY[i];
+	  }
+	else
+	  retval = (key[i] & KB_NORMAL) && ALLOWED_KEYBOARD_KEY[i];
+
+      }
+
+
+  return retval ? 1 : 0;
+}
+
+/*------------------------------------------------------------------*/
+void
+wait_no_key (void)
+{
+  int touched, i;
+  int start_tick;
+  int dummy;
+
+  start_tick = get_ticker ();
+
+  lw_mouse_reset_control ();
+  do
+    {
+      /*
+       * Force a all to poll_keyboard if needed
+       */
+      dummy = keypressed ();
+
+      touched = 0;
+      lw_mouse_update_control ();
+      my_poll_joystick ();
+      for (i = 0; i < 256; ++i)
+	if (is_touched_key (i))
+	  touched = 1;
+    }
+  while (touched &&
+	 get_ticker () < start_tick + LW_KEYBOARD_WAITNOKEY_TICK_LIMIT);
+}
+
+/*------------------------------------------------------------------*/
+int
+wait_key_pressed (void)
+{
+  int touched = 0, i, result = 0;
+  int start_tick;
+  int dummy;
+
+  start_tick = get_ticker ();
+
+  lw_mouse_reset_control ();
+  while ((!touched) &&
+	 get_ticker () < start_tick + LW_KEYBOARD_WAITKEYPRESSED_TICK_LIMIT)
+    {
+      /*
+       * Force a all to poll_keyboard if needed
+       */
+      dummy = keypressed ();
+
+      lw_mouse_update_control ();
+      my_poll_joystick ();
+      for (i = 0; i < 256 && !touched; ++i)
+	if (is_touched_key (i))
+	  {
+	    touched = 1;
+	    result = i;
+	  }
+    }
+
+  /*
+   * We map all the >= 128 keys to [0-127] since the strongest bit
+   * is used by allegro as a "modifier" which we do not care about
+   * at all
+   */
+  if (result >= 128)
+    {
+      result -= 128;
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Ugly hack to fix a UNIX bug. When one switches between workspaces,
+ * under X, the keyboard functions go crazy. One solution: uninstall
+ * and then reinstall the keyboad. It's ugly but it works...
+ */
+void
+lw_keyboard_reset_hack (void)
+{
+#ifdef UNIX
+  {
+    int keyboard_state = 0;
+
+    clear_keybuf ();
+    remove_keyboard ();
+    keyboard_state = install_keyboard ();
+
+    if (keyboard_state)
+      {
+	log_println_str ("Error: unable to reinstall keyboard");
+      }
+  }
+#endif
+}

Added: unstable/liquidwar/branches/upstream/current/src/keyboard.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/keyboard.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/keyboard.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,71 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : keyboard.h                                       */
+/* contenu       : gestion du clavier                               */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_KEYBOARD
+#define LIQUID_WAR_INCLUDE_KEYBOARD
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int is_touched_key (int i);
+void wait_no_key (void);
+int wait_key_pressed (void);
+void lw_keyboard_reset_hack (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/keyexch.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/keyexch.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/keyexch.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,184 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : keyexch.c                                        */
+/* content       : code to exchange key presses with the server     */
+/* last update   : June 24th  2001                                  */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "netkey.h"
+#include "keyexch.h"
+#include "log.h"
+
+/*==================================================================*/
+/* defines                                                          */
+/*==================================================================*/
+
+#define LW_KEYEXCH_LAG_LOWER_LIMIT 2
+#define LW_KEYEXCH_LAG_UPPER_LIMIT 5
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+int LW_KEYEXCH_SOCK = -1;
+
+/*==================================================================*/
+/* static functions                                                 */
+/*==================================================================*/
+
+static int send_keys (int *sock, CURSOR * cursors, unsigned int checksum);
+static int recv_keys (int *sock, CURSOR * cursors);
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static int
+send_keys (int *sock, CURSOR * cursors, unsigned int checksum)
+{
+  int result = 0;
+  int i;
+  LW_NETKEY netkey;
+
+  lw_netkey_reset (&netkey);
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      /*
+       * We send informations about cursors who are not network
+       * controlled only.
+       */
+      if (!cursors[i].from_network)
+	{
+	  netkey.key_states[i] = cursors[i].key_state;
+	}
+    }
+
+  /*
+   * If there are not enough keys in the buffer, we ask the server
+   * to increase the lag
+   */
+  if (!lw_netkey_peek (sock, LW_KEYEXCH_LAG_LOWER_LIMIT))
+    {
+      netkey.cmd = LW_NETKEY_CMD_INCREASE_LAG;
+    }
+
+  /*
+   * If there are not enough keys in the buffer, we ask the server
+   * to increase the lag
+   */
+  if (lw_netkey_peek (sock, LW_KEYEXCH_LAG_UPPER_LIMIT))
+    {
+      netkey.cmd = LW_NETKEY_CMD_DECREASE_LAG;
+    }
+
+  /*
+   * Checksum which will help the server to control things and
+   * detect consistency problems.
+   */
+  netkey.checksum = checksum;
+
+  result = lw_netkey_send (sock, &netkey);
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+static int
+recv_keys (int *sock, CURSOR * cursors)
+{
+  int result = 0;
+  int i;
+  LW_NETKEY netkey;
+
+  result = lw_netkey_recv (sock, &netkey);
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      /*
+       * The informations is retrieved from the network for
+       * _every_ cursor_ , including those who are not network
+       * managed. In fact, we just wait for the server to send
+       * back the information we have sent to him a few game
+       * cycles before.
+       */
+      cursors[i].key_state = netkey.key_states[i];
+    }
+
+  if (result)
+    {
+      /*
+       * Now we check for checksum errors
+       */
+      if (!netkey.checksum)
+	{
+	  log_println_str
+	    ("Error: incorrect checksum, the game is broken, or someone is cheating");
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_keyexch_flush (CURSOR * cursors, unsigned int checksum)
+{
+  int result = 1;
+
+  /*
+   * It's important to send keys before we receive them
+   */
+  result = result && send_keys (&LW_KEYEXCH_SOCK, cursors, checksum);
+  result = result && recv_keys (&LW_KEYEXCH_SOCK, cursors);
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/keyexch.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/keyexch.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/keyexch.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,76 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : keyexch.h                                        */
+/* content       : code to exchange key presses with the server     */
+/* last update   : June  24th 2001                                  */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_KEYEXCH
+#define LIQUID_WAR_INCLUDE_KEYEXCH
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "cursor.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+extern int LW_KEYEXCH_SOCK;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int lw_keyexch_flush (CURSOR * cursors, unsigned int checksum);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/lang.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/lang.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/lang.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,257 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : lang.c                                           */
+/* content       : handles language dependent stuff (locale)        */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#ifdef WIN32
+#include <windows.h>
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "lang.h"
+#include "langde.h"
+#include "langdk.h"
+#include "langen.h"
+#include "langfr.h"
+#include "config.h"
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/* initializes the string tables                                    */
+/*------------------------------------------------------------------*/
+void
+lw_lang_init ()
+{
+  lw_langde_init ();
+  lw_langdk_init ();
+  lw_langen_init ();
+  lw_langfr_init ();
+}
+
+/*------------------------------------------------------------------*/
+/* returns the string associated to an id                           */
+/*------------------------------------------------------------------*/
+char *
+lw_lang_string (int id)
+{
+  char *result = NULL;
+  int language;
+
+  language = (CONFIG_LANGUAGE == LW_LANG_LANGUAGE_AUTO)
+    ? lw_lang_auto () : CONFIG_LANGUAGE;
+
+  switch (language)
+    {
+    case LW_LANG_LANGUAGE_DEUTSCH:
+      result = lw_langde_string (id);
+      break;
+    case LW_LANG_LANGUAGE_DANISH:
+      result = lw_langdk_string (id);
+      break;
+    case LW_LANG_LANGUAGE_ENGLISH:
+      result = lw_langen_string (id);
+      break;
+    case LW_LANG_LANGUAGE_FRANCAIS:
+      result = lw_langfr_string (id);
+      break;
+    }
+
+  if (!result)
+    {
+      result = "???";
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/* returns the string associated to a given language                */
+/*------------------------------------------------------------------*/
+char *
+lw_lang_language (int lang)
+{
+  char *result = NULL;
+
+  switch (lang)
+    {
+    case LW_LANG_LANGUAGE_DEUTSCH:
+      result = lw_langde_string (LW_LANG_STRING_LANGUAGE);
+      break;
+    case LW_LANG_LANGUAGE_DANISH:
+      result = lw_langdk_string (LW_LANG_STRING_LANGUAGE);
+      break;
+    case LW_LANG_LANGUAGE_ENGLISH:
+      result = lw_langen_string (LW_LANG_STRING_LANGUAGE);
+      break;
+    case LW_LANG_LANGUAGE_FRANCAIS:
+      result = lw_langfr_string (LW_LANG_STRING_LANGUAGE);
+      break;
+    }
+
+  if (!result)
+    {
+      result = "???";
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/* returns the "automatic" language code                            */
+/*------------------------------------------------------------------*/
+int
+lw_lang_auto ()
+{
+  int language;
+
+  /*
+   * By default, we speak English
+   */
+  language = LW_LANG_LANGUAGE_ENGLISH;
+
+#ifdef UNIX
+  {
+    char *env_lang;
+
+    env_lang = getenv ("LANG");
+
+    if (env_lang != NULL)
+      {
+	/*
+	 * We try and check if LANG is set to "DE..." to enable German
+	 * support.
+	 */
+	if (strncmp (env_lang, "DE", 2) == 0 ||
+	    strncmp (env_lang, "de", 2) == 0)
+	  {
+	    language = LW_LANG_LANGUAGE_DEUTSCH;
+	  }
+
+	/*
+	 * We try and check if LANG is set to "DK..." to enable Danish
+	 * support.
+	 */
+	if (strncmp (env_lang, "DK", 2) == 0 ||
+	    strncmp (env_lang, "dk", 2) == 0)
+	  {
+	    language = LW_LANG_LANGUAGE_DANISH;
+	  }
+
+	/*
+	 * We try and check if LANG is set to "FR..." to enable French
+	 * support.
+	 */
+	if (strncmp (env_lang, "FR", 2) == 0 ||
+	    strncmp (env_lang, "fr", 2) == 0)
+	  {
+	    language = LW_LANG_LANGUAGE_FRANCAIS;
+	  }
+      }
+  }
+#endif
+
+#ifdef WIN32
+  {
+    int lang_id;
+
+    lang_id = GetSystemDefaultLangID ();
+
+    /*
+     * Lists of some Windows language codes, got it online:
+     * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_238z.asp
+     *
+     * 0x0406 Danish
+     * 
+     * 0x040c French (Standard) 
+     * 0x080c French (Belgian) 
+     * 0x0c0c French (Canadian) 
+     * 0x100c French (Switzerland) 
+     * 0x140c French (Luxembourg) 
+     * 0x180c Windows 98/Me, Windows 2000/XP: French (Monaco)
+     *
+     * 0x0407 German (Standard) 
+     * 0x0807 German (Switzerland) 
+     * 0x0c07 German (Austria) 
+     * 0x1007 German (Luxembourg) 
+     * 0x1407 German (Liechtenstein)
+     */
+
+    switch (lang_id)
+      {
+      case 0x0407:
+      case 0x0807:
+      case 0x0c07:
+      case 0x1007:
+      case 0x1407:
+	language = LW_LANG_LANGUAGE_DEUTSCH;
+	break;
+      case 0x0406:
+	language = LW_LANG_LANGUAGE_DANISH;
+	break;
+      case 0x040c:
+      case 0x080c:
+      case 0x0c0c:
+      case 0x100c:
+      case 0x140c:
+      case 0x180c:
+	language = LW_LANG_LANGUAGE_FRANCAIS;
+	break;
+      }
+  }
+#endif
+
+  return language;
+}

Added: unstable/liquidwar/branches/upstream/current/src/lang.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/lang.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/lang.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,303 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : lang.h                                           */
+/* content       : handles language dependant stuff (locale)        */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_LANG
+#define LIQUID_WAR_INCLUDE_LANG
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/* Declaration of all available languages                           */
+/*------------------------------------------------------------------*/
+
+#define LW_LANG_LANGUAGE_AUTO                     -1
+#define LW_LANG_LANGUAGE_ENGLISH                   0
+#define LW_LANG_LANGUAGE_FRANCAIS                  1
+#define LW_LANG_LANGUAGE_DEUTSCH                   2
+#define LW_LANG_LANGUAGE_DANISH                    3
+
+#define LW_LANG_NB_LANGUAGES                       4
+
+/*------------------------------------------------------------------*/
+/* Declaration of all available strings                             */
+/*------------------------------------------------------------------*/
+
+#define LW_LANG_STRING_LANGUAGE                    0
+#define LW_LANG_STRING_APPNAME                     1
+
+#define LW_LANG_STRING_HELP_CREDITS                2
+#define LW_LANG_STRING_HELP_COPYRIGHT              3
+#define LW_LANG_STRING_HELP_LICENSE                4
+#define LW_LANG_STRING_HELP_VERSION                5
+
+#define LW_LANG_STRING_MENU_PLAY                   6
+#define LW_LANG_STRING_MENU_NETGAME                7
+#define LW_LANG_STRING_MENU_MAP                    8
+#define LW_LANG_STRING_MENU_TEAMS                  9
+#define LW_LANG_STRING_MENU_OPTIONS               10
+#define LW_LANG_STRING_MENU_ABOUT                 11
+#define LW_LANG_STRING_MENU_EXIT                  12
+#define LW_LANG_STRING_MENU_EXITDOS               13
+#define LW_LANG_STRING_MENU_EXITWINDOWS           14
+#define LW_LANG_STRING_MENU_EXITUNIX              15
+#define LW_LANG_STRING_MENU_BACK                  16
+
+#define LW_LANG_STRING_DIALOG_QUIT                17
+#define LW_LANG_STRING_DIALOG_BACK                18
+#define LW_LANG_STRING_DIALOG_PLAY                19
+#define LW_LANG_STRING_DIALOG_MAIN                20
+
+#define LW_LANG_STRING_PLAY_GETREADY              21
+
+#define LW_LANG_STRING_NETGAME_STARTGAME          22
+#define LW_LANG_STRING_NETGAME_SERVERADDR         23
+#define LW_LANG_STRING_NETGAME_SERVERPORT         24
+#define LW_LANG_STRING_NETGAME_SEARCH             25
+#define LW_LANG_STRING_NETGAME_PASSWORD           26
+#define LW_LANG_STRING_NETGAME_WEAKPASSWORD       27
+
+#define LW_LANG_STRING_LANGUAGE_AUTO              28
+
+#define LW_LANG_STRING_TEAM_OFF                   29
+#define LW_LANG_STRING_TEAM_HUMAN                 30
+#define LW_LANG_STRING_TEAM_CPU                   31
+
+#define LW_LANG_STRING_OPTIONS_GRAPHICS           32
+#define LW_LANG_STRING_OPTIONS_SOUND              33
+#define LW_LANG_STRING_OPTIONS_RULES              34
+#define LW_LANG_STRING_OPTIONS_SPEEDS             35
+#define LW_LANG_STRING_OPTIONS_CONTROLS           36
+#define LW_LANG_STRING_OPTIONS_LANGUAGE           37
+#define LW_LANG_STRING_OPTIONS_DEFAULT            38
+
+#define LW_LANG_STRING_GRAPHICS_GAME              39
+#define LW_LANG_STRING_GRAPHICS_MENU              40
+#define LW_LANG_STRING_GRAPHICS_ON                41
+#define LW_LANG_STRING_GRAPHICS_OFF               42
+#define LW_LANG_STRING_GRAPHICS_FULLSCREEN        43
+#define LW_LANG_STRING_GRAPHICS_WINDOWED          44
+#define LW_LANG_STRING_GRAPHICS_ADVANCED          45
+#define LW_LANG_STRING_GRAPHICS_VIDEOMODE         46
+#define LW_LANG_STRING_GRAPHICS_BRIGHTNESS        47
+#define LW_LANG_STRING_GRAPHICS_VIEWPORTSIZE      48
+#define LW_LANG_STRING_GRAPHICS_PAGEFLIPPING      49
+#define LW_LANG_STRING_GRAPHICS_WAVES             50
+
+#define LW_LANG_STRING_VOLUME_SFX                 51
+#define LW_LANG_STRING_VOLUME_CLICK               52
+#define LW_LANG_STRING_VOLUME_GAMEWATER           53
+#define LW_LANG_STRING_VOLUME_MENUWATER           54
+#define LW_LANG_STRING_VOLUME_MUSIC               55
+
+#define LW_LANG_STRING_RULES_TIME                 56
+#define LW_LANG_STRING_RULES_ADVANCED             57
+#define LW_LANG_STRING_RULES_ARMYSIZE             58
+#define LW_LANG_STRING_RULES_CURSOR               59
+#define LW_LANG_STRING_RULES_DEFAULT              60
+#define LW_LANG_STRING_RULES_MINMAPRES            61
+
+#define LW_LANG_STRING_ADVANCED_ATTACK            62
+#define LW_LANG_STRING_ADVANCED_DEFENSE           63
+#define LW_LANG_STRING_ADVANCED_BASEHEALTH        64
+#define LW_LANG_STRING_ADVANCED_WINNERHELP        65
+#define LW_LANG_STRING_ADVANCED_CPUSTRENGTH       66
+#define LW_LANG_STRING_ADVANCED_CPUVSHUMAN        67
+#define LW_LANG_STRING_ADVANCED_ALWAYS            68
+#define LW_LANG_STRING_ADVANCED_RANDOM            69
+#define LW_LANG_STRING_ADVANCED_NEVER             70
+#define LW_LANG_STRING_ADVANCED_ASMALGORITHM      71
+#define LW_LANG_STRING_ADVANCED_ASSEMBLY          72
+#define LW_LANG_STRING_ADVANCED_STANDARDC         73
+#define LW_LANG_STRING_ADVANCED_ALLOWNETWORKBOTS  74
+#define LW_LANG_STRING_ADVANCED_YES               75
+#define LW_LANG_STRING_ADVANCED_NO                76
+
+#define LW_LANG_STRING_SPEEDS_FPS                 77
+#define LW_LANG_STRING_SPEEDS_NOFPSLIMIT          78
+#define LW_LANG_STRING_SPEEDS_RPS                 79
+#define LW_LANG_STRING_SPEEDS_NORPSLIMIT          80
+
+#define LW_LANG_STRING_CONTROLS_JOYSTICK          81
+#define LW_LANG_STRING_CONTROLS_OFF               82
+#define LW_LANG_STRING_CONTROLS_2JOYSTICKS        83
+#define LW_LANG_STRING_CONTROLS_4BUTTONS          84
+#define LW_LANG_STRING_CONTROLS_STANDARD          85
+#define LW_LANG_STRING_CONTROLS_MOUSESENSIB       86
+
+#define LW_LANG_STRING_ABOUT_CREDITS              87
+#define LW_LANG_STRING_ABOUT_COPYRIGHT            88
+#define LW_LANG_STRING_ABOUT_LICENSE              89
+#define LW_LANG_STRING_ABOUT_VERSION              90
+
+#define LW_LANG_STRING_INTERNET_REFRESH           91
+#define LW_LANG_STRING_INTERNET_JOINNOW           92
+#define LW_LANG_STRING_INTERNET_PORT              93
+#define LW_LANG_STRING_INTERNET_PASSWORD          94
+#define LW_LANG_STRING_INTERNET_YES               95
+#define LW_LANG_STRING_INTERNET_NO                96
+#define LW_LANG_STRING_INTERNET_UPTIME            97
+#define LW_LANG_STRING_INTERNET_DAYS              98
+#define LW_LANG_STRING_INTERNET_DAY               99
+#define LW_LANG_STRING_INTERNET_HOURS            100
+#define LW_LANG_STRING_INTERNET_MINUTES          101
+#define LW_LANG_STRING_INTERNET_SECONDS          102
+#define LW_LANG_STRING_INTERNET_UNREACHABLE      103
+#define LW_LANG_STRING_INTERNET_PING             104
+#define LW_LANG_STRING_INTERNET_MSEC             105
+
+#define LW_LANG_STRING_WAVE_AMPLI                106
+#define LW_LANG_STRING_WAVE_NUMBER               107
+#define LW_LANG_STRING_WAVE_SPEED                108
+#define LW_LANG_STRING_WAVE_WX                   109
+#define LW_LANG_STRING_WAVE_HY                   110
+#define LW_LANG_STRING_WAVE_WY                   111
+#define LW_LANG_STRING_WAVE_HX                   112
+
+#define LW_LANG_STRING_CONNECT_STARTNOW          113
+#define LW_LANG_STRING_CONNECT_WAITING           114
+#define LW_LANG_STRING_CONNECT_WAITINGFOR        115
+#define LW_LANG_STRING_CONNECT_TEAMS             116
+#define LW_LANG_STRING_CONNECT_SENDMESSAGE       117
+
+#define LW_LANG_STRING_NETPLAY_CONNECT           118
+#define LW_LANG_STRING_NETPLAY_PING              119
+#define LW_LANG_STRING_NETPLAY_CHECKPROGRAM      120
+#define LW_LANG_STRING_NETPLAY_CHECKVERSION      121
+#define LW_LANG_STRING_NETPLAY_SENDPASSWORD      122
+#define LW_LANG_STRING_NETPLAY_FREETEAMS         123
+#define LW_LANG_STRING_NETPLAY_RESERVETEAMS      124
+#define LW_LANG_STRING_NETPLAY_SENDCONFIG        125
+#define LW_LANG_STRING_NETPLAY_SENDMAP           126
+#define LW_LANG_STRING_NETPLAY_WAITING           127
+#define LW_LANG_STRING_NETPLAY_WHOPLAYS          128
+#define LW_LANG_STRING_NETPLAY_RECVCONFIG        129
+#define LW_LANG_STRING_NETPLAY_RECVMAP           130
+
+#define LW_LANG_STRING_LEVEL_USEDEFAULTTEXTURE   131
+#define LW_LANG_STRING_LEVEL_ON                  132
+#define LW_LANG_STRING_LEVEL_OFF                 133
+#define LW_LANG_STRING_LEVEL_RANDOMMAP           134
+
+#define LW_LANG_STRING_CODE_FPS                  135
+#define LW_LANG_STRING_CODE_RPS                  136
+#define LW_LANG_STRING_CODE_PERCENTCALC          137
+#define LW_LANG_STRING_CODE_PERCENTDISPLAY       138
+#define LW_LANG_STRING_CODE_SPREADGRADTIME       139
+#define LW_LANG_STRING_CODE_MOVEARMYTIME         140
+#define LW_LANG_STRING_CODE_DISPLAYTIME          141
+#define LW_LANG_STRING_CODE_FLIPTIME             142
+#define LW_LANG_STRING_CODE_OTHERCALCTIME        143
+#define LW_LANG_STRING_CODE_GLOBALTIME           144
+#define LW_LANG_STRING_CODE_STANDARDDISPLAY      145
+#define LW_LANG_STRING_CODE_GRADIENT1            146
+#define LW_LANG_STRING_CODE_GRADIENT2            147
+#define LW_LANG_STRING_CODE_GRADIENT3            148
+#define LW_LANG_STRING_CODE_GRADIENT4            149
+#define LW_LANG_STRING_CODE_GRADIENT5            150
+#define LW_LANG_STRING_CODE_GRADIENT6            151
+#define LW_LANG_STRING_CODE_MESHSIZE             152
+#define LW_LANG_STRING_CODE_MESHSTRUCTURE        153
+#define LW_LANG_STRING_CODE_PAUSEOFF             154
+#define LW_LANG_STRING_CODE_PAUSEON              155
+#define LW_LANG_STRING_CODE_WAVEEFFECTSOFF       156
+#define LW_LANG_STRING_CODE_WAVEEFFECTSON        157
+#define LW_LANG_STRING_CODE_CAPTUREOFF           158
+#define LW_LANG_STRING_CODE_CAPTUREON            159
+
+#define LW_LANG_STRING_SCORE_WINNER              160
+
+#define LW_LANG_STRING_GAME_BACKMEMFAIL          161
+#define LW_LANG_STRING_GAME_DISPMEMFAIL          162
+#define LW_LANG_STRING_GAME_MESHMEMFAIL          163
+#define LW_LANG_STRING_GAME_AREAMEMFAIL          164
+#define LW_LANG_STRING_GAME_ARMYMEMFAIL          165
+
+#define LW_LANG_STRING_ERROR_NOTENOUGHTEAMS      166
+#define LW_LANG_STRING_ERROR_NOTENOUGHBIGDATA    167
+#define LW_LANG_STRING_ERROR_GRAPHICSINITFAILED  168
+#define LW_LANG_STRING_ERROR_NONETWORKSUPPORT    169
+#define LW_LANG_STRING_ERROR_UNABLETOCONNECT     170
+#define LW_LANG_STRING_ERROR_NOTALIQUIDWARSERVER 171
+#define LW_LANG_STRING_ERROR_WRONGVERSION        172
+#define LW_LANG_STRING_ERROR_NETWORKPROBLEM      173
+#define LW_LANG_STRING_ERROR_CANTSENDMAP         174
+#define LW_LANG_STRING_ERROR_CANTRECEIVEMAP      175
+#define LW_LANG_STRING_ERROR_SERVERFULL          176
+#define LW_LANG_STRING_ERROR_BADPASSWORD         177
+#define LW_LANG_STRING_ERROR_BADCONFIGRANGE      178
+
+#define LW_LANG_STRING_POPUP_INITFAIL            179
+#define LW_LANG_STRING_POPUP_MEMTROUBLE          180
+#define LW_LANG_STRING_POPUP_BIGDATA             181
+#define LW_LANG_STRING_POPUP_LOADFAIL            182
+#define LW_LANG_STRING_POPUP_CUSTOMFAIL          183
+#define LW_LANG_STRING_POPUP_GRAPHICSFAIL        184
+
+#define LW_LANG_NB_STRINGS                       185
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+extern void lw_lang_init ();
+extern char *lw_lang_string (int id);
+extern char *lw_lang_language (int lang);
+extern int lw_lang_auto ();
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/langde.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/langde.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/langde.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,368 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : langde.c                                         */
+/* content       : handles German dependent stuff (locale)          */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+#include <stdlib.h>
+
+#include "lang.h"
+#include "langde.h"
+#include "base.h"
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+static char *LW_LANGDE_DATA[LW_LANG_NB_STRINGS];
+
+/*------------------------------------------------------------------*/
+/* initializes the string table                                     */
+/*------------------------------------------------------------------*/
+void
+lw_langde_init ()
+{
+  memset (LW_LANGDE_DATA, 0, sizeof (LW_LANGDE_DATA));
+
+  LW_LANGDE_DATA[LW_LANG_STRING_LANGUAGE] = "Deutsch";
+  LW_LANGDE_DATA[LW_LANG_STRING_APPNAME] = "Liquid War " LW_VERSION;
+
+  LW_LANGDE_DATA[LW_LANG_STRING_HELP_CREDITS] =
+    "Idee: \n* Thomas Colcombet\n\nProgrammation: \n* Christian Mauduit\n\nMusik: \n* Tim Chadburn\n\nAndere Mitwirkende:\n* Alstar\n* Peter Wang\n* Cort Danger Stratton\n* Jan Gretschuskin (www.game-factor.de)\n* Mouse\n* Rene Stach\n* Roderick Schertler\n* Ryan D. Brown\n* Eduard Bloch\n* Michael Terry\n* Kasper Hviid\n* David Redick\n* Alexandre Pineau\n* Michael Wagner\n* Peter Williams\n* Jan Samohyl\n* Gavin\n* Dave Vasilevsky\n* 2 of Omega\n* 666-REFIZUL-666\n\nFuer weitere Informationen, siehe www.ufoot.org/liquidwar\n";
+  LW_LANGDE_DATA[LW_LANG_STRING_HELP_COPYRIGHT] =
+    "Liquid War ist ein Kriegspiel fuer mehrere Teilnehmer.\nCopyright (C) 1998-2005 Christian Mauduit (ufoot at ufoot.org)\n\nDieses Programm ist freie Software. Sie koennen es unter den Bedingungen der GNU General Public License, wie von der Free Software Foundation veroeffentlicht, weitergeben und/oder modifizieren, entweder gemaess Version 2 der Lizenz oder (nach Ihrer Option) jeder spaeteren Version.\n\nDie Veroeffentlichung dieses Programms erfolgt in der Hoffnung, dass es Ihnen von Nutzen sein wird, aber OHNE IRGENDEINE GARANTIE, sogar ohne die implizite Garantie der MARKTREIFE oder der VERWENDBARKEIT FUER EINEN BESTIMMTEN ZWECK. Details finden Sie in der GNU General Public License.\n\nSie sollten eine Kopie der GNU General Public License zusammen mit diesem Programm erhalten haben. Falls nicht, schreiben Sie an die Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.\n\nFuer weitere Informationen, siehe www.ufoot.org/liquidwar\n";
+  /*
+   * Stupid Microsoft VC++ can't handle strings over 2048 chars correctly,
+   * (compiler error C2026) so we had to split this one...
+   */
+  LW_LANGDE_DATA[LW_LANG_STRING_HELP_LICENSE] =
+    "Deutsche Uebersetzung der\nGNU General Public License\n\nErstellt im Auftrag der S.u.S.E. GmbH http://www.suse.de\nvon Katja Lachmann Uebersetzungen,\nueberarbeitet von Peter Gerwinski, G-N-U GmbH http://www.g-n-u.de\n(31. Oktober 1996, 4. Juni 2000)\n\nDiese Uebersetzung wird mit der Absicht angeboten, das Verstaendnis der GNU General Public License (GNU-GPL) zu erleichtern. Es handelt sich jedoch nicht um eine offizielle oder im rechtlichen Sinne anerkannte Uebersetzung.\n\nDie Free Software Foundation (FSF) ist nicht der Herausgeber dieser Uebersetzung, und sie hat diese Uebersetzung auch nicht als rechtskraeftigen Ersatz fuer die Original-GNU-GPL anerkannt. Da die Uebersetzung nicht sorgfaeltig von Anwaelten ueberprueft wurde, koennen die Uebersetzer nicht garantieren, dass die Uebersetzung die rechtlichen Aussagen der GNU-GPL exakt wiedergibt. Wenn Sie sichergehen wollen, dass von Ihnen geplante Aktivitaeten im Sinne der GNU-GPL gestattet sind, "
+    "halten Sie sich bitte an die englischsprachige Originalversion.\n\nDie Free Software Foundation moechte Sie darum bitten, diese Uebersetzung nicht als offizielle Lizenzbedingungen fuer von Ihnen geschriebene Programme zu verwenden. Bitte benutzen Sie hierfuer stattdessen die von der Free Software Foundation herausgegebene englischsprachige Originalversion.\n\nThis is a translation of the GNU General Public License into German. This translation is distributed in the hope that it will facilitate understanding, but it is not an official or legally approved translation.\n\nThe Free Software Foundation is not the publisher of this translation and has not approved it as a legal substitute for the authentic GNU General Public License. The translation has not been reviewed carefully by lawyers, and therefore the translator cannot be sure that it exactly represents the legal meaning of the GNU General Public License. If you wish to be sure whether your planned activities are permitted "
+    "by the GNU General Public License, please refer to the authentic English version.\n\nThe Free Software Foundation strongly urges you not to use this translation as the official distribution terms for your programs; instead, please use the authentic English version published by the Free Software Foundation.\n\nGNU General Public License\n\nDeutsche Uebersetzung der Version 2, Juni 1991\n\nCopyright (c) 1989, 1991 Free Software Foundation, Inc.\n\n59 Temple Place, Suite 330, Boston, MA 02111-1307, USA\n\npeter at gerwinski.de\n\nEs ist jedermann gestattet, diese Lizenzurkunde zu vervielfaeltigen und unveraenderte Kopien zu verbreiten; Aenderungen sind jedoch nicht erlaubt.\n\nDiese Uebersetzung ist kein rechtskraeftiger Ersatz fuer die englischsprachige Originalversion!\n\nVorwort\n\nDie meisten Softwarelizenzen sind daraufhin entworfen worden, Ihnen die Freiheit zu nehmen, die Software weiterzugeben und zu veraendern. Im Gegensatz dazu soll Ihnen die GNU General Public License , "
+    "die Allgemeine Oeffentliche GNU-Lizenz, ebendiese Freiheit garantieren. Sie soll sicherstellen, dass die Software fuer alle Benutzer frei ist. Diese Lizenz gilt fuer den Grossteil der von der Free Software Foundation herausgegebenen Software und fuer alle anderen Programme, deren Autoren ihr Datenwerk dieser Lizenz unterstellt haben. Auch Sie koennen diese Moeglichkeit der Lizenzierung fuer Ihre Programme anwenden. (Ein anderer Teil der Software der Free Software Foundation unterliegt stattdessen der GNU Library General Public License , der Allgemeinen Oeffentlichen GNU-Lizenz fuer Bibliotheken.) [Mittlerweile wurde die GNU Library Public License von der GNU Lesser Public License abgeloest - Anmerkung des Uebersetzers.]\n\nDie Bezeichnung ,,freie`` Software bezieht sich auf Freiheit, nicht auf den Preis. Unsere Lizenzen sollen Ihnen die Freiheit garantieren, Kopien freier Software zu verbreiten (und etwas fuer diesen Service zu berechnen, wenn Sie moechten), die Moeglichkeit, "
+    "die Software im Quelltext zu erhalten oder den Quelltext auf Wunsch zu bekommen. Die Lizenzen sollen garantieren, dass Sie die Software aendern oder Teile davon in neuen freien Programmen verwenden duerfen - und dass Sie wissen, dass Sie dies alles tun duerfen.\n\nUm Ihre Rechte zu schuetzen, muessen wir Einschraenkungen machen, die es jedem verbieten, Ihnen diese Rechte zu verweigern oder Sie aufzufordern, auf diese Rechte zu verzichten. Aus diesen Einschraenkungen folgen bestimmte Verantwortlichkeiten fuer Sie, wenn Sie Kopien der Software verbreiten oder sie veraendern.\n\nBeispielsweise muessen Sie den Empfaengern alle Rechte gewaehren, die Sie selbst haben, wenn Sie - kostenlos oder gegen Bezahlung - Kopien eines solchen Programms verbreiten. Sie muessen sicherstellen, dass auch die Empfaenger den Quelltext erhalten bzw. erhalten koennen. Und Sie muessen ihnen diese Bedingungen zeigen, damit sie ihre Rechte kennen.\n\nWir schuetzen Ihre Rechte in zwei Schritten: "
+    "(1) Wir stellen die Software unter ein Urheberrecht (Copyright), und (2) wir bieten Ihnen diese Lizenz an, die Ihnen das Recht gibt, die Software zu vervielfaeltigen, zu verbreiten und/oder zu veraendern.\n\nUm die Autoren und uns zu schuetzen, wollen wir darueberhinaus sicherstellen, dass jeder erfaehrt, dass fuer diese freie Software keinerlei Garantie besteht. Wenn die Software von jemand anderem modifiziert und weitergegeben wird, moechten wir, dass die Empfaenger wissen, dass sie nicht das Original erhalten haben, damit irgendwelche von anderen verursachte Probleme nicht den Ruf des urspruenglichen Autors schaedigen.\n\nSchliesslich und endlich ist jedes freie Programm permanent durch Software-Patente bedroht. Wir moechten die Gefahr ausschliessen, dass Distributoren eines freien Programms individuell Patente lizensieren - mit dem Ergebnis, dass das Programm proprietaer wuerde. Um dies zu verhindern, haben wir klargestellt, dass jedes Patent entweder fuer freie Benutzung "
+    "durch jedermann lizenziert werden muss oder ueberhaupt nicht lizenziert werden darf.\n\nEs folgen die genauen Bedingungen fuer die Vervielfaeltigung, Verbreitung und Bearbeitung:\n\nAllgemeine Oeffentliche GNU-Lizenz\nBedingungen fuer die Vervielfaeltigung,\nVerbreitung und Bearbeitung\n\n0. Diese Lizenz gilt fuer jedes Programm und jedes andere Datenwerk, in dem ein entsprechender Vermerk des Copyright-Inhabers darauf hinweist, dass das Datenwerk unter den Bestimmungen dieser General Public License verbreitet werden darf. Im folgenden wird jedes derartige Programm oder Datenwerk als ,,das Programm`` bezeichnet; die Formulierung ,,auf dem Programm basierendes Datenwerk`` bezeichnet das Programm sowie jegliche Bearbeitung des Programms im urheberrechtlichen Sinne, also ein Datenwerk, welches das Programm, auch auszugsweise, sei es unveraendert oder veraendert und/oder in eine andere Sprache uebersetzt, enthaelt. (Im folgenden wird die Uebersetzung ohne Einschraenkung als ,,Bearbeitung`` eingestuft.) "
+    "Jeder Lizenznehmer wird im folgenden als ,,Sie`` angesprochen.\n\nAndere Handlungen als Vervielfaeltigung, Verbreitung und Bearbeitung werden von dieser Lizenz nicht beruehrt; sie fallen nicht in ihren Anwendungsbereich. Der Vorgang der Ausfuehrung des Programms wird nicht eingeschraenkt, und die Ausgaben des Programms unterliegen dieser Lizenz nur, wenn der Inhalt ein auf dem Programm basierendes Datenwerk darstellt (unabhaengig davon, dass die Ausgabe durch die Ausfuehrung des Programmes erfolgte). Ob dies zutrifft, haengt von den Funktionen des Programms ab.\n\n1. Sie duerfen auf beliebigen Medien unveraenderte Kopien des Quelltextes des Programms, wie sie ihn erhalten haben, anfertigen und verbreiten. Voraussetzung hierfuer ist, dass Sie mit jeder Kopie einen entsprechenden Copyright-Vermerk sowie einen Haftungsausschluss veroeffentlichen, alle Vermerke, die sich auf diese Lizenz und das Fehlen einer Garantie beziehen, unveraendert lassen "
+    "und desweiteren allen anderen Empfaengern des Programms zusammen mit dem Programm eine Kopie dieser Lizenz zukommen lassen.\n\nSie duerfen fuer den eigentlichen Kopiervorgang eine Gebuehr verlangen. Wenn Sie es wuenschen, duerfen Sie auch gegen Entgeld eine Garantie fuer das Programm anbieten.\n\n2. Sie duerfen Ihre Kopie(n) des Programms oder eines Teils davon veraendern, wodurch ein auf dem Programm basierendes Datenwerk entsteht; Sie duerfen derartige Bearbeitungen unter den Bestimmungen von Paragraph 1 vervielfaeltigen und verbreiten, vorausgesetzt, dass zusaetzlich alle im folgenden genannten Bedingungen erfuellt werden:\n\n1.\nSie muessen die veraenderten Dateien mit einem auffaelligen Vermerk versehen, der auf die von Ihnen vorgenommene Modifizierung und das Datum jeder Aenderung hinweist.\n2.\nSie muessen dafuer sorgen, dass jede von Ihnen verbreitete oder veroeffentlichte Arbeit, die ganz oder teilweise von dem Programm oder Teilen davon abgeleitet ist, "
+    "Dritten gegenueber als Ganzes unter den Bedingungen dieser Lizenz ohne Lizenzgebuehren zur Verfuegung gestellt wird.\n3.\nWenn das veraenderte Programm normalerweise bei der Ausfuehrung interaktiv Kommandos einliest, muessen Sie dafuer sorgen, dass es, wenn es auf dem ueblichsten Wege fuer solche interaktive Nutzung gestartet wird, eine Meldung ausgibt oder ausdruckt, die einen geeigneten Copyright-Vermerk enthaelt sowie einen Hinweis, dass es keine Gewaehrleistung gibt (oder anderenfalls, dass Sie Garantie leisten), und dass die Benutzer das Programm unter diesen Bedingungen weiter verbreiten duerfen. Auch muss der Benutzer darauf hingewiesen werden, wie er eine Kopie dieser Lizenz ansehen kann. (Ausnahme: Wenn das Programm selbst interaktiv arbeitet, aber normalerweise keine derartige Meldung ausgibt, muss Ihr auf dem Programm basierendes Datenwerk auch keine solche Meldung ausgeben).\n\nDiese Anforderungen gelten fuer das bearbeitete Datenwerk als Ganzes. "
+    "Wenn identifizierbare Teile des Datenwerkes nicht von dem Programm abgeleitet sind und vernuenftigerweise als unabhaengige und eigenstaendige Datenwerke fuer sich selbst zu betrachten sind, dann gelten diese Lizenz und ihre Bedingungen nicht fuer die betroffenen Teile, wenn Sie diese als eigenstaendige Datenwerke weitergeben. Wenn Sie jedoch dieselben Abschnitte als Teil eines Ganzen weitergeben, das ein auf dem Programm basierendes Datenwerk darstellt, dann muss die Weitergabe des Ganzen nach den Bedingungen dieser Lizenz erfolgen, deren Bedingungen fuer weitere Lizenznehmer somit auf das gesamte Ganze ausgedehnt werden - und somit auf jeden einzelnen Teil, unabhaengig vom jeweiligen Autor.\n\nSomit ist es nicht die Absicht dieses Abschnittes, Rechte fuer Datenwerke in Anspruch zu nehmen oder Ihnen die Rechte fuer Datenwerke streitig zu machen, die komplett von Ihnen geschrieben wurden; vielmehr ist es die Absicht, die Rechte zur Kontrolle der Verbreitung von Datenwerken, "
+    "die auf dem Programm basieren oder unter seiner auszugsweisen Verwendung zusammengestellt worden sind, auszuueben.\n\nFerner bringt auch das einfache Zusammenlegen eines anderen Datenwerkes, das nicht auf dem Programm basiert, mit dem Programm oder einem auf dem Programm basierenden Datenwerk auf ein- und demselben Speicher- oder Vertriebsmedium dieses andere Datenwerk nicht in den Anwendungsbereich dieser Lizenz.\n\n3. Sie duerfen das Programm (oder ein darauf basierendes Datenwerk gemaess Paragraph 2) als Objectcode oder in ausfuehrbarer Form unter den Bedingungen der Paragraphen 1 und 2 kopieren und weitergeben - vorausgesetzt, dass Sie ausserdem eine der folgenden Leistungen erbringen:\n\n1.\nLiefern Sie das Programm zusammen mit dem vollstaendigen zugehoerigen maschinenlesbaren Quelltext auf einem fuer den Datenaustausch ueblichen Medium aus, wobei die Verteilung unter den Bedingungen der Paragraphen 1 und 2 erfolgen muss. Oder:\n2.\nLiefern Sie das Programm "
+    "zusammen mit einem mindestens drei Jahre lang gueltigen schriftlichen Angebot aus, jedem Dritten eine vollstaendige maschinenlesbare Kopie des Quelltextes zur Verfuegung zu stellen - zu nicht hoeheren Kosten als denen, die durch den physikalischen Kopiervorgang anfallen -, wobei der Quelltext unter den Bedingungen der Paragraphen 1 und 2 auf einem fuer den Datenaustausch ueblichen Medium weitergegeben wird. Oder:\n3.\nLiefern Sie das Programm zusammen mit dem schriftlichen Angebot der Zurverfuegungstellung des Quelltextes aus, das Sie selbst erhalten haben. (Diese Alternative ist nur fuer nicht-kommerzielle Verbreitung zulaessig und nur, wenn Sie das Programm als Objectcode oder in ausfuehrbarer Form mit einem entsprechenden Angebot gemaess Absatz b erhalten haben.)\n\nUnter dem Quelltext eines Datenwerkes wird diejenige Form des Datenwerkes verstanden, die fuer Bearbeitungen vorzugsweise verwendet wird. Fuer ein ausfuehrbares Programm bedeutet ,,der komplette Quelltext``: "
+    "Der Quelltext aller im Programm enthaltenen Module einschliesslich aller zugehoerigen Modulschnittstellen-Definitionsdateien sowie der zur Compilation und Installation verwendeten Skripte. Als besondere Ausnahme jedoch braucht der verteilte Quelltext nichts von dem zu enthalten, was ueblicherweise (entweder als Quelltext oder in binaerer Form) zusammen mit den Hauptkomponenten des Betriebssystems (Kernel, Compiler usw.) geliefert wird, unter dem das Programm laeuft - es sei denn, diese Komponente selbst gehoert zum ausfuehrbaren Programm.\n\nWenn die Verbreitung eines ausfuehrbaren Programms oder von Objectcode dadurch erfolgt, dass der Kopierzugriff auf eine dafuer vorgesehene Stelle gewaehrt wird, so gilt die Gewaehrung eines gleichwertigen Zugriffs auf den Quelltext als Verbreitung des Quelltextes, auch wenn Dritte nicht dazu gezwungen sind, den Quelltext zusammen mit dem Objectcode zu kopieren.\n\n4. Sie duerfen das Programm nicht vervielfaeltigen, veraendern, weiter lizenzieren oder verbreiten, "
+    "sofern es nicht durch diese Lizenz ausdruecklich gestattet ist. Jeder anderweitige Versuch der Vervielfaeltigung, Modifizierung, Weiterlizenzierung und Verbreitung ist nichtig und beendet automatisch Ihre Rechte unter dieser Lizenz. Jedoch werden die Lizenzen Dritter, die von Ihnen Kopien oder Rechte unter dieser Lizenz erhalten haben, nicht beendet, solange diese die Lizenz voll anerkennen und befolgen.\n\n5. Sie sind nicht verpflichtet, diese Lizenz anzunehmen, da Sie sie nicht unterzeichnet haben. Jedoch gibt Ihnen nichts anderes die Erlaubnis, das Programm oder von ihm abgeleitete Datenwerke zu veraendern oder zu verbreiten. Diese Handlungen sind gesetzlich verboten, wenn Sie diese Lizenz nicht anerkennen. Indem Sie das Programm (oder ein darauf basierendes Datenwerk) veraendern oder verbreiten, erklaeren Sie Ihr Einverstaendnis mit dieser Lizenz und mit allen ihren Bedingungen bezueglich der Vervielfaeltigung, Verbreitung und Veraenderung des Programms "
+    "oder eines darauf basierenden Datenwerks.\n\n6. Jedesmal, wenn Sie das Programm (oder ein auf dem Programm basierendes Datenwerk) weitergeben, erhaelt der Empfaenger automatisch vom urspruenglichen Lizenzgeber die Lizenz, das Programm entsprechend den hier festgelegten Bestimmungen zu vervielfaeltigen, zu verbreiten und zu veraendern. Sie duerfen keine weiteren Einschraenkungen der Durchsetzung der hierin zugestandenen Rechte des Empfaengers vornehmen. Sie sind nicht dafuer verantwortlich, die Einhaltung dieser Lizenz durch Dritte durchzusetzen.\n\n7. Sollten Ihnen infolge eines Gerichtsurteils, des Vorwurfs einer Patentverletzung oder aus einem anderen Grunde (nicht auf Patentfragen begrenzt) Bedingungen (durch Gerichtsbeschluss, Vergleich oder anderweitig) auferlegt werden, die den Bedingungen dieser Lizenz widersprechen, so befreien Sie diese Umstaende nicht von den Bestimmungen dieser Lizenz. Wenn es Ihnen nicht moeglich ist, "
+    "das Programm unter gleichzeitiger Beachtung der Bedingungen in dieser Lizenz und Ihrer anderweitigen Verpflichtungen zu verbreiten, dann duerfen Sie als Folge das Programm ueberhaupt nicht verbreiten. Wenn zum Beispiel ein Patent nicht die gebuehrenfreie Weiterverbreitung des Programms durch diejenigen erlaubt, die das Programm direkt oder indirekt von Ihnen erhalten haben, dann besteht der einzige Weg, sowohl das Patentrecht als auch diese Lizenz zu befolgen, darin, ganz auf die Verbreitung des Programms zu verzichten.\n\nSollte sich ein Teil dieses Paragraphen als ungueltig oder unter bestimmten Umstaenden nicht durchsetzbar erweisen, so soll dieser Paragraph seinem Sinne nach angewandt werden; im uebrigen soll dieser Paragraph als Ganzes gelten.\n\nZweck dieses Paragraphen ist nicht, Sie dazu zu bringen, irgendwelche Patente oder andere Eigentumsansprueche zu verletzen oder die Gueltigkeit solcher Ansprueche zu bestreiten; dieser Paragraph hat einzig den Zweck, "
+    "die Integritaet des Verbreitungssystems der freien Software zu schuetzen, das durch die Praxis oeffentlicher Lizenzen verwirklicht wird. Viele Leute haben grosszuegige Beitraege zu dem grossen Angebot der mit diesem System verbreiteten Software im Vertrauen auf die konsistente Anwendung dieses Systems geleistet; es liegt am Autor/Geber, zu entscheiden, ob er die Software mittels irgendeines anderen Systems verbreiten will; ein Lizenznehmer hat auf diese Entscheidung keinen Einfluss.\n\nDieser Paragraph ist dazu gedacht, deutlich klarzustellen, was als Konsequenz aus dem Rest dieser Lizenz betrachtet wird.\n\n8. Wenn die Verbreitung und/oder die Benutzung des Programms in bestimmten Staaten entweder durch Patente oder durch urheberrechtlich geschuetzte Schnittstellen eingeschraenkt ist, kann der Urheberrechtsinhaber, der das Programm unter diese Lizenz gestellt hat, eine explizite geographische Begrenzung der Verbreitung angeben, in der diese Staaten ausgeschlossen werden, "
+    "so dass die Verbreitung nur innerhalb und zwischen den Staaten erlaubt ist, die nicht ausgeschlossen sind. In einem solchen Fall beinhaltet diese Lizenz die Beschraenkung, als waere sie in diesem Text niedergeschrieben.\n\n9. Die Free Software Foundation kann von Zeit zu Zeit ueberarbeitete und/oder neue Versionen der General Public License veroeffentlichen. Solche neuen Versionen werden vom Grundprinzip her der gegenwaertigen entsprechen, koennen aber im Detail abweichen, um neuen Problemen und Anforderungen gerecht zu werden.\n\nJede Version dieser Lizenz hat eine eindeutige Versionsnummer. Wenn in einem Programm angegeben wird, dass es dieser Lizenz in einer bestimmten Versionsnummer oder ,,jeder spaeteren Version`` (``any later version'') unterliegt, so haben Sie die Wahl, entweder den Bestimmungen der genannten Version zu folgen oder denen jeder beliebigen spaeteren Version, die von der Free Software Foundation veroeffentlicht wurde. Wenn das Programm keine Versionsnummer angibt, "
+    "koennen Sie eine beliebige Version waehlen, die je von der Free Software Foundation veroeffentlicht wurde.\n\n10. Wenn Sie den Wunsch haben, Teile des Programms in anderen freien Programmen zu verwenden, deren Bedingungen fuer die Verbreitung anders sind, schreiben Sie an den Autor, um ihn um die Erlaubnis zu bitten. Fuer Software, die unter dem Copyright der Free Software Foundation steht, schreiben Sie an die Free Software Foundation ; wir machen zu diesem Zweck gelegentlich Ausnahmen. Unsere Entscheidung wird von den beiden Zielen geleitet werden, zum einen den freien Status aller von unserer freien Software abgeleiteten Datenwerke zu erhalten und zum anderen das gemeinschaftliche Nutzen und Wiederverwenden von Software im allgemeinen zu foerdern.\n\nKeine Gewaehrleistung\n\n11. Da das Programm ohne jegliche Kosten lizenziert wird, besteht keinerlei Gewaehrleistung fuer das Programm, soweit dies gesetzlich zulaessig ist. Sofern nicht anderweitig schriftlich bestaetigt, "
+    "stellen die Copyright-Inhaber und/oder Dritte das Programm so zur Verfuegung, ,,wie es ist``, ohne irgendeine Gewaehrleistung, weder ausdruecklich noch implizit, einschliesslich - aber nicht begrenzt auf - Marktreife oder Verwendbarkeit fuer einen bestimmten Zweck. Das volle Risiko bezueglich Qualitaet und Leistungsfaehigkeit des Programms liegt bei Ihnen. Sollte sich das Programm als fehlerhaft herausstellen, liegen die Kosten fuer notwendigen Service, Reparatur oder Korrektur bei Ihnen.\n\n12. In keinem Fall, ausser wenn durch geltendes Recht gefordert oder schriftlich zugesichert, ist irgendein Copyright-Inhaber oder irgendein Dritter, der das Programm wie oben erlaubt modifiziert oder verbreitet hat, Ihnen gegenueber fuer irgendwelche Schaeden haftbar, einschliesslich jeglicher allgemeiner oder spezieller Schaeden, Schaeden durch Seiteneffekte (Nebenwirkungen) oder Folgeschaeden, die aus der Benutzung des Programms oder der Unbenutzbarkeit des Programms folgen "
+    "(einschliesslich - aber nicht beschraenkt auf - Datenverluste, fehlerhafte Verarbeitung von Daten, Verluste, die von Ihnen oder anderen getragen werden muessen, oder dem Unvermoegen des Programms, mit irgendeinem anderen Programm zusammenzuarbeiten), selbst wenn ein Copyright-Inhaber oder Dritter ueber die Moeglichkeit solcher Schaeden unterrichtet worden war.\n\nEnde der Bedingungen\n\nAnhang: Wie Sie diese Bedingungen auf Ihre eigenen,\nneuen Programme anwenden koennen\n\nWenn Sie ein neues Programm entwickeln und wollen, dass es vom groesstmoeglichen Nutzen fuer die Allgemeinheit ist, dann erreichen Sie das am besten, indem Sie es zu freier Software machen, die jeder unter diesen Bestimmungen weiterverbreiten und veraendern kann.\n\nUm dies zu erreichen, fuegen Sie die folgenden Vermerke zu Ihrem Programm hinzu. Am sichersten ist es, sie an den Anfang einer jeden Quelldatei zu stellen, um den Gewaehrleistungsausschluss moeglichst deutlich darzustellen; "
+    "zumindest aber sollte jede Datei eine Copyright-Zeile besitzen sowie einen kurzen Hinweis darauf, wo die vollstaendigen Vermerke zu finden sind.\n\n[eine Zeile mit dem Programmnamen und einer kurzen Beschreibung]\nCopyright (C) [Jahr]  [Name des Autors]\n\nThis 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.\n\nThis 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.\n\nYou 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.\n\nAuf Deutsch:\n\n[eine Zeile mit dem Programmnamen "
+    "und einer kurzen Beschreibung]\nCopyright (C) [Jahr]  [Name des Autors]\n\nDieses Programm ist freie Software. Sie koennen es unter den Bedingungen der GNU General Public License, wie von der Free Software Foundation veroeffentlicht, weitergeben und/oder modifizieren, entweder gemaess Version 2 der Lizenz oder (nach Ihrer Option) jeder spaeteren Version.\n\nDie Veroeffentlichung dieses Programms erfolgt in der Hoffnung, dass es Ihnen von Nutzen sein wird, aber OHNE IRGENDEINE GARANTIE, sogar ohne die implizite Garantie der MARKTREIFE oder der VERWENDBARKEIT FUER EINEN BESTIMMTEN ZWECK. Details finden Sie in der GNU General Public License.\n\nSie sollten eine Kopie der GNU General Public License zusammen mit diesem Programm erhalten haben. Falls nicht, schreiben Sie an die Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.\n\nFuegen Sie auch einen kurzen Hinweis hinzu, wie Sie elektronisch und per Brief erreichbar sind.\n\nWenn Ihr Programm interaktiv ist, "
+    "sorgen Sie dafuer, dass es nach dem Start einen kurzen Vermerk ausgibt:\n\nversion 69, Copyright (C) [Jahr]  [Name des Autors] Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.\n\nAuf Deutsch:\n\nVersion 69, Copyright (C) [Jahr]  [Name des Autors] Fuer Gnomovision besteht KEINERLEI GARANTIE; geben Sie `show w' fuer Details ein. Gnonovision ist freie Software, die Sie unter bestimmten Bedingungen weitergeben duerfen; geben Sie `show c' fuer Details ein.\n\nDie hypothetischen Kommandos `show w' und `show c' sollten die entsprechenden Teile der GNU-GPL anzeigen. Natuerlich koennen die von Ihnen verwendeten Kommandos anders heissen als `show w' und `show c'; es koennten auch Mausklicks oder Menuepunkte sein - was immer am besten in Ihr Programm passt.\n\nSoweit vorhanden, sollten Sie auch Ihren Arbeitgeber (wenn Sie als Programmierer arbeiten) "
+    "oder Ihre Schule einen Copyright-Verzicht fuer das Programm unterschreiben lassen. Hier ein Beispiel. Die Namen muessen Sie natuerlich aendern.\n\nYoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.\n\n[Unterschrift von Ty Coon], 1 April 1989\nTy Coon, President of Vice\n\nAuf Deutsch:\n\nDie Yoyodyne GmbH erhebt keinen urheberrechtlichen Anspruch auf das von James Hacker geschriebene Programm ,Gnomovision` (einem Schrittmacher fuer Compiler).\n\n[Unterschrift von Ty Coon], 1. April 1989\nTy Coon, Vizepraesident\n\nDiese General Public License gestattet nicht die Einbindung des Programms in proprietaere Programme. Ist Ihr Programm eine Funktionsbibliothek, so kann es sinnvoller sein, das Binden proprietaerer Programme mit dieser Bibliothek zu gestatten. Wenn Sie dies tun wollen, sollten Sie die GNU Library General Public License anstelle dieser Lizenz verwenden.";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_HELP_VERSION] =
+    "Liquid War von U-Foot\n\nv" LW_VERSION " \n\ncompiled am " __DATE__
+    " um " __TIME__ "\n\nWeitere Informationen auf www.ufoot.org/liquidwar\n";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_MENU_PLAY] = "Spielen";
+  LW_LANGDE_DATA[LW_LANG_STRING_MENU_NETGAME] = "Netzwerk";
+  LW_LANGDE_DATA[LW_LANG_STRING_MENU_MAP] = "Karte";
+  LW_LANGDE_DATA[LW_LANG_STRING_MENU_TEAMS] = "Teams";
+  LW_LANGDE_DATA[LW_LANG_STRING_MENU_OPTIONS] = "Optionen";
+  LW_LANGDE_DATA[LW_LANG_STRING_MENU_ABOUT] = "Informationen";
+  LW_LANGDE_DATA[LW_LANG_STRING_MENU_EXIT] = "Quit";
+  LW_LANGDE_DATA[LW_LANG_STRING_MENU_EXITDOS] = "Exit";
+  LW_LANGDE_DATA[LW_LANG_STRING_MENU_EXITWINDOWS] = "Quit";
+  LW_LANGDE_DATA[LW_LANG_STRING_MENU_EXITUNIX] = "Quit";
+  LW_LANGDE_DATA[LW_LANG_STRING_MENU_BACK] = "Zurueck zu LW";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_DIALOG_QUIT] = "Quit";
+  LW_LANGDE_DATA[LW_LANG_STRING_DIALOG_BACK] = "Zurueck";
+  LW_LANGDE_DATA[LW_LANG_STRING_DIALOG_PLAY] = "Spielen";
+  LW_LANGDE_DATA[LW_LANG_STRING_DIALOG_MAIN] = "Menue";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_PLAY_GETREADY] = "Macht euch bereit!";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_NETGAME_STARTGAME] = "Starten";
+  LW_LANGDE_DATA[LW_LANG_STRING_NETGAME_SERVERADDR] = "Server Addr.";
+  LW_LANGDE_DATA[LW_LANG_STRING_NETGAME_SERVERPORT] = "Server Port";
+  LW_LANGDE_DATA[LW_LANG_STRING_NETGAME_SEARCH] = "Suche Internetspiele";
+  LW_LANGDE_DATA[LW_LANG_STRING_NETGAME_PASSWORD] = "Password";
+  LW_LANGDE_DATA[LW_LANG_STRING_NETGAME_WEAKPASSWORD] =
+    "*) Achtung! Waehle ein schwaches Wort wie \"hallo\", welches auf deiner Festplatte gespecihert ist und sende es zum Server..";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_LANGUAGE_AUTO] = "Automatisch";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_TEAM_OFF] = "Inaktiv";
+  LW_LANGDE_DATA[LW_LANG_STRING_TEAM_HUMAN] = "Mensch";
+  LW_LANGDE_DATA[LW_LANG_STRING_TEAM_CPU] = "CPU";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_OPTIONS_GRAPHICS] = "Grafik";
+  LW_LANGDE_DATA[LW_LANG_STRING_OPTIONS_SOUND] = "Sound";
+  LW_LANGDE_DATA[LW_LANG_STRING_OPTIONS_RULES] = "Regeln";
+  LW_LANGDE_DATA[LW_LANG_STRING_OPTIONS_SPEEDS] = "Geschwindigkeit";
+  LW_LANGDE_DATA[LW_LANG_STRING_OPTIONS_CONTROLS] = "Steuerung";
+  LW_LANGDE_DATA[LW_LANG_STRING_OPTIONS_LANGUAGE] = "Sprache";
+  LW_LANGDE_DATA[LW_LANG_STRING_OPTIONS_DEFAULT] = "Standard";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_GRAPHICS_GAME] = "Spiel";
+  LW_LANGDE_DATA[LW_LANG_STRING_GRAPHICS_MENU] = "Menue";
+  LW_LANGDE_DATA[LW_LANG_STRING_GRAPHICS_ON] = "Ja";
+  LW_LANGDE_DATA[LW_LANG_STRING_GRAPHICS_OFF] = "Nein";
+  LW_LANGDE_DATA[LW_LANG_STRING_GRAPHICS_FULLSCREEN] = "Vollbild";
+  LW_LANGDE_DATA[LW_LANG_STRING_GRAPHICS_WINDOWED] = "Fenster";
+  LW_LANGDE_DATA[LW_LANG_STRING_GRAPHICS_ADVANCED] = "erw. Optionen";
+  LW_LANGDE_DATA[LW_LANG_STRING_GRAPHICS_VIDEOMODE] = "Videomodus";
+  LW_LANGDE_DATA[LW_LANG_STRING_GRAPHICS_BRIGHTNESS] = "Brightness";
+  LW_LANGDE_DATA[LW_LANG_STRING_GRAPHICS_VIEWPORTSIZE] = "Portgroesse";
+  LW_LANGDE_DATA[LW_LANG_STRING_GRAPHICS_PAGEFLIPPING] = "\"Page flipping\"";
+  LW_LANGDE_DATA[LW_LANG_STRING_GRAPHICS_WAVES] = "Wellen (F4)";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_VOLUME_SFX] = "FX Sound";
+  LW_LANGDE_DATA[LW_LANG_STRING_VOLUME_CLICK] = "Click";
+  LW_LANGDE_DATA[LW_LANG_STRING_VOLUME_GAMEWATER] = "Spielwasser";
+  LW_LANGDE_DATA[LW_LANG_STRING_VOLUME_MENUWATER] = "Wassermenue";
+  LW_LANGDE_DATA[LW_LANG_STRING_VOLUME_MUSIC] = "Musik";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_RULES_TIME] = "Zeit";
+  LW_LANGDE_DATA[LW_LANG_STRING_RULES_ADVANCED] = "erw. Optionen";
+  LW_LANGDE_DATA[LW_LANG_STRING_RULES_ARMYSIZE] = "Armeegroesse";
+  LW_LANGDE_DATA[LW_LANG_STRING_RULES_CURSOR] = "Cursor";
+  LW_LANGDE_DATA[LW_LANG_STRING_RULES_DEFAULT] = "Standard";
+  LW_LANGDE_DATA[LW_LANG_STRING_RULES_MINMAPRES] = "Min ";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_ADVANCED_ATTACK] = "Angriff";
+  LW_LANGDE_DATA[LW_LANG_STRING_ADVANCED_DEFENSE] = "Abwehr";
+  LW_LANGDE_DATA[LW_LANG_STRING_ADVANCED_BASEHEALTH] = "Gesundheit";
+  LW_LANGDE_DATA[LW_LANG_STRING_ADVANCED_WINNERHELP] = "Siegerhilfe";
+  LW_LANGDE_DATA[LW_LANG_STRING_ADVANCED_CPUSTRENGTH] = "CPU Staerke";
+  LW_LANGDE_DATA[LW_LANG_STRING_ADVANCED_CPUVSHUMAN] = "CPU vs Mensch";
+  LW_LANGDE_DATA[LW_LANG_STRING_ADVANCED_ALWAYS] = "Immer";
+  LW_LANGDE_DATA[LW_LANG_STRING_ADVANCED_RANDOM] = "Normal";
+  LW_LANGDE_DATA[LW_LANG_STRING_ADVANCED_NEVER] = "Nie";
+  LW_LANGDE_DATA[LW_LANG_STRING_ADVANCED_ASMALGORITHM] = "Algorithmus";
+  LW_LANGDE_DATA[LW_LANG_STRING_ADVANCED_ASSEMBLY] = "Assembly";
+  LW_LANGDE_DATA[LW_LANG_STRING_ADVANCED_STANDARDC] = "C-Standard";
+  LW_LANGDE_DATA[LW_LANG_STRING_ADVANCED_ALLOWNETWORKBOTS] = "Netzbots";
+  LW_LANGDE_DATA[LW_LANG_STRING_ADVANCED_YES] = "An";
+  LW_LANGDE_DATA[LW_LANG_STRING_ADVANCED_NO] = "Aus";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_SPEEDS_FPS] = "frames/s";
+  LW_LANGDE_DATA[LW_LANG_STRING_SPEEDS_NOFPSLIMIT] = "Kein FPS Limit";
+  LW_LANGDE_DATA[LW_LANG_STRING_SPEEDS_RPS] = "Runden/s";
+  LW_LANGDE_DATA[LW_LANG_STRING_SPEEDS_NORPSLIMIT] = "Kein Rundenlimit";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_CONTROLS_JOYSTICK] = "Joystick";
+  LW_LANGDE_DATA[LW_LANG_STRING_CONTROLS_OFF] = "Aus";
+  LW_LANGDE_DATA[LW_LANG_STRING_CONTROLS_2JOYSTICKS] = "2 Joysticks";
+  LW_LANGDE_DATA[LW_LANG_STRING_CONTROLS_4BUTTONS] = "4 Tasten";
+  LW_LANGDE_DATA[LW_LANG_STRING_CONTROLS_STANDARD] = "Standard";
+  LW_LANGDE_DATA[LW_LANG_STRING_CONTROLS_MOUSESENSIB] = "Maussensibilitaet";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_ABOUT_CREDITS] = "\"Credits\"";
+  LW_LANGDE_DATA[LW_LANG_STRING_ABOUT_COPYRIGHT] = "Copyright";
+  LW_LANGDE_DATA[LW_LANG_STRING_ABOUT_LICENSE] = "Lizenz";
+  LW_LANGDE_DATA[LW_LANG_STRING_ABOUT_VERSION] = "Version";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_INTERNET_REFRESH] = "Refresh";
+  LW_LANGDE_DATA[LW_LANG_STRING_INTERNET_JOINNOW] = "Jetzt teilnehmen";
+  LW_LANGDE_DATA[LW_LANG_STRING_INTERNET_PORT] = "Port";
+  LW_LANGDE_DATA[LW_LANG_STRING_INTERNET_PASSWORD] = "Passwort";
+  LW_LANGDE_DATA[LW_LANG_STRING_INTERNET_YES] = "Ja";
+  LW_LANGDE_DATA[LW_LANG_STRING_INTERNET_NO] = "Nein";
+  LW_LANGDE_DATA[LW_LANG_STRING_INTERNET_UPTIME] = "Alter";
+  LW_LANGDE_DATA[LW_LANG_STRING_INTERNET_DAYS] = "d";
+  LW_LANGDE_DATA[LW_LANG_STRING_INTERNET_DAY] = "d";
+  LW_LANGDE_DATA[LW_LANG_STRING_INTERNET_HOURS] = "h";
+  LW_LANGDE_DATA[LW_LANG_STRING_INTERNET_MINUTES] = "min";
+  LW_LANGDE_DATA[LW_LANG_STRING_INTERNET_SECONDS] = "sec";
+  LW_LANGDE_DATA[LW_LANG_STRING_INTERNET_UNREACHABLE] = "Zu weit / tot";
+  LW_LANGDE_DATA[LW_LANG_STRING_INTERNET_PING] = "Ping";
+  LW_LANGDE_DATA[LW_LANG_STRING_INTERNET_MSEC] = "ms";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_WAVE_AMPLI] = "Wellen";
+  LW_LANGDE_DATA[LW_LANG_STRING_WAVE_NUMBER] = "Nummer";
+  LW_LANGDE_DATA[LW_LANG_STRING_WAVE_SPEED] = "Speed";
+  LW_LANGDE_DATA[LW_LANG_STRING_WAVE_WX] = "WX";
+  LW_LANGDE_DATA[LW_LANG_STRING_WAVE_HY] = "HY";
+  LW_LANGDE_DATA[LW_LANG_STRING_WAVE_WY] = "WY";
+  LW_LANGDE_DATA[LW_LANG_STRING_WAVE_HX] = "HX";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_CONNECT_STARTNOW] = "Starten";
+  LW_LANGDE_DATA[LW_LANG_STRING_CONNECT_WAITING] = "Warte...";
+  LW_LANGDE_DATA[LW_LANG_STRING_CONNECT_WAITINGFOR] = "Warte auf ";
+  LW_LANGDE_DATA[LW_LANG_STRING_CONNECT_TEAMS] = " Team(s)";
+  LW_LANGDE_DATA[LW_LANG_STRING_CONNECT_SENDMESSAGE] = "Nachricht schreiben";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_NETPLAY_CONNECT] = "Verbinden";
+  LW_LANGDE_DATA[LW_LANG_STRING_NETPLAY_PING] = "\"Ping\"";
+  LW_LANGDE_DATA[LW_LANG_STRING_NETPLAY_CHECKPROGRAM] = "Programmcheck";
+  LW_LANGDE_DATA[LW_LANG_STRING_NETPLAY_CHECKVERSION] = "Versionscheck";
+  LW_LANGDE_DATA[LW_LANG_STRING_NETPLAY_SENDPASSWORD] = "Password";
+  LW_LANGDE_DATA[LW_LANG_STRING_NETPLAY_FREETEAMS] = "Freie Teams?";
+  LW_LANGDE_DATA[LW_LANG_STRING_NETPLAY_RESERVETEAMS] = "Reservierung";
+  LW_LANGDE_DATA[LW_LANG_STRING_NETPLAY_SENDCONFIG] = "Sende Konfig";
+  LW_LANGDE_DATA[LW_LANG_STRING_NETPLAY_SENDMAP] = "Sende Karte";
+  LW_LANGDE_DATA[LW_LANG_STRING_NETPLAY_WAITING] = "Warte...";
+  LW_LANGDE_DATA[LW_LANG_STRING_NETPLAY_WHOPLAYS] = "Wer spielt?";
+  LW_LANGDE_DATA[LW_LANG_STRING_NETPLAY_RECVCONFIG] = "Empfange Konfig";
+  LW_LANGDE_DATA[LW_LANG_STRING_NETPLAY_RECVMAP] = "Empfange Karte";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_LEVEL_USEDEFAULTTEXTURE] =
+    "Benutze Standardtextur";
+  LW_LANGDE_DATA[LW_LANG_STRING_LEVEL_ON] = "An";
+  LW_LANGDE_DATA[LW_LANG_STRING_LEVEL_OFF] = "Aus";
+  LW_LANGDE_DATA[LW_LANG_STRING_LEVEL_RANDOMMAP] = "Zufallskarte";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_FPS] = "FP/s ";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_RPS] = "Runden/s ";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_PERCENTCALC] = "% calcul ";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_PERCENTDISPLAY] = "% rechne ";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_SPREADGRADTIME] = "Spread gate time ";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_MOVEARMYTIME] = "Bewegungszeit";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_DISPLAYTIME] = "Zeitanzeige ";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_FLIPTIME] = "Fliptime";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_OTHERCALCTIME] = "Andere Zeit ";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_GLOBALTIME] = "Gesamtzeit ";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_STANDARDDISPLAY] = "Standardanzeige";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_GRADIENT1] = "Gradient 1";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_GRADIENT2] = "Gradient 2";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_GRADIENT3] = "Gradient 3";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_GRADIENT4] = "Gradient 4";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_GRADIENT5] = "Gradient 5";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_GRADIENT6] = "Gradient 6";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_MESHSIZE] = "Meshgroesse";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_MESHSTRUCTURE] = "Meshaufbau";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_PAUSEOFF] = "Pause aus";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_PAUSEON] = "Pause";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_WAVEEFFECTSOFF] = "Wellen aus";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_WAVEEFFECTSON] = "Wellen an";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_CAPTUREOFF] = "Fangvideo aus";
+  LW_LANGDE_DATA[LW_LANG_STRING_CODE_CAPTUREON] = "Fangvideo an";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_SCORE_WINNER] = "Spitze!";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_GAME_BACKMEMFAIL] =
+    "Keine Einheiten ueberlebten";
+  LW_LANGDE_DATA[LW_LANG_STRING_GAME_DISPMEMFAIL] = "Kein Meshniederlage";
+  LW_LANGDE_DATA[LW_LANG_STRING_GAME_MESHMEMFAIL] = "Meshniederlage";
+  LW_LANGDE_DATA[LW_LANG_STRING_GAME_AREAMEMFAIL] = "Kein Gebiet mehr";
+  LW_LANGDE_DATA[LW_LANG_STRING_GAME_ARMYMEMFAIL] = "Keine Armee mehr";
+
+  LW_LANGDE_DATA[LW_LANG_STRING_ERROR_NOTENOUGHTEAMS] =
+    "Zu wenig Teams vorhanden. Es muessen mindestens 2 Teams da sein.";
+  LW_LANGDE_DATA[LW_LANG_STRING_ERROR_NOTENOUGHBIGDATA] =
+    "Nicht genug Speicher vorhanden.";
+  LW_LANGDE_DATA[LW_LANG_STRING_ERROR_GRAPHICSINITFAILED] =
+    "Graphikmodus kann nicht gestartet werden.";
+  LW_LANGDE_DATA[LW_LANG_STRING_ERROR_NONETWORKSUPPORT] =
+    "Keine Unterstuetzung fuer Netzwerk auf ihrem PC vorhanden.";
+  LW_LANGDE_DATA[LW_LANG_STRING_ERROR_UNABLETOCONNECT] =
+    "Verbindung nicht moeglich.\nMoeglicherweise sind ihre Einstellungen nicht korrekt oder sie benutzen eine Firewall, die den Datenverkehr blockiert.";
+  LW_LANGDE_DATA[LW_LANG_STRING_ERROR_NOTALIQUIDWARSERVER] =
+    "Keine Kommunikation mit dem Server moeglich\nWahrscheinlich ist der server kein LiquidWar Server";
+  LW_LANGDE_DATA[LW_LANG_STRING_ERROR_WRONGVERSION] =
+    "Falsche Programmversion.\nServer und Programm muessen die gleiche Version haben (Programmversion ist: \""
+    LW_VERSION "\").";
+  LW_LANGDE_DATA[LW_LANG_STRING_ERROR_NETWORKPROBLEM] =
+    "Ein Netzwerkfehler trat auf.\nDies passiert meistens wenn die Verbindung mit demServer zu langsam oder gar nicht mehr vorhanden ist.";
+  LW_LANGDE_DATA[LW_LANG_STRING_ERROR_CANTSENDMAP] =
+    "Kann die Karte nicht zum Server senden.";
+  LW_LANGDE_DATA[LW_LANG_STRING_ERROR_CANTRECEIVEMAP] =
+    "Kann die Map nicht vom Server empfangen.";
+  LW_LANGDE_DATA[LW_LANG_STRING_ERROR_SERVERFULL] =
+    "Dieser Server ist voll und kann derzeit keine weiteren Teams aufnehmen.";
+  LW_LANGDE_DATA[LW_LANG_STRING_ERROR_BADPASSWORD] = "Falsches Passwort.";
+  LW_LANGDE_DATA[LW_LANG_STRING_ERROR_BADCONFIGRANGE] =
+    "Eines der Configparameter ist falsch. Eventuell cheatet oder hackt jemand.";
+
+  /*
+   * In the following section we can use accented chars since these
+   * labels are used in system popup windows which are supposed to
+   * handle chars>127, unlike Liquid War graphical functions.
+   */
+  LW_LANGDE_DATA[LW_LANG_STRING_POPUP_INITFAIL] =
+    "Initalisierung fehlgeschlagen.";
+  LW_LANGDE_DATA[LW_LANG_STRING_POPUP_MEMTROUBLE] =
+    "Für Bilder ist nicht genug Speicher vorhanden.";
+  LW_LANGDE_DATA[LW_LANG_STRING_POPUP_BIGDATA] =
+    "Nicht genug Speicher vorhanden.";
+  LW_LANGDE_DATA[LW_LANG_STRING_POPUP_LOADFAIL] =
+    "Die Daten konnten nicht geladen werden. Sind sie sich sicher, dass Liquid Wars richtig installiert ist?";
+  LW_LANGDE_DATA[LW_LANG_STRING_POPUP_CUSTOMFAIL] =
+    "Die selbsterstellten Daten konnten nicht geladen werden.";
+  LW_LANGDE_DATA[LW_LANG_STRING_POPUP_GRAPHICSFAIL] =
+    "Graphiken konnten nicht geladen werden.";
+}
+
+/*------------------------------------------------------------------*/
+/* returns the French string associated to an id                    */
+/*------------------------------------------------------------------*/
+char *
+lw_langde_string (int id)
+{
+  char *result = NULL;
+
+  if (id >= 0 && id < LW_LANG_NB_STRINGS)
+    {
+      result = LW_LANGDE_DATA[id];
+    }
+
+  if (!result)
+    {
+      result = "??? de";
+    }
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/langde.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/langde.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/langde.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,72 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : langde.h                                         */
+/* content       : handles German dependant stuff (locale)          */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_LANGDE
+#define LIQUID_WAR_INCLUDE_LANGDE
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+extern void lw_langde_init ();
+extern char *lw_langde_string (int id);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/langdk.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/langdk.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/langdk.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,344 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : langdk.c                                         */
+/* content       : handles Danish dependent stuff (locale)          */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+#include <stdlib.h>
+
+#include "lang.h"
+#include "langdk.h"
+#include "base.h"
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+static char *LW_LANGDK_DATA[LW_LANG_NB_STRINGS];
+
+/*------------------------------------------------------------------*/
+/* initializes the string table                                     */
+/*------------------------------------------------------------------*/
+void
+lw_langdk_init ()
+{
+  memset (LW_LANGDK_DATA, 0, sizeof (LW_LANGDK_DATA));
+
+  LW_LANGDK_DATA[LW_LANG_STRING_LANGUAGE] = "Danish";
+  LW_LANGDK_DATA[LW_LANG_STRING_APPNAME] = "Liquid War " LW_VERSION;
+
+  LW_LANGDK_DATA[LW_LANG_STRING_HELP_CREDITS] =
+    "Idea: \n* Thomas Colcombet\n\nCoding: \n* Christian Mauduit\n\nMusic:\n* Tim Chadburn\n\nOther contributors:\n* Alstar\n* Peter Wang\n* Cort Danger Stratton\n* Jan Gretschuskin (www.game-factor.de)\n* Mouse\n* Rene Stach\n* Roderick Schertler\n* Ryan D. Brown\n* Eduard Bloch\n* Michael Terry\n* Kasper Hviid\n* David Redick\n* Alexandre Pineau\n* Michael Wagner\n* Peter Williams\n* Jan Samohyl\n* Gavin\n* Dave Vasilevsky\n* 2 of Omega\n* 666-REFIZUL-666\n\nMore informations on www.ufoot.org/liquidwar\n";
+  LW_LANGDK_DATA[LW_LANG_STRING_HELP_COPYRIGHT] =
+    "Liquid War er et flerpersoners krigsspil.\nCopyright (C) 1998-2005 Christian Mauduit (ufoot at ufoot.org)\n\nDette program er frit software; Du kan kopiere og aendre det under betingelserne i GNU General Public License, udgivet af Free Software Foundation; enten version 2 af Licensen, eller (dit valg) hvilken som helst senere version.\n\nDette program er udgivet i haabet om at det er brugbart, men UDEN NOGEN SOM HELST GARANTI; ikke engang nogen indforstaaet garanti for BRUGBARHED eller BRUGBARHED TIL ET SPECIFIKT FORMAAL. Laes GNU General Public License for flere detaljer.\n\nDu skulle have modtaget en kopi af GNU General Public License sammen med dette program; hvis ikke, skriv til Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA\n\nMere information paa www.ufoot.org/liquidwar\n";
+  /*
+   * Stupid Microsoft VC++ can't handle strings over 2048 chars correctly,
+   * (compiler error C2026) so we had to split this one...
+   */
+  LW_LANGDK_DATA[LW_LANG_STRING_HELP_LICENSE] =
+    "GNU GENERAL PUBLIC LICENSE\n2. version, juni 1991 \n\nCopyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA \n\nEnhver har tilladelse til at kopiere og distribuere ordrette eksemplarer af dette licensdokument, men det er ikke tilladt at aendre det. \n\nForord \n\nDe fleste licenser paa software har til formaal at fjerne Deres ret til at dele softwaren med andre og aendre i det. I modsaetning hertil har GNU General Public License til formaal at garantere Deres ret til at dele og aendre frit software - for at sikre, at det paagaeldende software er tilgaengeligt for alle brugere. Denne licens, General Public License, er gaeldende for stoerstedelen af Free Software Foundations software samt for ethvert andet program, hvis ophavsmaend oensker at anvende licensen. (En del af Free Software Foundations programmer er i stedet omfattet af \"The GNU Library General Public License\".) De kan ogsaa anvende licensen til Deres programmer. \n\nVi taler om frit software - ikke gratis software. Dvs. vi taler om frihedsgraden, og ikke om prisen. Vores licenser, General Public Licenses, er udarbejdet med henblik paa at sikre Deres frihed til at distribuere kopier af frit software (og evt. tage betaling for denne ydelse) og at soerge for, at De modtager den paagaeldende kildetekst eller kan faa den, hvis De vil; at De kan aendre softwaren eller bruge dele af det til nye programmer; og at De er klar over, at De har disse rettigheder. \n\nFor at beskytte Deres rettigheder er vi noedt til at lave restriktioner, der forbyder andre at naegte Dem disse rettigheder eller kraeve, at De afstaar disse rettigheder. Disse restriktioner indebaerer visse forpligtelser for Dem, hvis De distribuerer kopier af softwaren eller aendrer det. \n\nHvis De f.eks. distribuerer kopier af et saadant program, enten gratis eller mod gebyr, er De forpligtet til at give modtagere alle de rettigheder, som De selv har. De skal sikre, at ogsaa modtagerne faar e"
+    "ller kan faa fat paa kildeteksten. Desuden er De forpligtet til, at vise modtagerne disse betingelser, saa de ogsaa er bekendt med deres rettigheder. \n\nVi beskytter Deres rettigheder med en totrinsmodel: (1) vi tager ophavsret paa softwaren og (2) vi tilbyder Dem denne licens, der giver Dem juridisk ret til at kopiere, distribuere og/eller aendre softwaren. \n\nDesuden vil vi med henblik paa at beskytte os selv og de enkelte softwareproducenter sikre os, at alle er bekendte med, at der ikke ydes nogen garanti paa dette frie software. Hvis programmet er aendret af en anden og givet videre, vil vi have, at modtagerne skal vide, at deres version ikke er det originale program. Saaledes undgaar vi, at eventuelle problemer indarbejdet af andre ikke skader de oprindelige softwareproducenters ry. \n\nEndelig er ethvert frit program under konstant trussel fra softwarepatenter. Vi oensker at undgaa faren for, at de, der videregiver et frit program, personligt udtager patentlicens, hvorved programmet faktisk bliver beskyttet af ophavsret. For at undgaa dette har vi gjort det klart, at ethvert patent skal registreres til alles frie afbenyttelse eller slet ikke registreres. \n\nNedenfor foelger de betingelser og vilkaar, der gaelder i forhold til at kopiere, distribuere og aendre software under General Public License. \n\nBETINGELSER OG VILKAAR FOR KOPIERING, DISTRIBUTION OG AENDRING AF SOFTWARE UNDER GENERAL PUBLIC LICENSE \n\n0. Denne licens gaelder for ethvert program eller andet vaerk, som ved siden af navnet paa ophavsretindehaveren har en meddelelse om, at det paagaeldende produkt maa distribueres under de gaeldende betingelser for denne General Public License. I det foelgende henviser ordet \"Program\" til ethvert saadant program eller vaerk, og et \"Vaerk baseret paa Programmet\" betegner enten Programmet eller ethvert afledt vaerk i henhold til lovgivningen om ophavsret. Det betyder med andre ord et vaerk, der indeholder Programmet eller en del af det, enten ordret e"
+    "ller aendret og/eller oversat til et andet sprog. (I det foelgende omfattes oversaettelser, uden begraensninger, af termen \"aendring\".) Enhver licenstager tiltales som \"De\". \n\nAktiviteter ud over kopiering, distribution og aendring er ikke daekket af denne licens men falder uden for dens omraade. Der er ingen restriktioner paa at koere Programmet, og outputtet fra Programmet er kun omfattet, hvis indholdet heraf udgoer et Vaerk baseret paa Programmet (uafhaengigt af at vaere blevet lavet ved at koere Programmet). Om dette er tilfaeldet, afhaenger af, hvad Programmet goer. \n\n1. De har ret til at kopiere og distribuere ordrette kopier af Programmets kildetekst, saaledes som De har modtaget den, i ethvert medium, under forudsaetning af, at alle kopier tydeligt og paa behoerig vis forsynes med en passende ophavsretmeddelelse og garantifraskrivelse; at alle meddelelser, der refererer til denne licens og den manglende garanti, bibeholdes; og at en kopi af denne licens vedlaegges, naar De distribuerer Programmet. \n\nDe har ret til at tage et gebyr for den fysiske handling at overfoere en kopi, og De kan eventuelt tilbyde garantibeskyttelse mod et gebyr. \n\n2. De har ret til at aendre Deres kopi eller kopier, eller en hvilken som helst del deraf, hvorved der skabes et Vaerk baseret paa Programmet, samt ret til at kopiere og distribuere saadanne aendringer eller vaerk i henhold til paragraf 1 ovenfor, forudsat De ogsaa opfylder foelgende betingelser: \nDe er forpligtet til at sikre, at de aendrede filer har en tydelig meddelelse om, at De har foretaget aendringer i filerne samt datoen herfor. \nDe er forpligtet til at sikre, at ethvert vaerk, som De distribuerer eller offentliggoer, der helt eller delvis indeholder Programmet, eller som er afledt af Programmet eller dele heraf, skal registreres til alles frie afbenyttelse i henhold til denne licens. \nHvis det aendrede program normalt laeser kommandoer interaktivt, naar det koeres, skal De sikre, at der ved starte"
+    "n paa programkoerslen for interaktiv brug paa den mest normale vis udskrives eller vises en meddelelse, som indeholder behoerig ophavsretmeddelelse og garantifraskrivelse (eller alternativt tilkendegive, at De oensker at tilbyde garanti) samt fortaeller, at brugere har ret til videredistribuere Programmet under disse betingelser. Desuden skal meddelelsen orientere brugeren om, hvordan en kopi af denne licens kan vises. (Undtagelse: Hvis selve Programmet er interaktivt, men ikke normalt printer en saadan besked, kraeves det ikke, at Deres Vaerk baseret paa Programmet printer den omtalte besked.) \nDisse krav er gaeldende for det aendrede vaerk i sin helhed. Hvis identificerbare sektioner af vaerket ikke er afledt af Programmet, og hvis disse i sig selv med rimelighed kan anses for at vaere selvstaendige og separate vaerker, saa gaelder denne licens og dens betingelser ikke for de sektioner, naar De distribuerer dem som separate vaerker. Hvis De derimod distribuerer de samme sektioner som en del af et hele, der udgoer et Vaerk baseret paa Programmet, skal denne distribution vaere i overensstemmelse med licensens betingelser. De rettigheder, som licensen yder alle, udvides til det paagaeldende vaerk i sin helhed og gaelder saaledes for enhver del af vaerket, uanset ophavsmanden. \n\nDet er saaledes ikke vores hensigt med denne paragraf at paaberaabe os rettigheder eller bestride Deres rettigheder til vaerker skrevet af Dem alene. Hensigten er derimod at udoeve vores ret til at kontrollere distributionen af afledte vaerker eller kollektive vaerker baseret paa Programmet. \n\nHertil kommer, at forekomsten af et andet vaerk paa et lagrings- eller distributionsmedium, der indeholder Programmet eller et Vaerk baseret paa Programmet, medfoerer ikke, at det andet vaerk omfattes af betingelserne for denne licens. \n\n3. De har ret til at kopiere og distribuere Programmet (eller et Vaerk baseret paa Programmet i henhold til paragraf 2) i objektkode eller i eksekverbar form i h"
+    "enhold til betingelserne i paragraf 1 og 2 under forudsaetning af, at De ogsaa foelger én af disse retningslinjer: \nProgrammet ledsages af den fuldstaendige maskinlaesbare kildetekst, der skal distribueres under de anfoerte betingelser i paragraf 1 og 2 ovenfor i et medium, der saedvanligvis bruges til udveksling af software; eller \nProgrammet ledsages af et skriftligt tilbud - gaeldende i mindst tre aar - om at give tredjemand den fuldstaendige maskinlaesbare kildetekst, der skal distribueres under de anfoerte betingelser i paragraf 1 og 2 ovenfor i et medium, der saedvanligvis bruges til udveksling af software, mod et gebyr, der maksimalt daekker Deres omkostninger ved rent fysisk at udfoere distributionen,; eller \nProgrammet ledsages af den information, som De modtog vedroerende tilbuddet om at distribuere kildeteksten. (Dette alternativ gaelder udelukkende for ukommerciel distribution, og kun hvis De har modtaget Programmet i objektkode eller i eksekverbar form med et saadant tilbud i henhold til stykke b ovenfor.) \nKildeteksten for et vaerk betyder den form af et givet vaerk, der foretraekkes som grundlag for at aendre det. For et eksekverbart vaerk betyder den fuldstaendige kildetekst hele kildeteksten for alle de moduler, det indeholder, plus eventuelle tilhoerende graenseflade-definitionsfiler plus de skripter, der anvendes til at kontrollere kompileringen og installeringen af det eksekverbare software. Helt undtagelsesvis behoever den kildetekst, der distribueres, dog ikke at indeholde noget, der normalt distribueres (enten i kildeform eller i binaer form) sammen med de stoerre komponenter i operativsystemet (compiler, kerneprogram, osv.), som det eksekverbare program koeres paa, medmindre den komponent selv ledsager det eksekverbare program. \n\nHvis distributionen af det eksekverbare program eller objektkoden foretages ved tilbud om adgang til at kopiere fra et angivet sted, regnes tilbud om tilsvarende adgang til at kopiere kildeteksten fra det samm"
+    "e sted som distribution af kildeteksten, ogsaa selv om tredjemand ikke er tvunget til at kopiere kildeteksten sammen med objektkoden. \n\n4. De har kun ret til at kopiere, aendre, udstede underlicenser for eller distribuere Programmet som udtrykkeligt anfoert i de specifikke betingelser for licensen. Herudover er ethvert forsoeg paa at kopiere, aendre, udstede underlicenser for eller distribuere Programmet ugyldigt og medfoerer automatisk ophoer af Deres rettigheder i henhold til denne licens. Paa den anden side vil tredjemand, der maatte have modtaget kopier eller rettigheder fra Dem i henhold til denne licens, ikke miste sin licens saa laenge alle betingelser for licensen overholdes. \n\n5. De er ikke forpligtet til at acceptere denne licens, eftersom De ikke har skrevet under paa den. De har dog ingen anden mulighed for at faa tilladelse til at aendre eller distribuere Programmet eller dets afledte vaerker, og de handlinger er forbudt ved lov, hvis De ikke accepterer denne licens. Ved at aendre eller distribuere Programmet (eller et Vaerk baseret paa Programmet) tilkendegiver De derfor Deres accept af licensen samt alle dens betingelser og vilkaar for at kopiere, distribuere eller aendre Programmet eller Vaerker baseret paa Programmet. \n\n6. Hver gang De distribuerer Programmet (eller et Vaerk baseret paa Programmet), faar modtageren automatisk licens fra den oprindelige licensgiver til at kopiere, distribuere eller aendre Programmet i henhold til disse betingelser og vilkaar. De har ikke ret til at paalaegge modtagerne yderligere restriktioner i deres brug af de rettigheder, der herved ydes. De er ikke ansvarlig for at haandhaeve tredjemands overholdelse af denne licens. \n\n7. Hvis De som foelge af en retsafgoerelse eller paastand om kraenkelse af patentret eller af en hvilken som helst anden grund (ikke begraenset til patentudstedelse) paatvinges vilkaar (det vaere sig ved retskendelse, kontrakt eller andet), der strider mod vilkaarene for denne licens, er D"
+    "e ikke dermed fritaget for vilkaarene for denne licens. Hvis De ikke kan distribuere Programmet, saaledes at De paa samme tid opfylder Deres forpligtelser i henhold til denne licens og i overensstemmelse med andre relevante forpligtelser, foelger det, at De ikke har tilladelse til at distribuere Programmet overhovedet. Hvis f.eks. en patentlicens ikke ville tillade afgiftsfri videredistribution af Programmet via alle dem, der modtager kopier direkte eller indirekte igennem Dem, ville den eneste maade, hvorpaa De kunne overholde baade patentlicensen og denne licens, at De fuldstaendigt afholder Dem fra at distribuere Programmet. \n\nDersom en del af denne paragraf erklaeres ugyldig eller bliver umulig at haandhaeve i en bestemt situation, er det hensigten, at resten af paragraffen skal finde anvendelse, ligesom det er hensigten, at paragraffen som helhed skal gaelde i andre situationer.  \nDet er saaledes ikke formaalet med denne paragraf at tilskynde Dem til at kraenke andre patenter eller ejendomskrav eller at bestride gyldigheden af saadanne krav. Denne paragraf har udelukkende til formaal at beskytte integriteten af distributionssystemet for frit software, som er implementeret gennem offentlig licenspraksis. Der er mange mennesker, der har ydet store bidrag til det brede udvalg af software, der distribueres via dette system i tiltro til, at systemet anvendes konsekvent. Det er op til softwareproducenten/donoren at beslutte, om han eller hun er villig til at distribuere software via et andet system, og en licenstager har ikke ret til at paatvinge nogen et saadant valg. \n\nFormaalet med denne paragraf er at goere det fuldstaendigt klart, hvad konsekvensen af resten af denne licens menes at vaere. \n\n8. Hvis distributionen og/eller brugen af Programmet er underlagt restriktioner i visse lande pga. enten patenter eller graenseflader, der er belagt med ophavsret, kan den oprindelige ophavsretindehaver, der har placeret Programmet under denne licens, tilfoeje en udt"
+    "rykkelig geografisk distributionsbegraensning, der udelukker de paagaeldende lande, saaledes at distribution kun er tilladt i eller imellem lande, der ikke paa denne vis er udelukket. I tilfaelde heraf inkorporerer denne licens en saadan begraensning som om den var indarbejdet i selve licenstekstens ordlyd. \n\n9. The Free Software Foundation offentliggoer formodentligt reviderede og/eller nye versioner af sin General Public License fra tid til anden. Saadanne nye versioner vil udtrykke den samme grundlaeggende tankegang som den nuvaerende version, men visse detaljer vil sikkert aendres for at tage hoejde for nye vinkler eller problemer. \n\nDet er let at kende forskel paa de forskellige versioner, idet de alle er tydeligt forsynet med et nummer. Hvis Programmet specificerer et versionsnummer for denne licens som gaeldende for Programmet, tillige med ordene \"alle senere versioner\", har De mulighed for at vaelge, om De vil foelge vilkaar og betingelser for enten den version eller en anden senere version udgivet af The Free Software Foundation. Hvis Programmet ikke specificerer et versionsnummer for denne licens, kan De vaelge blandt samtlige versioner, der nogensinde er udgivet af The Free Software Foundation. \n\n10. Hvis De oensker at inkorporere dele af Programmet i andre frie programmer, der er underlagt andre distributionsbetingelser, foreslaar vi, at De skriver til ophavsmanden og anmoder om tilladelse. Hvis det drejer sig om software, hvor ophavsretten tilhoerer The Free Software Foundation, bedes De skrive til The Free Software Foundation. Der er visse undtagelser. Vores afgoerelse vil vaere baseret paa to maal - at bevare den frie status for alle afledte vaerker af vores frie software og at fremme udvekslingen og genbrugen af software generelt. \n\n\nINGEN GARANTI \n\n11. IDET LICENSEN GIVER GRATIS BRUGSTILLADELSE PAA PROGRAMMET, YDES DER INGEN GARANTI PAA PROGRAMMET I DET OMFANG, DET ER TILLADT EFTER GAELDENDE LOV. MEDMINDRE DET UDTRYKKELIGT MEDDELES SKR"
+    "IFTLIGT, YDER OPHAVSRETINDEHAVERNE OG/ELLER ANDRE PARTER PROGRAMMET \"SOM BESET\" UDEN GARANTI AF NOGEN ART, DET VAERE SIG UDTRYKTE ELLER UNDERFORSTAAEDE GARANTIER, HERUNDER, MEN IKKE BEGRAENSET TIL, DE UNDERFORSTAAEDE GARANTIER VEDROERENDE SALGBARHED OG SPECIFIK BRUGSEGNETHED. DEN FULDE RISIKO, HVAD ANGAAR PROGRAMMETS KVALITET OG FUNKTION, PAAHVILER DEM. SKULLE DET VISE SIG, AT PROGRAMMET ER DEFEKT, SKAL DE ERHOLDE UDGIFTERNE TIL AL NOEDVENDIG SERVICE, REPARATION ELLER JUSTERING. \n\n12. UNDER INGEN OMSTAENDIGHEDER - MEDMINDRE DET KRAEVES AF GAELDENDE LOV ELLER ER SKRIFTLIGT AFTALT - SKAL EN OPHAVSRETINDEHAVER ELLER EN ANDEN PART, DER HAR TILLADELSE TIL AT AENDRE OG/ELLER DISTRIBUERE PROGRAMMET SAALEDES SOM BESKREVET OVENFOR, VAERE ERSTATNINGSANSVARLIG OVER FOR DEM VEDROERENDE SKADER, HERUNDER GENERELLE, SPECIFIKKE OG TILFAELDIGE SKADER SAMT FOELGESKADER I FORBINDELSE MED BRUG AF ELLER MANGLENDE BRUG AF PROGRAMMET (HERUNDER MEN IKKE BEGRAENSET TIL TAB AF DATA ELLER DATA, DER ER BLEVET UNOEJAGTIGE, ELLER TAB, DER ER PAAFOERT DEM ELLER TREDJEMAND, ELLER PROGRAMMETS MANGLENDE EVNE TIL AT KOERE SAMMEN MED ANDRE PROGRAMMER) SELV OM DEN PAAGAELDENDE OPHAVSRETINDEHAVER ELLER ANDEN PART ER BLEVET OPLYST OM MULIGHEDEN FOR, AT SAADANNE TAB KUNNE OPSTAA. \n\nHER SLUTTER BETINGELSER OG VILKAAR FOR GENERAL PUBLIC LICENSE\n\nMore informations on www.ufoot.org/liquidwar\n";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_HELP_VERSION] =
+    "Liquid War by U-Foot\n\nv" LW_VERSION " \n\ncompiled on " __DATE__
+    " at " __TIME__ "\n\nMere information paa www.ufoot.org/liquidwar\n";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_MENU_PLAY] = "Start";
+  LW_LANGDK_DATA[LW_LANG_STRING_MENU_NETGAME] = "Netspil";
+  LW_LANGDK_DATA[LW_LANG_STRING_MENU_MAP] = "Baner";
+  LW_LANGDK_DATA[LW_LANG_STRING_MENU_TEAMS] = "Hold";
+  LW_LANGDK_DATA[LW_LANG_STRING_MENU_OPTIONS] = "Indstillinger";
+  LW_LANGDK_DATA[LW_LANG_STRING_MENU_ABOUT] = "Om spillet";
+  LW_LANGDK_DATA[LW_LANG_STRING_MENU_EXIT] = "Afslut";
+  LW_LANGDK_DATA[LW_LANG_STRING_MENU_EXITDOS] = "Ud til DOS";
+  LW_LANGDK_DATA[LW_LANG_STRING_MENU_EXITWINDOWS] = "Afslut";
+  LW_LANGDK_DATA[LW_LANG_STRING_MENU_EXITUNIX] = "Afslut";
+  LW_LANGDK_DATA[LW_LANG_STRING_MENU_BACK] = "Tilbage til LW";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_DIALOG_QUIT] = "Afslut";
+  LW_LANGDK_DATA[LW_LANG_STRING_DIALOG_BACK] = "Tilbage";
+  LW_LANGDK_DATA[LW_LANG_STRING_DIALOG_PLAY] = "Start";
+  LW_LANGDK_DATA[LW_LANG_STRING_DIALOG_MAIN] = "Menu";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_PLAY_GETREADY] = "Lad kampen begynde!";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_NETGAME_STARTGAME] = "Start spil";
+  LW_LANGDK_DATA[LW_LANG_STRING_NETGAME_SERVERADDR] = "Server addr";
+  LW_LANGDK_DATA[LW_LANG_STRING_NETGAME_SERVERPORT] = "Server port";
+  LW_LANGDK_DATA[LW_LANG_STRING_NETGAME_SEARCH] = "Find internet-spil";
+  LW_LANGDK_DATA[LW_LANG_STRING_NETGAME_PASSWORD] = "kodeord (*)";
+  LW_LANGDK_DATA[LW_LANG_STRING_NETGAME_WEAKPASSWORD] =
+    "(*) ADVARSEL! Benyt et svagt kodeord som \"hallo\", da det opbevares paa din harddisk og sendes til serveren som ren tekst.";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_LANGUAGE_AUTO] = "Automatisk";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_TEAM_OFF] = "Inaktiv";
+  LW_LANGDK_DATA[LW_LANG_STRING_TEAM_HUMAN] = "Spiller";
+  LW_LANGDK_DATA[LW_LANG_STRING_TEAM_CPU] = "CPU";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_OPTIONS_GRAPHICS] = "Grafik";
+  LW_LANGDK_DATA[LW_LANG_STRING_OPTIONS_SOUND] = "Lyd";
+  LW_LANGDK_DATA[LW_LANG_STRING_OPTIONS_RULES] = "Regler";
+  LW_LANGDK_DATA[LW_LANG_STRING_OPTIONS_SPEEDS] = "Fart";
+  LW_LANGDK_DATA[LW_LANG_STRING_OPTIONS_CONTROLS] = "Kontrol";
+  LW_LANGDK_DATA[LW_LANG_STRING_OPTIONS_LANGUAGE] = "Sprog";
+  LW_LANGDK_DATA[LW_LANG_STRING_OPTIONS_DEFAULT] = "Standard";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_GRAPHICS_GAME] = "Spil";
+  LW_LANGDK_DATA[LW_LANG_STRING_GRAPHICS_MENU] = "Menu";
+  LW_LANGDK_DATA[LW_LANG_STRING_GRAPHICS_ON] = "Til";
+  LW_LANGDK_DATA[LW_LANG_STRING_GRAPHICS_OFF] = "Fra";
+  LW_LANGDK_DATA[LW_LANG_STRING_GRAPHICS_FULLSCREEN] = "Fuldskaerm";
+  LW_LANGDK_DATA[LW_LANG_STRING_GRAPHICS_WINDOWED] = "Windowed";
+  LW_LANGDK_DATA[LW_LANG_STRING_GRAPHICS_ADVANCED] = "Advanceret";
+  LW_LANGDK_DATA[LW_LANG_STRING_GRAPHICS_VIDEOMODE] = "Video tilstand";
+  LW_LANGDK_DATA[LW_LANG_STRING_GRAPHICS_BRIGHTNESS] = "Lysstyrke";
+  LW_LANGDK_DATA[LW_LANG_STRING_GRAPHICS_VIEWPORTSIZE] = "Rammebredte";
+  LW_LANGDK_DATA[LW_LANG_STRING_GRAPHICS_PAGEFLIPPING] = "Page flipping";
+  LW_LANGDK_DATA[LW_LANG_STRING_GRAPHICS_WAVES] = "Waves (F4)";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_VOLUME_SFX] = "Lydeffekter";
+  LW_LANGDK_DATA[LW_LANG_STRING_VOLUME_CLICK] = "Klik";
+  LW_LANGDK_DATA[LW_LANG_STRING_VOLUME_GAMEWATER] = "Vand i spil";
+  LW_LANGDK_DATA[LW_LANG_STRING_VOLUME_MENUWATER] = "Vand i menu";
+  LW_LANGDK_DATA[LW_LANG_STRING_VOLUME_MUSIC] = "MusiK";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_RULES_TIME] = "Tid";
+  LW_LANGDK_DATA[LW_LANG_STRING_RULES_ADVANCED] = "Advanceret";
+  LW_LANGDK_DATA[LW_LANG_STRING_RULES_ARMYSIZE] = "Antal soldat";
+  LW_LANGDK_DATA[LW_LANG_STRING_RULES_CURSOR] = "Curser";
+  LW_LANGDK_DATA[LW_LANG_STRING_RULES_DEFAULT] = "Standard";
+  LW_LANGDK_DATA[LW_LANG_STRING_RULES_MINMAPRES] = "Min ";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_ADVANCED_ATTACK] = "Angrib";
+  LW_LANGDK_DATA[LW_LANG_STRING_ADVANCED_DEFENSE] = "Forsvar";
+  LW_LANGDK_DATA[LW_LANG_STRING_ADVANCED_BASEHEALTH] = "Basalt helbred";
+  LW_LANGDK_DATA[LW_LANG_STRING_ADVANCED_WINNERHELP] = "Vinderhjaelp";
+  LW_LANGDK_DATA[LW_LANG_STRING_ADVANCED_CPUSTRENGTH] = "CPU styrke";
+  LW_LANGDK_DATA[LW_LANG_STRING_ADVANCED_CPUVSHUMAN] = "CPU vs spiller";
+  LW_LANGDK_DATA[LW_LANG_STRING_ADVANCED_ALWAYS] = "Altid";
+  LW_LANGDK_DATA[LW_LANG_STRING_ADVANCED_RANDOM] = "Tilfaeldigt";
+  LW_LANGDK_DATA[LW_LANG_STRING_ADVANCED_NEVER] = "Aldrig";
+  LW_LANGDK_DATA[LW_LANG_STRING_ADVANCED_ASMALGORITHM] = "Algoritme";
+  LW_LANGDK_DATA[LW_LANG_STRING_ADVANCED_ASSEMBLY] = "Assembly";
+  LW_LANGDK_DATA[LW_LANG_STRING_ADVANCED_STANDARDC] = "Standard C";
+  LW_LANGDK_DATA[LW_LANG_STRING_ADVANCED_ALLOWNETWORKBOTS] = "Bots i netspil";
+  LW_LANGDK_DATA[LW_LANG_STRING_ADVANCED_YES] = "Ja";
+  LW_LANGDK_DATA[LW_LANG_STRING_ADVANCED_NO] = "Nej";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_SPEEDS_FPS] = "frames/s";
+  LW_LANGDK_DATA[LW_LANG_STRING_SPEEDS_NOFPSLIMIT] = "Ingen fps-graense";
+  LW_LANGDK_DATA[LW_LANG_STRING_SPEEDS_RPS] = "Omgange/s";
+  LW_LANGDK_DATA[LW_LANG_STRING_SPEEDS_NORPSLIMIT] = "Ingen rps-graense";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_CONTROLS_JOYSTICK] = "Joystick";
+  LW_LANGDK_DATA[LW_LANG_STRING_CONTROLS_OFF] = "Fra";
+  LW_LANGDK_DATA[LW_LANG_STRING_CONTROLS_2JOYSTICKS] = "2 joysticks";
+  LW_LANGDK_DATA[LW_LANG_STRING_CONTROLS_4BUTTONS] = "4 knapper";
+  LW_LANGDK_DATA[LW_LANG_STRING_CONTROLS_STANDARD] = "Standard";
+  LW_LANGDK_DATA[LW_LANG_STRING_CONTROLS_MOUSESENSIB] =
+    "In-game mouse sensibility";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_ABOUT_CREDITS] = "Credits";
+  LW_LANGDK_DATA[LW_LANG_STRING_ABOUT_COPYRIGHT] = "Copyright";
+  LW_LANGDK_DATA[LW_LANG_STRING_ABOUT_LICENSE] = "Licens";
+  LW_LANGDK_DATA[LW_LANG_STRING_ABOUT_VERSION] = "Version";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_INTERNET_REFRESH] = "Opdater";
+  LW_LANGDK_DATA[LW_LANG_STRING_INTERNET_JOINNOW] = "Log ind";
+  LW_LANGDK_DATA[LW_LANG_STRING_INTERNET_PORT] = "Port";
+  LW_LANGDK_DATA[LW_LANG_STRING_INTERNET_PASSWORD] = "Kodeord";
+  LW_LANGDK_DATA[LW_LANG_STRING_INTERNET_YES] = "Ja";
+  LW_LANGDK_DATA[LW_LANG_STRING_INTERNET_NO] = "Nej";
+  LW_LANGDK_DATA[LW_LANG_STRING_INTERNET_UPTIME] = "Uptime";
+  LW_LANGDK_DATA[LW_LANG_STRING_INTERNET_DAYS] = "dage";
+  LW_LANGDK_DATA[LW_LANG_STRING_INTERNET_DAY] = "dage";
+  LW_LANGDK_DATA[LW_LANG_STRING_INTERNET_HOURS] = "t";
+  LW_LANGDK_DATA[LW_LANG_STRING_INTERNET_MINUTES] = "min";
+  LW_LANGDK_DATA[LW_LANG_STRING_INTERNET_SECONDS] = "sek";
+  LW_LANGDK_DATA[LW_LANG_STRING_INTERNET_UNREACHABLE] = "Unreachable";
+  LW_LANGDK_DATA[LW_LANG_STRING_INTERNET_PING] = "Ping";
+  LW_LANGDK_DATA[LW_LANG_STRING_INTERNET_MSEC] = "ms";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_WAVE_AMPLI] = "Ampli";
+  LW_LANGDK_DATA[LW_LANG_STRING_WAVE_NUMBER] = "Antal";
+  LW_LANGDK_DATA[LW_LANG_STRING_WAVE_SPEED] = "Fart";
+  LW_LANGDK_DATA[LW_LANG_STRING_WAVE_WX] = "WX";
+  LW_LANGDK_DATA[LW_LANG_STRING_WAVE_HY] = "HY";
+  LW_LANGDK_DATA[LW_LANG_STRING_WAVE_WY] = "WY";
+  LW_LANGDK_DATA[LW_LANG_STRING_WAVE_HX] = "HX";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_CONNECT_STARTNOW] = "Start nu";
+  LW_LANGDK_DATA[LW_LANG_STRING_CONNECT_WAITING] = "Vent...";
+  LW_LANGDK_DATA[LW_LANG_STRING_CONNECT_WAITINGFOR] = "Venter paa ";
+  LW_LANGDK_DATA[LW_LANG_STRING_CONNECT_TEAMS] = " hold";
+  LW_LANGDK_DATA[LW_LANG_STRING_CONNECT_SENDMESSAGE] = "Send besked";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_NETPLAY_CONNECT] = "Connect";
+  LW_LANGDK_DATA[LW_LANG_STRING_NETPLAY_PING] = "Ping";
+  LW_LANGDK_DATA[LW_LANG_STRING_NETPLAY_CHECKPROGRAM] = "Check program";
+  LW_LANGDK_DATA[LW_LANG_STRING_NETPLAY_CHECKVERSION] = "Check version";
+  LW_LANGDK_DATA[LW_LANG_STRING_NETPLAY_SENDPASSWORD] = "Kodeord";
+  LW_LANGDK_DATA[LW_LANG_STRING_NETPLAY_FREETEAMS] = "Frie hold?";
+  LW_LANGDK_DATA[LW_LANG_STRING_NETPLAY_RESERVETEAMS] = "Reserver hold";
+  LW_LANGDK_DATA[LW_LANG_STRING_NETPLAY_SENDCONFIG] = "Send config";
+  LW_LANGDK_DATA[LW_LANG_STRING_NETPLAY_SENDMAP] = "Send bane";
+  LW_LANGDK_DATA[LW_LANG_STRING_NETPLAY_WAITING] = "venter...";
+  LW_LANGDK_DATA[LW_LANG_STRING_NETPLAY_WHOPLAYS] = "Hvem spiller?";
+  LW_LANGDK_DATA[LW_LANG_STRING_NETPLAY_RECVCONFIG] = "Modtag konfig";
+  LW_LANGDK_DATA[LW_LANG_STRING_NETPLAY_RECVMAP] = "Modtag bane";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_LEVEL_USEDEFAULTTEXTURE] =
+    "Brug standard-texture";
+  LW_LANGDK_DATA[LW_LANG_STRING_LEVEL_ON] = "Til";
+  LW_LANGDK_DATA[LW_LANG_STRING_LEVEL_OFF] = "Fra";
+  LW_LANGDK_DATA[LW_LANG_STRING_LEVEL_RANDOMMAP] = "Tilfaeldig bane";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_FPS] = "frames/s ";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_RPS] = "rounds/s ";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_PERCENTCALC] = "% calc ";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_PERCENTDISPLAY] = "% display ";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_SPREADGRADTIME] = "Spread grad time ";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_MOVEARMYTIME] = "Move army time ";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_DISPLAYTIME] = "Vis tid ";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_FLIPTIME] = "Flip tid ";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_OTHERCALCTIME] = "Other calc time ";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_GLOBALTIME] = "Global tid ";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_STANDARDDISPLAY] = "Standard display";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_GRADIENT1] = "Gradient 1";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_GRADIENT2] = "Gradient 2";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_GRADIENT3] = "Gradient 3";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_GRADIENT4] = "Gradient 4";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_GRADIENT5] = "Gradient 5";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_GRADIENT6] = "Gradient 6";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_MESHSIZE] = "Gitter-stoerrelse";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_MESHSTRUCTURE] = "gitterstruktur";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_PAUSEOFF] = "Pause Fra";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_PAUSEON] = "Pause til";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_WAVEEFFECTSOFF] = "Wave-effekter fra";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_WAVEEFFECTSON] = "Wave-effekter til";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_CAPTUREOFF] = "Video capture fra";
+  LW_LANGDK_DATA[LW_LANG_STRING_CODE_CAPTUREON] = "Video capture til";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_SCORE_WINNER] = "Vinder";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_GAME_BACKMEMFAIL] = "Back mem fail";
+  LW_LANGDK_DATA[LW_LANG_STRING_GAME_DISPMEMFAIL] = "Disp mem fail";
+  LW_LANGDK_DATA[LW_LANG_STRING_GAME_MESHMEMFAIL] = "Mesh mem fail";
+  LW_LANGDK_DATA[LW_LANG_STRING_GAME_AREAMEMFAIL] = "Area mem fail";
+  LW_LANGDK_DATA[LW_LANG_STRING_GAME_ARMYMEMFAIL] = "Army mem fail";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_ERROR_NOTENOUGHTEAMS] =
+    "Ikke nok hold.\nDu skal mindst vaelge 2 hold fra \"Hold\" menuen.";
+  LW_LANGDK_DATA[LW_LANG_STRING_ERROR_NOTENOUGHBIGDATA] =
+    "Ikke nok hukommelse til at udvide level.\nBrug et mindre level eller laes dokumentationen og brug kommandolinie-parametre som \"-mem n\".";
+  LW_LANGDK_DATA[LW_LANG_STRING_ERROR_GRAPHICSINITFAILED] =
+    "Kan ikke starte grafisk tilstand";
+  LW_LANGDK_DATA[LW_LANG_STRING_ERROR_NONETWORKSUPPORT] =
+    "Intet netvaerkssupport paa denne platform.\nKun Windows og UNIX har det.";
+  LW_LANGDK_DATA[LW_LANG_STRING_ERROR_UNABLETOCONNECT] =
+    "Kan ikke faa forbindelse med serveren.\nMaaske er det ikke korrekt sat op, eller du er bag en firewall der forbyder forbindelsen.";
+  LW_LANGDK_DATA[LW_LANG_STRING_ERROR_NOTALIQUIDWARSERVER] =
+    "Kan ikke kommunikere med serveren.\nDet er nok ikke nogen Liquid War server.";
+  LW_LANGDK_DATA[LW_LANG_STRING_ERROR_WRONGVERSION] =
+    "Forkert client/server version.\nServer og client skal have samme version (Denne klient's version er \""
+    LW_VERSION "\").";
+  LW_LANGDK_DATA[LW_LANG_STRING_ERROR_NETWORKPROBLEM] =
+    "Der er sket en netvaerksfejl.\nDette sker ofte hvis serveren er for langsom eller mistet.";
+  LW_LANGDK_DATA[LW_LANG_STRING_ERROR_CANTSENDMAP] =
+    "Kan ikke sende banen til serveren.";
+  LW_LANGDK_DATA[LW_LANG_STRING_ERROR_CANTRECEIVEMAP] =
+    "Kan ikke modtage banen fra serveren.";
+  LW_LANGDK_DATA[LW_LANG_STRING_ERROR_SERVERFULL] =
+    "Serveren er fuld og accepterer ikke flere hold.";
+  LW_LANGDK_DATA[LW_LANG_STRING_ERROR_BADPASSWORD] = "Forkert kodeord.";
+  LW_LANGDK_DATA[LW_LANG_STRING_ERROR_BADCONFIGRANGE] =
+    "En af konfigurationsparametrene er is \"out of range\". Der en enten en fejl i spillet, nogen snyder og/eller proever at hacke noget.";
+
+  LW_LANGDK_DATA[LW_LANG_STRING_POPUP_INITFAIL] = "Init failed.";
+  LW_LANGDK_DATA[LW_LANG_STRING_POPUP_MEMTROUBLE] =
+    "Der er ikke nok hukommelse til bitmaps.";
+  LW_LANGDK_DATA[LW_LANG_STRING_POPUP_BIGDATA] =
+    "Der er ikke nok hukommelse.";
+  LW_LANGDK_DATA[LW_LANG_STRING_POPUP_LOADFAIL] =
+    "Kan ikke loade datafil. Er du sikker paa at Liquid War er korrekt installeret?";
+  LW_LANGDK_DATA[LW_LANG_STRING_POPUP_CUSTOMFAIL] =
+    "Kan ikke loade custom data.";
+  LW_LANGDK_DATA[LW_LANG_STRING_POPUP_GRAPHICSFAIL] =
+    "Kan ikke initialisere grafik.";
+}
+
+
+/*------------------------------------------------------------------*/
+/* returns the English string associated to an id                   */
+/*------------------------------------------------------------------*/
+char *
+lw_langdk_string (int id)
+{
+  char *result = NULL;
+  if (id >= 0 && id < LW_LANG_NB_STRINGS)
+
+    {
+      result = LW_LANGDK_DATA[id];
+    }
+  if (!result)
+
+    {
+      result = "??? en";
+    }
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/langdk.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/langdk.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/langdk.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,72 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : langdk.h                                         */
+/* content       : handles Danish dependant stuff (locale)          */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_LANGDK
+#define LIQUID_WAR_INCLUDE_LANGDK
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+extern void lw_langdk_init ();
+extern char *lw_langdk_string (int id);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/langen.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/langen.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/langen.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,336 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : langen.c                                         */
+/* content       : handles English dependent stuff (locale)         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+#include <stdlib.h>
+
+#include "lang.h"
+#include "langen.h"
+#include "base.h"
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+static char *LW_LANGEN_DATA[LW_LANG_NB_STRINGS];
+
+/*------------------------------------------------------------------*/
+/* initializes the string table                                     */
+/*------------------------------------------------------------------*/
+void
+lw_langen_init ()
+{
+  memset (LW_LANGEN_DATA, 0, sizeof (LW_LANGEN_DATA));
+
+  LW_LANGEN_DATA[LW_LANG_STRING_LANGUAGE] = "English";
+  LW_LANGEN_DATA[LW_LANG_STRING_APPNAME] = "Liquid War " LW_VERSION;
+
+  LW_LANGEN_DATA[LW_LANG_STRING_HELP_CREDITS] =
+    "Idea: \n* Thomas Colcombet\n\nCoding: \n* Christian Mauduit\n\nMusic:\n* Tim Chadburn\n\nOther contributors:\n* Alstar\n* Peter Wang\n* Cort Danger Stratton\n* Jan Gretschuskin (www.game-factor.de)\n* Mouse\n* Rene Stach\n* Roderick Schertler\n* Ryan D. Brown\n* Eduard Bloch\n* Michael Terry\n* Kasper Hviid\n* David Redick\n* Alexandre Pineau\n* Michael Wagner\n* Peter Williams\n* Jan Samohyl\n* Gavin\n* Dave Vasilevsky\n* 2 of Omega\n* 666-REFIZUL-666\n\nMore informations on www.ufoot.org/liquidwar\n";
+  LW_LANGEN_DATA[LW_LANG_STRING_HELP_COPYRIGHT] =
+    "Liquid War is a multiplayer wargame.\nCopyright (C) 1998-2005 Christian Mauduit (ufoot at ufoot.org)\n\nThis 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.\n\nThis 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.\n\nYou 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\n\nMore informations on www.ufoot.org/liquidwar\n";
+  /*
+   * Stupid Microsoft VC++ can't handle strings over 2048 chars correctly,
+   * (compiler error C2026) so we had to split this one...
+   */
+  LW_LANGEN_DATA[LW_LANG_STRING_HELP_LICENSE] =
+    "GNU GENERAL PUBLIC LICENSE\nVersion 2, June 1991\n\nCopyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA\n\nEveryone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\n\nPreamble\n\nThe licenses for most software are designed to take away your freedom to share and change it.  By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.  This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it.  (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.)  You can apply it to your programs, too.\n\nWhen we speak of free software, we are referring to freedom, not price.  Our General Public Licenses are designed to make sure that you have the freedom "
+    "to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. \n\nTo protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. \n\nFor example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have.  You must make sure that they, too, receive or can get the source code.  And you must show them these terms so they know their rights.\n\nWe protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.\n\nAlso, " "for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software.  If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.\n\nFinally, any free program is threatened constantly by software patents.  We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary.  To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.\n\nThe precise terms and conditions for copying, distribution and modification follow.\n\nGNU GENERAL PUBLIC LICENSE\nTERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n0. This License applies to any program or other work which contains a notice placed by the copyright " "holder saying it may be distributed under the terms of this General Public License.  The \"Program\", below, refers to any such program or work, and a \"work based on the Program\" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language.  (Hereinafter, translation is included without limitation in the term \"modification\".)  Each licensee is addressed as \"you\".\nActivities other than copying, distribution and modification are not covered by this License; they are outside its scope.  The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. \n\n1. You may copy and distribute verbatim copies of the Program's source code as you " "receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. \nYou may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.\n\n2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: \na) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.\nb) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or " "any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.\nc) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License.  (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)\nThese requirements apply to the modified work as a whole.  If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to " "those sections when you distribute them as separate works.  But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.\nThus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. \nIn addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. \n\n3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above " "provided that you also do one of the following:\na) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,\nb) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,\nc) Accompany it with the information you received as to the offer to distribute corresponding source code.  (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)\nThe source code for a work means the preferred form of the work for making modifications " "to it.  For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable.  However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.\nIf distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.\n\n4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License.  Any attempt " "otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.\n\n5. You are not required to accept this License, since you have not signed it.  However, nothing else grants you permission to modify or distribute the Program or its derivative works.  These actions are prohibited by law if you do not accept this License.  Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.\n\n6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify " "the Program subject to these terms and conditions.  You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.\n\n7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License.  If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all.  For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain " "entirely from distribution of the Program.\nIf any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.\nIt is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices.  Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.\nThis section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.\n\n8. " "If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded.  In such case, this License incorporates the limitation as if written in the body of this License.\n\n9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time.  Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\nEach version is given a distinguishing version number.  If the Program specifies a version number of this License which applies to it and \"any later version\", you have the option of following the terms and conditions either of that version or of any later version published by the " "Free Software Foundation.  If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. \n\n10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission.  For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this.  Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.\n\nNO WARRANTY\n\n11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT " "NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. \n\n12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n\nEND OF TERMS AND CONDITIONS\n\nMore informations on www.ufoot.org/liquidwar\n";
+  LW_LANGEN_DATA[LW_LANG_STRING_HELP_VERSION] =
+    "Liquid War by U-Foot\n\nv" LW_VERSION " \n\ncompiled on " __DATE__ " at "
+    __TIME__ "\n\nMore informations on www.ufoot.org/liquidwar\n";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_MENU_PLAY] = "Play";
+  LW_LANGEN_DATA[LW_LANG_STRING_MENU_NETGAME] = "Net game";
+  LW_LANGEN_DATA[LW_LANG_STRING_MENU_MAP] = "Map";
+  LW_LANGEN_DATA[LW_LANG_STRING_MENU_TEAMS] = "Teams";
+  LW_LANGEN_DATA[LW_LANG_STRING_MENU_OPTIONS] = "Options";
+  LW_LANGEN_DATA[LW_LANG_STRING_MENU_ABOUT] = "About";
+  LW_LANGEN_DATA[LW_LANG_STRING_MENU_EXIT] = "Exit";
+  LW_LANGEN_DATA[LW_LANG_STRING_MENU_EXITDOS] = "Exit to DOS";
+  LW_LANGEN_DATA[LW_LANG_STRING_MENU_EXITWINDOWS] = "Exit";
+  LW_LANGEN_DATA[LW_LANG_STRING_MENU_EXITUNIX] = "Exit";
+  LW_LANGEN_DATA[LW_LANG_STRING_MENU_BACK] = "Back to LW";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_DIALOG_QUIT] = "Quit";
+  LW_LANGEN_DATA[LW_LANG_STRING_DIALOG_BACK] = "Back";
+  LW_LANGEN_DATA[LW_LANG_STRING_DIALOG_PLAY] = "Play";
+  LW_LANGEN_DATA[LW_LANG_STRING_DIALOG_MAIN] = "Main";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_PLAY_GETREADY] = "Get ready!";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_NETGAME_STARTGAME] = "Start game";
+  LW_LANGEN_DATA[LW_LANG_STRING_NETGAME_SERVERADDR] = "Server addr";
+  LW_LANGEN_DATA[LW_LANG_STRING_NETGAME_SERVERPORT] = "Server port";
+  LW_LANGEN_DATA[LW_LANG_STRING_NETGAME_SEARCH] = "Search for internet games";
+  LW_LANGEN_DATA[LW_LANG_STRING_NETGAME_PASSWORD] = "Password (*)";
+  LW_LANGEN_DATA[LW_LANG_STRING_NETGAME_WEAKPASSWORD] =
+    "(*) WARNING! Choose a weak password like \"hello\", for it is stored on your hard drive and sent to the server as plain text.";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_LANGUAGE_AUTO] = "Automatic";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_TEAM_OFF] = "Off";
+  LW_LANGEN_DATA[LW_LANG_STRING_TEAM_HUMAN] = "Human";
+  LW_LANGEN_DATA[LW_LANG_STRING_TEAM_CPU] = "Cpu";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_OPTIONS_GRAPHICS] = "Graphics";
+  LW_LANGEN_DATA[LW_LANG_STRING_OPTIONS_SOUND] = "Sound";
+  LW_LANGEN_DATA[LW_LANG_STRING_OPTIONS_RULES] = "Rules";
+  LW_LANGEN_DATA[LW_LANG_STRING_OPTIONS_SPEEDS] = "Speeds";
+  LW_LANGEN_DATA[LW_LANG_STRING_OPTIONS_CONTROLS] = "Controls";
+  LW_LANGEN_DATA[LW_LANG_STRING_OPTIONS_LANGUAGE] = "Language";
+  LW_LANGEN_DATA[LW_LANG_STRING_OPTIONS_DEFAULT] = "Defaults";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_GRAPHICS_GAME] = "Game";
+  LW_LANGEN_DATA[LW_LANG_STRING_GRAPHICS_MENU] = "Menu";
+  LW_LANGEN_DATA[LW_LANG_STRING_GRAPHICS_ON] = "On";
+  LW_LANGEN_DATA[LW_LANG_STRING_GRAPHICS_OFF] = "Off";
+  LW_LANGEN_DATA[LW_LANG_STRING_GRAPHICS_FULLSCREEN] = "Fullscreen";
+  LW_LANGEN_DATA[LW_LANG_STRING_GRAPHICS_WINDOWED] = "Windowed";
+  LW_LANGEN_DATA[LW_LANG_STRING_GRAPHICS_ADVANCED] = "Advanced";
+  LW_LANGEN_DATA[LW_LANG_STRING_GRAPHICS_VIDEOMODE] = "Video mode";
+  LW_LANGEN_DATA[LW_LANG_STRING_GRAPHICS_BRIGHTNESS] = "Brightness";
+  LW_LANGEN_DATA[LW_LANG_STRING_GRAPHICS_VIEWPORTSIZE] = "Viewport size";
+  LW_LANGEN_DATA[LW_LANG_STRING_GRAPHICS_PAGEFLIPPING] = "Page flipping";
+  LW_LANGEN_DATA[LW_LANG_STRING_GRAPHICS_WAVES] = "Waves (F4)";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_VOLUME_SFX] = "Sound fx";
+  LW_LANGEN_DATA[LW_LANG_STRING_VOLUME_CLICK] = "Click";
+  LW_LANGEN_DATA[LW_LANG_STRING_VOLUME_GAMEWATER] = "Game water";
+  LW_LANGEN_DATA[LW_LANG_STRING_VOLUME_MENUWATER] = "Menu water";
+  LW_LANGEN_DATA[LW_LANG_STRING_VOLUME_MUSIC] = "Music";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_RULES_TIME] = "Time";
+  LW_LANGEN_DATA[LW_LANG_STRING_RULES_ADVANCED] = "Advanced";
+  LW_LANGEN_DATA[LW_LANG_STRING_RULES_ARMYSIZE] = "Army size";
+  LW_LANGEN_DATA[LW_LANG_STRING_RULES_CURSOR] = "Cursor";
+  LW_LANGEN_DATA[LW_LANG_STRING_RULES_DEFAULT] = "Defaults";
+  LW_LANGEN_DATA[LW_LANG_STRING_RULES_MINMAPRES] = "Min ";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_ADVANCED_ATTACK] = "Attack";
+  LW_LANGEN_DATA[LW_LANG_STRING_ADVANCED_DEFENSE] = "Defense";
+  LW_LANGEN_DATA[LW_LANG_STRING_ADVANCED_BASEHEALTH] = "Base health";
+  LW_LANGEN_DATA[LW_LANG_STRING_ADVANCED_WINNERHELP] = "Winner help";
+  LW_LANGEN_DATA[LW_LANG_STRING_ADVANCED_CPUSTRENGTH] = "CPU strength";
+  LW_LANGEN_DATA[LW_LANG_STRING_ADVANCED_CPUVSHUMAN] = "CPU vs human";
+  LW_LANGEN_DATA[LW_LANG_STRING_ADVANCED_ALWAYS] = "Always";
+  LW_LANGEN_DATA[LW_LANG_STRING_ADVANCED_RANDOM] = "Random";
+  LW_LANGEN_DATA[LW_LANG_STRING_ADVANCED_NEVER] = "Never";
+  LW_LANGEN_DATA[LW_LANG_STRING_ADVANCED_ASMALGORITHM] = "Algorithm";
+  LW_LANGEN_DATA[LW_LANG_STRING_ADVANCED_ASSEMBLY] = "Assembly";
+  LW_LANGEN_DATA[LW_LANG_STRING_ADVANCED_STANDARDC] = "Standard C";
+  LW_LANGEN_DATA[LW_LANG_STRING_ADVANCED_ALLOWNETWORKBOTS] = "Allow net bots";
+  LW_LANGEN_DATA[LW_LANG_STRING_ADVANCED_YES] = "Yes";
+  LW_LANGEN_DATA[LW_LANG_STRING_ADVANCED_NO] = "No";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_SPEEDS_FPS] = "frames/s";
+  LW_LANGEN_DATA[LW_LANG_STRING_SPEEDS_NOFPSLIMIT] = "No fps limit";
+  LW_LANGEN_DATA[LW_LANG_STRING_SPEEDS_RPS] = "rounds/s";
+  LW_LANGEN_DATA[LW_LANG_STRING_SPEEDS_NORPSLIMIT] = "No rps limit";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_CONTROLS_JOYSTICK] = "Joystick";
+  LW_LANGEN_DATA[LW_LANG_STRING_CONTROLS_OFF] = "Off";
+  LW_LANGEN_DATA[LW_LANG_STRING_CONTROLS_2JOYSTICKS] = "2 joysticks";
+  LW_LANGEN_DATA[LW_LANG_STRING_CONTROLS_4BUTTONS] = "4 buttons";
+  LW_LANGEN_DATA[LW_LANG_STRING_CONTROLS_STANDARD] = "Standard";
+  LW_LANGEN_DATA[LW_LANG_STRING_CONTROLS_MOUSESENSIB] =
+    "In-game mouse sensibility";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_ABOUT_CREDITS] = "Credits";
+  LW_LANGEN_DATA[LW_LANG_STRING_ABOUT_COPYRIGHT] = "Copyright";
+  LW_LANGEN_DATA[LW_LANG_STRING_ABOUT_LICENSE] = "License";
+  LW_LANGEN_DATA[LW_LANG_STRING_ABOUT_VERSION] = "Version";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_INTERNET_REFRESH] = "Refresh";
+  LW_LANGEN_DATA[LW_LANG_STRING_INTERNET_JOINNOW] = "Join now";
+  LW_LANGEN_DATA[LW_LANG_STRING_INTERNET_PORT] = "Port";
+  LW_LANGEN_DATA[LW_LANG_STRING_INTERNET_PASSWORD] = "Password";
+  LW_LANGEN_DATA[LW_LANG_STRING_INTERNET_YES] = "yes";
+  LW_LANGEN_DATA[LW_LANG_STRING_INTERNET_NO] = "no";
+  LW_LANGEN_DATA[LW_LANG_STRING_INTERNET_UPTIME] = "Uptime";
+  LW_LANGEN_DATA[LW_LANG_STRING_INTERNET_DAYS] = "days";
+  LW_LANGEN_DATA[LW_LANG_STRING_INTERNET_DAY] = "day";
+  LW_LANGEN_DATA[LW_LANG_STRING_INTERNET_HOURS] = "h";
+  LW_LANGEN_DATA[LW_LANG_STRING_INTERNET_MINUTES] = "min";
+  LW_LANGEN_DATA[LW_LANG_STRING_INTERNET_SECONDS] = "sec";
+  LW_LANGEN_DATA[LW_LANG_STRING_INTERNET_UNREACHABLE] = "Unreachable";
+  LW_LANGEN_DATA[LW_LANG_STRING_INTERNET_PING] = "Ping";
+  LW_LANGEN_DATA[LW_LANG_STRING_INTERNET_MSEC] = "ms";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_WAVE_AMPLI] = "Ampli";
+  LW_LANGEN_DATA[LW_LANG_STRING_WAVE_NUMBER] = "Number";
+  LW_LANGEN_DATA[LW_LANG_STRING_WAVE_SPEED] = "Speed";
+  LW_LANGEN_DATA[LW_LANG_STRING_WAVE_WX] = "WX";
+  LW_LANGEN_DATA[LW_LANG_STRING_WAVE_HY] = "HY";
+  LW_LANGEN_DATA[LW_LANG_STRING_WAVE_WY] = "WY";
+  LW_LANGEN_DATA[LW_LANG_STRING_WAVE_HX] = "HX";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_CONNECT_STARTNOW] = "Start now";
+  LW_LANGEN_DATA[LW_LANG_STRING_CONNECT_WAITING] = "Waiting...";
+  LW_LANGEN_DATA[LW_LANG_STRING_CONNECT_WAITINGFOR] = "Waiting for ";
+  LW_LANGEN_DATA[LW_LANG_STRING_CONNECT_TEAMS] = " team(s)";
+  LW_LANGEN_DATA[LW_LANG_STRING_CONNECT_SENDMESSAGE] = "Send message";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_NETPLAY_CONNECT] = "Connect";
+  LW_LANGEN_DATA[LW_LANG_STRING_NETPLAY_PING] = "Ping";
+  LW_LANGEN_DATA[LW_LANG_STRING_NETPLAY_CHECKPROGRAM] = "Check program";
+  LW_LANGEN_DATA[LW_LANG_STRING_NETPLAY_CHECKVERSION] = "Check version";
+  LW_LANGEN_DATA[LW_LANG_STRING_NETPLAY_SENDPASSWORD] = "Password";
+  LW_LANGEN_DATA[LW_LANG_STRING_NETPLAY_FREETEAMS] = "Free teams?";
+  LW_LANGEN_DATA[LW_LANG_STRING_NETPLAY_RESERVETEAMS] = "Reserve teams";
+  LW_LANGEN_DATA[LW_LANG_STRING_NETPLAY_SENDCONFIG] = "Send config";
+  LW_LANGEN_DATA[LW_LANG_STRING_NETPLAY_SENDMAP] = "Send map";
+  LW_LANGEN_DATA[LW_LANG_STRING_NETPLAY_WAITING] = "Waiting...";
+  LW_LANGEN_DATA[LW_LANG_STRING_NETPLAY_WHOPLAYS] = "Who plays?";
+  LW_LANGEN_DATA[LW_LANG_STRING_NETPLAY_RECVCONFIG] = "Receive config";
+  LW_LANGEN_DATA[LW_LANG_STRING_NETPLAY_RECVMAP] = "Receive map";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_LEVEL_USEDEFAULTTEXTURE] =
+    "Use default texture";
+  LW_LANGEN_DATA[LW_LANG_STRING_LEVEL_ON] = "On";
+  LW_LANGEN_DATA[LW_LANG_STRING_LEVEL_OFF] = "Off";
+  LW_LANGEN_DATA[LW_LANG_STRING_LEVEL_RANDOMMAP] = "Random map";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_FPS] = "frames/s ";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_RPS] = "rounds/s ";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_PERCENTCALC] = "% calc ";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_PERCENTDISPLAY] = "% display ";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_SPREADGRADTIME] = "Spread grad time ";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_MOVEARMYTIME] = "Move army time ";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_DISPLAYTIME] = "Display time ";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_FLIPTIME] = "Flip time ";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_OTHERCALCTIME] = "Other calc time ";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_GLOBALTIME] = "Global time ";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_STANDARDDISPLAY] = "Standard display";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_GRADIENT1] = "Gradient 1";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_GRADIENT2] = "Gradient 2";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_GRADIENT3] = "Gradient 3";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_GRADIENT4] = "Gradient 4";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_GRADIENT5] = "Gradient 5";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_GRADIENT6] = "Gradient 6";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_MESHSIZE] = "Mesh size";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_MESHSTRUCTURE] = "Mesh structure";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_PAUSEOFF] = "Pause off";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_PAUSEON] = "Pause on";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_WAVEEFFECTSOFF] = "Wave effects off";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_WAVEEFFECTSON] = "Wave effects on";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_CAPTUREOFF] = "Video capture off";
+  LW_LANGEN_DATA[LW_LANG_STRING_CODE_CAPTUREON] = "Video capture on";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_SCORE_WINNER] = "Winner";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_GAME_BACKMEMFAIL] = "Back mem fail";
+  LW_LANGEN_DATA[LW_LANG_STRING_GAME_DISPMEMFAIL] = "Disp mem fail";
+  LW_LANGEN_DATA[LW_LANG_STRING_GAME_MESHMEMFAIL] = "Mesh mem fail";
+  LW_LANGEN_DATA[LW_LANG_STRING_GAME_AREAMEMFAIL] = "Area mem fail";
+  LW_LANGEN_DATA[LW_LANG_STRING_GAME_ARMYMEMFAIL] = "Army mem fail";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_ERROR_NOTENOUGHTEAMS] =
+    "Not enough teams.\nYou must select at least 2 teams from the \"Teams\" menu.";
+  LW_LANGEN_DATA[LW_LANG_STRING_ERROR_NOTENOUGHBIGDATA] =
+    "Not enough memory to expand level.\nChoose a smaller level or look at the documentation and try command line options such as \"-mem n\".";
+  LW_LANGEN_DATA[LW_LANG_STRING_ERROR_GRAPHICSINITFAILED] =
+    "Unable to start graphic mode";
+  LW_LANGEN_DATA[LW_LANG_STRING_ERROR_NONETWORKSUPPORT] =
+    "No network support for this platform.\nOnly Windows and UNIX have it.";
+  LW_LANGEN_DATA[LW_LANG_STRING_ERROR_UNABLETOCONNECT] =
+    "Unable to connect to the server.\nMaybe it's not correctly set up, or you are behind a firewall which forbids the connection.";
+  LW_LANGEN_DATA[LW_LANG_STRING_ERROR_NOTALIQUIDWARSERVER] =
+    "Unable to communicate with the server.\nIt doesn't seem to be a Liquid War server.";
+  LW_LANGEN_DATA[LW_LANG_STRING_ERROR_WRONGVERSION] =
+    "Wrong client/server versions.\nServer and client must have the same version (this client's version is \""
+    LW_VERSION "\").";
+  LW_LANGEN_DATA[LW_LANG_STRING_ERROR_NETWORKPROBLEM] =
+    "A network error has occured.\nThis often happens when the connection with the server is too slow or simply lost.";
+  LW_LANGEN_DATA[LW_LANG_STRING_ERROR_CANTSENDMAP] =
+    "Unable to send the map to the server.";
+  LW_LANGEN_DATA[LW_LANG_STRING_ERROR_CANTRECEIVEMAP] =
+    "Unable to receive the map from the server.";
+  LW_LANGEN_DATA[LW_LANG_STRING_ERROR_SERVERFULL] =
+    "This server is full and doesn't accept new teams for now.";
+  LW_LANGEN_DATA[LW_LANG_STRING_ERROR_BADPASSWORD] = "Incorrect password.";
+  LW_LANGEN_DATA[LW_LANG_STRING_ERROR_BADCONFIGRANGE] =
+    "One of the config parameters is out of range. Either there's a bug in the game, or someone is cheating and/or trying to hack something.";
+
+  LW_LANGEN_DATA[LW_LANG_STRING_POPUP_INITFAIL] = "Init failed.";
+  LW_LANGEN_DATA[LW_LANG_STRING_POPUP_MEMTROUBLE] =
+    "Not enough memory for bitmaps.";
+  LW_LANGEN_DATA[LW_LANG_STRING_POPUP_BIGDATA] = "Not enough memory.";
+  LW_LANGEN_DATA[LW_LANG_STRING_POPUP_LOADFAIL] =
+    "Unable to load datafile. Are you sure Liquid War is correctly installed?";
+  LW_LANGEN_DATA[LW_LANG_STRING_POPUP_CUSTOMFAIL] =
+    "Unable to load custom data.";
+  LW_LANGEN_DATA[LW_LANG_STRING_POPUP_GRAPHICSFAIL] =
+    "Unable to initialize graphics.";
+}
+
+/*------------------------------------------------------------------*/
+/* returns the English string associated to an id                   */
+/*------------------------------------------------------------------*/
+char *
+lw_langen_string (int id)
+{
+  char *result = NULL;
+
+  if (id >= 0 && id < LW_LANG_NB_STRINGS)
+    {
+      result = LW_LANGEN_DATA[id];
+    }
+
+  if (!result)
+    {
+      result = "??? en";
+    }
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/langen.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/langen.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/langen.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,72 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : langen.h                                         */
+/* content       : handles English dependant stuff (locale)         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_LANGEN
+#define LIQUID_WAR_INCLUDE_LANGEN
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+extern void lw_langen_init ();
+extern char *lw_langen_string (int id);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/langfr.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/langfr.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/langfr.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,364 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : langfr.c                                         */
+/* content       : handles French dependent stuff (locale)          */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+#include <stdlib.h>
+
+#include "lang.h"
+#include "langfr.h"
+#include "base.h"
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+static char *LW_LANGFR_DATA[LW_LANG_NB_STRINGS];
+
+/*------------------------------------------------------------------*/
+/* initializes the string table                                     */
+/*------------------------------------------------------------------*/
+void
+lw_langfr_init ()
+{
+  memset (LW_LANGFR_DATA, 0, sizeof (LW_LANGFR_DATA));
+
+  LW_LANGFR_DATA[LW_LANG_STRING_LANGUAGE] = "Francais";
+  LW_LANGFR_DATA[LW_LANG_STRING_APPNAME] = "Liquid War " LW_VERSION;
+
+  LW_LANGFR_DATA[LW_LANG_STRING_HELP_CREDITS] =
+    "Idee: \n* Thomas Colcombet\n\nProgrammation: \n* Christian Mauduit\n\nMusique: \n* Tim Chadburn\n\nAutres contributeurs:\n* Alstar\n* Peter Wang\n* Cort Danger Stratton\n* Jan Gretschuskin (www.game-factor.de)\n* Mouse\n* Rene Stach\n* Roderick Schertler\n* Ryan D. Brown\n* Eduard Bloch\n* Michael Terry\n* Kasper Hviid\n* David Redick\n* Alexandre Pineau\n* Michael Wagner\n* Peter Williams\n* Jan Samohyl\n* Gavin\n* Dave Vasilevsky\n* 2 of Omega\n* 666-REFIZUL-666\n\nPlus d'informations sur www.ufoot.org/liquidwar\n";
+  LW_LANGFR_DATA[LW_LANG_STRING_HELP_COPYRIGHT] =
+    "Liquid War est un \"wargame\" multijoueur.\nCopyright (C) 1998-2005 Christian Mauduit (ufoot at ufoot.org)\n\nCe programme est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier conformement aux dispositions de la Licence Publique Generale GNU, telle que publiee par la Free Software Foundation ; version 2 de la licence, ou encore (a votre choix) toute version ulterieure.\n\nCe programme est distribue dans l'espoir qu'il sera utile, mais SANS AUCUNE GARANTIE ; sans meme la garantie implicite de COMMERCIALISATION ou D'ADAPTATION A UN OBJET PARTICULIER. Pour plus de detail, voir la Licence Publique Generale GNU .\n\nVous devez avoir recu un exemplaire de la Licence Publique Generale GNU en meme temps que ce programme ; si ce n'est pas le cas, ecrivez a la Free Software Foundation Inc., 675 Mass Ave, Cambridge, MA 02139, Etats-Unis.\n\nPlus d'informations sur www.ufoot.org/liquidwar\n";
+  /*
+   * Stupid Microsoft VC++ can't handle strings over 2048 chars correctly,
+   * (compiler error C2026) so we had to split this one...
+   */
+  LW_LANGFR_DATA[LW_LANG_STRING_HELP_LICENSE] =
+    "Traduction de la GPL\n\nNotice d'accompagnement de la traduction non officielle a conserver dans toute reproduction de cette traduction\n\nThis is an unofficial translation of the GNU General Public License into french. It was not published by the Free Software Foundation, and does not legally state the distribution terms for software that uses the GNU GPL--only the original English text of the GNU GPL does that. However, we hope that this translation will help french speakers understand the GNU GPL better.\n\nCeci est une traduction non officielle de la GNU General Public License en francais. Elle n'a pas ete publiee par la Free Software Foundation, et ne determine pas les termes de distribution pour les logiciels qui utilisent la GNU GPL--seul le texte anglais original de la GNU GPL en a le droit. Cependant, nous esperons que cette traduction aidera les francophones a mieux comprendre la GPL.\n\nCette traduction est sous Copyright 2001 APRIL (http://www.april.org). "
+    "\nLa version la plus a jour de ce document est disponible sur http://www.april.org/gnu/gpl_french.html\n\nIl est permis a tout le monde de reproduire et distribuer des copies conformes de cette traduction, mais aucune modification ne doit y etre apportee, et la presente notice doit etre preservee.\n\nNous autorisons la FSF a apporter toute modification qu'elle jugera necessaire pour rendre la traduction plus claire.\n\nGNU GENERAL PUBLIC LICENSE (TRADUCTION NON OFFICIELLE)\n\nVersion 2, juin 1991\n\nCopyright (C) 1989, 1991, Free Software Foundation Inc. 675 Mass Ave, Cambridge, MA02139, Etats-Unis.\n\nIl est permis a tout le monde de reproduire et distribuer des copies conformes de ce document de licence, mais aucune modification ne doit y etre apportee.\n\nPreambule\n\nLes licences relatives a la plupart des logiciels sont destinees a supprimer votre liberte de les partager et de les modifier. Par contraste, la licence publique generale GNU General Public License veut garantir votre "
+    "liberte de partager et de modifier les logiciels libres, pour qu'ils soient vraiment libres pour tous leurs utilisateurs. La presente licence publique generale s'applique a la plupart des logiciels de la Free Software Foundation, ainsi qu'a tout autre programme dont les auteurs s'engagent a l'utiliser. (Certains autres logiciels sont couverts par la Licence Publique Generale pour Bibliotheques GNU a la place). Vous pouvez aussi l'appliquer a vos programmes.\n\nQuand nous parlons de logiciels libres, nous parlons de liberte, non de gratuite. Nos licences publiques generales veulent vous garantir :\n\n* que vous avez toute liberte de distribuer des copies des logiciels libres (et de facturer ce service, si vous le souhaitez) ;\n\n* que vous recevez les codes sources ou pouvez les obtenir si vous le souhaitez ;\n\n* que vous pouvez modifier les logiciels ou en utiliser des elements dans de nouveaux programmes libres ;\n\n* et que vous savez que vous pouvez le faire.\n\nPour proteger vos droits, "
+    "nous devons apporter des restrictions, qui vont interdire a quiconque de vous denier ces droits, ou de vous demander de vous en desister. Ces restrictions se traduisent par certaines responsabilites pour ce qui vous concerne, si vous distribuez des copies de logiciels, ou si vous les modifiez.\n\nPar exemple, si vous distribuez des copies d'un tel programme, gratuitement ou contre une remuneration, vous devez transferer aux destinataires tous les droits dont vous disposez. Vous devez vous garantir qu'eux-memes, par ailleurs, recoivent ou peuvent recevoir le code source. Et vous devez leur montrer les presentes dispositions, de facon qu'ils connaissent leurs droits.\n\nNous protegeons vos droits en deux etapes :\n\n1. Nous assurons le droit d'auteur (copyright) du logiciel, et\n\n2. Nous vous proposons cette licence, qui vous donne l'autorisation legale de dupliquer, distribuer et/ou modifier le logiciel.\n\nDe meme, pour la protection de chacun des auteurs, et pour notre propre protection, "
+    "nous souhaitons nous assurer que tout le monde comprenne qu'il n'y a aucune garantie portant sur ce logiciel libre. Si le logiciel est modifie par quelqu'un d'autre puis transmis a des tiers, nous souhaitons que les destinataires sachent que ce qu'ils possedent n'est pas l'original, de facon que tous problemes introduits par d'autres ne se traduisent pas par une repercussion negative sur la reputation de l'auteur original.\n\nEnfin, tout programme libre est en permanence menace par des brevets de logiciels. Nous souhaitons eviter le danger que des sous-distributeurs d'un programme libre obtiennent a titre individuel des licences de brevets, avec comme consequence qu'ils ont un droit de propriete sur le programme. Pour eviter cette situation, nous avons fait tout ce qui est necessaire pour que tous brevets doivent faire l'objet d'une concession de licence qui en permette l'utilisation libre par quiconque, ou bien qu'il ne soit pas concede du tout.\n\nNous presentons ci-dessous les clauses "
+    "et dispositions concernant la duplication, la distribution et la modification.\n\nCONDITIONS D'EXPLOITATION PORTANT SUR LA DUPLICATION, LA DISTRIBUTION ET LA MODIFICATION\n\n1. Le present contrat de licence s'applique a tout programme ou autre ouvrage contenant un avis, appose par le detenteur du droit de propriete, disant qu'il peut etre distribue au titre des dispositions de la presente Licence Publique Generale. Ci-apres, le \"Programme\" designe l'un quelconque de ces programmes ou ouvrages, et un \"ouvrage fonde sur le programme\" designe soit le programme, soit un ouvrage qui en derive au titre de la loi sur le droit d'auteur ; plus precisement, il s'agira d'un ouvrage contenant le programme ou une version de ce dernier, soit mot a mot, soit avec des modifications et/ou traduit en une autre langue (ci-apres, le terme \"modification\" englobe, sans aucune limitation, les traductions qui en sont faites). Chaque titulaire de licence sera appele \"concessionnaire\".\nLes activites autres "
+    "que la duplication, la distribution et la modification ne sont pas couvertes par la presente licence ; elles n'entrent pas dans le cadre de cette derniere. L'execution du programme n'est soumise a aucune restriction, et les resultats du programme ne sont couverts que si son contenu constitue un ouvrage fonde sur le programme (independamment du fait qu'il a ete realise par execution du programme). La veracite de ce qui precede depend de ce que fait le programme.\n\n2. Le concessionnaire peut dupliquer et distribuer des copies mot a mot du code source du programme tel qu'il les recoit, et ce sur un support quelconque, du moment qu'il appose, d'une maniere parfaitement visible et appropriee, sur chaque exemplaire, un avis approprie de droits d'auteur (Copyright) et de renonciation a garantie ; qu'il maintient intacts tous les avis qui se rapportent a la presente licence et a l'absence de toute garantie ; et qu'il transmet a tout destinataire du programme un exemplaire de la presente licence "
+    "en meme temps que le programme.\nLe concessionnaire peut facturer l'acte physique de transfert d'un exemplaire, et il peut, a sa discretion, proposer en echange d'une remuneration une protection en garantie.\n\n3. Le concessionnaire peut modifier son ou ses exemplaires du programme ou de toute portion de ce dernier, en formant ainsi un ouvrage fonde sur le programme, et dupliquer et distribuer ces modifications ou cet ouvrage selon les dispositions de la section 1 ci-dessus, du moment que le concessionnaire satisfait aussi a toutes ces conditions :\na. Le concessionnaire doit faire en sorte que les fichiers modifies portent un avis, parfaitement visible, disant que le concessionnaire a modifie les fichiers, avec la date de tout changement.\nb. Le concessionnaire doit faire en sorte que tout ouvrage qu'il distribue ou publie, et qui, en totalite ou en partie, contient le programme ou une partie quelconque de ce dernier ou en derive, soit concede en bloc, a titre gracieux, a tous tiers au "
+    "titre des dispositions de la presente licence.\nc. Si le programme modifie lit normalement des instructions interactives lors de son execution, le concessionnaire doit, quand il commence l'execution du programme pour une telle utilisation interactive de la maniere la plus usuelle, faire en sorte que ce programme imprime ou affiche une annonce, comprenant un avis approprie de droits d'auteur, et un avis selon lequel il n'y a aucune garantie (ou autrement, que le concessionnaire fournit une garantie), et que les utilisateurs peuvent redistribuer le programme au titre de ces dispositions, et disant a l'utilisateur comment visualiser une copie de cette licence (exception : si le programme par lui-meme est interactif mais n'imprime normalement pas une telle annonce, l'ouvrage du concessionnaire se fondant sur le programme n'a pas besoin d'imprimer une annonce).\nLes exigences ci-dessus s'appliquent a l'ouvrage modifie pris en bloc. Si des sections identifiables de cet ouvrage ne derivent pas "
+    "du programme et peuvent etre considerees raisonnablement comme representant des ouvrages independants et distincts par eux-memes, alors la presente licence, et ses dispositions, ne s'appliquent pas a ces sections quand le concessionnaire les distribue sous forme d'ouvrages distincts. Mais quand le concessionnaire distribue ces memes sections en tant qu'element d'un tout qui represente un ouvrage se fondant sur le programme, la distribution de ce tout doit se faire conformement aux dispositions de la presente licence, dont les autorisations, portant sur d'autres concessionnaires, s'etendent a la totalite dont il est question, et ainsi a chacune de ces parties, independamment de celui qu'il a ecrite.\nAinsi, cette section n'a pas pour but de revendiquer des droits ou de contester vos droits sur un ouvrage entierement ecrit par le concessionnaire ; bien plus, l'intention est d'exercer le droit de surveiller la distribution d'ouvrages derivee ou collective se fondant sur le programme.\nDe "
+    "plus, un simple assemblage d'un autre ouvrage ne se fondant pas sur le programme, avec le programme (ou avec un ouvrage se fondant sur le programme) sur un volume d'un support de stockage ou distribution, ne fait pas entrer l'autre ouvrage dans le cadre de la presente licence.\n\n4. Le concessionnaire peut dupliquer et distribuer le programme (ou un ouvrage se fondant sur ce dernier, au titre de la Section 2), en code objet ou sous une forme executable, au titre des dispositions des Sections 1 et 2 ci-dessus, du moment que le concessionnaire effectue aussi l'une des operations suivantes :\na. Lui joindre le code source complet correspondant, exploitable par une machine, code qui doit etre distribue au titre des Sections 1 et 2 ci-dessus sur un support couramment utilise pour l'echange de logiciels ; ou bien\nb. Lui joindre une offre ecrite, dont la validite se prolonge pendant au moins 3 ans, de transmettre a un tiers quelconque, pour un montant non superieur au cout pour le concessionnaire, "
+    "de realisation physique de la distribution de la source, un exemplaire complet, exploitable par une machine, du code source correspondant, qui devra etre distribue au titre des dispositions des Sections 1 et 2 ci-dessus sur un support couramment utilise pour l'echange des logiciels ; ou bien\nc. Lui joindre les informations que le concessionnaire a recues, pour proposer une distribution du code source correspondant (cette variante n'est autorisee que pour la distribution non commerciale, et seulement si le concessionnaire a recu le programme sous forme executable ou sous forme d'un code objet, avec une telle offre, conformement a l'alinea b) ci-dessus).\nLe code source d'un ouvrage represente la forme preferee de l'ouvrage pour y effectuer des modifications. Pour un ouvrage executable, le code source complet represente la totalite du code source pour tous les modules qu'il contient, plus tous fichiers de definitions d'interface associes, plus les informations en code machine pour commander "
+    "la compilation et l'installation du programme executable. Cependant, a titre d'exceptions speciales, le code source distribue n'a pas besoin de comprendre quoi que ce soit qui est normalement distribue (sous forme source ou sous forme binaire) avec les composants principaux (compilateur, noyau de systeme d'exploitation, etc.) du systeme d'exploitation sur lequel est execute le programme executable, a moins que le composant, par lui-meme, soit joint au programme executable.\nSi la distribution de l*executable ou du code objet est realisee de telle sorte qu'elle offre d'acceder a une copie a partir d'un lieu designe, alors le fait d'offrir un acces equivalent a la duplication du code source a partir de ce meme lieu s'entend comme distribution du code source, meme si des tiers ne sont pas contraints de dupliquer la source en meme temps que le code objet.\n\n5. Le concessionnaire ne peut dupliquer, modifier, conceder en sous-licence ou distribuer le programme, sauf si cela est expressement "
+    "prevu par les dispositions de la presente licence. Toute tentative pour autrement dupliquer, modifier, conceder en sous-licence ou distribuer le programme est repetee nulle, et met automatiquement fin aux droits du concessionnaire au titre de la presente licence. Cependant, les parties qui ont recu des copies, ou des droits, de la part du concessionnaire au titre de la presente licence, ne verront pas expirer leur contrat de licence, tant que ces parties agissent d'une maniere parfaitement conforme.\n\n6. Il n'est pas exige du concessionnaire qu'il accepte la presente licence, car il ne l'a pas signee. Cependant, rien d'autre n'octroie au concessionnaire l'autorisation de modifier ou de distribuer le programme ou ses ouvrages derives. Ces actions sont interdites par la loi si le concessionnaire n'accepte pas la presente licence. En consequence, par le fait de modifier ou de distribuer le programme (ou un ouvrage quelconque se fondant sur le programme), le concessionnaire indique qu'il "
+    "accepte la presente licence, et qu'il a la volonte de se conformer a toutes les clauses et dispositions concernant la duplication, la distribution ou la modification du programme ou d'ouvrages se fondant sur ce dernier.\n\n7. Chaque fois que le concessionnaire redistribue le programme (ou tout ouvrage se fondant sur le programme), le destinataire recoit automatiquement une licence de l'emetteur initial de la licence, pour dupliquer, distribuer ou modifier le programme, sous reserve des presentes clauses et dispositions. Le concessionnaire ne peut imposer aucune restriction plus poussee sur l'exercice, par le destinataire, des droits octroyes au titre des presentes. Le concessionnaire n'a pas pour responsabilite d'exiger que des tiers se conforment a la presente licence.\n\n8. Si, en consequence une decision de justice ou une allegation d'infraction au droit des brevets, ou pour toute autre raison (qui n'est pas limitee a des problemes de proprietes industrielles), des conditions sont imposees "
+    "au concessionnaire (par autorite de justice, par convention ou autrement), qui entrent en contradiction avec les dispositions de la presente licence, elles n'exemptent pas le concessionnaire de respecter les dispositions de la presente licence. Si le concessionnaire ne peut proceder a la distribution de facon a satisfaire simultanement a ces obligations au titre de la presente licence et a toutes autres obligations pertinentes, alors, en consequence de ce qui precede, le concessionnaire peut ne pas proceder du tout a la distribution du programme. Par exemple, si une licence de brevet ne permettait pas une redistribution du programme, sans redevances, par tous ceux qui recoivent des copies directement ou indirectement par l'intermediaire du concessionnaire, alors le seul moyen par lequel le concessionnaire pourrait satisfaire tant a cette licence de brevet qu'a la presente licence, consisterait a s'abstenir completement de distribuer le programme.\nSi une partie quelconque de cette section "
+    "est consideree comme nulle ou non executoire dans certaines circonstances particulieres, le reste de cette section est repute s'appliquer, et la section dans son ensemble est consideree comme s'appliquant dans les autres circonstances.\nLa presente section n'a pas pour objet de pousser le concessionnaire a enfreindre tous brevets ou autres revendications a droit de propriete, ou encore a contester la validite de une ou plusieurs quelconques de ces revendications ; la presente section a pour objet unique de proteger l'integrite du systeme de distribution des logiciels libres, systeme qui est mis en oeuvre par les pratiques liees aux licences publiques. De nombreuses personnes ont apporte une forte contribution a la gamme etendue des logiciels distribues par ce systeme, en comptant sur l'application systematique de ce systeme ; c'est a l'auteur/donateur de decider s'il a la volonte de distribuer le logiciel par un quelconque autre systeme, et un concessionnaire ne peut imposer ce choix.\nLa "
+    "presente section veut rendre parfaitement claire ce que l'on pense etre une consequence du reste de la presente licence.\n\n9. Si la distribution et/ou l'utilisation du Programme est restreinte dans certains pays, sous l'effet de brevets ou d'interfaces presentant un droit d'auteur, le detenteur du droit d'auteur original, qui soumet le Programme aux dispositions de la presente licence, pourra ajouter une limitation expresse de distribution geographique excluant ces pays, de facon que la distribution ne soit autorisee que dans les pays ou parmi les pays qui ne sont pas ainsi exclus. Dans ce cas, la limitation fait partie integrante de la presente licence, comme si elle etait ecrite dans le corps de la presente licence.\nLa Free Software Foundation peut, de temps a autre, publier des versions revisees et/ou nouvelles du General Public License. Ces nouvelles versions seront analogues, du point de vue de leur esprit, a la presente version, mais pourront en differer dans le detail, pour resoudre "
+    "de nouveaux problemes ou de nouvelles situations.\nChaque version recoit un numero de version qui lui est propre. Si le programme specifie un numero de version de la presente licence, qui s'applique a cette dernier et \"a toute autre version ulterieure\", le concessionnaire a le choix de respecter les clauses et dispositions de cette version, ou une quelconque version ulterieure publiee par la Free Software Foundation. Si le programme ne specifie pas de numero de version de la presente licence, le concessionnaire pourra choisir une version quelconque publiee a tout moment par la Free Software Foundation.\n\n10. Si le concessionnaire souhaite incorporer des parties du programme dans d'autres programmes libres dont les conditions de distribution sont differentes, il devrait ecrire a l'auteur pour demander son autorisation. Pour un logiciel soumis a droit d'auteur par la Free Software Foundation, il devra ecrire a la Free Software Foundation ; nous faisons quelquefois des exceptions a cette "
+    "regle. Notre decision va etre guidee par le double objectif de proteger le statut libre de tous les derives de nos logiciels libres, et de favoriser le partage et la reutilisation des logiciels en general.\n\nABSENCE DE GARANTIE\n\n11. COMME LA LICENCE DU PROGRAMME EST CONCEDEE A TITRE GRATUIT, IL N'Y A AUCUNE GARANTIE S'APPLIQUANT AU PROGRAMME, DANS LA MESURE AUTORISEE PAR LA LOI EN VIGUEUR. SAUF MENTION CONTRAIRE ECRITE, LES DETENTEURS DU DROIT D'AUTEUR ET/OU LES AUTRES PARTIES METTENT LE PROGRAMME A DISPOSITON \"EN L'ETAT\", SANS AUCUNE GARANTIE DE QUELQUE NATURE QUE CE SOIT, EXPRESSE OU IMPLICITE, Y COMPRIS, MAIS SANS LIMITATION, LES GARANTIES IMPLICITES DE COMMERCIALISATION ET DE L'APTITUDE A UN OBJET PARTICULIER. C'EST LE CONCESSIONNAIRE QUI PREND LA TOTALITE DU RISQUE QUANT A LA QUALITE ET AUX PERFORMANCES DU PROGRAMME. SI LE PROGRAMME SE REVELAIT DEFECTUEUX, C'EST LE CONCESSIONNAIRE QUI PRENDRAIT A SA CHARGE LE COUT DE L'ENSEMBLE DES OPERATIONS NECESSAIRES D'ENTRETIEN, REPARATION "
+    "OU CORRECTION.\n\n12. EN AUCUN CAS, SAUF SI LA LOI EN VIGUEUR L'EXIGE OU SI UNE CONVENTION ECRITE EXISTE A CE SUJET, AUCUN DETENTEUR DE DROITS D'AUTEUR, OU AUCUNE PARTIE AYANT LE POUVOIR DE MODIFIER ET/OU DE REDISTRIBUER LE PROGRAMME CONFORMEMENT AUX AUTORISATIONS CI-DESSUS, N'EST RESPONSABLE VIS-A-VIS DU CONCESSIONNAIRE POUR CE QUI EST DES DOMMAGES, Y COMPRIS TOUS DOMMAGES GENERAUX, SPECIAUX, ACCIDENTELS OU INDIRECTS, RESULTANT DE L'UTILISATION OU DU PROGRAMME OU DE L'IMPOSSIBILITE D'UTILISER LE PROGRAMME (Y COMPRIS, MAIS SANS LIMITATION, LA PERTE DE DONNEES, OU LE FAIT QUE DES DONNEES SONT RENDUES IMPRECISES, OU ENCORE LES PERTES EPROUVEES PAR LE CONCESSIONNAIRE OU PAR DES TIERS, OU ENCORE UN MANQUEMENT DU PROGRAMME A FONCTIONNER AVEC TOUS AUTRES PROGRAMMES), MEME SI CE DETENTEUR OU CETTE AUTRE PARTIE A ETE AVISE DE LA POSSIBILITE DE TELS DOMMAGES.\n\nFIN DES CONDITIONS D'EXPLOITATION\n\nPlus d'informations sur www.ufoot.org/liquidwar\n";
+  LW_LANGFR_DATA[LW_LANG_STRING_HELP_VERSION] =
+    "Liquid War par U-Foot\n\nv" LW_VERSION " \n\ncompilee le " __DATE__ " a "
+    __TIME__ "\n\nPlus d'informations sur www.ufoot.org/liquidwar\n";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_MENU_PLAY] = "Jouer";
+  LW_LANGFR_DATA[LW_LANG_STRING_MENU_NETGAME] = "Jeu reseau";
+  LW_LANGFR_DATA[LW_LANG_STRING_MENU_MAP] = "Tableau";
+  LW_LANGFR_DATA[LW_LANG_STRING_MENU_TEAMS] = "Equipes";
+  LW_LANGFR_DATA[LW_LANG_STRING_MENU_OPTIONS] = "Options";
+  LW_LANGFR_DATA[LW_LANG_STRING_MENU_ABOUT] = "A propos";
+  LW_LANGFR_DATA[LW_LANG_STRING_MENU_EXIT] = "Quitter";
+  LW_LANGFR_DATA[LW_LANG_STRING_MENU_EXITDOS] = "Revenir a DOS";
+  LW_LANGFR_DATA[LW_LANG_STRING_MENU_EXITWINDOWS] = "Quitter";
+  LW_LANGFR_DATA[LW_LANG_STRING_MENU_EXITUNIX] = "Quitter";
+  LW_LANGFR_DATA[LW_LANG_STRING_MENU_BACK] = "Retour a LW";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_DIALOG_QUIT] = "Quitter";
+  LW_LANGFR_DATA[LW_LANG_STRING_DIALOG_BACK] = "Retour";
+  LW_LANGFR_DATA[LW_LANG_STRING_DIALOG_PLAY] = "Jouer";
+  LW_LANGFR_DATA[LW_LANG_STRING_DIALOG_MAIN] = "Accueil";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_PLAY_GETREADY] = "C'est parti!";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_NETGAME_STARTGAME] = "Demarrer";
+  LW_LANGFR_DATA[LW_LANG_STRING_NETGAME_SERVERADDR] = "Addr serveur";
+  LW_LANGFR_DATA[LW_LANG_STRING_NETGAME_SERVERPORT] = "Port serveur";
+  LW_LANGFR_DATA[LW_LANG_STRING_NETGAME_SEARCH] =
+    "Trouver un serveur sur le Net";
+  LW_LANGFR_DATA[LW_LANG_STRING_NETGAME_PASSWORD] = "Mot de passe";
+  LW_LANGFR_DATA[LW_LANG_STRING_NETGAME_WEAKPASSWORD] =
+    "ATTENTION! Choisir un mot de passe simple genre \"bonjour\", car il est stocke sur le disque dur et envoye au serveur en clair.";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_LANGUAGE_AUTO] = "Automatique";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_TEAM_OFF] = "Inactif";
+  LW_LANGFR_DATA[LW_LANG_STRING_TEAM_HUMAN] = "Joueur";
+  LW_LANGFR_DATA[LW_LANG_STRING_TEAM_CPU] = "Ordi";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_OPTIONS_GRAPHICS] = "Affichage";
+  LW_LANGFR_DATA[LW_LANG_STRING_OPTIONS_SOUND] = "Son";
+  LW_LANGFR_DATA[LW_LANG_STRING_OPTIONS_RULES] = "Regles";
+  LW_LANGFR_DATA[LW_LANG_STRING_OPTIONS_SPEEDS] = "Vitesses";
+  LW_LANGFR_DATA[LW_LANG_STRING_OPTIONS_CONTROLS] = "Controles";
+  LW_LANGFR_DATA[LW_LANG_STRING_OPTIONS_LANGUAGE] = "Langue";
+  LW_LANGFR_DATA[LW_LANG_STRING_OPTIONS_DEFAULT] = "Remise a zero";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_GRAPHICS_GAME] = "Jeu";
+  LW_LANGFR_DATA[LW_LANG_STRING_GRAPHICS_MENU] = "Menu";
+  LW_LANGFR_DATA[LW_LANG_STRING_GRAPHICS_ON] = "Oui";
+  LW_LANGFR_DATA[LW_LANG_STRING_GRAPHICS_OFF] = "Non";
+  LW_LANGFR_DATA[LW_LANG_STRING_GRAPHICS_FULLSCREEN] = "Plein ecran";
+  LW_LANGFR_DATA[LW_LANG_STRING_GRAPHICS_WINDOWED] = "Fenetre";
+  LW_LANGFR_DATA[LW_LANG_STRING_GRAPHICS_ADVANCED] = "Opt avancees";
+  LW_LANGFR_DATA[LW_LANG_STRING_GRAPHICS_VIDEOMODE] = "Mode video";
+  LW_LANGFR_DATA[LW_LANG_STRING_GRAPHICS_BRIGHTNESS] = "Luminosite";
+  LW_LANGFR_DATA[LW_LANG_STRING_GRAPHICS_VIEWPORTSIZE] = "Surface";
+  LW_LANGFR_DATA[LW_LANG_STRING_GRAPHICS_PAGEFLIPPING] = "\"Page flipping\"";
+  LW_LANGFR_DATA[LW_LANG_STRING_GRAPHICS_WAVES] = "Vagues (F4)";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_VOLUME_SFX] = "Bruits";
+  LW_LANGFR_DATA[LW_LANG_STRING_VOLUME_CLICK] = "Clics";
+  LW_LANGFR_DATA[LW_LANG_STRING_VOLUME_GAMEWATER] = "Eau (jeu)";
+  LW_LANGFR_DATA[LW_LANG_STRING_VOLUME_MENUWATER] = "Eau (menu)";
+  LW_LANGFR_DATA[LW_LANG_STRING_VOLUME_MUSIC] = "Musique";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_RULES_TIME] = "Temps";
+  LW_LANGFR_DATA[LW_LANG_STRING_RULES_ADVANCED] = "Opt avancees";
+  LW_LANGFR_DATA[LW_LANG_STRING_RULES_ARMYSIZE] = "Taille armees";
+  LW_LANGFR_DATA[LW_LANG_STRING_RULES_CURSOR] = "Curseur";
+  LW_LANGFR_DATA[LW_LANG_STRING_RULES_DEFAULT] = "Remise a zero";
+  LW_LANGFR_DATA[LW_LANG_STRING_RULES_MINMAPRES] = "Mini ";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_ADVANCED_ATTACK] = "Attaque";
+  LW_LANGFR_DATA[LW_LANG_STRING_ADVANCED_DEFENSE] = "Defense";
+  LW_LANGFR_DATA[LW_LANG_STRING_ADVANCED_BASEHEALTH] = "Force depart";
+  LW_LANGFR_DATA[LW_LANG_STRING_ADVANCED_WINNERHELP] = "Aide vainqueur";
+  LW_LANGFR_DATA[LW_LANG_STRING_ADVANCED_CPUSTRENGTH] = "Force ordi";
+  LW_LANGFR_DATA[LW_LANG_STRING_ADVANCED_CPUVSHUMAN] = "Ordi vs joueur";
+  LW_LANGFR_DATA[LW_LANG_STRING_ADVANCED_ALWAYS] = "Toujours";
+  LW_LANGFR_DATA[LW_LANG_STRING_ADVANCED_RANDOM] = "Au hasard";
+  LW_LANGFR_DATA[LW_LANG_STRING_ADVANCED_NEVER] = "Jamais";
+  LW_LANGFR_DATA[LW_LANG_STRING_ADVANCED_ASMALGORITHM] = "Algorithme";
+  LW_LANGFR_DATA[LW_LANG_STRING_ADVANCED_ASSEMBLY] = "Assembleur";
+  LW_LANGFR_DATA[LW_LANG_STRING_ADVANCED_STANDARDC] = "C standard";
+  LW_LANGFR_DATA[LW_LANG_STRING_ADVANCED_ALLOWNETWORKBOTS] = "Bots reseau";
+  LW_LANGFR_DATA[LW_LANG_STRING_ADVANCED_YES] = "Oui";
+  LW_LANGFR_DATA[LW_LANG_STRING_ADVANCED_NO] = "Non";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_SPEEDS_FPS] = "affich/s";
+  LW_LANGFR_DATA[LW_LANG_STRING_SPEEDS_NOFPSLIMIT] = "Pas de limite";
+  LW_LANGFR_DATA[LW_LANG_STRING_SPEEDS_RPS] = "tours/s";
+  LW_LANGFR_DATA[LW_LANG_STRING_SPEEDS_NORPSLIMIT] = "Pas de limite";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_CONTROLS_JOYSTICK] = "Joystick";
+  LW_LANGFR_DATA[LW_LANG_STRING_CONTROLS_OFF] = "Aucun";
+  LW_LANGFR_DATA[LW_LANG_STRING_CONTROLS_2JOYSTICKS] = "2 joysticks";
+  LW_LANGFR_DATA[LW_LANG_STRING_CONTROLS_4BUTTONS] = "4 boutons";
+  LW_LANGFR_DATA[LW_LANG_STRING_CONTROLS_STANDARD] = "Standard";
+  LW_LANGFR_DATA[LW_LANG_STRING_CONTROLS_MOUSESENSIB] =
+    "Sensibilite de la souris (jeu)";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_ABOUT_CREDITS] = "\"Credits\"";
+  LW_LANGFR_DATA[LW_LANG_STRING_ABOUT_COPYRIGHT] = "Copyright";
+  LW_LANGFR_DATA[LW_LANG_STRING_ABOUT_LICENSE] = "Licence";
+  LW_LANGFR_DATA[LW_LANG_STRING_ABOUT_VERSION] = "Version";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_INTERNET_REFRESH] = "Rafraichir";
+  LW_LANGFR_DATA[LW_LANG_STRING_INTERNET_JOINNOW] = "Se connecter";
+  LW_LANGFR_DATA[LW_LANG_STRING_INTERNET_PORT] = "Port";
+  LW_LANGFR_DATA[LW_LANG_STRING_INTERNET_PASSWORD] = "Mot de passe";
+  LW_LANGFR_DATA[LW_LANG_STRING_INTERNET_YES] = "oui";
+  LW_LANGFR_DATA[LW_LANG_STRING_INTERNET_NO] = "non";
+  LW_LANGFR_DATA[LW_LANG_STRING_INTERNET_UPTIME] = "Age";
+  LW_LANGFR_DATA[LW_LANG_STRING_INTERNET_DAYS] = "j";
+  LW_LANGFR_DATA[LW_LANG_STRING_INTERNET_DAY] = "j";
+  LW_LANGFR_DATA[LW_LANG_STRING_INTERNET_HOURS] = "h";
+  LW_LANGFR_DATA[LW_LANG_STRING_INTERNET_MINUTES] = "min";
+  LW_LANGFR_DATA[LW_LANG_STRING_INTERNET_SECONDS] = "sec";
+  LW_LANGFR_DATA[LW_LANG_STRING_INTERNET_UNREACHABLE] = "Pas joignable";
+  LW_LANGFR_DATA[LW_LANG_STRING_INTERNET_PING] = "Ping";
+  LW_LANGFR_DATA[LW_LANG_STRING_INTERNET_MSEC] = "ms";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_WAVE_AMPLI] = "Taille";
+  LW_LANGFR_DATA[LW_LANG_STRING_WAVE_NUMBER] = "Nombre";
+  LW_LANGFR_DATA[LW_LANG_STRING_WAVE_SPEED] = "Rapid";
+  LW_LANGFR_DATA[LW_LANG_STRING_WAVE_WX] = "WX";
+  LW_LANGFR_DATA[LW_LANG_STRING_WAVE_HY] = "HY";
+  LW_LANGFR_DATA[LW_LANG_STRING_WAVE_WY] = "WY";
+  LW_LANGFR_DATA[LW_LANG_STRING_WAVE_HX] = "HX";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_CONNECT_STARTNOW] = "Commencer";
+  LW_LANGFR_DATA[LW_LANG_STRING_CONNECT_WAITING] = "En attente...";
+  LW_LANGFR_DATA[LW_LANG_STRING_CONNECT_WAITINGFOR] = "Il manque ";
+  LW_LANGFR_DATA[LW_LANG_STRING_CONNECT_TEAMS] = " equipe(s)";
+  LW_LANGFR_DATA[LW_LANG_STRING_CONNECT_SENDMESSAGE] = "Envoyer";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_NETPLAY_CONNECT] = "Connexion";
+  LW_LANGFR_DATA[LW_LANG_STRING_NETPLAY_PING] = "\"Ping\"";
+  LW_LANGFR_DATA[LW_LANG_STRING_NETPLAY_CHECKPROGRAM] = "Verif prog";
+  LW_LANGFR_DATA[LW_LANG_STRING_NETPLAY_CHECKVERSION] = "Verif version";
+  LW_LANGFR_DATA[LW_LANG_STRING_NETPLAY_SENDPASSWORD] = "Mot de passe";
+  LW_LANGFR_DATA[LW_LANG_STRING_NETPLAY_FREETEAMS] = "Place libre?";
+  LW_LANGFR_DATA[LW_LANG_STRING_NETPLAY_RESERVETEAMS] = "Reservation";
+  LW_LANGFR_DATA[LW_LANG_STRING_NETPLAY_SENDCONFIG] = "Envoi conf";
+  LW_LANGFR_DATA[LW_LANG_STRING_NETPLAY_SENDMAP] = "Envoi tab";
+  LW_LANGFR_DATA[LW_LANG_STRING_NETPLAY_WAITING] = "En attente...";
+  LW_LANGFR_DATA[LW_LANG_STRING_NETPLAY_WHOPLAYS] = "Qui joue?";
+  LW_LANGFR_DATA[LW_LANG_STRING_NETPLAY_RECVCONFIG] = "Lecture conf";
+  LW_LANGFR_DATA[LW_LANG_STRING_NETPLAY_RECVMAP] = "Lecture tab";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_LEVEL_USEDEFAULTTEXTURE] =
+    "Texture par defaut";
+  LW_LANGFR_DATA[LW_LANG_STRING_LEVEL_ON] = "Oui";
+  LW_LANGFR_DATA[LW_LANG_STRING_LEVEL_OFF] = "Non";
+  LW_LANGFR_DATA[LW_LANG_STRING_LEVEL_RANDOMMAP] = "Tableau au hasard";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_FPS] = "affich/s ";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_RPS] = "tours/s ";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_PERCENTCALC] = "% calcul ";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_PERCENTDISPLAY] = "% affichage ";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_SPREADGRADTIME] = "Temps calc gradient ";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_MOVEARMYTIME] = "Temps deplac armees ";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_DISPLAYTIME] = "Temps affichage ";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_FLIPTIME] = "Temps \"page flip\" ";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_OTHERCALCTIME] = "Temps restant ";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_GLOBALTIME] = "Temps total ";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_STANDARDDISPLAY] = "Affichage standard";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_GRADIENT1] = "Gradient 1";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_GRADIENT2] = "Gradient 2";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_GRADIENT3] = "Gradient 3";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_GRADIENT4] = "Gradient 4";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_GRADIENT5] = "Gradient 5";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_GRADIENT6] = "Gradient 6";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_MESHSIZE] = "Forme du maillage";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_MESHSTRUCTURE] = "Structure du maillage";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_PAUSEOFF] = "Pause terminee";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_PAUSEON] = "Pause";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_WAVEEFFECTSOFF] =
+    "Pas d'effets de vague";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_WAVEEFFECTSON] = "Effets de vague";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_CAPTUREOFF] = "Capture video desactivee";
+  LW_LANGFR_DATA[LW_LANG_STRING_CODE_CAPTUREON] = "Capture video activee";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_SCORE_WINNER] = "Bravo!";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_GAME_BACKMEMFAIL] = "Pb mem \"back\"";
+  LW_LANGFR_DATA[LW_LANG_STRING_GAME_DISPMEMFAIL] = "Pb mem \"disp\"";
+  LW_LANGFR_DATA[LW_LANG_STRING_GAME_MESHMEMFAIL] = "Pb mem \"mesh\"";
+  LW_LANGFR_DATA[LW_LANG_STRING_GAME_AREAMEMFAIL] = "Pb mem \"area\"";
+  LW_LANGFR_DATA[LW_LANG_STRING_GAME_ARMYMEMFAIL] = "Pb mem \"army\"";
+
+  LW_LANGFR_DATA[LW_LANG_STRING_ERROR_NOTENOUGHTEAMS] =
+    "Pas assez d'equipes.\nIl faut selectionner au moins 2 equipes dans le menu \"Equipes\"";
+  LW_LANGFR_DATA[LW_LANG_STRING_ERROR_NOTENOUGHBIGDATA] =
+    "Pas assez de memoire.\nIl faut choisir un plus petit tableau ou bien lire la documentation et essayer des options du type \"-mem n\".";
+  LW_LANGFR_DATA[LW_LANG_STRING_ERROR_GRAPHICSINITFAILED] =
+    "Impossible d'initialiser le mode video.";
+  LW_LANGFR_DATA[LW_LANG_STRING_ERROR_NONETWORKSUPPORT] =
+    "Pas de support reseau pour cette plate-forme.\nLe reseau est disponiblre sous Windows et UNIX uniquement.";
+  LW_LANGFR_DATA[LW_LANG_STRING_ERROR_UNABLETOCONNECT] =
+    "Impossible de joindre le serveur.\nIl est peut-etre mal configure, ou bien vous etes derriere un pare-feu (firewall) qui vous empeche de vous connecter.";
+  LW_LANGFR_DATA[LW_LANG_STRING_ERROR_NOTALIQUIDWARSERVER] =
+    "Impossible de communiquer avec le serveur.\nIl semble que ce ne soit pas un serveur Liquid War.";
+  LW_LANGFR_DATA[LW_LANG_STRING_ERROR_WRONGVERSION] =
+    "Probleme de version client/serveur.\nLe client et le serveur doivent avoir la meme version (la version de ce client est \""
+    LW_VERSION "\").";
+  LW_LANGFR_DATA[LW_LANG_STRING_ERROR_NETWORKPROBLEM] =
+    "Il y a eu une erreur reseau.\nCela peut arriver si la connexion est trop lente ou bien si elle a ete coupee.";
+  LW_LANGFR_DATA[LW_LANG_STRING_ERROR_CANTSENDMAP] =
+    "Impossible d'envoyer le tableau au serveur.";
+  LW_LANGFR_DATA[LW_LANG_STRING_ERROR_CANTRECEIVEMAP] =
+    "Impossible de recevoir le tableau du serveur.";
+  LW_LANGFR_DATA[LW_LANG_STRING_ERROR_SERVERFULL] =
+    "Ce serveur est plein, il n'accepte plus de nouvelles equipes.";
+  LW_LANGFR_DATA[LW_LANG_STRING_ERROR_BADPASSWORD] =
+    "Mot de passe incorrect.";
+  LW_LANGFR_DATA[LW_LANG_STRING_ERROR_BADCONFIGRANGE] =
+    "Un des parametres de configuration est en dehors des valeurs admises. Soit il y a un bug dans le jeu, soit quelqu'un est en train d'essayer de tricher et/ou de hacker quelque chose.";
+
+  /*
+   * In the following section we can use accented chars since these
+   * labels are used in system popup windows which are supposed to
+   * handle chars>127, unlike Liquid War graphical functions.
+   */
+  LW_LANGFR_DATA[LW_LANG_STRING_POPUP_INITFAIL] =
+    "Echec lors de l'initialisation.";
+  LW_LANGFR_DATA[LW_LANG_STRING_POPUP_MEMTROUBLE] =
+    "Pas assez de mémoire pour les bitmaps.";
+  LW_LANGFR_DATA[LW_LANG_STRING_POPUP_BIGDATA] = "Pas assez de mémoire.";
+  LW_LANGFR_DATA[LW_LANG_STRING_POPUP_LOADFAIL] =
+    "Impossible de charger le fichier de données. Etes-vous sûr que Liquid War est correctement installé?";
+  LW_LANGFR_DATA[LW_LANG_STRING_POPUP_CUSTOMFAIL] =
+    "Impossible de charger les fichiers de données utilisateur.";
+  LW_LANGFR_DATA[LW_LANG_STRING_POPUP_GRAPHICSFAIL] =
+    "Impossible de passer en mode graphique.";
+}
+
+/*------------------------------------------------------------------*/
+/* returns the French string associated to an id                    */
+/*------------------------------------------------------------------*/
+char *
+lw_langfr_string (int id)
+{
+  char *result = NULL;
+
+  if (id >= 0 && id < LW_LANG_NB_STRINGS)
+    {
+      result = LW_LANGFR_DATA[id];
+    }
+
+  if (!result)
+    {
+      result = "??? fr";
+    }
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/langfr.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/langfr.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/langfr.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,72 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : langfr.h                                         */
+/* content       : handles French dependant stuff (locale)          */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_LANGFR
+#define LIQUID_WAR_INCLUDE_LANGFR
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+extern void lw_langfr_init ();
+extern char *lw_langfr_string (int id);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/language.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/language.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/language.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,142 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : language.c                                       */
+/* contenu       : menu used to set up language options             */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+
+#include "language.h"
+#include "config.h"
+#include "dialog.h"
+#include "disk.h"
+#include "help.h"
+#include "menu.h"
+#include "lang.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static void
+update_language (DIALOG * d)
+{
+  int i;
+
+  quick_buttons (d);
+
+  d[4].dp = lw_lang_string (LW_LANG_STRING_LANGUAGE_AUTO);
+  for (i = 0; i < LW_LANG_NB_LANGUAGES; ++i)
+    {
+      d[i + 5].dp = lw_lang_language (i);
+    }
+}
+
+/*------------------------------------------------------------------*/
+int
+language_options (void)
+{
+  DIALOG d[6 + LW_LANG_NB_LANGUAGES];
+  int i, choix = 4, retour = 0;
+
+  memset (d, 0, sizeof (d));
+
+  standard_button (d + 4, 0, 0, 1, 2 + LW_LANG_NB_LANGUAGES);
+  for (i = 0; i < LW_LANG_NB_LANGUAGES; ++i)
+    {
+      standard_button (d + i + 5, 0, 2 + i, 1, 2 + LW_LANG_NB_LANGUAGES);
+    }
+
+  update_language (d);
+
+  d[5 + LW_LANG_NB_LANGUAGES].proc = 0;
+
+  while (retour == 0)
+    {
+      choix = my_do_dialog (d, choix);
+      switch (choix)
+	{
+	case -1:
+	case MENU_QUICK_BACK:
+	  retour = 1;
+	  break;
+	case MENU_QUICK_MAIN:
+	  retour = MENU_TOP;
+	  break;
+	case MENU_QUICK_QUIT:
+	  if (confirm_quit ())
+	    retour = MENU_EXIT;
+	  break;
+	case MENU_QUICK_PLAY:
+	  retour = MENU_PLAY;
+	  break;
+	case 4:
+	  CONFIG_LANGUAGE = LW_LANG_LANGUAGE_AUTO;
+	  update_language (d);
+	  break;
+	default:
+	  if (choix >= 5 && choix < 5 + LW_LANG_NB_LANGUAGES)
+	    {
+	      CONFIG_LANGUAGE = choix - 5;
+	      update_language (d);
+	    }
+	}
+    }
+
+  if (retour > 0)
+    retour--;
+
+  return retour;
+}

Added: unstable/liquidwar/branches/upstream/current/src/language.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/language.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/language.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,67 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : language.h                                       */
+/* contenu       : menu used to set up language options             */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_LANGUAGE
+#define LIQUID_WAR_INCLUDE_LANGUAGE
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int language_options (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/level.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/level.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/level.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,854 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : level.c                                          */
+/* contenu       : choix du niveau a jouer                          */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdio.h>
+#include <string.h>
+
+#include "back.h"
+#include "config.h"
+#include "dialog.h"
+#include "disk.h"
+#include "help.h"
+#include "level.h"
+#include "map.h"
+#include "maptex.h"
+#include "menu.h"
+#include "palette.h"
+#include "sound.h"
+#include "texture.h"
+#include "macro.h"
+#include "lang.h"
+#include "mutxgen.h"
+#include "log.h"
+#include "random.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static void
+palette_128 (DIALOG * d, int x, int y, int w, int h)
+{
+  int w1, h1, w2, h2, i, j, k;
+  w += 2;
+  h += 2;
+  w1 = w / 10;
+  h1 = h / 13;
+  w2 = w1 - 2;
+  h2 = h1 - 2;
+  for (k = 0; k < 128; ++k)
+
+    {
+      d[k].proc = d_button_proc;
+      d[k].key = 0;
+      d[k].dp = "";
+      d[k].w = w2;
+      d[k].h = h2;
+      d[k].fg = MENU_FG;
+      d[k].flags = D_EXIT;
+      d[k].bg = k + 128;
+    }
+  k = 0;
+  for (i = 0; i < 12; ++i)
+    for (j = 0; j < 10; ++j)
+
+      {
+	d[k].x = x + j * w1;
+	d[k].y = y + i * h1;
+	++k;
+      }
+  d[k].x = x;
+  d[k].y = y + 12 * h1;
+  d[k].w = 2 * w2 + 2;
+  k++;
+  for (j = 0; j < 6; ++j)
+
+    {
+      d[k].x = x + (j + 2) * w1;
+      d[k].y = y + 12 * h1;
+      ++k;
+    }
+  d[k].x = x + 8 * w1;
+  d[k].y = y + 12 * h1;
+  d[k].w = 2 * w2 + 2;
+}
+
+
+/*------------------------------------------------------------------*/
+static void
+retrieve_choose_level_xy (int *x1, int *x2, int *x3, int *x4, int *x5,
+			  int *x6, int *x7, int *x8, int *y1, int *y2,
+			  int *y3, int *y4, int *y5, int *y6, int *y7,
+			  int *y8)
+{
+  (*x1) = (MENU_VIRTUAL_W - MENU_W_LEVEL * 2
+	   - MENU_H_LEVEL * 2
+	   - MENU_W_SPACE * 2 - MENU_H_SPACE * 2 - MENU_W_SAMPLE) / 2;
+  (*x2) = (*x1) + MENU_H_SPACE + MENU_H_LEVEL;
+  (*x3) = (*x1) + MENU_W_SPACE + MENU_W_LEVEL;
+  (*x4) = (*x3) + MENU_H_LEVEL + MENU_H_SPACE;
+  (*x5) = (*x4) + MENU_H_SPACE + MENU_H_LEVEL;
+  (*x7) = (*x4) + MENU_W_SAMPLE + MENU_W_SPACE;
+  (*x6) = (*x7) - MENU_H_SPACE - MENU_H_LEVEL;
+  (*x8) = (*x7) + MENU_H_LEVEL + MENU_H_SPACE;
+  (*y1) = (MENU_VIRTUAL_H - MENU_H_LEVEL * 4
+	   - MENU_H_SPACE * 4 - MENU_H_SAMPLE) / 2;
+  (*y2) = (*y1) + MENU_H_LEVEL + MENU_H_SPACE;
+  (*y3) = (*y1) + MENU_W_LEVEL + MENU_H_SPACE;
+  (*y4) = (*y1) + MENU_H_SAMPLE - MENU_H_LEVEL;
+  (*y5) = (*y4) + MENU_H_LEVEL + MENU_H_SPACE;
+  (*y6) = (*y5) + MENU_H_LEVEL + MENU_H_SPACE;
+  (*y7) = (*y6) + MENU_H_LEVEL + MENU_H_SPACE;
+  (*y8) = (*y7) + MENU_H_LEVEL + MENU_H_SPACE;
+}
+
+
+/*------------------------------------------------------------------*/
+static void
+display_chosen_level (void)
+{
+  int x1, x2, x3, x4, x5, x6, x7, x8;
+  int y1, y2, y3, y4, y5, y6, y7, y8;
+  int sample_x, sample_y, sample_w, sample_h;
+  int max_w, max_h, bmp_w, bmp_h;
+  BITMAP *pour_voir;
+  retrieve_choose_level_xy (&x1, &x2, &x3, &x4, &x5, &x6, &x7, &x8,
+			    &y1, &y2, &y3, &y4, &y5, &y6, &y7, &y8);
+  rectfill (screen, menu_real_x (x4), menu_real_y (y1),
+	    menu_real_x (x4 + MENU_W_SAMPLE) - 1,
+	    menu_real_y (y1 + MENU_H_SAMPLE) - 1, MENU_BG);
+  lw_maptex_set_fg_palette (CONFIG_LEVEL_MAP, CONFIG_LEVEL_FG, 0,
+			    LW_RANDOM_ON, CONFIG_USE_DEFAULT_TEXTURE);
+  lw_maptex_set_bg_palette (CONFIG_LEVEL_MAP, CONFIG_LEVEL_BG, 0,
+			    LW_RANDOM_ON, CONFIG_USE_DEFAULT_TEXTURE);
+  my_set_palette ();
+  pour_voir = lw_maptex_create_map
+    (CONFIG_LEVEL_MAP, CONFIG_LEVEL_FG, CONFIG_LEVEL_BG, 0, LW_RANDOM_ON,
+     MIN_MAP_RES_W[CONFIG_MIN_MAP_RES], MIN_MAP_RES_H[CONFIG_MIN_MAP_RES],
+     CONFIG_USE_DEFAULT_TEXTURE);
+  if (pour_voir)
+
+    {
+      max_w = menu_real_x (MENU_W_SAMPLE);
+      max_h = menu_real_y (MENU_H_SAMPLE);
+      bmp_w = pour_voir->w;
+      bmp_h = pour_voir->h;
+      if (max_w * bmp_h < max_h * bmp_w)
+
+	{
+	  sample_w = max_w;
+	  sample_h = (max_w * bmp_h) / bmp_w;
+	}
+
+      else
+
+	{
+	  sample_w = (max_h * bmp_w) / bmp_h;
+	  sample_h = max_h;
+	}
+      sample_x = menu_real_x (x4) + (max_w - sample_w) / 2;
+      sample_y = menu_real_y (y1) + (max_h - sample_h) / 2;
+      stretch_blit (pour_voir, screen, 0, 0, bmp_w, bmp_h, sample_x,
+		    sample_y, sample_w, sample_h);
+      destroy_bitmap (pour_voir);
+    }
+  if (!lw_maptex_is_custom_texture_used
+      (CONFIG_LEVEL_MAP, CONFIG_LEVEL_FG, 0, LW_RANDOM_ON,
+       CONFIG_USE_DEFAULT_TEXTURE))
+
+    {
+      rectfill (screen, menu_real_x (x1), menu_real_y (y1),
+		menu_real_x (x1 + MENU_W_LEVEL) - 1,
+		menu_real_y (y1 + MENU_W_LEVEL) - 1, MENU_BG);
+      pour_voir =
+	lw_maptex_create_fg (CONFIG_LEVEL_MAP, CONFIG_LEVEL_FG, 0,
+			     LW_RANDOM_ON, CONFIG_USE_DEFAULT_TEXTURE);
+      if (pour_voir)
+
+	{
+	  stretch_blit (pour_voir, screen, 0, 0, pour_voir->w, pour_voir->h,
+			menu_real_x (x1), menu_real_x (y1),
+			menu_real_x (MENU_W_LEVEL),
+			menu_real_x (MENU_W_LEVEL));
+	  destroy_bitmap (pour_voir);
+	}
+    }
+  if (!lw_maptex_is_custom_texture_used
+      (CONFIG_LEVEL_MAP, CONFIG_LEVEL_BG, 0, LW_RANDOM_ON,
+       CONFIG_USE_DEFAULT_TEXTURE))
+
+    {
+      rectfill (screen, menu_real_x (x8), menu_real_y (y1),
+		menu_real_x (x8 + MENU_W_LEVEL) - 1,
+		menu_real_y (y1 + MENU_W_LEVEL) - 1, MENU_BG);
+      pour_voir =
+	lw_maptex_create_bg (CONFIG_LEVEL_MAP, CONFIG_LEVEL_BG, 0,
+			     LW_RANDOM_ON, CONFIG_USE_DEFAULT_TEXTURE);
+      if (pour_voir)
+
+	{
+	  stretch_blit (pour_voir, screen, 0, 0, pour_voir->w, pour_voir->h,
+			menu_real_x (x8), menu_real_x (y1),
+			menu_real_x (MENU_W_LEVEL),
+			menu_real_x (MENU_W_LEVEL));
+	  destroy_bitmap (pour_voir);
+	}
+    }
+}
+
+
+/*------------------------------------------------------------------*/
+static void
+set_dialog_visibility (DIALOG * d, int state)
+{
+  if (state)
+
+    {
+      d->flags &= ~D_HIDDEN;
+    }
+
+  else
+
+    {
+      d->flags |= D_HIDDEN;
+    }
+  if (!(d->flags & D_HIDDEN))
+
+    {
+      d->proc (MSG_DRAW, d, 0);
+    }
+}
+
+
+/*------------------------------------------------------------------*/
+static void
+set_fg_dialogs_visibility (DIALOG * d, int *just_hidden)
+{
+  int state;
+  static int last_state = 1;
+  int i;
+  state =
+    !lw_maptex_is_custom_texture_used (CONFIG_LEVEL_MAP, CONFIG_LEVEL_FG, 0,
+				       LW_RANDOM_ON,
+				       CONFIG_USE_DEFAULT_TEXTURE);
+  if (state == 0 && last_state != 0)
+
+    {
+      *just_hidden = 1;
+    }
+  last_state = state;
+  set_dialog_visibility (d + 5, state);
+  set_dialog_visibility (d + 9, state);
+  set_dialog_visibility (d + 10, state);
+  set_dialog_visibility (d + 14, state);
+  for (i = 21; i < 149; ++i)
+
+    {
+      set_dialog_visibility (d + i, state);
+    }
+}
+
+
+/*------------------------------------------------------------------*/
+static void
+set_bg_dialogs_visibility (DIALOG * d, int *just_hidden)
+{
+  int state;
+  static int last_state = 1;
+  int i;
+  state =
+    !lw_maptex_is_custom_texture_used (CONFIG_LEVEL_MAP, CONFIG_LEVEL_BG, 0,
+				       LW_RANDOM_ON,
+				       CONFIG_USE_DEFAULT_TEXTURE);
+  if (state == 0 && last_state != 0)
+
+    {
+      *just_hidden = 1;
+    }
+  last_state = state;
+  set_dialog_visibility (d + 6, state);
+  set_dialog_visibility (d + 11, state);
+  set_dialog_visibility (d + 12, state);
+  set_dialog_visibility (d + 15, state);
+  for (i = 149; i < 277; ++i)
+
+    {
+      set_dialog_visibility (d + i, state);
+    }
+}
+
+
+/*------------------------------------------------------------------*/
+static void
+box_for_choose_map (void)
+{
+  DIALOG d[10];
+  DIALOG_PLAYER *dp;
+  int i;
+  int x1, x2, x3, x4, x5, x6, x7, x8;
+  int y1, y2, y3, y4, y5, y6, y7, y8;
+  memset (d, 0, sizeof (d));
+  retrieve_choose_level_xy (&x1, &x2, &x3, &x4, &x5, &x6, &x7, &x8,
+			    &y1, &y2, &y3, &y4, &y5, &y6, &y7, &y8);
+  d[0].x = x4;
+  d[0].y = y1;
+  d[0].w = MENU_W_SAMPLE;
+  d[0].h = MENU_H_SAMPLE;
+  d[1].x = x1;
+  d[1].y = y1;
+  d[1].w = MENU_W_LEVEL;
+  d[1].h = MENU_W_LEVEL;
+  d[2].x = x8;
+  d[2].y = y1;
+  d[2].w = MENU_W_LEVEL;
+  d[2].h = MENU_W_LEVEL;
+  d[3].x = x8;
+  d[3].y = y5;
+  d[3].w = MENU_W_LEVEL;
+  d[3].h = MENU_H_LEVEL;
+  d[4].x = x1;
+  d[4].y = y4;
+  d[4].w = MENU_W_LEVEL;
+  d[4].h = MENU_H_LEVEL;
+  d[5].x = x8;
+  d[5].y = y4;
+  d[5].w = MENU_W_LEVEL;
+  d[5].h = MENU_H_LEVEL;
+  for (i = 0; i < 6; ++i)
+
+    {
+      d[i].proc = d_box_proc;
+      d[i].flags = 0;
+      color_one_dialog (d + i);
+      menu_real_coord (d + i);
+      d[i].x--;
+      d[i].y--;
+      d[i].w += 2;
+      d[i].h += 2;
+    }
+  if (lw_maptex_is_custom_texture_used
+      (CONFIG_LEVEL_MAP, CONFIG_LEVEL_FG, 0, LW_RANDOM_ON,
+       CONFIG_USE_DEFAULT_TEXTURE))
+
+    {
+      d[1].flags = d[4].flags |= D_HIDDEN;
+    }
+  if (lw_maptex_is_custom_texture_used
+      (CONFIG_LEVEL_MAP, CONFIG_LEVEL_BG, 0, LW_RANDOM_ON,
+       CONFIG_USE_DEFAULT_TEXTURE))
+
+    {
+      d[2].flags = d[5].flags |= D_HIDDEN;
+    }
+  d[6].proc = NULL;		/* 6 remplace par 9 pour boites des sliders */
+
+  /* caduque depuis que my_slider fait tout tout seul */
+  dp = my_init_dialog (d, 0);
+  my_update_dialog (dp);
+  shutdown_dialog (dp);
+}
+
+
+/*------------------------------------------------------------------*/
+static void
+update_choose_map (DIALOG * d, int map, int fg, int bg, int random,
+		   int use_default_texture)
+{
+  static char res_buffer[30];
+  int res_w, res_h;
+  int just_hidden = 0;
+  int i;
+  static LW_MUTEX_DATA mutex = { NULL };
+  if (lw_mutex_trylock (&mutex))
+
+    {
+
+      /*
+       * These parameters are passed to the function and set globally within
+       * the mutex to avoid possible bugs due to the fact that a parameter
+       * could be changed while this function is executed.
+       */
+      CONFIG_LEVEL_MAP = map;
+      CONFIG_LEVEL_FG = fg;
+      CONFIG_LEVEL_BG = bg;
+      LW_RANDOM_ON = random;
+      CONFIG_USE_DEFAULT_TEXTURE = use_default_texture;
+      scare_mouse ();
+      set_fg_dialogs_visibility (d, &just_hidden);
+      set_bg_dialogs_visibility (d, &just_hidden);
+      if (just_hidden)
+
+	{
+
+	  /*
+	   * OK, now we need to "hide" some part of the screen
+	   * therefore we simply paste the background image and
+	   * redraw everything. This is called a performance killer.
+	   */
+	  display_back_image ();
+	  for (i = 0; (d + i)->proc != NULL; ++i)
+
+	    {
+	      if (!((d + i)->flags & D_HIDDEN))
+
+		{
+		  (d + i)->proc (MSG_DRAW, d + i, 0);
+		}
+	    }
+	}
+      box_for_choose_map ();
+      LW_MACRO_SNPRINTF1 ((char *) d[13].dp, BUFFER_EDIT_NUMBER, "%d",
+			  CONFIG_LEVEL_MAP + 1);
+      if (!((d + 13)->flags & D_HIDDEN))
+
+	{
+	  my_edit_proc (MSG_DRAW, d + 13, 0);
+	}
+      LW_MACRO_SNPRINTF1 ((char *) d[14].dp, BUFFER_EDIT_NUMBER, "%d",
+			  CONFIG_LEVEL_FG + 1);
+      if (!((d + 14)->flags & D_HIDDEN))
+
+	{
+	  my_edit_proc (MSG_DRAW, d + 14, 0);
+	}
+      LW_MACRO_SNPRINTF1 ((char *) d[15].dp, BUFFER_EDIT_NUMBER, "%d",
+			  CONFIG_LEVEL_BG + 1);
+      if (!((d + 15)->flags & D_HIDDEN))
+
+	{
+	  my_edit_proc (MSG_DRAW, d + 15, 0);
+	}
+      d[4].d2 = CONFIG_LEVEL_MAP;
+      if (CONFIG_LEVEL_FG >= CHOOSE_COLOR_NUMBER)
+	d[5].d2 = CONFIG_LEVEL_FG - CHOOSE_COLOR_NUMBER;
+      if (CONFIG_LEVEL_BG >= CHOOSE_COLOR_NUMBER)
+	d[6].d2 = CONFIG_LEVEL_BG - CHOOSE_COLOR_NUMBER;
+      if (d[4].d2 < 0)
+	d[4].d2 = d[4].d1;
+      if (d[4].d2 > d[4].d1)
+	d[4].d2 = 0;
+      if (!((d + 4)->flags & D_HIDDEN))
+
+	{
+	  my_slider_proc (MSG_DRAW, d + 4, 0);
+	}
+      if (d[5].d2 < 0)
+	d[5].d2 = d[5].d1;
+      if (d[5].d2 > d[5].d1)
+	d[5].d2 = 0;
+      if (!((d + 5)->flags & D_HIDDEN))
+
+	{
+	  my_slider_proc (MSG_DRAW, d + 5, 0);
+	}
+      if (d[6].d2 < 0)
+	d[6].d2 = d[6].d1;
+      if (d[6].d2 > d[6].d1)
+	d[6].d2 = 0;
+      if (!((d + 6)->flags & D_HIDDEN))
+
+	{
+	  my_slider_proc (MSG_DRAW, d + 6, 0);
+	}
+      lw_map_get_res (CONFIG_LEVEL_MAP, &res_w, &res_h, 0, LW_RANDOM_ON,
+		      MIN_MAP_RES_W[CONFIG_MIN_MAP_RES],
+		      MIN_MAP_RES_H[CONFIG_MIN_MAP_RES]);
+      LW_MACRO_SPRINTF2 (res_buffer, "%dx%d", res_w, res_h);
+      d[16].dp = res_buffer;
+      my_textbox_proc (MSG_DRAW, d + 16, 0);
+      d[17].dp = lw_map_get_readable_name (CONFIG_LEVEL_MAP, 0, LW_RANDOM_ON);
+      my_textbox_proc (MSG_DRAW, d + 17, 0);
+      display_chosen_level ();
+      unscare_mouse ();
+      lw_mutex_unlock (&mutex);
+    }
+
+  else
+
+    {
+      log_println_str ("Warning: too many calls to \"update_choose_map\"...");
+    }
+}
+
+
+/*------------------------------------------------------------------*/
+static int
+slider_map (void *dp3, int d2)
+{
+  DIALOG *d;
+  int map;
+  play_click ();
+  d = dp3;
+  map = d2;
+  update_choose_map (d, map, CONFIG_LEVEL_FG, CONFIG_LEVEL_BG, 0,
+		     CONFIG_USE_DEFAULT_TEXTURE);
+  return 0;
+}
+
+
+/*------------------------------------------------------------------*/
+static int
+slider_fg (void *dp3, int d2)
+{
+  DIALOG *d;
+  int fg;
+  play_click ();
+  d = dp3;
+  fg = d2 + CHOOSE_COLOR_NUMBER;
+  update_choose_map (d, CONFIG_LEVEL_MAP, fg, CONFIG_LEVEL_BG, LW_RANDOM_ON,
+		     CONFIG_USE_DEFAULT_TEXTURE);
+  return 0;
+}
+
+
+/*------------------------------------------------------------------*/
+static int
+slider_bg (void *dp3, int d2)
+{
+  DIALOG *d;
+  int bg;
+  play_click ();
+  d = dp3;
+  bg = d2 + CHOOSE_COLOR_NUMBER;
+  update_choose_map (d, CONFIG_LEVEL_MAP, CONFIG_LEVEL_FG, bg, LW_RANDOM_ON,
+		     CONFIG_USE_DEFAULT_TEXTURE);
+  return 0;
+}
+
+
+/*------------------------------------------------------------------*/
+static void
+update_use_default_texture_state (DIALOG * d)
+{
+  static char state_buffer[30];
+  scare_mouse ();
+  LW_MACRO_SPRINTF0 (state_buffer,
+		     lw_lang_string (CONFIG_USE_DEFAULT_TEXTURE ?
+				     LW_LANG_STRING_LEVEL_ON :
+				     LW_LANG_STRING_LEVEL_OFF));
+  d[19].dp = state_buffer;
+  my_button_proc (MSG_DRAW, d + 19, 0);
+  unscare_mouse ();
+}
+
+
+/*------------------------------------------------------------------*/
+int
+choose_map (void)
+{
+  int retour = 0, choix = MENU_QUICK_BACK;
+  int i;
+  int x1, x2, x3, x4, x5, x6, x7, x8;
+  int y1, y2, y3, y4, y5, y6, y7, y8;
+  DIALOG d[278];
+  char buf1[BUFFER_EDIT_NUMBER + 1];
+  char buf2[BUFFER_EDIT_NUMBER + 1];
+  char buf3[BUFFER_EDIT_NUMBER + 1];
+  memset (d, 0, sizeof (d));
+  buf1[0] = 0;
+  buf2[0] = 0;
+  display_back_image ();
+  set_palette_for_choose_color ();
+  quick_buttons (d);
+  retrieve_choose_level_xy (&x1, &x2, &x3, &x4, &x5, &x6, &x7, &x8,
+			    &y1, &y2, &y3, &y4, &y5, &y6, &y7, &y8);
+  d[4].proc = d[5].proc = d[6].proc = my_slider_proc;
+  d[4].dp = d[5].dp = d[6].dp = NULL;
+  d[4].key = d[5].key = d[6].key = 0;
+  d[4].dp2 = slider_map;
+  d[5].dp2 = slider_fg;
+  d[6].dp2 = slider_bg;
+  d[4].dp3 = d[5].dp3 = d[6].dp3 = d;
+  d[4].flags = d[5].flags = d[6].flags = 0;
+  d[4].d1 = RAW_MAP_NUMBER - 1;
+  d[5].d1 = d[6].d1 = RAW_TEXTURE_NUMBER - 1;
+  d[4].d2 = CONFIG_LEVEL_MAP;
+  d[5].d2 = CONFIG_LEVEL_FG;
+  d[6].d2 = CONFIG_LEVEL_BG;
+  d[4].x = x4;
+  d[4].y = y5;
+  d[4].w = MENU_W_SAMPLE;
+  d[4].h = MENU_H_LEVEL;
+  d[5].x = x3;
+  d[6].x = x7;
+  d[5].y = d[6].y = y2;
+  d[5].w = d[6].w = MENU_H_LEVEL;
+  d[5].h = d[6].h = y4 - y2 - MENU_H_SPACE;
+  for (i = 7; i < 13; ++i)
+
+    {
+      d[i].proc = my_button_proc;
+      d[i].key = 0;
+      d[i].flags = D_EXIT;
+      d[i].w = d[i].h = MENU_H_LEVEL;
+    };
+  d[7].dp = d[9].dp = d[11].dp = "-";
+  d[8].dp = d[10].dp = d[12].dp = "+";
+  d[7].x = x3;
+  d[7].y = d[8].y = y5;
+  d[8].x = x7;
+  d[9].x = d[10].x = x3;
+  d[11].x = d[12].x = x7;
+  d[9].y = d[11].y = y4;
+  d[10].y = d[12].y = y1;
+  d[13].proc = d[14].proc = d[15].proc = my_edit_proc;
+  d[13].flags = d[14].flags = d[15].flags = D_EXIT;
+  d[13].dp = buf1;
+  d[14].dp = buf2;
+  d[15].dp = buf3;
+  d[13].d1 = d[14].d1 = d[15].d1 = BUFFER_EDIT_NUMBER;
+  d[13].d2 = d[14].d2 = d[15].d2 = 0;
+  d[13].x = d[15].x = x8;
+  d[14].x = x1;
+  d[13].w = d[14].w = d[15].w = MENU_W_LEVEL;
+  d[13].h = d[14].h = d[15].h = MENU_H_LEVEL;
+  d[13].y = y5;
+  d[14].y = d[15].y = y4;
+  d[16].proc = my_textbox_proc;
+  d[16].x = x1;
+  d[16].y = y6;
+  d[16].w = x5 - x1 - MENU_W_SPACE;
+  d[16].h = MENU_H_LEVEL;
+  d[16].flags = 0;
+  d[16].dp = "";
+  d[17].proc = my_textbox_proc;
+  d[17].x = x5;
+  d[17].y = y6;
+  d[17].w = x8 - x5 + MENU_W_LEVEL;
+  d[17].h = MENU_H_LEVEL;
+  d[17].flags = 0;
+  d[17].dp = "";
+  d[18].proc = my_textbox_proc;
+  d[18].x = x1;
+  d[18].y = y7;
+  d[18].w = x6 - x1 - MENU_W_SPACE;
+  d[18].h = MENU_H_LEVEL;
+  d[18].flags = 0;
+  d[18].dp = lw_lang_string (LW_LANG_STRING_LEVEL_USEDEFAULTTEXTURE);
+  d[19].proc = my_button_proc;
+  d[19].x = x6;
+  d[19].y = y7;
+  d[19].w = x8 - x6 + MENU_W_LEVEL;
+  d[19].h = MENU_H_LEVEL;
+  d[19].flags = D_EXIT;
+  d[19].dp = "";
+  d[20].proc = my_button_proc;
+  d[20].x = x3;
+  d[20].y = y8;
+  d[20].w = x8 - x3 - MENU_W_SPACE;
+  d[20].h = MENU_H_LEVEL;
+  d[20].flags = D_EXIT;
+  d[20].dp = lw_lang_string (LW_LANG_STRING_LEVEL_RANDOMMAP);;
+
+#ifdef DOS
+  d[20].flags = D_HIDDEN;
+#endif
+
+  for (i = 4; i < 21; ++i)
+    {
+      color_one_dialog (d + i);
+      menu_real_coord (d + i);
+    }
+  palette_128 (d + 21, menu_real_x (x1), menu_real_y (y3),
+	       menu_real_x (MENU_W_LEVEL),
+	       menu_real_y (y4 - y3 - MENU_H_SPACE));
+  palette_128 (d + 149, menu_real_x (x8), menu_real_y (y3),
+	       menu_real_x (MENU_W_LEVEL),
+	       menu_real_y (y4 - y3 - MENU_H_SPACE));
+  box_for_choose_map ();
+  d[277].proc = NULL;
+  update_use_default_texture_state (d);
+  update_choose_map (d, CONFIG_LEVEL_MAP, CONFIG_LEVEL_FG, CONFIG_LEVEL_BG,
+		     LW_RANDOM_ON, CONFIG_USE_DEFAULT_TEXTURE);
+  while (retour == 0)
+
+    {
+      choix = my_do_dialog_no_clear (d, choix);
+      switch (choix)
+
+	{
+	case -1:
+	case MENU_QUICK_BACK:
+	  retour = 1;
+	  break;
+	case MENU_QUICK_MAIN:
+	  retour = MENU_TOP;
+	  break;
+	case MENU_QUICK_QUIT:
+	  if (confirm_quit ())
+	    retour = MENU_EXIT;
+
+	  else
+
+	    {
+	      display_back_image ();
+	      box_for_choose_map ();
+	      update_choose_map (d, CONFIG_LEVEL_MAP, CONFIG_LEVEL_FG,
+				 CONFIG_LEVEL_BG, LW_RANDOM_ON,
+				 CONFIG_USE_DEFAULT_TEXTURE);
+	    }
+	  break;
+	case MENU_QUICK_PLAY:
+	  retour = MENU_PLAY;
+	  break;
+	case 7:
+	  d[4].d2--;
+	  if (d[4].d2 < 0)
+	    d[4].d2 = d[4].d1;
+	  slider_map (d[4].dp3, d[4].d2);
+	  break;
+	case 8:
+	  d[4].d2++;
+	  if (d[4].d2 > d[4].d1)
+	    d[4].d2 = 0;
+	  slider_map (d[4].dp3, d[4].d2);
+	  break;
+	case 9:
+	  d[5].d2--;
+	  if (d[5].d2 < 0)
+	    d[5].d2 = d[5].d1;
+	  slider_fg (d[5].dp3, d[5].d2);
+	  break;
+	case 10:
+	  d[5].d2++;
+	  if (d[5].d2 > d[5].d1)
+	    d[5].d2 = 0;
+	  slider_fg (d[5].dp3, d[5].d2);
+	  break;
+	case 11:
+	  d[6].d2--;
+	  if (d[6].d2 < 0)
+	    d[6].d2 = d[6].d1;
+	  slider_bg (d[6].dp3, d[6].d2);
+	  break;
+	case 12:
+	  d[6].d2++;
+	  if (d[6].d2 > d[6].d1)
+	    d[6].d2 = 0;
+	  slider_bg (d[6].dp3, d[6].d2);
+	  break;
+	case 13:
+	  i = atoi (d[13].dp) - 1;
+	  if (!(i >= 0 && i < RAW_MAP_NUMBER))
+
+	    {
+	      i = CONFIG_LEVEL_MAP;
+	    }
+	  play_click ();
+	  update_choose_map (d, i, CONFIG_LEVEL_FG, CONFIG_LEVEL_BG, 0,
+			     CONFIG_USE_DEFAULT_TEXTURE);
+	  break;
+	case 14:
+	  i = atoi (d[14].dp) - 1;
+	  if (!(i >= 0 && i < RAW_TEXTURE_NUMBER + CHOOSE_COLOR_NUMBER))
+
+	    {
+	      i = CONFIG_LEVEL_FG;
+	    }
+	  play_click ();
+	  update_choose_map (d, CONFIG_LEVEL_MAP, i, CONFIG_LEVEL_BG,
+			     LW_RANDOM_ON, CONFIG_USE_DEFAULT_TEXTURE);
+	  break;
+	case 15:
+	  i = atoi (d[15].dp) - 1;
+	  if (!(i >= 0 && i < RAW_TEXTURE_NUMBER + CHOOSE_COLOR_NUMBER))
+
+	    {
+	      i = CONFIG_LEVEL_BG;
+	    }
+	  play_click ();
+	  update_choose_map (d, CONFIG_LEVEL_MAP, CONFIG_LEVEL_FG, i,
+			     LW_RANDOM_ON, CONFIG_USE_DEFAULT_TEXTURE);
+	  break;
+	case 19:
+	  i = CONFIG_USE_DEFAULT_TEXTURE ? 0 : 1;
+	  update_choose_map (d, CONFIG_LEVEL_MAP, CONFIG_LEVEL_FG,
+			     CONFIG_LEVEL_BG, LW_RANDOM_ON, i);
+	  update_use_default_texture_state (d);
+	  break;
+	case 20:
+	  if (lw_random_generate_map ())
+
+	    {
+	      update_choose_map (d, CONFIG_LEVEL_MAP, CONFIG_LEVEL_FG,
+				 CONFIG_LEVEL_BG, 1,
+				 CONFIG_USE_DEFAULT_TEXTURE);
+	    }
+	  break;
+	default:
+	  if (choix >= 21 && choix < 149)
+
+	    {
+	      i = choix - 21;
+	      update_choose_map (d, CONFIG_LEVEL_MAP, i, CONFIG_LEVEL_BG,
+				 LW_RANDOM_ON, CONFIG_USE_DEFAULT_TEXTURE);
+	    }
+	  if (choix >= 149 && choix < 277)
+
+	    {
+	      i = choix - 149;
+	      update_choose_map (d, CONFIG_LEVEL_MAP, CONFIG_LEVEL_FG, i,
+				 LW_RANDOM_ON, CONFIG_USE_DEFAULT_TEXTURE);
+	    }
+	}
+    }
+  if (retour > 0)
+    retour--;
+  return retour;
+}

Added: unstable/liquidwar/branches/upstream/current/src/level.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/level.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/level.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,68 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : level.h                                          */
+/* contenu       : choix du niveau a jouer                          */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_LEVEL
+#define LIQUID_WAR_INCLUDE_LEVEL
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int choose_map (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/log.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/log.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/log.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,79 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : log.h                                            */
+/* contenu       : gestion de log (affichage+fichier?)              */
+/* date de modif : 1 aout 99                                        */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_LOG
+#define LIQUID_WAR_INCLUDE_LOG
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+extern int LW_LOG_BEEP;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void log_init (void);
+void log_exit (void);
+void log_print_str (char *str);
+void log_print_int (int i);
+void log_println ();
+void log_println_str (char *str);
+void log_println_int (int i);
+void log_flush ();
+void log_beep ();
+void log_set_server_mode (int mode);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/logcli.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/logcli.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/logcli.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,283 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : logcli.c                                         */
+/* contenu       : gestion de log client (affichage+fichier?)       */
+/* date de modif : 1 aout 99                                        */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*
+ * Note: we must *not* include allegro.h here, or everything's
+ * wrecked with the use of windows.h...
+ */
+#ifdef WIN32
+#include <windows.h>
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "startup.h"
+#include "log.h"
+#include "macro.h"
+#include "mutxgen.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_LOG_FALLBACK_PATH "lwlog.txt"
+
+/*==================================================================*/
+/* definitions de types                                             */
+/*==================================================================*/
+
+#ifndef UNIX
+FILE *LW_LOG_FILE = NULL;
+#endif
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+int LW_LOG_BEEP = 1;
+static LW_MUTEX_DATA LOG_MUTEX = { NULL };
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+
+/*------------------------------------------------------------------*/
+void
+log_init (void)
+{
+  lw_mutex_lock (&LOG_MUTEX);
+
+#ifndef UNIX
+  LW_LOG_FILE = fopen (STARTUP_LOG_PATH, "w");
+  if (LW_LOG_FILE == NULL)
+    {
+      /*
+       * Unable to open the log file probably because the data/
+       * directoty is not here, we try and open "lw.log" instead...
+       */
+      LW_LOG_FILE = fopen (LW_LOG_FALLBACK_PATH, "w");
+    }
+#endif
+
+  lw_mutex_unlock (&LOG_MUTEX);
+}
+
+/*------------------------------------------------------------------*/
+void
+log_exit (void)
+{
+  lw_mutex_lock (&LOG_MUTEX);
+
+#ifndef UNIX
+  if (LW_LOG_FILE)
+    {
+      fclose (LW_LOG_FILE);
+    }
+#endif
+
+  lw_mutex_unlock (&LOG_MUTEX);
+}
+
+/*------------------------------------------------------------------*/
+void
+log_print_str (char *str)
+{
+  lw_mutex_lock (&LOG_MUTEX);
+
+#ifndef WIN32
+  printf ("%s", str);
+#endif
+#ifndef UNIX
+  if (LW_LOG_FILE)
+    {
+      fprintf (LW_LOG_FILE, "%s", str);
+    }
+#endif
+
+  lw_mutex_unlock (&LOG_MUTEX);
+}
+
+/*------------------------------------------------------------------*/
+void
+log_print_int (int i)
+{
+  lw_mutex_lock (&LOG_MUTEX);
+
+#ifndef WIN32
+  printf ("%d", i);
+#endif
+#ifndef UNIX
+  if (LW_LOG_FILE)
+    {
+      fprintf (LW_LOG_FILE, "%d", i);
+    }
+#endif
+
+  lw_mutex_unlock (&LOG_MUTEX);
+}
+
+/*------------------------------------------------------------------*/
+void
+log_println ()
+{
+  lw_mutex_lock (&LOG_MUTEX);
+
+#ifndef WIN32
+  printf ("\n");
+#endif
+#ifndef UNIX
+  if (LW_LOG_FILE)
+    {
+      fprintf (LW_LOG_FILE, "\n");
+      log_flush ();
+    }
+#endif
+
+  lw_mutex_unlock (&LOG_MUTEX);
+}
+
+/*------------------------------------------------------------------*/
+void
+log_println_str (char *str)
+{
+  lw_mutex_lock (&LOG_MUTEX);
+
+#ifndef WIN32
+  printf ("%s\n", str);
+#endif
+#ifndef UNIX
+  if (LW_LOG_FILE)
+    {
+      fprintf (LW_LOG_FILE, "%s\n", str);
+      log_flush ();
+    }
+#endif
+
+  lw_mutex_unlock (&LOG_MUTEX);
+}
+
+/*------------------------------------------------------------------*/
+void
+log_println_int (int i)
+{
+  lw_mutex_lock (&LOG_MUTEX);
+
+#ifndef WIN32
+  printf ("%d\n", i);
+#endif
+#ifndef UNIX
+  if (LW_LOG_FILE)
+    {
+      fprintf (LW_LOG_FILE, "%d\n", i);
+      log_flush ();
+    }
+#endif
+
+  lw_mutex_unlock (&LOG_MUTEX);
+}
+
+/*------------------------------------------------------------------*/
+void
+log_flush ()
+{
+  lw_mutex_lock (&LOG_MUTEX);
+
+#ifndef WIN32
+  fflush (stdout);
+#endif
+#ifndef UNIX
+  if (LW_LOG_FILE)
+    {
+      fflush (LW_LOG_FILE);
+    }
+#endif
+
+  lw_mutex_unlock (&LOG_MUTEX);
+}
+
+/*------------------------------------------------------------------*/
+void
+log_beep ()
+{
+  lw_mutex_lock (&LOG_MUTEX);
+
+  if (LW_LOG_BEEP)
+    {
+#ifdef WIN32
+      /*
+       * We play a beep using the Win32 API
+       */
+      MessageBeep (MB_OK);
+#else
+      /*
+       * We play a beep using the console
+       */
+      fprintf (stderr, "\a");
+#endif
+    }
+
+  lw_mutex_unlock (&LOG_MUTEX);
+}
+
+/*------------------------------------------------------------------*/
+void
+log_set_server_mode (int mode)
+{
+  /*
+   * We do nothing here
+   */
+  LW_MACRO_NOP (mode);
+}

Added: unstable/liquidwar/branches/upstream/current/src/logsrv.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/logsrv.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/logsrv.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,240 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : logsrv.c                                         */
+/* contenu       : gestion de log serveur (affichage+fichier?)      */
+/* date de modif : 1 aout 99                                        */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <time.h>
+
+#include "log.h"
+#include "server.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* definitions de types                                             */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+int LW_LOG_BEEP = 1;
+
+static FILE *LW_LOG_FILE = NULL;
+static int LW_LOG_NEW_LINE = 1;
+static int LW_LOG_SERVER_MODE = 0;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Displays date and time at the beginning of each line
+ */
+static void
+display_date_and_time ()
+{
+  time_t time_stamp;
+  struct tm *time_struct;
+  char time_str[50];
+
+  if (LW_LOG_FILE && LW_LOG_NEW_LINE && LW_LOG_SERVER_MODE)
+    {
+      time_stamp = time (NULL);
+      time_struct = localtime (&time_stamp);
+      LW_MACRO_SPRINTF6 (time_str, "%04d-%02d-%02d %02d:%02d:%02d: ",
+			 time_struct->tm_year + 1900,
+			 time_struct->tm_mon + 1,
+			 time_struct->tm_mday,
+			 time_struct->tm_hour,
+			 time_struct->tm_min, time_struct->tm_sec);
+
+      fprintf (LW_LOG_FILE, time_str);
+    }
+  LW_LOG_NEW_LINE = 0;
+}
+
+/*------------------------------------------------------------------*/
+static void
+prepare_new_line ()
+{
+  if (LW_LOG_FILE)
+    {
+      fflush (LW_LOG_FILE);
+    }
+  LW_LOG_NEW_LINE = 1;
+}
+
+/*------------------------------------------------------------------*/
+void
+log_init (void)
+{
+  char *filename;
+
+  filename = lw_server_get_log ();
+
+  if (filename && strlen (filename) > 0)
+    {
+      LW_LOG_FILE = fopen (filename, "a");
+    }
+
+  /*
+   * By default, we output stuff to stdout
+   */
+  if (LW_LOG_FILE == NULL)
+    {
+      LW_LOG_FILE = stdout;
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+log_exit (void)
+{
+  if (LW_LOG_FILE && LW_LOG_FILE != stdout)
+    {
+      fclose (LW_LOG_FILE);
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+log_print_str (char *str)
+{
+  if (LW_LOG_FILE)
+    {
+      display_date_and_time ();
+      fprintf (LW_LOG_FILE, "%s", str);
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+log_print_int (int i)
+{
+  if (LW_LOG_FILE)
+    {
+      display_date_and_time ();
+      fprintf (LW_LOG_FILE, "%d", i);
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+log_println ()
+{
+  if (LW_LOG_FILE)
+    {
+      display_date_and_time ();
+      fprintf (LW_LOG_FILE, "\n");
+      log_flush ();
+      prepare_new_line ();
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+log_println_str (char *str)
+{
+  if (LW_LOG_FILE)
+    {
+      display_date_and_time ();
+      fprintf (LW_LOG_FILE, "%s\n", str);
+      log_flush ();
+      prepare_new_line ();
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+log_println_int (int i)
+{
+  if (LW_LOG_FILE)
+    {
+      display_date_and_time ();
+      fprintf (LW_LOG_FILE, "%d\n", i);
+      log_flush ();
+      prepare_new_line ();
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+log_flush ()
+{
+  if (LW_LOG_FILE)
+    {
+      fflush (LW_LOG_FILE);
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+log_beep ()
+{
+  if (LW_LOG_BEEP)
+    {
+      /*
+       * We play a beep
+       */
+      fprintf (stderr, "\a");
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+log_set_server_mode (int mode)
+{
+  LW_LOG_SERVER_MODE = mode;
+}

Added: unstable/liquidwar/branches/upstream/current/src/lwwin.rc
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/lwwin.rc	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/lwwin.rc	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,4 @@
+#include "windows.h"
+
+allegro_icon ICON "..\misc\liquidwar.ico"
+

Added: unstable/liquidwar/branches/upstream/current/src/macro.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/macro.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/macro.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,112 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : macro.h                                          */
+/* content       : application wide macros                          */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_MACRO
+#define LIQUID_WAR_INCLUDE_MACRO
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdio.h>
+#include <string.h>
+
+#ifdef SNPRINTF
+#include "../utils/snprintf/snprintf.h"
+#endif
+
+/*==================================================================*/
+/* defines                                                          */
+/*==================================================================*/
+
+#define LW_MACRO_MEMSET0(BUFFER) { memset((BUFFER),0,sizeof(BUFFER)); }
+
+#define LW_MACRO_STRNCPY(DST,SRC,SIZE) { memset((DST),0,(SIZE)); strncpy((DST),(SRC),(SIZE)-1); (DST)[(SIZE)-1]='\0'; }
+#define LW_MACRO_STRCPY(DST,SRC) { LW_MACRO_STRNCPY((DST),(SRC),sizeof(DST)); }
+
+#define LW_MACRO_STRNCAT(DST,SRC,SIZE) { int len,pos; pos=strlen(DST); len=(SIZE)-1-pos; if (len>0) { int end; strncat((DST),(SRC),len); end = pos+strlen(SRC); if (end<(int) ((SIZE)-1)) { (DST)[end]='\0'; } } (DST)[(SIZE)-1]='\0'; }
+#define LW_MACRO_STRCAT(DST,SRC) { LW_MACRO_STRNCAT((DST),(SRC),sizeof(DST)); }
+
+/*
+ * GCC 3.0 supports "..." parameters, together with __VA_ARGS__, however
+ * GCC 2.95 does not seem to support it. Since we want LW to be 
+ * "GCC 2.95 friendly" we do not use this stuff. It's in C99 however...
+ * So that's why there are zillion macros depending on how many args are
+ * provided to the snprintf function. 8-(
+ */
+#define LW_MACRO_SNPRINTF0(DST,SIZE,FMT) { LW_MACRO_STRNCPY((DST),(FMT),(SIZE)); }
+#define LW_MACRO_SNPRINTF1(DST,SIZE,FMT,A) { memset((DST),0,(SIZE)); snprintf((DST),(SIZE)-1,(FMT),(A)); (DST)[(SIZE)-1]='\0'; }
+#define LW_MACRO_SNPRINTF2(DST,SIZE,FMT,A,B) { memset((DST),0,(SIZE)); snprintf((DST),(SIZE)-1,(FMT),(A),(B)); (DST)[(SIZE)-1]='\0'; }
+#define LW_MACRO_SNPRINTF3(DST,SIZE,FMT,A,B,C) { memset((DST),0,(SIZE)); snprintf((DST),(SIZE)-1,(FMT),(A),(B),C); (DST)[(SIZE)-1]='\0'; }
+#define LW_MACRO_SNPRINTF4(DST,SIZE,FMT,A,B,C,D) { memset((DST),0,(SIZE)); snprintf((DST),(SIZE)-1,(FMT),(A),(B),C,(D)); (DST)[(SIZE)-1]='\0'; }
+#define LW_MACRO_SNPRINTF5(DST,SIZE,FMT,A,B,C,D,E) { memset((DST),0,(SIZE)); snprintf((DST),(SIZE)-1,(FMT),(A),(B),C,(D),(E)); (DST)[(SIZE)-1]='\0'; }
+#define LW_MACRO_SNPRINTF6(DST,SIZE,FMT,A,B,C,D,E,F) { memset((DST),0,(SIZE)); snprintf((DST),(SIZE)-1,(FMT),(A),(B),C,(D),(E),(F)); (DST)[(SIZE)-1]='\0'; }
+#define LW_MACRO_SNPRINTF7(DST,SIZE,FMT,A,B,C,D,E,F,G) { memset((DST),0,(SIZE)); snprintf((DST),(SIZE)-1,(FMT),(A),(B),C,(D),(E),(F),(G)); (DST)[(SIZE)-1]='\0'; }
+#define LW_MACRO_SNPRINTF8(DST,SIZE,FMT,A,B,C,D,E,F,G,H) { memset((DST),0,(SIZE)); snprintf((DST),(SIZE)-1,(FMT),(A),(B),(C),(D),(E),(F),(G),(H)); (DST)[(SIZE)-1]='\0'; }
+#define LW_MACRO_SNPRINTF9(DST,SIZE,FMT,A,B,C,D,E,F,G,H,I) { memset((DST),0,(SIZE)); snprintf((DST),(SIZE)-1,(FMT),(A),(B),(C),(D),(E),(F),(G),(H),(I)); (DST)[(SIZE)-1]='\0'; }
+
+#define LW_MACRO_SPRINTF0(DST,FMT) { LW_MACRO_SNPRINTF0((DST),sizeof(DST),(FMT)); }
+#define LW_MACRO_SPRINTF1(DST,FMT,A) { LW_MACRO_SNPRINTF1((DST),sizeof(DST),(FMT),(A)); }
+#define LW_MACRO_SPRINTF2(DST,FMT,A,B) { LW_MACRO_SNPRINTF2((DST),sizeof(DST),(FMT),(A),(B)); }
+#define LW_MACRO_SPRINTF3(DST,FMT,A,B,C) { LW_MACRO_SNPRINTF3((DST),sizeof(DST),(FMT),(A),(B),(C)); }
+#define LW_MACRO_SPRINTF4(DST,FMT,A,B,C,D) { LW_MACRO_SNPRINTF4((DST),sizeof(DST),(FMT),(A),(B),(C),(D)); }
+#define LW_MACRO_SPRINTF5(DST,FMT,A,B,C,D,E) { LW_MACRO_SNPRINTF5((DST),sizeof(DST),(FMT),(A),(B),(C),(D),(E)); }
+#define LW_MACRO_SPRINTF6(DST,FMT,A,B,C,D,E,F) { LW_MACRO_SNPRINTF6((DST),sizeof(DST),(FMT),(A),(B),(C),(D),(E),(F)); }
+#define LW_MACRO_SPRINTF7(DST,FMT,A,B,C,D,E,F,G) { LW_MACRO_SNPRINTF7((DST),sizeof(DST),(FMT),(A),(B),(C),(D),(E),(F),(G)); }
+#define LW_MACRO_SPRINTF8(DST,FMT,A,B,C,D,E,F,G,H) { LW_MACRO_SNPRINTF8((DST),sizeof(DST),(FMT),(A),(B),(C),(D),(E),(F),(G),(H)); }
+#define LW_MACRO_SPRINTF9(DST,FMT,A,B,C,D,E,F,G,H,I) { LW_MACRO_SNPRINTF9((DST),sizeof(DST),(FMT),(A),(B),(C),(D),(E),(F),(G),(H),(I)); }
+
+/*
+ * Macros that does nothing, used to get rid of "unused variable"
+ * messages when one still wants to keep a parameter in a function
+ * for prototype consistency.
+ */
+#define LW_MACRO_NOP(X) { (X)=(X); }
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/main.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/main.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/main.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,156 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : main.c                                           */
+/* contenu       : procedure main                                   */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+#include "bigdata.h"
+#include "config.h"
+#include "disk.h"
+#include "exit.h"
+#include "init.h"
+#include "log.h"
+#include "menu.h"
+#include "parser.h"
+#include "sound.h"
+#include "startup.h"
+#include "basicopt.h"
+
+/*==================================================================*/
+/* construct pour reduire la place d'allegro                        */
+/*==================================================================*/
+#ifdef DOS
+
+BEGIN_GFX_DRIVER_LIST
+  GFX_DRIVER_VGA
+  GFX_DRIVER_MODEX
+  GFX_DRIVER_VBEAF
+  GFX_DRIVER_VESA2L
+  GFX_DRIVER_VESA2B
+  GFX_DRIVER_VESA1
+  END_GFX_DRIVER_LIST
+  BEGIN_COLOR_DEPTH_LIST
+  COLOR_DEPTH_8
+  COLOR_DEPTH_15
+  COLOR_DEPTH_16
+  COLOR_DEPTH_24
+  COLOR_DEPTH_32
+  END_COLOR_DEPTH_LIST
+  BEGIN_DIGI_DRIVER_LIST
+  DIGI_DRIVER_SB
+  DIGI_DRIVER_SOUNDSCAPE
+  DIGI_DRIVER_AUDIODRIVE
+  END_DIGI_DRIVER_LIST BEGIN_MIDI_DRIVER_LIST END_MIDI_DRIVER_LIST
+#endif
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+/*------------------------------------------------------------------*/
+  int
+main (int argc, char **argv)
+{
+  int init_success;
+  int big_data_success;
+  int load_dat_success;
+  int load_custom_success;
+
+  read_command_line (argc, argv);
+
+  if (lw_basicopt_process ("Liquid War - a unique multiplayer wargame"))
+    {
+      init_success = init_all ();
+
+      big_data_success = (malloc_big_data () != NULL);
+      log_println ();
+      load_dat_success = load_dat ();
+      log_println ();
+      load_custom_success = load_custom ();
+      log_println ();
+
+#ifdef DOS
+      if (STARTUP_STOP)
+	readkey ();
+      else
+	delay (500);
+#endif
+
+      if (!init_success)
+	my_exit (EXIT_CODE_INIT_FAIL);
+      if (!big_data_success)
+	my_exit (EXIT_CODE_BIG_DATA);
+      if (!load_dat_success)
+	my_exit (EXIT_CODE_LOAD_FAIL);
+      if (!load_custom_success)
+	my_exit (EXIT_CODE_CUSTOM_FAIL);
+
+      order_map ();
+      check_config_range ();
+
+      check_free_memory ();
+
+      start_graphic ();
+      start_water ();
+      main_menu ();
+
+      my_exit (EXIT_CODE_OK);
+    }
+
+  return 0;
+}
+
+#ifdef WIN32
+END_OF_MAIN ()
+#endif
+#ifdef UNIX
+  END_OF_MAIN ();
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/map.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/map.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/map.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,708 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : map.c                                            */
+/* contenu       : decryptage des tableaux en memoire               */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdio.h>
+#include <string.h>
+
+#include "alleg2.h"
+#include "bigdata.h"
+#include "disk.h"
+#include "map.h"
+#include "texture.h"
+#include "network.h"
+#include "log.h"
+#include "macro.h"
+#include "serial.h"
+#include "path.h"
+#include "random.h"
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+#define LIGHT_OR_DARK_TRESHOLD 315
+#define CONSIDERED_AS_DARK 0
+#define CONSIDERED_AS_LIGHT 2
+#define PLAYABLE_AREA 1
+#define MINI_SIDE_SIZE 4
+#define MINI_PLAYABLE_AREA 1024
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static int
+calc_zoom_factor (int w, int h, int min_w, int min_h)
+{
+  int factor_w, factor_h, factor;
+
+  if (w <= 0 || h <= 0)
+    {
+      log_println_str ("Error: map size is null or negative!");
+      w = h = 1;
+    }
+
+  factor_w = ((min_w - 1) / w) + 1;
+  factor_h = ((min_h - 1) / h) + 1;
+
+  factor = (factor_w > factor_h) ? factor_w : factor_h;
+
+  return factor;
+}
+
+/*------------------------------------------------------------------*/
+static void
+sort_light_and_dark (BITMAP * bmp, PALETTE pal)
+{
+  char table[256];
+  int i, x, y;
+
+  for (i = 0; i < 256; ++i)
+    {
+      if (6 * pal[i].r + 3 * pal[i].g + pal[i].b > LIGHT_OR_DARK_TRESHOLD)
+	table[i] = CONSIDERED_AS_LIGHT;
+      else
+	table[i] = CONSIDERED_AS_DARK;
+    }
+
+  for (y = 0; y < bmp->h; ++y)
+    for (x = 0; x < bmp->w; ++x)
+      putpixel (bmp, x, y, table[getpixel (bmp, x, y)]);
+}
+
+/*------------------------------------------------------------------*/
+static BITMAP *
+extract_significant_part (BITMAP * src)
+{
+  int min_x = src->w;
+  int min_y = src->h;
+  int max_x = -1;
+  int max_y = -1;
+  int dst_x, dst_y, dst_w, dst_h;
+  int x, y;
+  BITMAP *result;
+
+  for (y = 0; y < src->h; ++y)
+    for (x = 0; x < src->w; ++x)
+      if (getpixel (src, x, y) == CONSIDERED_AS_DARK)
+	{
+	  if (min_x > x)
+	    min_x = x;
+	  if (min_y > y)
+	    min_y = y;
+	  if (max_x < x)
+	    max_x = x;
+	  if (max_y < y)
+	    max_y = y;
+	}
+  dst_x = min_x;
+  dst_y = min_y;
+  dst_w = max_x - min_x + 1;
+  dst_h = max_y - min_y + 1;
+
+  if (dst_w < MINI_SIDE_SIZE || dst_h < MINI_SIDE_SIZE)
+    result = NULL;
+  else
+    {
+      result = my_create_bitmap (dst_w, dst_h);
+      if (result)
+	blit (src, result, dst_x, dst_y, 0, 0, dst_w, dst_h);
+    }
+
+  return result;
+}
+
+/*-----------------------------------------------------------------*/
+static int
+spread_color_down (BITMAP * bmp, int color1, int color2)
+{
+  int x, y, x1, y1, x2, y2, found = 0;
+
+  for (y = 0; y < bmp->h; ++y)
+    for (x = 0; x < bmp->w; ++x)
+      if (getpixel (bmp, x, y) == color2)
+	{
+	  x1 = x - 1;
+	  if (x1 < 0)
+	    x1 = 0;
+	  x2 = x + 1;
+	  if (x2 > bmp->w - 1)
+	    x2 = bmp->w - 1;
+	  y1 = y - 1;
+	  if (y1 < 0)
+	    y1 = 0;
+	  y2 = y + 1;
+	  if (y2 > bmp->h - 1)
+	    y2 = bmp->h - 1;
+
+	  if (getpixel (bmp, x2, y) == color1)
+	    {
+	      putpixel (bmp, x2, y, color2);
+	      found++;
+	    }
+	  if (getpixel (bmp, x2, y2) == color1)
+	    {
+	      putpixel (bmp, x2, y2, color2);
+	      found++;
+	    }
+	  if (getpixel (bmp, x, y2) == color1)
+	    {
+	      putpixel (bmp, x, y2, color2);
+	      found++;
+	    }
+	  if (getpixel (bmp, x1, y2) == color1)
+	    {
+	      putpixel (bmp, x1, y2, color2);
+	      found++;
+	    }
+	}
+
+  return found;
+}
+
+/*-----------------------------------------------------------------*/
+static int
+spread_color_up (BITMAP * bmp, int color1, int color2)
+{
+  int x, y, x1, y1, x2, y2, found = 0;
+
+  for (y = bmp->h - 1; y >= 0; --y)
+    for (x = bmp->w - 1; x >= 0; --x)
+      if (getpixel (bmp, x, y) == color2)
+	{
+	  x1 = x - 1;
+	  if (x1 < 0)
+	    x1 = 0;
+	  x2 = x + 1;
+	  if (x2 > bmp->w - 1)
+	    x2 = bmp->w - 1;
+	  y1 = y - 1;
+	  if (y1 < 0)
+	    y1 = 0;
+	  y2 = y + 1;
+	  if (y2 > bmp->h - 1)
+	    y2 = bmp->h - 1;
+
+	  if (getpixel (bmp, x1, y) == color1)
+	    {
+	      putpixel (bmp, x1, y, color2);
+	      found++;
+	    }
+	  if (getpixel (bmp, x1, y1) == color1)
+	    {
+	      putpixel (bmp, x1, y1, color2);
+	      found++;
+	    }
+	  if (getpixel (bmp, x, y1) == color1)
+	    {
+	      putpixel (bmp, x, y1, color2);
+	      found++;
+	    }
+	  if (getpixel (bmp, x2, y1) == color1)
+	    {
+	      putpixel (bmp, x2, y1, color2);
+	      found++;
+	    }
+	}
+
+  return found;
+}
+
+
+/*-----------------------------------------------------------------*/
+static int
+check_if_playable (BITMAP * bmp)
+{
+  int x = 0, y = 0, x0, y0;
+  int unplayable = 0;
+  int playable_place = 0;
+
+  /*
+   * Now we draw the "outside" of the map. This is usefull
+   * to avoid bugs (core dumps) if the map is not correctly drawn.
+   */
+  hline (bmp, 0, 0, bmp->w - 1, CONSIDERED_AS_DARK);
+  hline (bmp, 0, bmp->h - 1, bmp->w - 1, CONSIDERED_AS_DARK);
+  vline (bmp, 0, 0, bmp->h - 1, CONSIDERED_AS_DARK);
+  vline (bmp, bmp->w - 1, 0, bmp->h - 1, CONSIDERED_AS_DARK);
+
+  x0 = y0 = -1;
+  for (y = 0; y < bmp->h && y0 < 0; ++y)
+    for (x = 0; x < bmp->w && x0 < 0; ++x)
+      if (getpixel (bmp, x, y) == CONSIDERED_AS_LIGHT)
+	{
+	  x0 = x;
+	  y0 = y;
+	}
+
+  if (x0 > 0 && y0 > 0)
+    {
+      putpixel (bmp, x, y, PLAYABLE_AREA);
+      while (spread_color_down (bmp, CONSIDERED_AS_LIGHT,
+				PLAYABLE_AREA)
+	     + spread_color_up (bmp, CONSIDERED_AS_LIGHT, PLAYABLE_AREA));
+    }
+  else
+    unplayable |= 1;
+
+  for (y = 0; y < bmp->h; ++y)
+    for (x = 0; x < bmp->w; ++x)
+      if (getpixel (bmp, x, y) == PLAYABLE_AREA)
+	++playable_place;
+
+  unplayable |= (playable_place < MINI_PLAYABLE_AREA);
+
+  return (!unplayable);
+}
+
+/*-----------------------------------------------------------------*/
+static void
+fill_with_fg_and_bg (BITMAP * bmp, int fg, int bg)
+{
+  int x, y;
+
+  /*
+   * We set up the real fg and bg color instead of the
+   * CONSIDERED_AS_... constants.
+   */
+  for (y = 0; y < bmp->h; ++y)
+    {
+      for (x = 0; x < bmp->w; ++x)
+	{
+	  putpixel (bmp, x, y,
+		    getpixel (bmp, x, y) == PLAYABLE_AREA ? bg : fg);
+	}
+    }
+}
+
+/*-----------------------------------------------------------------*/
+static void
+convert_to_buffer (BITMAP * bmp, char *buffer, int *size, int *bg_size)
+{
+  int pos_src, l, wh;
+  char *data;
+
+  wh = bmp->h * bmp->w;
+  data = bmp->dat;
+  pos_src = 0;
+  (*size) = 0;
+  (*bg_size) = 0;
+
+  while (pos_src < wh)
+    {
+      l = 0;
+      if (data[pos_src] != PLAYABLE_AREA)
+	{
+	  while (pos_src < wh && (data[pos_src] != PLAYABLE_AREA) && l < 127)
+	    {
+	      l++;
+	      pos_src++;
+	    }
+	  buffer[(*size)++] = l;
+	}
+      else
+	{
+	  while (pos_src < wh && (data[pos_src] == PLAYABLE_AREA) && l < 127)
+	    {
+	      l++;
+	      pos_src++;
+	    }
+	  buffer[(*size)++] = -l;
+	  (*bg_size) += l;
+	}
+    }
+  buffer[(*size)++] = 0;
+}
+
+/*------------------------------------------------------------------*/
+void *
+lw_map_archive_raw_bmp (BITMAP * bmp, PALETTE pal, const char *filename)
+{
+  int w = 0, h = 0, size = 0, bg_size = 0;
+  BITMAP *sub_bmp;
+  char *temp = NULL;
+  char *result = NULL;
+  static int index = 1;
+  char readable_name_buffer[LW_MAP_READABLE_NAME_SIZE + 1];
+  char system_name_buffer[LW_MAP_SYSTEM_NAME_SIZE + 1];
+
+  if (bmp)
+    {
+      sort_light_and_dark (bmp, pal);
+      sub_bmp = extract_significant_part (bmp);
+      if (sub_bmp)
+	{
+	  w = sub_bmp->w;
+	  h = sub_bmp->h;
+	  if (check_if_playable (sub_bmp))
+	    {
+	      temp = malloc_in_big_data_bottom (w * h + 1);
+	      if (temp)
+		convert_to_buffer (sub_bmp, temp, &size, &bg_size);
+	    }
+	  destroy_bitmap (sub_bmp);
+	}
+      destroy_bitmap (bmp);
+    }
+
+  if (temp)
+    {
+      result =
+	malloc (size + 8 + LW_MAP_SYSTEM_NAME_SIZE +
+		LW_MAP_READABLE_NAME_SIZE);
+      if (result)
+	{
+	  /*
+	   * Write the header (size + geometry)
+	   */
+	  lw_serial_set_map_header ((void *) result, size, (short) w,
+				    (short) h);
+
+	  /*
+	   * Then we store its system name
+	   */
+	  memset (system_name_buffer, 0, sizeof (system_name_buffer));
+	  LW_MACRO_STRCPY (system_name_buffer,
+			   lw_path_get_system_name (filename));
+	  memcpy (result + 8, system_name_buffer, LW_MAP_SYSTEM_NAME_SIZE);
+
+	  /*
+	   * Then we store its readable name
+	   */
+	  memset (readable_name_buffer, 0, sizeof (readable_name_buffer));
+	  if (strcmp (filename, "lwmapgen") == 0)
+	    {
+	      /* 
+	       * This is a map generated by lwmapgen, we label it as such.
+	       */
+	      LW_MACRO_SPRINTF0 (readable_name_buffer, "Random map");
+	    }
+	  else
+	    {
+	      LW_MACRO_SPRINTF1 (readable_name_buffer, "Custom map %d",
+				 index++);
+	    }
+	  memcpy (result + 8 + LW_MAP_SYSTEM_NAME_SIZE, readable_name_buffer,
+		  LW_MAP_READABLE_NAME_SIZE);
+
+	  /*
+	   * And at last we write the map itself
+	   */
+	  memcpy (result + 8 + LW_MAP_SYSTEM_NAME_SIZE +
+		  LW_MAP_READABLE_NAME_SIZE, temp, size);
+	}
+      free_last_big_data_bottom ();
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+void *
+lw_map_archive_raw (const char *filename)
+{
+  BITMAP *bmp;
+  PALETTE pal;
+  void *result = NULL;
+
+  bmp = load_bitmap (filename, pal);
+  if (bmp)
+    {
+      result = lw_map_archive_raw_bmp (bmp, pal, filename);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+static void *
+lw_map_get_safe (int num, int network, int random)
+{
+  void *raw_map = NULL;
+
+  if (num > RAW_MAP_NUMBER - 1)
+    num = RAW_MAP_NUMBER - 1;
+
+  if (num < 0)
+    num = 0;
+
+  if (network && LW_NETWORK_RAW_MAP != NULL)
+    {
+      raw_map = LW_NETWORK_RAW_MAP;
+    }
+  else
+    {
+      if (random && LW_RANDOM_RAW_MAP != NULL)
+	{
+	  raw_map = LW_RANDOM_RAW_MAP;
+	}
+      else
+	{
+	  raw_map = RAW_MAP_ORDERED[num];
+	}
+    }
+
+  return raw_map;
+}
+
+/*------------------------------------------------------------------*/
+BITMAP *
+lw_map_create_bicolor (int num, int fg, int bg,
+		       int network, int random, int min_w, int min_h,
+		       int *zoom_factor)
+{
+  int pos_dst, pos_src, i, j, l, color;
+  short w, h;
+  signed char *data_dst, *data_src;
+  BITMAP *result = NULL;
+  BITMAP *temp;
+  void *raw_map;
+  int size, surface;
+  int x, y;
+
+  raw_map = lw_map_get_safe (num, network, random);
+
+  data_src = raw_map;
+  data_src += 8 + LW_MAP_SYSTEM_NAME_SIZE + LW_MAP_READABLE_NAME_SIZE;
+
+  /* 
+   * We read the header (size + geometry)
+   */
+  lw_serial_get_map_header (raw_map, &size, &w, &h);
+
+  surface = ((int) w) * ((int) h);
+  *zoom_factor = calc_zoom_factor (w, h, min_w, min_h);
+
+  pos_src = pos_dst = 0;
+  temp = my_create_bitmap (w, h);
+
+  if (temp)
+    {
+      data_dst = temp->dat;
+      while (pos_src < size && (l = data_src[pos_src++]) != 0)
+	{
+	  if (l > 0)
+	    color = CONSIDERED_AS_DARK;
+	  else
+	    {
+	      l = -l;
+	      color = CONSIDERED_AS_LIGHT;
+	    }
+	  for (i = 0; i < l && pos_dst < surface; ++i)
+	    data_dst[pos_dst++] = color;
+	}
+
+      /*
+       * We check if the map is "playable". Normally unplayable maps
+       * should never make it there but...
+       */
+      if (check_if_playable (temp))
+	{
+	  fill_with_fg_and_bg (temp, fg, bg);
+
+	  result = my_create_bitmap (w * (*zoom_factor), h * (*zoom_factor));
+
+	  if (result)
+	    {
+	      /*
+	       * Not we magnify the map if needed, so that very small
+	       * maps are interesting to play on fast fancy computers
+	       */
+	      for (y = 0; y < h; ++y)
+		for (x = 0; x < w; ++x)
+		  {
+		    color = getpixel (temp, x, y);
+		    for (i = 0; i < *zoom_factor; ++i)
+		      for (j = 0; j < *zoom_factor; ++j)
+			{
+			  putpixel (result,
+				    x * *zoom_factor + j,
+				    y * *zoom_factor + i, color);
+			}
+		  }
+	    }
+	}
+      else
+	{
+	  log_println_str ("Error: unplayable map!");
+	}
+
+      destroy_bitmap (temp);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+BITMAP *
+lw_map_create_textured (int num, int fg, int bg,
+			int network, int random, int min_w, int min_h)
+{
+  int x, y, w, h, color;
+  BITMAP *result = NULL, *bg_tex, *fg_tex;
+  int fg_w, fg_h;
+  int bg_w, bg_h;
+  int zoom_factor, zoom_factor_fg, zoom_factor_bg;
+
+  bg_tex = lw_texture_create_bg (bg);
+  fg_tex = lw_texture_create_fg (fg);
+
+  if (bg_tex && fg_tex)
+    {
+      bg_w = bg_tex->w;
+      bg_h = bg_tex->h;
+      fg_w = fg_tex->w;
+      fg_h = fg_tex->h;
+
+      result =
+	lw_map_create_bicolor (num, 1, 0, network, random,
+			       min_w, min_h, &zoom_factor);
+      if (result)
+	{
+	  w = result->w;
+	  h = result->h;
+	  zoom_factor_fg = zoom_factor_bg = zoom_factor;
+	  if (w != zoom_factor * fg_tex->w || h != zoom_factor * fg_tex->h)
+	    {
+	      zoom_factor_fg = 1;
+	    }
+	  if (w != zoom_factor * bg_tex->w || h != zoom_factor * bg_tex->h)
+	    {
+	      zoom_factor_bg = 1;
+	    }
+	  for (y = 0; y < h; ++y)
+	    for (x = 0; x < w; ++x)
+	      {
+		if (getpixel (result, x, y))
+		  {
+		    color =
+		      getpixel (fg_tex, (x / zoom_factor_fg) % fg_w,
+				(y / zoom_factor_bg) % fg_h);
+		  }
+		else
+		  {
+		    color =
+		      getpixel (bg_tex, (x / zoom_factor_bg) % bg_w,
+				(y / zoom_factor_bg) % bg_h);
+		  }
+		putpixel (result, x, y, color);
+	      }
+	}
+    }
+
+  if (bg_tex)
+    destroy_bitmap (bg_tex);
+
+  if (fg_tex)
+    destroy_bitmap (fg_tex);
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+char *
+lw_map_get_system_name (int num, int network, int random)
+{
+  static char result[LW_MAP_SYSTEM_NAME_SIZE + 1];
+  void *raw_map;
+  char *char_ptr;
+
+  raw_map = lw_map_get_safe (num, network, random);
+  char_ptr = (char *) raw_map;
+
+  LW_MACRO_MEMSET0 (result);
+  memcpy (result, char_ptr + 8, LW_MAP_SYSTEM_NAME_SIZE);
+  result[sizeof (result) - 1] = '\0';
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+char *
+lw_map_get_readable_name (int num, int network, int random)
+{
+  static char result[LW_MAP_READABLE_NAME_SIZE + 1];
+  void *raw_map;
+  char *char_ptr;
+
+  raw_map = lw_map_get_safe (num, network, random);
+  char_ptr = (char *) raw_map;
+
+  LW_MACRO_MEMSET0 (result);
+  memcpy (result, char_ptr + 8 + LW_MAP_SYSTEM_NAME_SIZE,
+	  LW_MAP_READABLE_NAME_SIZE);
+  result[sizeof (result) - 1] = '\0';
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_map_get_res (int num, int *w, int *h, int network, int random, int min_w,
+		int min_h)
+{
+  void *raw_map;
+  short res_w, res_h;
+  int zoom_factor;
+
+  raw_map = lw_map_get_safe (num, network, random);
+
+  lw_serial_get_map_header (raw_map, NULL, &res_w, &res_h);
+
+  zoom_factor = calc_zoom_factor (res_w, res_h, min_w, min_h);
+
+  *w = res_w * zoom_factor;
+  *h = res_h * zoom_factor;
+}

Added: unstable/liquidwar/branches/upstream/current/src/map.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/map.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/map.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,85 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : map.h                                            */
+/* contenu       : decryptage des tableaux en memoire               */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_MAP
+#define LIQUID_WAR_INCLUDE_MAP
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_MAP_SYSTEM_NAME_SIZE 16
+#define LW_MAP_READABLE_NAME_SIZE 32
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void *lw_map_archive_raw (const char *filename);
+void *lw_map_archive_raw_bmp (BITMAP * bmp, PALETTE pal,
+			      const char *filename);
+BITMAP *lw_map_create_bicolor (int num, int fg, int bg,
+			       int network, int random, int min_w, int min_h,
+			       int *zoom_factor);
+BITMAP *lw_map_create_textured (int num, int fg, int bg,
+				int network, int random, int min_w,
+				int min_h);
+char *lw_map_get_system_name (int num, int network, int random);
+char *lw_map_get_readable_name (int num, int network, int random);
+void lw_map_get_res (int num, int *w, int *h,
+		     int network, int random, int min_w, int min_h);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/maptex.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/maptex.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/maptex.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,204 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : maptex.c                                         */
+/* content       : used to associate maps with textures             */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+
+#include "maptex.h"
+#include "map.h"
+#include "texture.h"
+#include "palette.h"
+#include "disk.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/* gestion des bitmaps des textures                                 */
+/*------------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------*/
+static int
+calc_real_texture_number (int num,
+			  int texture, int network, int random,
+			  int use_default_texture, int *found)
+{
+  int i;
+  char *map_name;
+  int real_texture;
+
+  *found = 0;
+  real_texture = texture;
+
+  if (use_default_texture)
+    {
+      /*
+       * OK, the player has chosen the "use default texture" option,
+       * now we check that such a default texture does exists
+       */
+
+      map_name = lw_map_get_system_name (num, network, random);
+      for (i = CHOOSE_COLOR_NUMBER;
+	   i < CHOOSE_COLOR_NUMBER + RAW_TEXTURE_NUMBER + RAW_MAPTEX_NUMBER
+	   && !(*found); ++i)
+	{
+	  if (strcmp (map_name, lw_texture_get_system_name (i)) == 0)
+	    {
+	      *found = 1;
+	      real_texture = i;
+	    }
+	}
+    }
+
+  return real_texture;
+}
+
+/*-----------------------------------------------------------------*/
+int
+lw_maptex_is_custom_texture_used (int num,
+				  int texture,
+				  int network, int random,
+				  int use_default_texture)
+{
+  int result = 0;
+
+  calc_real_texture_number (num, texture, network, random,
+			    use_default_texture, &result);
+
+  return result;
+}
+
+/*-----------------------------------------------------------------*/
+BITMAP *
+lw_maptex_create_map (int num, int fg, int bg,
+		      int network, int random, int min_w, int min_h,
+		      int use_default_texture)
+{
+  BITMAP *result;
+  int found;
+
+  result = lw_map_create_textured (num,
+				   calc_real_texture_number (num, fg,
+							     network, random,
+							     use_default_texture,
+							     &found),
+				   calc_real_texture_number (num, bg,
+							     network, random,
+							     use_default_texture,
+							     &found),
+				   network, random, min_w, min_h);
+
+  return result;
+}
+
+/*-----------------------------------------------------------------*/
+BITMAP *
+lw_maptex_create_fg (int num, int fg, int network, int random,
+		     int use_default_texture)
+{
+  BITMAP *result;
+  int found;
+
+  result =
+    lw_texture_create_fg (calc_real_texture_number
+			  (num, fg, network, random, use_default_texture,
+			   &found));
+
+  return result;
+}
+
+/*-----------------------------------------------------------------*/
+BITMAP *
+lw_maptex_create_bg (int num, int bg, int network, int random,
+		     int use_default_texture)
+{
+  BITMAP *result;
+  int found;
+
+  result =
+    lw_texture_create_bg (calc_real_texture_number
+			  (num, bg, network, random, use_default_texture,
+			   &found));
+
+  return result;
+}
+
+/*-----------------------------------------------------------------*/
+void
+lw_maptex_set_fg_palette (int num,
+			  int fg, int network, int random,
+			  int use_default_texture)
+{
+  int found;
+
+  set_fg_texture_palette (calc_real_texture_number
+			  (num, fg, network, random, use_default_texture,
+			   &found));
+}
+
+/*-----------------------------------------------------------------*/
+void
+lw_maptex_set_bg_palette (int num,
+			  int bg, int network, int random,
+			  int use_default_texture)
+{
+  int found;
+
+  set_bg_texture_palette (calc_real_texture_number
+			  (num, bg, network, random, use_default_texture,
+			   &found));
+}

Added: unstable/liquidwar/branches/upstream/current/src/maptex.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/maptex.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/maptex.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,84 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : maptex.h                                         */
+/* content       : used to associate maps with textures             */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_MAPTEX
+#define LIQUID_WAR_INCLUDE_MAPTEX
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+#include "maptex.h"
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int lw_maptex_is_custom_texture_used (int num,
+				      int texture,
+				      int network, int random,
+				      int use_default_texture);
+BITMAP *lw_maptex_create_map (int num, int fg, int bg, int network,
+			      int random, int min_w, int min_h,
+			      int use_default_texture);
+BITMAP *lw_maptex_create_fg (int num, int fg, int network, int random,
+			     int use_default_texture);
+BITMAP *lw_maptex_create_bg (int num, int bg, int network, int random,
+			     int use_default_texture);
+void lw_maptex_set_fg_palette (int num, int fg, int network, int random,
+			       int use_default_texture);
+void lw_maptex_set_bg_palette (int num, int bg, int network, int random,
+			       int use_default_texture);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/menu.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/menu.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/menu.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,197 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : menu.c                                           */
+/* contenu       : aaffichages des menus principaux                 */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+
+#include "back.h"
+#include "dialog.h"
+#include "disk.h"
+#include "help.h"
+#include "level.h"
+#include "menu.h"
+#include "options.h"
+#include "play.h"
+#include "netplay.h"
+#include "team.h"
+#include "netgame.h"
+#include "network.h"
+#include "error.h"
+#include "about.h"
+#include "lang.h"
+#include "log.h"
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+confirm_quit (void)
+{
+  DIALOG d[3];
+
+  memset (d, 0, sizeof (d));
+
+  d[2].proc = NULL;
+  standard_button (d, 0, 0, 2, 1);
+  standard_button (d + 1, 1, 0, 2, 1);
+  d[0].dp = lw_lang_string (LW_LANG_STRING_MENU_EXIT);
+#ifdef DOS
+  d[0].dp = lw_lang_string (LW_LANG_STRING_MENU_EXITDOS);
+#endif
+#ifdef WIN32
+  d[0].dp = lw_lang_string (LW_LANG_STRING_MENU_EXITWINDOWS);
+#endif
+#ifdef UNIX
+  d[0].dp = lw_lang_string (LW_LANG_STRING_MENU_EXITUNIX);
+#endif
+  d[1].dp = lw_lang_string (LW_LANG_STRING_MENU_BACK);
+  d[0].key = 'd';
+  d[1].key = 'w';
+
+  return (my_do_dialog (d, 0) == 0);
+}
+
+/*------------------------------------------------------------------*/
+/* lancement du menu principal                                      */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+void
+main_menu (void)
+{
+  DIALOG d[11];
+  int i, choix = 4, retour = 0;
+
+  memset (d, 0, sizeof (d));
+
+  display_back_image ();
+  /*
+     dp=my_init_dialog (d,4);
+     my_update_dialog (dp);
+     shutdown_dialog (dp);
+   */
+  my_fade_in ();
+
+  while (retour != MENU_EXIT)
+    {
+      for (i = 0; i < 6; ++i)
+	standard_button (d + i + 4, 0, i, 1, 6);
+
+      quick_buttons (d);
+      d[MENU_QUICK_BACK].flags = D_HIDDEN;
+      d[MENU_QUICK_MAIN].flags = D_HIDDEN;
+      d[4].dp = lw_lang_string (LW_LANG_STRING_MENU_PLAY);
+      d[5].dp = lw_lang_string (LW_LANG_STRING_MENU_NETGAME);
+      d[6].dp = lw_lang_string (LW_LANG_STRING_MENU_MAP);
+      d[7].dp = lw_lang_string (LW_LANG_STRING_MENU_TEAMS);
+      d[8].dp = lw_lang_string (LW_LANG_STRING_MENU_OPTIONS);
+      d[9].dp = lw_lang_string (LW_LANG_STRING_MENU_ABOUT);
+      d[10].proc = 0;
+
+      choix = my_do_dialog (d, choix);
+      switch (choix)
+	{
+	case -1:
+	case MENU_QUICK_QUIT:
+	  if (confirm_quit ())
+	    retour = MENU_EXIT;
+	  break;
+	case MENU_QUICK_PLAY:
+	  retour = MENU_PLAY;
+	  break;
+	case 4:
+	  LW_NETWORK_ON = 0;
+	  retour = play_sequence ();
+	  break;
+	case 5:
+#ifndef DOS
+	  retour = network_game ();
+#else
+	  retour = error_no_network_support ();
+#endif
+	  break;
+	case 6:
+	  retour = choose_map ();
+	  break;
+	case 7:
+	  retour = choose_teams ();
+	  break;
+	case 8:
+	  retour = options ();
+	  break;
+	case 9:
+	  retour = lw_about ();
+	  break;
+	}
+      /*
+       * We handle the quick top-right "Play" button
+       */
+      if (retour == MENU_PLAY)
+	{
+	  if (LW_NETWORK_ON)
+	    {
+#ifndef DOS
+	      retour = netplay_sequence ();
+#else
+	      retour = play_sequence ();
+#endif
+	    }
+	  else
+	    {
+	      retour = play_sequence ();
+	    }
+	}
+    }
+}

Added: unstable/liquidwar/branches/upstream/current/src/menu.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/menu.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/menu.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,69 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : menu.h                                           */
+/* contenu       : affichage des menus principaux                   */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_MENU
+#define LIQUID_WAR_INCLUDE_MENU
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int confirm_quit (void);
+void main_menu (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/mesh.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/mesh.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/mesh.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,424 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : mesh.c                                           */
+/* contenu       : calcul du maillage                               */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "bigdata.h"
+#include "config.h"
+#include "map.h"
+#include "maptex.h"
+#include "mesh.h"
+#include "network.h"
+#include "log.h"
+#include "random.h"
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+typedef struct
+{
+  char used;
+  short size;
+  void *link[NB_DIRS];
+  int corres;
+}
+MESHER;
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#define MESH_FG 1
+#define MESH_BG 2
+
+#define MESH_MAX_ELEM_SIZE 8
+
+MESH *CURRENT_MESH = NULL;
+int CURRENT_MESH_SIZE = 0;
+int CURRENT_AREA_W = 0;
+int CURRENT_AREA_H = 0;
+BITMAP *CURRENT_AREA_DISP = NULL;
+BITMAP *CURRENT_AREA_BACK = NULL;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/* fonction creant le premier mesher, base de tous les calculs      */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+static MESHER *
+create_first_mesher (BITMAP * map)
+{
+  MESHER *result;
+  int x, y, h, w, size, i, j;
+
+  w = map->w;
+  h = map->h;
+  size = h * w;
+  result = malloc_in_big_data_top (size * sizeof (MESHER));
+  if (result != NULL)
+    {
+      for (i = 0; i < size; ++i)
+	{
+	  result[i].size = 1;
+	  result[i].corres = 3;
+	  for (j = 0; j < NB_DIRS; ++j)
+	    result[i].link[j] = NULL;
+	}
+
+      for (y = 0; y < h; ++y)
+	for (x = 0; x < w; ++x)
+	  result[y * w + x].used = (getpixel (map, x, y) == MESH_FG) ? 0 : 1;
+
+      for (y = 1; y < h - 1; ++y)
+	for (x = 1; x < w - 1; ++x)
+	  {
+	    i = y * w + x;
+
+	    if (result[i - w].used)
+	      result[i].link[DIR_NNW] = result[i].link[DIR_NNE]
+		= result + i - w;
+	    if (result[i - w + 1].used)
+	      result[i].link[DIR_NE] = result + i - w + 1;
+	    if (result[i + 1].used)
+	      result[i].link[DIR_ENE] = result[i].link[DIR_ESE]
+		= result + i + 1;
+	    if (result[i + w + 1].used)
+	      result[i].link[DIR_SE] = result + i + w + 1;
+	    if (result[i + w].used)
+	      result[i].link[DIR_SSE] = result[i].link[DIR_SSW]
+		= result + i + w;
+	    if (result[i + w - 1].used)
+	      result[i].link[DIR_SW] = result + i + w - 1;
+	    if (result[i - 1].used)
+	      result[i].link[DIR_WSW] = result[i].link[DIR_WNW]
+		= result + i - 1;
+	    if (result[i - w - 1].used)
+	      result[i].link[DIR_NW] = result + i - w - 1;
+	  }
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/* fonction regroupant tous les carres d'1 certaine taille          */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+static int
+group_mesher (MESHER * mesher, BITMAP * map, int step)
+{
+  int found = 0;
+  int x, y, w, h, size, i, j, k;
+  MESHER *ne, *se, *sw, *nw, *test;
+
+  w = map->w;
+  h = map->h;
+  size = h * w;
+
+  for (y = 0; y < h; y += step * 2)
+    for (x = 0; x < w; x += step * 2)
+      {
+	i = y * w + x;
+	ne = mesher + i + step;
+	se = mesher + i + (w + 1) * step;
+	sw = mesher + i + w * step;
+	nw = mesher + i;
+
+	if (ne->used && ne->size == step
+	    && se->used && se->size == step
+	    && sw->used && sw->size == step
+	    && nw->used && nw->size == step
+	    && ne->link[DIR_NNW] == ne->link[DIR_NNE]
+	    && ne->link[DIR_ENE] == ne->link[DIR_ESE]
+	    && se->link[DIR_ENE] == se->link[DIR_ESE]
+	    && se->link[DIR_SSE] == se->link[DIR_SSW]
+	    && sw->link[DIR_SSE] == sw->link[DIR_SSW]
+	    && sw->link[DIR_WSW] == sw->link[DIR_WNW]
+	    && nw->link[DIR_WSW] == nw->link[DIR_WNW]
+	    && nw->link[DIR_NNW] == nw->link[DIR_NNE]
+	    && ne->link[DIR_NE] != NULL
+	    && se->link[DIR_SE] != NULL
+	    && sw->link[DIR_SW] != NULL && nw->link[DIR_NW] != NULL)
+	  {
+	    ne->used = 0;
+	    se->used = 0;
+	    sw->used = 0;
+
+	    nw->size = step * 2;
+	    nw->link[DIR_NNE] = ne->link[DIR_NNE];
+	    nw->link[DIR_NE] = ne->link[DIR_NE];
+	    nw->link[DIR_ENE] = ne->link[DIR_ENE];
+	    nw->link[DIR_ESE] = se->link[DIR_ESE];
+	    nw->link[DIR_SE] = se->link[DIR_SE];
+	    nw->link[DIR_SSE] = se->link[DIR_SSE];
+	    nw->link[DIR_SSW] = sw->link[DIR_SSW];
+	    nw->link[DIR_SW] = sw->link[DIR_SW];
+	    nw->link[DIR_WSW] = sw->link[DIR_WSW];
+
+	    for (j = 0; j < NB_DIRS; ++j)
+	      for (k = 0; k < NB_DIRS; ++k)
+		{
+		  if (nw->link[j])
+		    {
+		      test = ((MESHER *) (nw->link[j]))->link[k];
+		      if (test == ne || test == se || test == sw)
+			((MESHER *) (nw->link[j]))->link[k] = nw;
+		    }
+		}
+
+	    ++found;
+	  }
+      }
+
+  return found;
+}
+
+/*------------------------------------------------------------------*/
+/* fonction creant le maillage definitif a partir du temporaire     */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+static MESH *
+mesher_to_mesh (MESHER * mesher, BITMAP * map, int *size, int *w, int *h)
+{
+  MESH *result;
+  MESHER *temp;
+  int mesher_size, i, j, k;
+
+  (*w) = map->w;
+  (*h) = map->h;
+  mesher_size = (*h) * (*w);
+
+  *size = 0;
+  for (i = 0; i < mesher_size; ++i)
+    if (mesher[i].used)
+      ++(*size);
+
+  result = malloc_in_big_data_bottom ((*size) * sizeof (MESH));
+  if (result != NULL)
+    {
+      j = 0;
+      for (i = 0; i < mesher_size; ++i)
+	{
+	  if (mesher[i].used)
+	    {
+	      result[j].x = i % (*w);
+	      result[j].y = i / (*w);
+	      result[j].side.decal_for_dir = 0;
+	      result[j].side.size = mesher[i].size;
+	      for (k = 0; k < NB_DIRS; ++k)
+		result[j].link[k] = mesher[i].link[k];
+	      mesher[i].corres = j;
+
+	      j++;
+	    }
+	}
+
+      for (j = 0; j < (*size); ++j)
+	for (k = 0; k < NB_DIRS; ++k)
+	  if ((temp = (result[j].link[k])) != NULL)
+	    result[j].link[k] = result + temp->corres;
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/* fonction creant tout le maillage si necessaire                   */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+void
+reset_mesh (void)
+{
+  int i, j;
+
+  for (i = 0; i < CURRENT_MESH_SIZE; ++i)
+    {
+      for (j = 0; j < NB_TEAMS; ++j)
+	{
+	  CURRENT_MESH[i].info[j].state.dir = (i + j) % NB_DIRS;
+	  CURRENT_MESH[i].info[j].update.time = -1;
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+test_one_mesh (MESH * test)
+{
+  MESH m;
+  MESH *bof;
+  int i;
+
+  i = m.x = test->x;
+  i = m.y = test->y;
+  m.side = test->side;
+  m.info[NB_TEAMS - 1] = test->info[NB_TEAMS - 1];
+
+  bof = m.link[NB_DIRS - 1] = test->link[NB_DIRS - 1];
+}
+
+/*------------------------------------------------------------------*/
+void
+test_mesh (void)
+{
+  int i, k;
+
+  for (i = 0; i < CURRENT_MESH_SIZE; ++i)
+    {
+      test_one_mesh (CURRENT_MESH + i);
+      for (k = 0; k < NB_DIRS; ++k)
+	if (CURRENT_MESH[i].link[k] != NULL)
+	  test_one_mesh (CURRENT_MESH[i].link[k]);
+    }
+}
+
+/*------------------------------------------------------------------*/
+int
+create_mesh (void)
+{
+  int retour = 0, i;
+  BITMAP *map;
+  MESHER *mesher;
+  int zoom_factor = 1;
+
+  CURRENT_MESH = NULL;
+  CURRENT_MESH_SIZE = 0;
+  CURRENT_AREA_W = 0;
+  CURRENT_AREA_H = 0;
+
+  if ((map = lw_map_create_bicolor
+       (CONFIG_LEVEL_MAP,
+	MESH_FG,
+	MESH_BG,
+	LW_NETWORK_ON,
+	LW_RANDOM_ON,
+	MIN_MAP_RES_W[LW_CONFIG_CURRENT_RULES.min_map_res],
+	MIN_MAP_RES_H[LW_CONFIG_CURRENT_RULES.min_map_res],
+	&zoom_factor)) != NULL)
+    {
+      mesher = create_first_mesher (map);
+      if (mesher != NULL)
+	{
+	  i = 1;
+	  while (i <= MESH_MAX_ELEM_SIZE && group_mesher (mesher, map, i))
+	    i *= 2;
+	  CURRENT_MESH = mesher_to_mesh (mesher, map,
+					 &CURRENT_MESH_SIZE,
+					 &CURRENT_AREA_W, &CURRENT_AREA_H);
+	  free_last_big_data_top ();
+	}
+      destroy_bitmap (map);
+    }
+  if (CURRENT_MESH == NULL)
+    retour = -1;		/* pas assez de memoire */
+
+  return retour;
+}
+
+/*------------------------------------------------------------------*/
+/* fonction creant une bitmap de demo du maillage si necessaire     */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+BITMAP *
+create_mesh_bitmap (int mode)
+{
+  BITMAP *result;
+  int i, j, color;
+
+  result = lw_maptex_create_map
+    (CONFIG_LEVEL_MAP,
+     CONFIG_LEVEL_FG,
+     CONFIG_LEVEL_BG,
+     LW_NETWORK_ON,
+     LW_RANDOM_ON,
+     MIN_MAP_RES_W[LW_CONFIG_CURRENT_RULES.min_map_res],
+     MIN_MAP_RES_H[LW_CONFIG_CURRENT_RULES.min_map_res],
+     CONFIG_USE_DEFAULT_TEXTURE);
+  if (result)
+    {
+      for (i = 0; i < CURRENT_MESH_SIZE; ++i)
+	{
+	  switch (mode)
+	    {
+	    case 0:
+	      color = 0;
+	      j = CURRENT_MESH[i].side.size;
+	      while (j > 1)
+		{
+		  j /= 2;
+		  ++color;
+		}
+	      break;
+	    default:
+	      color = i;
+	    }
+
+	  rectfill (result, CURRENT_MESH[i].x,
+		    CURRENT_MESH[i].y,
+		    CURRENT_MESH[i].x +
+		    CURRENT_MESH[i].side.size - 1,
+		    CURRENT_MESH[i].y +
+		    CURRENT_MESH[i].side.size - 1, 96 + color % 32);
+	}
+    }
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/mesh.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/mesh.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/mesh.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,137 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : mesh.h                                           */
+/* contenu       : calcul du maillage                               */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_MESH
+#define LIQUID_WAR_INCLUDE_MESH
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+#include "base.h"
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+typedef union
+{
+  int time;
+  struct
+  {
+    short x;
+    short y;
+  }
+  cursor;
+}
+MESH_UPDATE;
+
+typedef struct
+{
+  int dir:8;
+  int grad:24;
+}
+MESH_STATE;
+
+typedef struct
+{
+  MESH_UPDATE update;
+  MESH_STATE state;
+}
+MESH_INFO;
+
+typedef struct
+{
+  // char decal_for_dir :8; -> causes GPF under Win32.
+  // MSVC allocates 64 bits for the struct if decal_for_dir
+  // is declared as a char, and 32 bit if it's declared
+  // as an int. Go figure...
+  int decal_for_dir:8;
+  int size:24;
+}
+MESH_SIDE;
+
+typedef struct
+{
+  short x;
+  short y;
+  MESH_SIDE side;
+  MESH_INFO info[NB_TEAMS];
+  void *link[NB_DIRS];
+}
+MESH;
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+extern MESH *CURRENT_MESH;
+extern int CURRENT_MESH_SIZE;
+extern int CURRENT_AREA_W;
+extern int CURRENT_AREA_H;
+extern BITMAP *CURRENT_AREA_DISP;
+extern BITMAP *CURRENT_AREA_BACK;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void reset_mesh (void);
+void test_mesh (void);
+int create_mesh (void);
+BITMAP *create_mesh_bitmap (int mode);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/message.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/message.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/message.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,162 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : message.c                                        */
+/* contenu       : gestion des messages pendant le jeu              */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "message.h"
+#include "ticker.h"
+#include "viewport.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#define MESSAGE_MAX 12
+#define MESSAGE_SIZE 64
+
+static int MESSAGE_NB = 0;
+static char MESSAGE[MESSAGE_MAX][MESSAGE_SIZE + 1];
+static int MESSAGE_TICKER[MESSAGE_MAX];
+static int MESSAGE_DISPLAYED[MESSAGE_MAX];
+static int MESSAGE_DELAY = 1000;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+void
+clear_message (void)
+{
+  MESSAGE_NB = 0;
+}
+
+/*------------------------------------------------------------------*/
+void
+display_message (void)
+{
+  int i, h, j, new_ticker;
+
+  new_ticker = get_ticker ();
+  for (i = 0; i < MESSAGE_NB; ++i)
+    if (!MESSAGE_DISPLAYED[i])
+      {
+	MESSAGE_DISPLAYED[i] = 1;
+	MESSAGE_TICKER[i] = new_ticker + MESSAGE_DELAY * (i + 1);
+      }
+
+  while (MESSAGE_NB > 0
+	 && MESSAGE_DISPLAYED[0] && new_ticker > MESSAGE_TICKER[0])
+    {
+      for (i = 0; i < MESSAGE_NB - 1; ++i)
+	for (j = 0; j < MESSAGE_SIZE + 1; ++j)
+	  {
+	    MESSAGE[i][j] = MESSAGE[i + 1][j];
+	    MESSAGE_TICKER[i] = MESSAGE_TICKER[i + 1];
+	  }
+      MESSAGE_NB--;
+    }
+
+  h = text_height (font);
+  //text_mode (-1); deprecated
+  for (i = 0; i < MESSAGE_NB; ++i)
+    textout_ex (NEXT_SCREEN, font, MESSAGE[i],
+		NEXT_SCREEN->w - text_length (font, MESSAGE[i]),
+		NEXT_SCREEN->h - (MESSAGE_NB - i) * h, -1, -1);
+}
+
+/*------------------------------------------------------------------*/
+void
+message_str (char *str)
+{
+  int i;
+
+  while (MESSAGE_NB >= MESSAGE_MAX)
+    {
+      for (i = 0; i < MESSAGE_NB - 1; ++i)
+	{
+	  LW_MACRO_STRCPY (MESSAGE[i], MESSAGE[i + 1]);
+	  MESSAGE_TICKER[i] = MESSAGE_TICKER[i + 1] - MESSAGE_DELAY;
+	}
+      MESSAGE_NB--;
+    }
+
+  MESSAGE_DISPLAYED[MESSAGE_NB] = 0;
+  LW_MACRO_STRCPY (MESSAGE[MESSAGE_NB], str);
+
+  MESSAGE_NB++;
+}
+
+/*------------------------------------------------------------------*/
+void
+message_int (int val)
+{
+  static char buffer[33 + 1];
+
+  LW_MACRO_SPRINTF1 (buffer, "%d", val);
+  message_str (buffer);
+}
+
+/*------------------------------------------------------------------*/
+void
+message_str_int (char *str, int val)
+{
+  static char buffer[MESSAGE_SIZE + 33 + 1];
+
+  LW_MACRO_SPRINTF2 (buffer, "%s%d", str, val);
+  message_str (buffer);
+}

Added: unstable/liquidwar/branches/upstream/current/src/message.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/message.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/message.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,64 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : message.h                                        */
+/* contenu       : gestion des messages pendant le jeu              */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_MESSAGE
+#define LIQUID_WAR_INCLUDE_MESSAGE
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void clear_message (void);
+void display_message (void);
+void message_str (char *str);
+void message_int (int val);
+void message_str_int (char *str, int val);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/monster.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/monster.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/monster.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,92 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : monster.h                                        */
+/* contenu       : deplacement des streums accelere                 */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_MONSTER
+#define LIQUID_WAR_INCLUDE_MONSTER
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "area.h"
+#include "mesh.h"
+#include "asm.h"
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+extern void LW_ASM_FUNC boost_move_fighters (FIGHTER * current_army,
+					     int current_army_size,
+					     PLACE * current_area,
+					     int current_area_w,
+					     int *active_fighters,
+					     int *attack,
+					     int *defense,
+					     int *new_health,
+					     int max_fighter_health_1,
+					     int sens,
+					     int start,
+					     int neg_global_clock,
+					     int *fighter_move_xy,
+					     int *fighter_move_offset,
+					     char *current_area_back_data,
+					     char *current_area_disp_data,
+					     int *color_first_entry,
+					     int colors_per_team,
+					     int *local_dir,
+					     int temp1,
+					     int temp2,
+					     int temp3,
+					     int temp4,
+					     int temp5,
+					     int temp6, int temp7, int temp8);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/monster.s
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/monster.s	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/monster.s	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,974 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : monster.s                                        */
+/* contenu       : deplacement des streums accelere                 */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+
+/*typedef union          */
+/*        {              */
+/*         int time;     */
+/*         struct        */
+/*          {            */
+/*           short x;    */
+/*           short y;    */
+/*          } cursor;    */
+/*        } MESH_UPDATE; */
+
+/* typedef struct           */
+/*        {                 */
+/*         int dir :8;      */
+/*         int grad:24;     */
+/*        } MESH_STATE;     */
+
+/*typedef struct              */
+/*        {                   */
+/*         MESH_UPDATE update;*/
+/*         MESH_STATE state;  */
+/*        } MESH_INFO;        */
+
+.equ SIZE_OF_INFO,8
+
+.equ INFO_UPDATE,0
+.equ INFO_STATE,4
+
+
+/*typedef struct                   */
+/*        {                        */
+/*         char decal_for_dir :8;  */
+/*         int  size          :24; */
+/*        } MESH_SIDE;             */ 
+
+/*typedef struct                     */
+/*        {                          */
+/*         short x;                  */
+/*         short y;                  */
+/*         MESH_SIDE side;           */
+/*         MESH_INFO info[NB_TEAMS]; */
+/*         void *link[NB_DIRS];      */
+/*        } MESH;                    */
+
+.equ SIZE_OF_MESH,104
+
+.equ MESH_INFO,8
+.equ MESH_LINK,56
+
+
+
+/*typedef struct              */
+/*        {                   */
+/*         short x;           */
+/*         short y;           */
+/*         short   health;    */
+/*         char team;         */
+/*        char last_dir;      */
+/*        } FIGHTER;          */
+
+
+.equ SIZE_OF_FIGHTER,8
+.equ FIGHTER_XY,0
+.equ FIGHTER_X,0
+.equ FIGHTER_Y,2
+.equ FIGHTER_HEALTH,4
+.equ FIGHTER_TEAM,6
+.equ FIGHTER_LAST_DIR,7
+
+
+/*typedef struct              */
+/*        {                   */
+/*         MESH    *mesh;     */
+/*         FIGHTER *fighter;  */
+/*        } PLACE;            */
+
+
+.equ SIZE_OF_PLACE,8
+.equ PLACE_MESH,0
+.equ PLACE_FIGHTER,4
+
+.equ MOVE_BLOCK_NUMBER,5
+
+.equ ARG_CURRENT_ARMY,             8
+.equ ARG_CURRENT_ARMY_SIZE,       12
+.equ ARG_CURRENT_AREA,            16
+.equ ARG_CURRENT_AREA_W,          20
+.equ ARG_ACTIVE_FIGHTERS,         24
+.equ ARG_ATTACK,                  28
+.equ ARG_DEFENSE,                 32
+.equ ARG_NEW_HEALTH,              36
+.equ ARG_MAX_FIGHTER_HEALTH_1,    40
+.equ ARG_SENS,                    44
+.equ ARG_START,                   48
+.equ ARG_NEG_GLOBAL_CLOCK,        52
+.equ ARG_FIGHTER_MOVE_XY,         56
+.equ ARG_FIGHTER_MOVE_OFFSET,     60
+.equ ARG_CURRENT_AREA_BACK,       64
+.equ ARG_CURRENT_AREA_DISP,       68
+.equ ARG_COLOR_FIRST_ENTRY,       72
+.equ ARG_COLORS_PER_TEAM,         76
+.equ ARG_LOCAL_DIR,               80
+.equ ARG_TEMP1,                   84
+.equ ARG_TEMP2,                   88
+.equ ARG_TEMP3,                   92
+.equ ARG_TEMP4,                   96
+.equ ARG_TEMP5,                   100
+.equ ARG_TEMP6,                   104
+.equ ARG_TEMP7,                   108
+.equ ARG_TEMP8,                   112
+
+.equ OFFSET_P0,0
+.equ OFFSET_P1,4
+.equ OFFSET_P2,8
+.equ OFFSET_P3,12
+.equ OFFSET_P4,16
+
+.equ SIDE_ATTACK_FACTOR,4     #on divise attaque par 2^4=16 qd
+                              #l attaque se fait sur le cote
+
+/*#define AREA_START_GRADIENT 2000000*/
+.equ AREA_START_GRADIENT,2000000*256
+
+.text
+
+
+
+/*==================================================================*/
+/* grosse fonction enorme, on fait ce qu on pneu                    */
+/*==================================================================*/
+
+/*--------------------------------------------------------------------*/
+/* void boost_move_fighters (FIGHTER *current_army,                   */
+/*                          int current_army_size,                    */
+/*                          PLACE *current_area,                      */
+/*                          int current_area_w,                       */
+/*                          int *active_fighters,                     */
+/*                          int *attack,                              */
+/*                          int *defense,                             */
+/*                          int *new_health,                          */
+/*                          int max_fighter_health_1,                 */
+/*                          int sens,                                 */
+/*                          int start,                                */
+/*                          int neg_global_clock,                     */
+/*                          int *fighter_move_xy,                     */
+/*                          int *fighter_move_offset,                 */
+/*                          char *current_area_back_data,             */
+/*                          char *current_area_disp_data,             */
+/*                          int *color_first_entry,                   */
+/*                          int colors_per_team,                      */
+/*                          int *local_dir,                           */
+/*                          int temp1,                                */
+/*                          int temp2,                                */
+/*                          int temp3,                                */
+/*                          int temp4,                                */
+/*                          int temp5,                                */
+/*                          int temp6,                                */
+/*                          int temp7,                                */
+/*                          int temp8);                               */
+/*--------------------------------------------------------------------*/
+.globl _boost_move_fighters
+.globl boost_move_fighters
+   .align 4
+_boost_move_fighters:	
+boost_move_fighters:
+   pushl %ebp
+   movl %esp, %ebp
+   pushl %eax
+   pushl %ebx
+   pushl %ecx
+   pushl %edx
+   pushl %esi
+   pushl %edi
+   pushw %es
+   pushw %fs
+   pushw %gs
+
+   movw  %ds,%ax
+   movw  %ax,%es
+   movw  %ax,%fs
+   movw  %ax,%gs
+
+   movl  ARG_CURRENT_ARMY_SIZE(%ebp),%ecx  # ecx=nombre de streums
+   movl  ARG_CURRENT_ARMY(%ebp),%esi       # esi=adresse du streum courant
+
+main_loop:
+   push  %ecx
+
+/*------------------------------------------------------------------*/
+/* indice de l equipe                                               */
+/*------------------------------------------------------------------*/
+   xor   %ecx,%ecx                  # ecx a zero
+   movb  FIGHTER_TEAM(%esi),%cl     # equipe dans le champ ecx
+   movl  %ecx,%ds:ARG_TEMP1(%ebp)   # temp1 prend team
+   shl   $2,%ecx                    # ecx contient maintenant team*4
+
+/*------------------------------------------------------------------*/
+/* mise a jour du nombre de combattants de l equipe                 */
+/*------------------------------------------------------------------*/
+   mov   ARG_ACTIVE_FIGHTERS(%ebp),%edi  # recuperation de pointeur
+   add   %ecx,%edi                       # ajout de l offset pour l equipe
+   incl  %ds:(%edi)                      # mise a jour du fighter number
+
+/*------------------------------------------------------------------*/
+/* localisation du streum courant                                   */
+/*------------------------------------------------------------------*/
+   movl  FIGHTER_XY(%esi),%eax        # eax contient fighter->xy
+   xor   %ebx,%ebx                    # ebx a 0
+   movw  %ax,%bx                      # ebx contient fighter->x
+   shr   $16,%eax                     # eax contient fighter->y
+   cdq                                # je crois que ca sert pour imul
+   mull  %ds:ARG_CURRENT_AREA_W(%ebp) # eax prend fighter->y*CURRENT_AREA_W
+   add   %ebx,%eax                    # eax contient un joli offset
+   mov   %eax,%ds:ARG_TEMP2(%ebp)     # temp2 prend y*CURRENT_AREA_W+1
+   shl   $3,%eax                      # eax*=8 (taille de PLACE)
+   add   ARG_CURRENT_AREA(%ebp),%eax
+   mov   %eax,%edi                    # edi=adresse dans CURRENT_AREA
+                                      # situant la place du streum courant
+/*------------------------------------------------------------------*/
+/* on recupere le parametre update du streum courant                */
+/*------------------------------------------------------------------*/
+   shl   $1,%ecx                      # ecx contient maintenant team*8
+   add   $MESH_INFO,%ecx              # ecx=offset pour info%team
+   mov   PLACE_MESH(%edi),%ebx        # ebx prend l adresse du maillage
+   add   %ecx,%ebx                    # sur l instant de mise a jour
+   mov   INFO_UPDATE(%ebx),%eax       # eax=instant mise a jour
+
+/*------------------------------------------------------------------*/
+/* on calcule la direction principale de deplacement                */
+/*------------------------------------------------------------------*/
+   cmp   $0,%eax
+   jge   fdl_start
+
+/*------------------------------------------------------------------*/
+/* calcul base sur les gradients                                    */
+/*------------------------------------------------------------------*/
+   mov   ARG_NEG_GLOBAL_CLOCK(%ebp),%edx  # edx=-GLOBAL_CLOCK
+   cmp   %edx,%eax                        # direction a jour???
+   je    fdg_dir_ok                       # oui...
+                                          # non, on la met, en
+   mov   %edx,INFO_UPDATE(%ebx)           # commencant par l heure
+
+   mov   ARG_START(%ebp),%al              # al=direction de depart
+   mov   %al,%ah                          # ah=direction courante
+   ror   $8,%eax
+   mov   %al,%ah                          # direction  trouvee sur
+   rol   $8,%eax                          # la partie haute de eax
+
+   mov   $AREA_START_GRADIENT,%edx        # plus proche distance
+                                          # trouvee
+
+   movb  ARG_SENS(%ebp),%bl               # bl=sens
+
+   cmp   $0,%bl
+   jne   fdg_sens_1
+
+/*------------------------------------------------------------------*/
+/* dans le sens 0                                                   */
+/*------------------------------------------------------------------*/
+fdg_sens_0:
+loop_fdg_sens_0:
+
+   xor   %ebx,%ebx
+   mov   %ah,%bl
+   sal   $2,%ebx
+   add   PLACE_MESH(%edi),%ebx        # ebx prend l adresse du maillage
+   mov   MESH_LINK(%ebx),%ebx
+   cmp   $0,%ebx                      # le mesh existe-t-il ???
+   je    not_better_fdg_sens_0
+   add   %ecx,%ebx                    # sur l instant de mise a jour
+   mov   INFO_STATE(%ebx),%ebx        # ebx= distance
+   cmp   %edx,%ebx                    # on compare
+   jge   not_better_fdg_sens_0        # pas mieux
+   mov   %ebx,%edx                    # mieux!, on met a jour
+   ror   $8,%eax
+   mov   %al,%ah                      # direction trouve ds eax haut
+   rol   $8,%eax
+
+not_better_fdg_sens_0:
+   inc   %ah                              # direction suivante
+   cmp   $12,%ah
+   jne   skip_fdg_sens_0
+   xor   %ah,%ah
+skip_fdg_sens_0:
+   cmp   %ah,%al
+   jne   loop_fdg_sens_0
+
+   movb  $1,ARG_SENS(%ebp)                # la prochaine fois on
+                                          # changera de direction
+   jmp   fdg_end_of_calc
+
+/*------------------------------------------------------------------*/
+/* dans le sens 1                                                   */
+/*------------------------------------------------------------------*/
+fdg_sens_1:
+loop_fdg_sens_1:
+
+   xor   %ebx,%ebx
+   mov   %ah,%bl
+   sal   $2,%ebx
+   add   PLACE_MESH(%edi),%ebx        # ebx prend l adresse du maillage
+   mov   MESH_LINK(%ebx),%ebx
+   cmp   $0,%ebx                      # le mesh existe-t-il ???
+   je    not_better_fdg_sens_1
+   add   %ecx,%ebx                    # sur l instant de mise a jour
+   mov   INFO_STATE(%ebx),%ebx        # ebx= distance
+   cmp   %edx,%ebx                    # on compare
+   jge   not_better_fdg_sens_1        # pas mieux
+   mov   %ebx,%edx                    # mieux!, on met a jour
+   ror   $8,%eax
+   mov   %al,%ah                      # direction trouve ds eax haut
+   rol   $8,%eax
+
+not_better_fdg_sens_1:
+   dec   %ah                              # direction suivante
+   jge   skip_fdg_sens_1
+   mov   $11,%ah
+skip_fdg_sens_1:
+   cmp   %ah,%al
+   jne   loop_fdg_sens_1
+
+   movb  $0,ARG_SENS(%ebp)                # la prochaine fois on
+                                          # changera de direction
+#   jmp   fdg_end_of_calc
+
+/*------------------------------------------------------------------*/
+/* fin du calcul, partie commune du calcul de direction principal   */
+/*------------------------------------------------------------------*/
+fdg_end_of_calc:
+   mov   PLACE_MESH(%edi),%ebx        # ebx prend l adresse du maillage
+   add   %ecx,%ebx                    # sur le param update
+   ror   $8,%eax                      # ah=dir choisie
+   movb  %ah,INFO_STATE(%ebx)         # mise a jour en memoire
+
+/*------------------------------------------------------------------*/
+/* la direction a ete calculee pour tout le mesh                    */
+/*------------------------------------------------------------------*/
+fdg_dir_ok:
+   xor   %eax,%eax                        # eax a 0
+   movb  INFO_STATE(%ebx),%al             #
+
+#   movb  $0,%al
+
+   jmp   dir_calculated
+skip_1:
+
+/*------------------------------------------------------------------*/
+/* calcul "local"                                                   */
+/*------------------------------------------------------------------*/
+
+fdl_start:
+   xor   %ecx,%ecx                    # ecx= resultat des tests
+   movl  FIGHTER_XY(%esi),%edx        # eax contient fighter->xy
+
+   cmp   %ax,%dx
+   je    fdl_skip_x1
+   jg    fdl_skip_x2
+   or    $2,%cl
+   jmp   fdl_skip_x1
+fdl_skip_x2:
+   or    $8,%cl
+fdl_skip_x1:
+
+   ror   $16,%eax
+   ror   $16,%edx
+
+   cmp   %ax,%dx
+   je    fdl_skip_x3
+   jg    fdl_skip_x4
+   or    $4,%cl
+   jmp   fdl_skip_x3
+fdl_skip_x4:
+   or    $1,%cl
+fdl_skip_x3:
+
+   or    %cl,%cl
+   je    on_the_spot
+   mov   ARG_LOCAL_DIR(%ebp),%ebx
+   dec   %cl
+   shl   $1,%cl
+   add   ARG_SENS(%ebp),%ecx
+   shl   $2,%cl
+   add   %ecx,%ebx
+   mov   (%ebx),%eax
+   jmp   end_of_fdl
+on_the_spot:
+   mov   ARG_START(%ebp),%eax
+end_of_fdl:
+
+#movb  $6,%al
+
+  # a l issue de ces calculs, eax contient la direction en question
+
+/*------------------------------------------------------------------*/
+/* on dispose ici dans eax de la direction principale de deplacement*/
+/*------------------------------------------------------------------*/
+
+dir_calculated:
+
+   shl   $2,%eax
+   mov   %eax,%ecx
+   shl   $2,%eax
+   add   %eax,%ecx                           #ecx=eax*20...
+
+/*------------------------------------------------------------------*/
+/* test si deplacement possible dans direction associee a p0        */
+/*------------------------------------------------------------------*/
+
+   mov   %ecx,%ebx                           #on recupere la dir
+   add   ARG_FIGHTER_MOVE_OFFSET(%ebp),%ebx  #ebx=pointeur a garder!!!
+   mov   OFFSET_P0(%ebx),%eax                #eax=offs ds cur_area
+
+   mov   %eax,ARG_TEMP5(%ebp)                #offset dir p0 memorise
+
+   shl   $3,%eax
+   add   %edi,%eax                           #eax=pointeur sur place
+
+   mov   PLACE_MESH(%eax),%edx               #edx=pointeur sur mesh
+   cmp   $0,%edx                             #la place est-elle un mur?
+   je    skip_3                              #oui
+   mov   PLACE_FIGHTER(%eax),%edx            #edx=pointeur sur fighter
+   cmp   $0,%edx                             #la place est-elle libre?
+   jne   skip_3                              #non
+
+/*------------------------------------------------------------------*/
+/* deplacement dans direction associee a p0                         */
+/*------------------------------------------------------------------*/
+
+   movl  $0,%ds:PLACE_FIGHTER(%edi)          #on vide dans cur_area
+   mov   %esi,%ds:PLACE_FIGHTER(%eax)        #nouvelle place
+
+   add   ARG_FIGHTER_MOVE_XY(%ebp),%ecx      #offset ds move_xy
+   mov   OFFSET_P0(%ecx),%edx                #on charge l increm
+   addl  %edx,%ds:FIGHTER_XY(%esi)           #addition des coord
+
+   mov   ARG_TEMP2(%ebp),%ecx                #y*cur_area_w+x
+   mov   ARG_CURRENT_AREA_BACK(%ebp),%eax    #eax=cur_area_back->dat
+   add   %ecx,%eax                           #pointe sur pixel
+   movb  %ds:(%eax),%dl                      #pixel memorise
+   mov   ARG_CURRENT_AREA_DISP(%ebp),%eax    #eax=cur_area_disp->dat
+   add   %ecx,%eax                           #pointe sur pixel
+   movb  %ds:(%eax),%dh                      #couleur du monstre
+   movb  %dl,%ds:(%eax)                      #effacement
+   add   OFFSET_P0(%ebx),%eax                #deplacement
+   movb  %dh,%ds:(%eax)                      #affichage
+
+   jmp   next_monster                        #fini avec ce monstre...
+
+skip_3:
+
+/*------------------------------------------------------------------*/
+/* test si deplacement possible dans direction associee a p1        */
+/*------------------------------------------------------------------*/
+
+   mov   %ecx,%ebx                           #on recupere la dir
+   add   ARG_FIGHTER_MOVE_OFFSET(%ebp),%ebx  #ebx=pointeur a garder!!!
+   mov   OFFSET_P1(%ebx),%eax                #eax=offs ds cur_area
+
+   mov   %eax,ARG_TEMP6(%ebp)                #offset dir p1 memorise
+
+   shl   $3,%eax
+   add   %edi,%eax                           #eax=pointeur sur place
+
+   mov   PLACE_MESH(%eax),%edx               #edx=pointeur sur mesh
+   cmp   $0,%edx                             #la place est-elle un mur?
+   je    skip_4                              #oui
+   mov   PLACE_FIGHTER(%eax),%edx            #edx=pointeur sur fighter
+   cmp   $0,%edx                             #la place est-elle libre?
+   jne   skip_4                              #non
+
+/*------------------------------------------------------------------*/
+/* deplacement dans direction associee a p1                         */
+/*------------------------------------------------------------------*/
+
+   movl  $0,%ds:PLACE_FIGHTER(%edi)          #on vide dans cur_area
+   mov   %esi,%ds:PLACE_FIGHTER(%eax)        #nouvelle place
+
+   add   ARG_FIGHTER_MOVE_XY(%ebp),%ecx      #offset ds move_xy
+   mov   OFFSET_P1(%ecx),%edx                #on charge l increm
+   addl  %edx,%ds:FIGHTER_XY(%esi)           #addition des coord
+
+   mov   ARG_TEMP2(%ebp),%ecx                #y*cur_area_w+x
+   mov   ARG_CURRENT_AREA_BACK(%ebp),%eax    #eax=cur_area_back->dat
+   add   %ecx,%eax                           #pointe sur pixel
+   movb  %ds:(%eax),%dl                      #pixel memorise
+   mov   ARG_CURRENT_AREA_DISP(%ebp),%eax    #eax=cur_area_disp->dat
+   add   %ecx,%eax                           #pointe sur pixel
+   movb  %ds:(%eax),%dh                      #couleur du monstre
+   movb  %dl,%ds:(%eax)                      #effacement
+   add   OFFSET_P1(%ebx),%eax                #deplacement
+   movb  %dh,%ds:(%eax)                      #affichage
+
+   jmp   next_monster                        #fini avec ce monstre...
+
+skip_4:
+
+/*------------------------------------------------------------------*/
+/* test si deplacement possible dans direction associee a p2        */
+/*------------------------------------------------------------------*/
+
+   mov   %ecx,%ebx                           #on recupere la dir
+   add   ARG_FIGHTER_MOVE_OFFSET(%ebp),%ebx  #ebx=pointeur a garder!!!
+   mov   OFFSET_P2(%ebx),%eax                #eax=offs ds cur_area
+
+   mov   %eax,ARG_TEMP7(%ebp)                #offset dir p2 memorise
+
+   shl   $3,%eax
+   add   %edi,%eax                           #eax=pointeur sur place
+
+   mov   PLACE_MESH(%eax),%edx               #edx=pointeur sur mesh
+   cmp   $0,%edx                             #la place est-elle un mur?
+   je    skip_5                              #oui
+   mov   PLACE_FIGHTER(%eax),%edx            #edx=pointeur sur fighter
+   cmp   $0,%edx                             #la place est-elle libre?
+   jne   skip_5                              #non
+
+/*------------------------------------------------------------------*/
+/* deplacement dans direction associee a p2                         */
+/*------------------------------------------------------------------*/
+
+   movl  $0,%ds:PLACE_FIGHTER(%edi)          #on vide dans cur_area
+   mov   %esi,%ds:PLACE_FIGHTER(%eax)        #nouvelle place
+
+   add   ARG_FIGHTER_MOVE_XY(%ebp),%ecx      #offset ds move_xy
+   mov   OFFSET_P2(%ecx),%edx                #on charge l increm
+   addl  %edx,%ds:FIGHTER_XY(%esi)           #addition des coord
+
+   mov   ARG_TEMP2(%ebp),%ecx                #y*cur_area_w+x
+   mov   ARG_CURRENT_AREA_BACK(%ebp),%eax    #eax=cur_area_back->dat
+   add   %ecx,%eax                           #pointe sur pixel
+   movb  %ds:(%eax),%dl                      #pixel memorise
+   mov   ARG_CURRENT_AREA_DISP(%ebp),%eax    #eax=cur_area_disp->dat
+   add   %ecx,%eax                           #pointe sur pixel
+   movb  %ds:(%eax),%dh                      #couleur du monstre
+   movb  %dl,%ds:(%eax)                      #effacement
+   add   OFFSET_P2(%ebx),%eax                #deplacement
+   movb  %dh,%ds:(%eax)                      #affichage
+
+   jmp   next_monster                        #fini avec ce monstre...
+
+skip_5:
+
+/*------------------------------------------------------------------*/
+/* test si deplacement possible dans direction associee a p3        */
+/*------------------------------------------------------------------*/
+
+   mov   %ecx,%ebx                           #on recupere la dir
+   add   ARG_FIGHTER_MOVE_OFFSET(%ebp),%ebx  #ebx=pointeur a garder!!!
+   mov   OFFSET_P3(%ebx),%eax                #eax=offs ds cur_area
+   shl   $3,%eax
+   add   %edi,%eax                           #eax=pointeur sur place
+
+   mov   PLACE_MESH(%eax),%edx               #edx=pointeur sur mesh
+   cmp   $0,%edx                             #la place est-elle un mur?
+   je    skip_6                              #oui
+   mov   PLACE_FIGHTER(%eax),%edx            #edx=pointeur sur fighter
+   cmp   $0,%edx                             #la place est-elle libre?
+   jne   skip_6                              #non
+
+/*------------------------------------------------------------------*/
+/* deplacement dans direction associee a p3                         */
+/*------------------------------------------------------------------*/
+
+   movl  $0,%ds:PLACE_FIGHTER(%edi)          #on vide dans cur_area
+   mov   %esi,%ds:PLACE_FIGHTER(%eax)        #nouvelle place
+
+   add   ARG_FIGHTER_MOVE_XY(%ebp),%ecx      #offset ds move_xy
+   mov   OFFSET_P3(%ecx),%edx                #on charge l increm
+   addl  %edx,%ds:FIGHTER_XY(%esi)           #addition des coord
+
+   mov   ARG_TEMP2(%ebp),%ecx                #y*cur_area_w+x
+   mov   ARG_CURRENT_AREA_BACK(%ebp),%eax    #eax=cur_area_back->dat
+   add   %ecx,%eax                           #pointe sur pixel
+   movb  %ds:(%eax),%dl                      #pixel memorise
+   mov   ARG_CURRENT_AREA_DISP(%ebp),%eax    #eax=cur_area_disp->dat
+   add   %ecx,%eax                           #pointe sur pixel
+   movb  %ds:(%eax),%dh                      #couleur du monstre
+   movb  %dl,%ds:(%eax)                      #effacement
+   add   OFFSET_P3(%ebx),%eax                #deplacement
+   movb  %dh,%ds:(%eax)                      #affichage
+
+   jmp   next_monster                        #fini avec ce monstre...
+
+skip_6:
+
+/*------------------------------------------------------------------*/
+/* test si deplacement possible dans direction associee a p4        */
+/*------------------------------------------------------------------*/
+
+   mov   %ecx,%ebx                           #on recupere la dir
+   add   ARG_FIGHTER_MOVE_OFFSET(%ebp),%ebx  #ebx=pointeur a garder!!!
+   mov   OFFSET_P4(%ebx),%eax                #eax=offs ds cur_area
+   shl   $3,%eax
+   add   %edi,%eax                           #eax=pointeur sur place
+
+   mov   PLACE_MESH(%eax),%edx               #edx=pointeur sur mesh
+   cmp   $0,%edx                             #la place est-elle un mur?
+   je    skip_7                              #oui
+   mov   PLACE_FIGHTER(%eax),%edx            #edx=pointeur sur fighter
+   cmp   $0,%edx                             #la place est-elle libre?
+   jne   skip_7                              #non
+
+/*------------------------------------------------------------------*/
+/* deplacement dans direction associee a p4                         */
+/*------------------------------------------------------------------*/
+
+   movl  $0,%ds:PLACE_FIGHTER(%edi)          #on vide dans cur_area
+   mov   %esi,%ds:PLACE_FIGHTER(%eax)        #nouvelle place
+
+   add   ARG_FIGHTER_MOVE_XY(%ebp),%ecx      #offset ds move_xy
+   mov   OFFSET_P4(%ecx),%edx                #on charge l increm
+   addl  %edx,%ds:FIGHTER_XY(%esi)           #addition des coord
+
+   mov   ARG_TEMP2(%ebp),%ecx                #y*cur_area_w+x
+   mov   ARG_CURRENT_AREA_BACK(%ebp),%eax    #eax=cur_area_back->dat
+   add   %ecx,%eax                           #pointe sur pixel
+   movb  %ds:(%eax),%dl                      #pixel memorise
+   mov   ARG_CURRENT_AREA_DISP(%ebp),%eax    #eax=cur_area_disp->dat
+   add   %ecx,%eax                           #pointe sur pixel
+   movb  %ds:(%eax),%dh                      #couleur du monstre
+   movb  %dl,%ds:(%eax)                      #effacement
+   add   OFFSET_P4(%ebx),%eax                #deplacement
+   movb  %dh,%ds:(%eax)                      #affichage
+
+   jmp   next_monster                        #fini avec ce monstre...
+
+skip_7:
+
+/*------------------------------------------------------------------*/
+/* test si attaque dans direction associee a p0                     */
+/*------------------------------------------------------------------*/
+
+   mov   ARG_TEMP5(%ebp),%eax                #mega astuce!!!
+   shl   $3,%eax
+   add   %edi,%eax                           #eax=pointeur sur place
+
+   mov   PLACE_MESH(%eax),%edx               #edx=pointeur sur mesh
+   cmp   $0,%edx                             #la place est-elle un mur?
+   je    skip_8                              #oui, fini
+   mov   PLACE_FIGHTER(%eax),%edx            #edx=pointeur sur fighter
+   cmp   $0,%edx                             #y-a-t-il un streum?
+   je    skip_8                              #non, fini
+   movb  ARG_TEMP1(%ebp),%al                 #recupere team
+   cmpb  FIGHTER_TEAM(%edx),%al              #compare
+   je    skip_8                              #les memes...
+
+/*------------------------------------------------------------------*/
+/* attaque ds dir associee a p0                                     */
+/*------------------------------------------------------------------*/
+
+   xor   %ecx,%ecx                   # ecx a 0
+   mov   %al,%cl                     # ecx=al
+   shl   $2,%cl                      # ecx=team*4
+   mov   ARG_ATTACK(%ebp),%ebx       # ebx=attack
+   add   %ecx,%ebx                   # ebx=attack[team]
+   movw  FIGHTER_HEALTH(%edx),%ax    # ax=health du voisin
+   subw  (%ebx),%ax                  # attaque!!!
+   jg    no_change_team_0            # change de camp???
+   mov   ARG_NEW_HEALTH(%ebp),%ebx   # ebx=new_health
+   add   %ecx,%ebx                   # ebx=new_health[team]
+   movw  (%ebx),%bx                  # bx=valeur de n_h[team]
+new_health_loop_0:
+   add   %bx,%ax                       # health+=new_health
+   jl    new_health_loop_0             # tant que health<0
+   mov   ARG_MAX_FIGHTER_HEALTH_1(%ebp),%bx
+   cmpw  %bx,%ax                       # health>max_health-1?
+   jle   not_to_much_new_health_0
+   mov   %bx,%ax                       # health=max_health-1
+not_to_much_new_health_0:
+   shr   $2,%cl
+   movb  %cl,FIGHTER_TEAM(%edx)        # changement de team
+   shl   $2,%cl                        # en memoire
+   jmp   display_attacked_fighter_0
+
+no_change_team_0:
+   xor   %ecx,%ecx                     # ecx=0
+   movb  FIGHTER_TEAM(%edx),%cl        # cl=team
+   shl   $2,%cl                        # ecx=team*4
+
+display_attacked_fighter_0:
+
+   movw  %ax,FIGHTER_HEALTH(%edx)           # health en mem
+
+   cwde                                     # eax=ax
+   mov   ARG_COLORS_PER_TEAM(%ebp),%ebx     # bx=colors
+   cdq
+   mull  %ebx                                # eax*=colors
+   mov   ARG_MAX_FIGHTER_HEALTH_1(%ebp),%ebx # bx=max_health
+   inc   %ebx
+   cdq
+   divl  %ebx                                # eax/=max_health
+   mov   ARG_COLOR_FIRST_ENTRY(%ebp),%ebx    # ebx=cfe
+   add   %ecx,%ebx                           # ebx=cfe+team
+   addb  (%ebx),%al                          # eax=color
+
+   mov   ARG_CURRENT_AREA_DISP(%ebp),%ebx # ecx=cur_area_disp>dat
+   add   ARG_TEMP2(%ebp),%ebx             # y*cur_area_w+x
+   add   ARG_TEMP5(%ebp),%ebx                #on recupere la dir
+
+   movb  %al,(%ebx)
+
+   jmp   next_monster
+skip_8:
+
+/*------------------------------------------------------------------*/
+/* test si attaque dans direction associee a p1                     */
+/*------------------------------------------------------------------*/
+
+   mov   ARG_TEMP6(%ebp),%eax                #mega astuce!!!
+   shl   $3,%eax
+   add   %edi,%eax                           #eax=pointeur sur place
+
+   mov   PLACE_MESH(%eax),%edx               #edx=pointeur sur mesh
+   cmp   $0,%edx                             #la place est-elle un mur?
+   je    skip_9                              #oui, fini
+   mov   PLACE_FIGHTER(%eax),%edx            #edx=pointeur sur fighter
+   cmp   $0,%edx                             #y-a-t-il un streum?
+   je    skip_9                              #non, fini
+   movb  ARG_TEMP1(%ebp),%al                 #recupere team
+   cmpb  FIGHTER_TEAM(%edx),%al              #compare
+   je    skip_9                              #les memes...
+
+/*------------------------------------------------------------------*/
+/* attaque ds dir associee a p1                                     */
+/*------------------------------------------------------------------*/
+
+   xor   %ecx,%ecx                   # ecx a 0
+   mov   %al,%cl                     # ecx=al
+   shl   $2,%cl                      # ecx=team*4
+   mov   ARG_ATTACK(%ebp),%ebx       # ebx=attack
+   add   %ecx,%ebx                   # ebx=attack[team]
+   movw  FIGHTER_HEALTH(%edx),%ax    # ax=health du voisin
+   mov   (%ebx),%bx                  # bx=force d attaque
+   shr   $SIDE_ATTACK_FACTOR,%bx     # force/ car
+                                     # attaque sur le cote
+   subw  %bx,%ax                     # attaque!!!
+   jg    no_change_team_1            # change de camp???
+   mov   ARG_NEW_HEALTH(%ebp),%ebx   # ebx=new_health
+   add   %ecx,%ebx                   # ebx=new_health[team]
+   movw  (%ebx),%bx                  # bx=valeur de n_h[team]
+new_health_loop_1:
+   add   %bx,%ax                       # health+=new_health
+   jl    new_health_loop_1             # tant que health<0
+   mov   ARG_MAX_FIGHTER_HEALTH_1(%ebp),%bx
+   cmpw  %bx,%ax                       # health>max_health-1?
+   jle   not_to_much_new_health_1
+   mov   %bx,%ax                       # health=max_health-1
+not_to_much_new_health_1:
+   shr   $2,%cl
+   movb  %cl,FIGHTER_TEAM(%edx)        # changement de team
+   shl   $2,%cl                        # en memoire
+   jmp   display_attacked_fighter_1
+
+no_change_team_1:
+   xor   %ecx,%ecx                     # ecx=0
+   movb  FIGHTER_TEAM(%edx),%cl        # cl=team
+   shl   $2,%cl                        # ecx=team*4
+
+display_attacked_fighter_1:
+
+   movw  %ax,FIGHTER_HEALTH(%edx)           # health en mem
+
+   cwde                                     # eax=ax
+   mov   ARG_COLORS_PER_TEAM(%ebp),%ebx     # bx=colors
+   cdq
+   mull  %ebx                                # eax*=colors
+   mov   ARG_MAX_FIGHTER_HEALTH_1(%ebp),%ebx # bx=max_health
+   inc   %ebx
+   cdq
+   divl  %ebx                                # eax/=max_health
+   mov   ARG_COLOR_FIRST_ENTRY(%ebp),%ebx    # ebx=cfe
+   add   %ecx,%ebx                           # ebx=cfe+team
+   addb  (%ebx),%al                          # eax=color
+
+   mov   ARG_CURRENT_AREA_DISP(%ebp),%ebx # ecx=cur_area_disp>dat
+   add   ARG_TEMP2(%ebp),%ebx             # y*cur_area_w+x
+   add   ARG_TEMP6(%ebp),%ebx                #on recupere la dir
+
+   movb  %al,(%ebx)
+
+   jmp   next_monster
+skip_9:
+
+/*------------------------------------------------------------------*/
+/* test si attaque dans direction associee a p2                     */
+/*------------------------------------------------------------------*/
+
+   mov   ARG_TEMP6(%ebp),%eax                #mega astuce!!!
+   shl   $3,%eax
+   add   %edi,%eax                           #eax=pointeur sur place
+
+   mov   PLACE_MESH(%eax),%edx               #edx=pointeur sur mesh
+   cmp   $0,%edx                             #la place est-elle un mur?
+   je    skip_10                              #oui, fini
+   mov   PLACE_FIGHTER(%eax),%edx            #edx=pointeur sur fighter
+   cmp   $0,%edx                             #y-a-t-il un streum?
+   je    skip_10                              #non, fini
+   movb  ARG_TEMP1(%ebp),%al                 #recupere team
+   cmpb  FIGHTER_TEAM(%edx),%al              #compare
+   je    skip_10                              #les memes...
+
+/*------------------------------------------------------------------*/
+/* attaque ds dir associee a p2                                     */
+/*------------------------------------------------------------------*/
+
+   xor   %ecx,%ecx                   # ecx a 0
+   mov   %al,%cl                     # ecx=al
+   shl   $2,%cl                      # ecx=team*4
+   mov   ARG_ATTACK(%ebp),%ebx       # ebx=attack
+   add   %ecx,%ebx                   # ebx=attack[team]
+   movw  FIGHTER_HEALTH(%edx),%ax    # ax=health du voisin
+   mov   (%ebx),%bx                  # bx=force d attaque
+   shr   $SIDE_ATTACK_FACTOR,%bx     # force/ car
+                                     # attaque sur le cote
+   subw  %bx,%ax                     # attaque!!!
+   jg    no_change_team_2            # change de camp???
+   mov   ARG_NEW_HEALTH(%ebp),%ebx   # ebx=new_health
+   add   %ecx,%ebx                   # ebx=new_health[team]
+   movw  (%ebx),%bx                  # bx=valeur de n_h[team]
+new_health_loop_2:
+   add   %bx,%ax                       # health+=new_health
+   jl    new_health_loop_2             # tant que health<0
+   mov   ARG_MAX_FIGHTER_HEALTH_1(%ebp),%bx
+   cmpw  %bx,%ax                       # health>max_health-1?
+   jle   not_to_much_new_health_2
+   mov   %bx,%ax                       # health=max_health-1
+not_to_much_new_health_2:
+   shr   $2,%cl
+   movb  %cl,FIGHTER_TEAM(%edx)        # changement de team
+   shl   $2,%cl                        # en memoire
+   jmp   display_attacked_fighter_2
+
+no_change_team_2:
+   xor   %ecx,%ecx                     # ecx=0
+   movb  FIGHTER_TEAM(%edx),%cl        # cl=team
+   shl   $2,%cl                        # ecx=team*4
+
+display_attacked_fighter_2:
+
+   movw  %ax,FIGHTER_HEALTH(%edx)           # health en mem
+
+   cwde                                     # eax=ax
+   mov   ARG_COLORS_PER_TEAM(%ebp),%ebx     # bx=colors
+   cdq
+   mull  %ebx                                # eax*=colors
+   mov   ARG_MAX_FIGHTER_HEALTH_1(%ebp),%ebx # bx=max_health
+   inc   %ebx
+   cdq
+   divl  %ebx                                # eax/=max_health
+   mov   ARG_COLOR_FIRST_ENTRY(%ebp),%ebx    # ebx=cfe
+   add   %ecx,%ebx                           # ebx=cfe+team
+   addb  (%ebx),%al                          # eax=color
+
+   mov   ARG_CURRENT_AREA_DISP(%ebp),%ebx # ecx=cur_area_disp>dat
+   add   ARG_TEMP2(%ebp),%ebx             # y*cur_area_w+x
+   add   ARG_TEMP6(%ebp),%ebx                #on recupere la dir
+
+   movb  %al,(%ebx)
+
+   jmp   next_monster
+skip_10:
+
+/*------------------------------------------------------------------*/
+/* test si regeneration dans direction associee a p0                */
+/*------------------------------------------------------------------*/
+   mov   ARG_TEMP5(%ebp),%eax                #mega astuce!!!
+   shl   $3,%eax
+   add   %edi,%eax                           #eax=pointeur sur place
+
+   mov   PLACE_MESH(%eax),%edx               #edx=pointeur sur mesh
+   cmp   $0,%edx                             #la place est-elle un mur?
+   je    skip_11                             #oui, fini
+   mov   PLACE_FIGHTER(%eax),%edx            #edx=pointeur sur fighter
+   cmp   $0,%edx                             #y-a-t-il un streum?
+   je    skip_11                             #non, fini
+   movb  ARG_TEMP1(%ebp),%al                 #recupere team
+   cmpb  FIGHTER_TEAM(%edx),%al              #compare
+   jne   skip_11                             #les memes...
+
+/*------------------------------------------------------------------*/
+/* regeneration ds dir associee a p0                                     */
+/*------------------------------------------------------------------*/
+   xor   %ecx,%ecx                   # ecx a 0
+   mov   %al,%cl                     # ecx=al
+   shl   $2,%cl                      # ecx=team*4
+   mov   ARG_DEFENSE(%ebp),%ebx      # ebx=defense
+   add   %ecx,%ebx                   # ebx=defense[team]
+   movw  FIGHTER_HEALTH(%edx),%ax    # ax=health du voisin
+   addw  (%ebx),%ax                  # regeneration!!!
+   mov   ARG_MAX_FIGHTER_HEALTH_1(%ebp),%bx
+   cmpw  %bx,%ax                       # health>max_health?
+   jle   not_to_much_defense
+   mov   %bx,%ax
+not_to_much_defense:
+   jmp   display_attacked_fighter_0
+skip_11:
+
+/*------------------------------------------------------------------*/
+/* fin de la boucle, on passe a la suite                            */
+/*------------------------------------------------------------------*/
+next_monster:
+   add   $SIZE_OF_FIGHTER,%esi # on passe au streumon suivant
+
+   pop  %ecx
+   dec  %ecx
+   je   the_end
+   jmp  main_loop
+
+the_end:
+
+   popw %gs
+   popw %fs
+   popw %es
+   popl %edi
+   popl %esi
+   popl %edx
+   popl %ecx
+   popl %ebx
+   popl %eax
+/*   movl %ebp, %esp*/
+   popl %ebp
+   ret                              # retour au c
+
+

Added: unstable/liquidwar/branches/upstream/current/src/mouse.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/mouse.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/mouse.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,173 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : mouse.c                                          */
+/* contenu       : gestion de la souris                             */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+#include "config.h"
+#include "mouse.h"
+#include "disk.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+int MOUSE_CONTROL_REF_X = 0;
+int MOUSE_CONTROL_REF_Y = 0;
+int MOUSE_CONTROL_UP = 0;
+int MOUSE_CONTROL_RIGHT = 0;
+int MOUSE_CONTROL_DOWN = 0;
+int MOUSE_CONTROL_LEFT = 0;
+
+static int MOUSE_CONTROL_GAP = 1000;
+static int MOUSE_ON = 1;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+void
+lw_mouse_update_control (void)
+{
+  if (mouse_y <= MOUSE_CONTROL_REF_Y - MOUSE_CONTROL_GAP)
+    {
+      MOUSE_CONTROL_UP = 1;
+      MOUSE_CONTROL_REF_Y = mouse_y + MOUSE_CONTROL_GAP;
+    }
+  else
+    MOUSE_CONTROL_UP = 0;
+
+  if (mouse_x >= MOUSE_CONTROL_REF_X + MOUSE_CONTROL_GAP)
+    {
+      MOUSE_CONTROL_RIGHT = 1;
+      MOUSE_CONTROL_REF_X = mouse_x - MOUSE_CONTROL_GAP;
+    }
+  else
+    MOUSE_CONTROL_RIGHT = 0;
+
+  if (mouse_y >= MOUSE_CONTROL_REF_Y + MOUSE_CONTROL_GAP)
+    {
+      MOUSE_CONTROL_DOWN = 1;
+      MOUSE_CONTROL_REF_Y = mouse_y - MOUSE_CONTROL_GAP;
+    }
+  else
+    MOUSE_CONTROL_DOWN = 0;
+
+  if (mouse_x <= MOUSE_CONTROL_REF_X - MOUSE_CONTROL_GAP)
+    {
+      MOUSE_CONTROL_LEFT = 1;
+      MOUSE_CONTROL_REF_X = mouse_x + MOUSE_CONTROL_GAP;
+    }
+  else
+    MOUSE_CONTROL_LEFT = 0;
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_mouse_reset_control (void)
+{
+  MOUSE_CONTROL_REF_X = mouse_x;
+  MOUSE_CONTROL_REF_Y = mouse_y;
+  MOUSE_CONTROL_GAP = 2 + (8 - CONFIG_MOUSE_GAP) * (8 - CONFIG_MOUSE_GAP);
+
+  if (MOUSE_CONTROL_REF_X < MOUSE_CONTROL_GAP)
+    MOUSE_CONTROL_REF_X = MOUSE_CONTROL_GAP;
+  if (MOUSE_CONTROL_REF_Y < MOUSE_CONTROL_GAP)
+    MOUSE_CONTROL_REF_Y = MOUSE_CONTROL_GAP;
+  if (MOUSE_CONTROL_REF_X > SCREEN_W - MOUSE_CONTROL_GAP - 1)
+    MOUSE_CONTROL_REF_X = SCREEN_W - MOUSE_CONTROL_GAP - 1;
+  if (MOUSE_CONTROL_REF_Y > SCREEN_H - MOUSE_CONTROL_GAP - 1)
+    MOUSE_CONTROL_REF_Y = SCREEN_H - MOUSE_CONTROL_GAP - 1;
+
+  position_mouse (MOUSE_CONTROL_REF_X, MOUSE_CONTROL_REF_Y);
+  lw_mouse_update_control ();
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_mouse_update_show_hide (void)
+{
+  if (MOUSE_ON)
+    {
+      if (font == BIG_FONT)
+	{
+	  set_mouse_sprite (BIG_MOUSE_CURSOR);
+	}
+      if (font == SMALL_FONT)
+	{
+	  set_mouse_sprite (SMALL_MOUSE_CURSOR);
+	}
+      show_mouse (screen);
+    }
+  else
+    {
+      set_mouse_sprite (INVISIBLE_MOUSE_CURSOR);
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_mouse_show (void)
+{
+  MOUSE_ON = 1;
+  lw_mouse_update_show_hide ();
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_mouse_hide (void)
+{
+  MOUSE_ON = 0;
+  lw_mouse_update_show_hide ();
+}

Added: unstable/liquidwar/branches/upstream/current/src/mouse.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/mouse.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/mouse.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,84 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : mouse.h                                          */
+/* contenu       : gestion de la souris                             */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_MOUSE
+#define LIQUID_WAR_INCLUDE_MOUSE
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#define KEY_MOUSE_UP      124
+#define KEY_MOUSE_RIGHT   125
+#define KEY_MOUSE_DOWN    126
+#define KEY_MOUSE_LEFT    127
+
+extern int MOUSE_CONTROL_REF_X;
+extern int MOUSE_CONTROL_REF_Y;
+extern int MOUSE_CONTROL_UP;
+extern int MOUSE_CONTROL_RIGHT;
+extern int MOUSE_CONTROL_DOWN;
+extern int MOUSE_CONTROL_LEFT;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void lw_mouse_update_control (void);
+void lw_mouse_reset_control (void);
+void lw_mouse_update_show_hide (void);
+void lw_mouse_show (void);
+void lw_mouse_hide (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/move.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/move.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/move.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,541 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : move.c                                           */
+/* contenu       : deplacement des curseurs                         */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+#include "area.h"
+#include "autoplay.h"
+#include "config.h"
+#include "cursor.h"
+#include "joystick.h"
+#include "keyboard.h"
+#include "mesh.h"
+#include "mouse.h"
+#include "move.h"
+#include "time.h"
+#include "keyexch.h"
+#include "network.h"
+#include "checksum.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#define LW_MOVE_SIDE_LIMIT 10
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * moves a cursor in a given direction if the place is free
+ * one just has to give the x & y values of the cursors as params
+ */
+static int
+move_if_free (int *x, int *y, int dir)
+{
+  int moved = 0;
+
+  /*
+   * we check if the direction is between 1 and 8
+   * if not force it into this range
+   */
+  while (dir > 8)
+    dir -= 8;
+  while (dir < 1)
+    dir += 8;
+
+  /*
+   * switch between all dirs
+   * in all the cases, the method is the same, we check if
+   * there's a mesh pointer defined for the target position
+   * if yes, this implies there are no walls. check area.c and mesh.c
+   * to understand while testing the mesh attribute is OK.
+   * then we keep track of the result of the move, for later
+   * we'll need to know if the cursor has really been moved
+   * this result is stored in the moved value
+   */
+  switch (dir)
+    {
+      /*
+       * trying to go NORTH
+       */
+    case 1:
+      if (CURRENT_AREA[((*y) - 1) * CURRENT_AREA_W + (*x)].mesh)
+	{
+	  (*y)--;
+	  moved = 1;
+	}
+      break;
+      /*
+       * trying to go NORTH EAST
+       */
+    case 2:
+      if (CURRENT_AREA[((*y) - 1) * CURRENT_AREA_W + (*x) + 1].mesh)
+	{
+	  (*y)--;
+	  (*x)++;
+	  moved = 1;
+	}
+      break;
+      /*
+       * trying to go EAST
+       */
+    case 3:
+      if (CURRENT_AREA[(*y) * CURRENT_AREA_W + (*x) + 1].mesh)
+	{
+	  (*x)++;
+	  moved = 1;
+	}
+      break;
+      /*
+       * trying to go SOUTH EAST
+       */
+    case 4:
+      if (CURRENT_AREA[((*y) + 1) * CURRENT_AREA_W + (*x) + 1].mesh)
+	{
+	  (*x)++;
+	  (*y)++;
+	  moved = 1;
+	}
+      break;
+      /*
+       * trying to go SOUTH
+       */
+    case 5:
+      if (CURRENT_AREA[((*y) + 1) * CURRENT_AREA_W + (*x)].mesh)
+	{
+	  (*y)++;
+	  moved = 1;
+	}
+      break;
+      /*
+       * trying to go SOUTH WEST
+       */
+    case 6:
+      if (CURRENT_AREA[((*y) + 1) * CURRENT_AREA_W + (*x) - 1].mesh)
+	{
+	  (*y)++;
+	  (*x)--;
+	  moved = 1;
+	}
+      break;
+      /*
+       * trying to go WEST
+       */
+    case 7:
+      if (CURRENT_AREA[(*y) * CURRENT_AREA_W + (*x) - 1].mesh)
+	{
+	  (*x)--;
+	  moved = 1;
+	}
+      break;
+      /*
+       * trying to go NORTH WEST
+       */
+    case 8:
+      if (CURRENT_AREA[((*y) - 1) * CURRENT_AREA_W + (*x) - 1].mesh)
+	{
+	  (*x)--;
+	  (*y)--;
+	  moved = 1;
+	}
+    }
+  return moved;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * moves a cursor
+ * in fact it interprets the key_state value , calculates the
+ * direction to use and then calls move_if_free
+ */
+static void
+move_cursor (int indice)
+{
+  int dir = 0, up, down, right, left, horiz = 0, vert = 0, moved = 0, team;
+  char key_state;
+  MESH *mesh;
+
+  /*
+   * we get the team associated to the cursor
+   */
+  team = CURRENT_CURSOR[indice].team;
+  /*
+   * we get the mesh item associated to the current position of the cursor
+   */
+  mesh = CURRENT_AREA[CURRENT_CURSOR[indice].y * CURRENT_AREA_W
+		      + CURRENT_CURSOR[indice].x].mesh;
+  /*
+   * we tell the mesh that the info won't be up to date anymore concerning
+   * this position
+   */
+  mesh->info[team].update.time = -1;
+
+  /*
+   * the key_state value gives the state of all pressed/unpressed keys
+   */
+  key_state = CURRENT_CURSOR[indice].key_state;
+
+  /*
+   * we interpret the content of the key_state value with binary masks
+   */
+  up = key_state & CURSOR_KEY_UP;
+  right = key_state & CURSOR_KEY_RIGHT;
+  down = key_state & CURSOR_KEY_DOWN;
+  left = key_state & CURSOR_KEY_LEFT;
+
+  /*
+   * if both left and right keys are pressed, no horizontal move!
+   */
+  if ((right && left) || ((!right) && (!left)))
+    horiz = 0;
+  /*
+   * if right key is pressed but not left key, let's go right
+   */
+  if (right && (!left))
+    horiz = 1;
+  /*
+   * if left key is pressed but not right key, let's go left
+   */
+  if ((!right) && left)
+    horiz = -1;
+
+  /*
+   * if both up and down keys are pressed, no verical move!
+   */
+  if ((up && down) || ((!up) && (!down)))
+    vert = 0;
+  /*
+   * if up key is pressed but not down key, let's go up
+   */
+  if (up && (!down))
+    vert = -1;
+  /*
+   * if down key is pressed but not up key, let's go down
+   */
+  if ((!up) && down)
+    vert = 1;
+
+  /*
+   * the cursor does not move at all
+   */
+  if (horiz == 0 && vert == 0)
+    dir = 0;
+  /*
+   * the cursor heads NORTH
+   */
+  if (horiz == 0 && vert == -1)
+    dir = 1;
+  /*
+   * the cursor heads NORTH EAST
+   */
+  if (horiz == 1 && vert == -1)
+    dir = 2;
+  /*
+   * the cursor heads EAST
+   */
+  if (horiz == 1 && vert == 0)
+    dir = 3;
+  /*
+   * the cursor heads SOUTH EAST
+   */
+  if (horiz == 1 && vert == 1)
+    dir = 4;
+  /*
+   * the cursor heads SOUTH
+   */
+  if (horiz == 0 && vert == 1)
+    dir = 5;
+  /*
+   * the cursor heads SOUTH WEST
+   */
+  if (horiz == -1 && vert == 1)
+    dir = 6;
+  /*
+   * the cursor heads WEST
+   */
+  if (horiz == -1 && vert == 0)
+    dir = 7;
+  /*
+   * the cursor heads NORTH WEST
+   */
+  if (horiz == -1 && vert == -1)
+    dir = 8;
+
+  /*
+   * if no direction has been found, we do nothing
+   */
+  if (dir)
+    {
+      /*
+       * we first try to move in the direction we have calculated
+       */
+      moved = move_if_free (&(CURRENT_CURSOR[indice].x),
+			    &(CURRENT_CURSOR[indice].y), dir);
+      /*
+       * if it did not work, we try another direction
+       * for instance if the direction was NORTH WEST we try WEST
+       */
+      if (!moved)
+	moved = move_if_free (&(CURRENT_CURSOR[indice].x),
+			      &(CURRENT_CURSOR[indice].y), dir - 1);
+      /*
+       * if it did not work, we try another direction
+       * for instance if the direction was NORTH WEST we try NORTH
+       */
+      if (!moved)
+	moved = move_if_free (&(CURRENT_CURSOR[indice].x),
+			      &(CURRENT_CURSOR[indice].y), dir + 1);
+      /*
+       * The following code allows the cursor to really "slip" on walls.
+       * Not very elegant, but it works 8-)
+       */
+      if (!moved)
+	{
+	  int xa1, ya1;
+	  int xb1, yb1;
+	  int xa2, ya2;
+	  int xb2, yb2;
+	  int i = 0;
+
+	  xa1 = xb1 = CURRENT_CURSOR[indice].x;
+	  ya1 = yb1 = CURRENT_CURSOR[indice].y;
+
+	  while (!moved && i < LW_MOVE_SIDE_LIMIT)
+	    {
+	      if (move_if_free (&xa1, &ya1, dir - 2))
+		{
+		  xa2 = xa1;
+		  ya2 = ya1;
+		  if (move_if_free (&xa2, &ya2, dir - 1))
+		    {
+		      /*
+		       * Normally moved should be true after this
+		       */
+		      moved = move_if_free (&(CURRENT_CURSOR[indice].x),
+					    &(CURRENT_CURSOR[indice].y),
+					    dir - 2);
+		    }
+		}
+
+	      if (move_if_free (&xb1, &yb1, dir + 2))
+		{
+		  xb2 = xb1;
+		  yb2 = yb1;
+		  if (move_if_free (&xb2, &yb2, dir + 1))
+		    {
+		      /*
+		       * Normally moved should be true after this
+		       */
+		      moved = move_if_free (&(CURRENT_CURSOR[indice].x),
+					    &(CURRENT_CURSOR[indice].y),
+					    dir + 2);
+		    }
+		}
+
+	      i++;
+	    }
+	}
+    }
+  /*
+   * now this is quite a subtle line
+   * we decrement the value of the cursor when
+   * - the cursor has moved, this is required since it means
+   *   that the cursor is now 1 pixel farer from all the fighters
+   *   as long as the gradient spreading has proven the contrary
+   * or
+   * - a condition base on the global clock is filled.
+   *   this avoids cyclic behaviors and some "lost" fighters which
+   *   might otherwise start looping in a corner of the map
+   */
+  if (moved || !(GLOBAL_CLOCK % (NB_DIRS + 1)))
+    {
+      CURRENT_CURSOR[indice].val--;
+    }
+
+  /*
+   * we retrieve the new mesh item associated to the new position
+   */
+  mesh = CURRENT_AREA[CURRENT_CURSOR[indice].y * CURRENT_AREA_W
+		      + CURRENT_CURSOR[indice].x].mesh;
+  /*
+   * we tell the mesh where the cursor is
+   * this information is redundant but it avoids complex things such as 
+   * my_struct->....->...   ...->...->my_attribute;
+   */
+  mesh->info[team].update.cursor.x = CURRENT_CURSOR[indice].x;
+  mesh->info[team].update.cursor.y = CURRENT_CURSOR[indice].y;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * updates the key_state value for a local player, ie polls the keys
+ * it might also poll the joystick but this is transparent
+ */
+static void
+update_key_local_cursor (int indice)
+{
+  /*
+   * the following code is pretty much the same for each key.
+   * the is_touched_key will automatically poll the right device,
+   * keyboard, mouse or joystick and return true if the logical
+   * is in a "pressed" state
+   */
+  CURRENT_CURSOR[indice].key_state
+    = is_touched_key (CONFIG_KEY_UP[indice]) ? CURSOR_KEY_UP : 0;
+  CURRENT_CURSOR[indice].key_state
+    += is_touched_key (CONFIG_KEY_RIGHT[indice]) ? CURSOR_KEY_RIGHT : 0;
+  CURRENT_CURSOR[indice].key_state
+    += is_touched_key (CONFIG_KEY_DOWN[indice]) ? CURSOR_KEY_DOWN : 0;
+  CURRENT_CURSOR[indice].key_state
+    += is_touched_key (CONFIG_KEY_LEFT[indice]) ? CURSOR_KEY_LEFT : 0;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * updates the key_state for a cursor which is AI driven
+ */
+static void
+update_key_cpu_cursor (int indice)
+{
+  /*
+   * get_computer_next_move is the main AI function
+   */
+  CURRENT_CURSOR[indice].key_state = get_computer_next_move (indice);
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * moves all the cursors, (logical, eh?)
+ * the kind of function one might wish to use in the main game loop
+ */
+void
+move_all_cursors (void)
+{
+  int i, j;
+  int checksum;
+
+  /*
+   * polls the module which wraps mouse moves to virtual keys
+   */
+  lw_mouse_update_control ();
+  /*
+   * polls the joystick
+   */
+  my_poll_joystick ();
+  /*
+   * one might wish to poll network stuff here but I'm not sure it's
+   * the right place because of performance issues
+   */
+
+  for (j = 0; j <= LW_CONFIG_CURRENT_RULES.cursor_increase_speed; ++j)
+    {
+      /*
+       * loop for all the teams, the cursor of which is active
+       */
+      for (i = 0; i < NB_TEAMS; ++i)
+	{
+	  if (CURRENT_CURSOR[i].active)
+	    {
+	      /*
+	       * If the cursor is network controlled, we do nothing yet
+	       */
+	      if (!CURRENT_CURSOR[i].from_network)
+		{
+		  if (CURRENT_CURSOR[i].control_type ==
+		      CONFIG_CONTROL_TYPE_CPU)
+		    {
+		      /*
+		       * the cursor is controlled by the computer
+		       */
+		      update_key_cpu_cursor (i);
+		    }
+		  else
+		    {
+		      /*
+		       * the cursor is controlled by a human local player
+		       */
+		      update_key_local_cursor (i);
+		    }
+		}
+	    }
+	}
+      /*
+       * we flush network informations if needed.
+       */
+      if (LW_NETWORK_ON)
+	{
+	  checksum = lw_checksum_calc (CURRENT_ARMY, CURRENT_ARMY_SIZE);
+
+	  /*
+	   * This call will automatically overwrite the key states
+	   * with those received from the network
+	   */
+	  if (!lw_keyexch_flush (CURRENT_CURSOR, checksum))
+	    {
+	      LW_NETWORK_ERROR_DETECTED = 1;
+	    }
+	}
+
+      for (i = 0; i < NB_TEAMS; ++i)
+	{
+	  if (CURRENT_CURSOR[i].active)
+	    {
+	      move_cursor (i);
+	    }
+	}
+    }
+}

Added: unstable/liquidwar/branches/upstream/current/src/move.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/move.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/move.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,73 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : move.h                                           */
+/* contenu       : deplacement des curseurs                         */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_MOVE
+#define LIQUID_WAR_INCLUDE_MOVE
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+/*
+ * these constants are combined with a logic "or" to produce a
+ * "key state" value which is used to move the cursors.
+ */
+#define CURSOR_KEY_UP    1
+#define CURSOR_KEY_RIGHT 2
+#define CURSOR_KEY_DOWN  4
+#define CURSOR_KEY_LEFT  8
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void move_all_cursors (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/music.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/music.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/music.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,137 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : music.c                                          */
+/* content       : music related functions                          */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdlib.h>
+
+#include "config.h"
+#include "disk.h"
+#include "startup.h"
+#include "music.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+int MUSIC_VOLUME = 0;
+
+static int MUSIC_VOLUME_VALUES[17] = { 0,
+  16, 32, 48, 64,
+  80, 96, 112, 128,
+  144, 160, 176, 192,
+  208, 224, 240, 255
+};
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+start_music (void)
+{
+  static int last_volume = -1;
+  static int last_file = -1;
+  int result = 1;
+  int i;
+
+  /*
+   * we pick up a random music, letting the user choose the music
+   * would imply work on the GUI, which is very time consuming 8-(
+   */
+  if (STARTUP_MUSIC_STATE && MIDI_MUSIC_NUMBER >= 0)
+    {
+      /*
+       * we try and pick up a music that is different from
+       * the last music played
+       */
+      if (MIDI_MUSIC_NUMBER >= 2)
+	{
+	  do
+	    {
+	      i = random () % MIDI_MUSIC_NUMBER;
+	    }
+	  while (i == last_file);
+	}
+      else
+	{
+	  /*
+	   * we have only 1 midi file loaded...
+	   */
+	  i = 0;
+	}
+      last_file = i;
+
+      if (CONFIG_MUSIC_VOLUME != last_volume)
+	{
+	  set_volume (-1, MUSIC_VOLUME_VALUES[CONFIG_MUSIC_VOLUME]);
+	  last_volume = CONFIG_MUSIC_VOLUME;
+	}
+
+      result = play_midi (MIDI_MUSIC[i], TRUE);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+void
+stop_music (void)
+{
+  if (STARTUP_MUSIC_STATE)
+    {
+      /*
+       * Calling play_midi with a NULL arg ends the midi output
+       */
+      play_midi (NULL, FALSE);
+    }
+}

Added: unstable/liquidwar/branches/upstream/current/src/music.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/music.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/music.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,66 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : music.h                                          */
+/* content       : music related functions                          */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_MUSIC
+#define LIQUID_WAR_INCLUDE_MUSIC
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+extern int MUSIC_VOLUME;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+extern int start_music (void);
+extern void stop_music (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/mutxdos.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/mutxdos.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/mutxdos.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,106 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : thrddos.c                                        */
+/* content       : provides fake mutex  support under DOS           */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "mutxgen.h"
+
+/*==================================================================*/
+/* defines                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* macros                                                           */
+/*==================================================================*/
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+lw_mutex_init (LW_MUTEX_DATA * mutex)
+{
+  int result = 1;
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_mutex_lock (LW_MUTEX_DATA * mutex)
+{
+  int result = 1;
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_mutex_trylock (LW_MUTEX_DATA * mutex)
+{
+  int result = 1;
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_mutex_unlock (LW_MUTEX_DATA * mutex)
+{
+  int result = 1;
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/mutxgen.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/mutxgen.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/mutxgen.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,72 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : mutxgen.h                                        */
+/* content       : cross platform API to handle basic mutexes       */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_MUTXGEN
+#define LIQUID_WAR_INCLUDE_MUTXGEN
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+
+typedef struct
+{
+  void *data;
+}
+LW_MUTEX_DATA, *LW_MUTEX_DATA_PTR;
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+int lw_mutex_init (LW_MUTEX_DATA * mutex);
+int lw_mutex_lock (LW_MUTEX_DATA * mutex);
+int lw_mutex_trylock (LW_MUTEX_DATA * mutex);
+int lw_mutex_unlock (LW_MUTEX_DATA * mutex);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/mutxunix.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/mutxunix.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/mutxunix.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,163 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : thrdunix.c                                       */
+/* content       : provides basic mutex support under unix          */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <errno.h>
+#include <stdlib.h>
+#include <pthread.h>
+
+#include "mutxgen.h"
+
+/*==================================================================*/
+/* defines                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* macros                                                           */
+/*==================================================================*/
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+lw_mutex_init (LW_MUTEX_DATA * mutex)
+{
+  int result = 0;
+  pthread_mutex_t *m;
+
+  mutex->data = malloc (sizeof (pthread_mutex_t));
+  if (mutex->data != NULL)
+    {
+      m = (pthread_mutex_t *) mutex->data;
+      pthread_mutex_init (m, NULL);
+      result = 1;
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_mutex_lock (LW_MUTEX_DATA * mutex)
+{
+  int result = 0;
+  pthread_mutex_t *m;
+
+  m = (pthread_mutex_t *) mutex->data;
+  if (!m)
+    {
+      lw_mutex_init (mutex);
+    }
+  m = (pthread_mutex_t *) mutex->data;
+  /*
+   * It's important to use another if(m) test since
+   * mutex might have just been initialized.
+   */
+  if (m)
+    {
+      pthread_mutex_lock (m);
+      result = 1;
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_mutex_trylock (LW_MUTEX_DATA * mutex)
+{
+  int result = 0;
+  pthread_mutex_t *m;
+
+  m = (pthread_mutex_t *) mutex->data;
+  if (!m)
+    {
+      lw_mutex_init (mutex);
+    }
+  m = (pthread_mutex_t *) mutex->data;
+  /*
+   * It's important to use another if(m) test since
+   * mutex might have just been initialized.
+   */
+  if (m)
+    {
+      if (pthread_mutex_trylock (m) != EBUSY)
+	{
+	  result = 1;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_mutex_unlock (LW_MUTEX_DATA * mutex)
+{
+  int result = 0;
+  pthread_mutex_t *m;
+
+  m = (pthread_mutex_t *) mutex->data;
+  if (m)
+    {
+      pthread_mutex_unlock (m);
+      result = 1;
+    }
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/mutxw32.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/mutxw32.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/mutxw32.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,175 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : thrdunix.c                                       */
+/* content       : provides basic mutex support under windows       */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#ifdef WIN32
+#include <windows.h>
+#endif
+
+#include "mutxgen.h"
+#include "log.h"
+
+/*==================================================================*/
+/* defines                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* macros                                                           */
+/*==================================================================*/
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+lw_mutex_init (LW_MUTEX_DATA * mutex)
+{
+  int result = 0;
+  HANDLE *h;
+
+  mutex->data = malloc (sizeof (HANDLE));
+  if (mutex->data != NULL)
+    {
+      h = (HANDLE *) mutex->data;
+      (*h) = CreateMutex (NULL, TRUE, NULL);
+
+      if ((*h) != NULL)
+	{
+	  result = 1;
+	}
+      else
+	{
+	  log_println ("Error: can't create mutex...");
+	  free (mutex->data);
+	  mutex->data = NULL;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_mutex_lock (LW_MUTEX_DATA * mutex)
+{
+  int result = 0;
+  HANDLE *h;
+
+  h = (HANDLE *) mutex->data;
+  if (!h)
+    {
+      lw_mutex_init (mutex);
+    }
+  h = (HANDLE *) mutex->data;
+  /*
+   * It's important to use another if(h) test since
+   * mutex might have just been initialized.
+   */
+  if (h)
+    {
+      if (WaitForSingleObject (h, INFINITE) == WAIT_OBJECT_0)
+	{
+	  result = 1;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_mutex_trylock (LW_MUTEX_DATA * mutex)
+{
+  int result = 1;
+
+  HANDLE *h;
+
+  h = (HANDLE *) mutex->data;
+  if (!h)
+    {
+      lw_mutex_init (mutex);
+    }
+  h = (HANDLE *) mutex->data;
+  /*
+   * It's important to use another if(h) test since
+   * mutex might have just been initialized.
+   */
+  if (h)
+    {
+      if (WaitForSingleObject (h, 0) == WAIT_OBJECT_0)
+	{
+	  result = 1;
+	}
+    }
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_mutex_unlock (LW_MUTEX_DATA * mutex)
+{
+  int result = 1;
+  HANDLE *h;
+
+  h = (HANDLE *) mutex->data;
+  if (!h)
+    {
+      ReleaseMutex (h);
+    }
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/netconf.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/netconf.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/netconf.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,279 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : netconf.c                                        */
+/* content       : functions to transmit the conf over the network  */
+/* last update   : June 30th 2001                                   */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "netconf.h"
+#include "sock2gen.h"
+#include "log.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+/*==================================================================*/
+/* macros                                                           */
+/*==================================================================*/
+
+#define LW_NETCONF_CHECK_RANGE(VAL,MAX) \
+if (config->VAL < 0) \
+{ \
+result=0; \
+log_print_str("Error: " #VAL " is "); \
+log_print_int(config->VAL); \
+log_println_str(", and should be >= 0"); \
+config->VAL = 0; \
+} \
+if (config->VAL > MAX) \
+{ \
+result=0; \
+log_print_str("Error: " #VAL " is > "); \
+log_print_int(config->VAL); \
+log_print_str(", and should be <= "); \
+log_println_int(MAX); \
+config->VAL = MAX; \
+}
+
+#define LW_NETCONF_PRINT_VALUE(VAL) \
+log_print_str(#VAL " = "); \
+log_println_int(config->VAL);
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* static functions declaration                                     */
+/*==================================================================*/
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends a config over the network
+ */
+int
+lw_netconf_send (int *sock, LW_NETCONF * config)
+{
+  int result = 0;
+  char buffer[LW_SOCK_MESSAGE_SIZE];
+
+  LW_MACRO_SPRINTF1 (buffer, "%d", config->cursor_increase_speed);
+  if (lw_sock_send_str (sock, buffer))
+    {
+      LW_MACRO_SPRINTF1 (buffer, "%d", config->fighter_attack);
+      if (lw_sock_send_str (sock, buffer))
+	{
+	  LW_MACRO_SPRINTF1 (buffer, "%d", config->fighter_defense);
+	  if (lw_sock_send_str (sock, buffer))
+	    {
+	      LW_MACRO_SPRINTF1 (buffer, "%d", config->fighter_new_health);
+	      if (lw_sock_send_str (sock, buffer))
+		{
+		  LW_MACRO_SPRINTF1 (buffer, "%d", config->number_influence);
+		  if (lw_sock_send_str (sock, buffer))
+		    {
+		      LW_MACRO_SPRINTF1 (buffer, "%d",
+					 config->fighter_number);
+		      if (lw_sock_send_str (sock, buffer))
+			{
+			  LW_MACRO_SPRINTF1 (buffer, "%d", config->game_time);
+			  if (lw_sock_send_str (sock, buffer))
+			    {
+			      LW_MACRO_SPRINTF1 (buffer, "%d",
+						 config->cpu_advantage);
+			      if (lw_sock_send_str (sock, buffer))
+				{
+				  LW_MACRO_SPRINTF1 (buffer, "%d",
+						     config->cpu_vs_human);
+				  if (lw_sock_send_str (sock, buffer))
+				    {
+				      LW_MACRO_SPRINTF1 (buffer, "%d",
+							 config->
+							 asm_algorithm);
+				      if (lw_sock_send_str (sock, buffer))
+					{
+					  LW_MACRO_SPRINTF1 (buffer, "%d",
+							     config->
+							     min_map_res);
+					  if (lw_sock_send_str (sock, buffer))
+					    {
+					      result = 1;
+					    }
+					}
+				    }
+				}
+			    }
+			}
+		    }
+		}
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Receives a config from the network
+ */
+int
+lw_netconf_recv (int *sock, LW_NETCONF * config)
+{
+  int result = 0;
+  char buffer[LW_SOCK_MESSAGE_SIZE];
+
+  memset (config, 0, sizeof (LW_NETCONF));
+
+  if (lw_sock_recv_str (sock, buffer))
+    {
+      config->cursor_increase_speed = atoi (buffer);
+      if (lw_sock_recv_str (sock, buffer))
+	{
+	  config->fighter_attack = atoi (buffer);
+	  if (lw_sock_recv_str (sock, buffer))
+	    {
+	      config->fighter_defense = atoi (buffer);
+	      if (lw_sock_recv_str (sock, buffer))
+		{
+		  config->fighter_new_health = atoi (buffer);
+		  if (lw_sock_recv_str (sock, buffer))
+		    {
+		      config->number_influence = atoi (buffer);
+		      if (lw_sock_recv_str (sock, buffer))
+			{
+			  config->fighter_number = atoi (buffer);
+			  if (lw_sock_recv_str (sock, buffer))
+			    {
+			      config->game_time = atoi (buffer);
+			      if (lw_sock_recv_str (sock, buffer))
+				{
+				  config->cpu_advantage = atoi (buffer);
+				  if (lw_sock_recv_str (sock, buffer))
+				    {
+				      config->cpu_vs_human = atoi (buffer);
+				      if (lw_sock_recv_str (sock, buffer))
+					{
+					  config->asm_algorithm =
+					    atoi (buffer);
+					  if (lw_sock_recv_str (sock, buffer))
+					    {
+					      config->min_map_res =
+						atoi (buffer);
+
+					      result = 1;
+					    }
+					}
+				    }
+				}
+			    }
+			}
+		    }
+		}
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Checks if all the values are within an acceptable range
+ */
+int
+lw_netconf_check (LW_NETCONF * config)
+{
+  int result = 1;
+
+  LW_NETCONF_CHECK_RANGE (cursor_increase_speed, 2);
+  LW_NETCONF_CHECK_RANGE (fighter_attack, 16);
+  LW_NETCONF_CHECK_RANGE (fighter_defense, 16);
+  LW_NETCONF_CHECK_RANGE (fighter_new_health, 16);
+  LW_NETCONF_CHECK_RANGE (number_influence, 16);
+  LW_NETCONF_CHECK_RANGE (fighter_number, 32);
+  LW_NETCONF_CHECK_RANGE (game_time, 16);
+  LW_NETCONF_CHECK_RANGE (cpu_advantage, 4);
+  LW_NETCONF_CHECK_RANGE (cpu_vs_human, 2);
+  LW_NETCONF_CHECK_RANGE (asm_algorithm, 1);
+  LW_NETCONF_CHECK_RANGE (min_map_res, 8);
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Prints the contents of a NETCONF object
+ */
+void
+lw_netconf_print (LW_NETCONF * config)
+{
+  LW_NETCONF_PRINT_VALUE (cursor_increase_speed);
+  LW_NETCONF_PRINT_VALUE (fighter_attack);
+  LW_NETCONF_PRINT_VALUE (fighter_defense);
+  LW_NETCONF_PRINT_VALUE (fighter_new_health);
+  LW_NETCONF_PRINT_VALUE (number_influence);
+  LW_NETCONF_PRINT_VALUE (fighter_number);
+  LW_NETCONF_PRINT_VALUE (game_time);
+  LW_NETCONF_PRINT_VALUE (cpu_advantage);
+  LW_NETCONF_PRINT_VALUE (cpu_vs_human);
+  LW_NETCONF_PRINT_VALUE (asm_algorithm);
+  LW_NETCONF_PRINT_VALUE (min_map_res);
+}

Added: unstable/liquidwar/branches/upstream/current/src/netconf.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/netconf.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/netconf.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,89 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : netconf.h                                        */
+/* content       : functions to transmit the conf over the network  */
+/* last update   : June 30th 2001                                   */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_NETCONF
+#define LIQUID_WAR_INCLUDE_NETCONF
+
+#include "base.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+
+typedef struct
+{
+  int cursor_increase_speed;
+  int fighter_attack;
+  int fighter_defense;
+  int fighter_new_health;
+  int number_influence;
+  int fighter_number;
+  int game_time;
+  int cpu_advantage;
+  int cpu_vs_human;
+  int asm_algorithm;
+  int min_map_res;
+}
+LW_NETCONF;
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+int lw_netconf_send (int *sock, LW_NETCONF * config);
+int lw_netconf_recv (int *sock, LW_NETCONF * config);
+int lw_netconf_check (LW_NETCONF * config);
+void lw_netconf_print (LW_NETCONF * config);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/netgame.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/netgame.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/netgame.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,198 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : netgame.c                                        */
+/* contenu       : netgame menu, where the client joins the server  */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdio.h>
+#include <string.h>
+
+#include "back.h"
+#include "base.h"
+#include "config.h"
+#include "decal.h"
+#include "dialog.h"
+#include "help.h"
+#include "menu.h"
+#include "play.h"
+#include "disk.h"
+#include "protocol.h"
+#include "sockgen.h"
+#include "server.h"
+#include "network.h"
+#include "keyexch.h"
+#include "error.h"
+#include "internet.h"
+#include "netplay.h"
+#include "lang.h"
+#include "netmess.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+network_game (void)
+{
+  DIALOG d[17];
+  int choix = 4, retour = 0;
+  char bufport[BUFFER_EDIT_NUMBER + 1];
+  int y0;
+
+  memset (d, 0, sizeof (d));
+
+  LW_NETWORK_ON = 1;
+
+  while (retour == 0)
+    {
+      LW_MACRO_SPRINTF1 (bufport, "%d", CONFIG_SERVER_PORT);
+
+      standard_button (d + 4, 0, 0, 1, 10);
+      standard_button (d + 5, 0, 2, 2, 10);
+      standard_button (d + 6, 0, 3, 2, 10);
+      standard_button (d + 7, 0, 4, 2, 10);
+      standard_button (d + 8, 1, 2, 2, 10);
+      standard_button (d + 9, 1, 3, 2, 10);
+      standard_button (d + 10, 1, 4, 2, 10);
+      standard_button (d + 11, 1, 2, 2, 10);
+      standard_button (d + 12, 1, 3, 2, 10);
+      standard_button (d + 13, 1, 4, 2, 10);
+      standard_big_button (d + 14, 0, 7, 1, 10);
+      y0 = d[14].y + d[14].h;
+      standard_big_button (d + 14, 0, 5, 1, 10);
+      d[14].h = y0 - d[14].y;
+      standard_big_button (d + 15, 0, 9, 1, 10);
+
+      quick_buttons (d);
+      d[4].dp = lw_lang_string (LW_LANG_STRING_NETGAME_STARTGAME);
+      d[5].dp = lw_lang_string (LW_LANG_STRING_NETGAME_SERVERADDR);
+      d[5].proc = my_textbox_proc;
+      d[6].dp = lw_lang_string (LW_LANG_STRING_NETGAME_SERVERPORT);
+      d[6].proc = my_textbox_proc;
+      d[7].dp = lw_lang_string (LW_LANG_STRING_NETGAME_PASSWORD);
+      d[7].proc = my_textbox_proc;
+      d[8].proc = d_box_proc;
+      d[9].proc = d_box_proc;
+      d[10].proc = d_box_proc;
+      d[11].dp = CONFIG_SERVER_ADDRESS;
+      d[11].d1 = SERVER_ADDRESS_SIZE;
+      d[11].proc = my_edit_proc;
+      d[11].flags = 0;
+      d[11].x++;
+      d[11].y++;
+      d[11].w -= 2;
+      d[11].h -= 2;
+      d[12].dp = bufport;
+      d[12].d1 = BUFFER_EDIT_NUMBER;
+      d[12].proc = my_edit_proc;
+      d[12].flags = 0;
+      d[12].x++;
+      d[12].y++;
+      d[12].w -= 2;
+      d[12].h -= 2;
+      d[12].d2 = d[9].d2 = 0;
+      d[13].dp = CONFIG_PASSWORD;
+      d[13].d1 = PASSWORD_SIZE;
+      d[13].proc = my_edit_proc;
+      d[13].flags = 0;
+      d[13].x++;
+      d[13].y++;
+      d[13].w -= 2;
+      d[13].h -= 2;
+      d[14].proc = my_textbox_proc;
+      d[14].dp = lw_lang_string (LW_LANG_STRING_NETGAME_WEAKPASSWORD);
+      d[15].dp = lw_lang_string (LW_LANG_STRING_NETGAME_SEARCH);
+      d[16].proc = 0;
+
+      choix = my_do_dialog (d, choix);
+
+      CONFIG_SERVER_PORT = atoi (bufport);
+      lw_netmess_cleanup_arg (CONFIG_PASSWORD);
+
+      switch (choix)
+	{
+	case -1:
+	case MENU_QUICK_BACK:
+	  retour = 1;
+	  break;
+	case MENU_QUICK_MAIN:
+	  retour = MENU_TOP;
+	  break;
+	case MENU_QUICK_QUIT:
+	  if (confirm_quit ())
+	    retour = MENU_EXIT;
+	  else
+	    display_back_image ();
+	  break;
+	case MENU_QUICK_PLAY:
+	case 4:
+	  /*
+	   * the "Play" and "Start game" buttons have the same meaning here,
+	   * so there's no break;
+	   */
+	  retour = netplay_sequence ();
+	  break;
+	case 15:
+	  retour = internet_find ();
+	  break;
+	}
+    }
+
+  if (retour > 0)
+    retour--;
+
+  return retour;
+}

Added: unstable/liquidwar/branches/upstream/current/src/netgame.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/netgame.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/netgame.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,63 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : netgame.h                                        */
+/* contenu       : netgame menu, where the client joins the server  */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_NETGAME
+#define LIQUID_WAR_INCLUDE_NETGAME
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int network_game (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/netkey.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/netkey.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/netkey.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,280 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : netkey.c                                         */
+/* content       : functions to manipulate network key messages     */
+/* last update   : June 20th 2001                                   */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+#include "netkey.h"
+#include "cursor.h"
+#include "sock2gen.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_NETKEY_SERIALIZED_SIZE (NB_TEAMS+2+4)
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*
+ * Used to store the information of a LW_NETKEY struct once it has
+ * been serialized to be sent over the network
+ */
+typedef unsigned char LW_NETKEY_SERIALIZED[LW_NETKEY_SERIALIZED_SIZE];
+
+/*==================================================================*/
+/* static functions declaration                                     */
+/*==================================================================*/
+
+static char int_to_ascii_hexa (int src);
+static int ascii_hexa_to_int (char src);
+static void encode (LW_NETKEY_SERIALIZED dst, LW_NETKEY * src);
+static void decode (LW_NETKEY * dst, LW_NETKEY_SERIALIZED src);
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Creates a blank netkey struct
+ */
+void
+lw_netkey_reset (LW_NETKEY * netkey)
+{
+  int i;
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      netkey->key_states[i] = 0;
+    }
+
+  netkey->cmd = LW_NETKEY_CMD_NONE;
+  netkey->arg = 0;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Transforms an integer into a readable hexadecimal ascii character
+ */
+static char
+int_to_ascii_hexa (int src)
+{
+  char dst;
+
+  dst = '0';
+  if (src >= 1 && src <= 9)
+    {
+      dst = '0' + src;
+    }
+  if (src >= 10 && src <= 15)
+    {
+      dst = 'A' - 10 + src;
+    }
+
+  return dst;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Transforms a readable hexadecimal ascii character into an integer
+ */
+static int
+ascii_hexa_to_int (char src)
+{
+  int dst;
+
+  dst = 0;
+  if (src >= '0' && src <= '9')
+    {
+      dst = src - '0';
+    }
+  if (src >= 'A' && src <= 'F')
+    {
+      dst = src - 'A' + 10;
+    }
+
+  return dst;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Serializes a LW_NETKEY struct to a buffer which is sendable over
+ * the network.
+ */
+static void
+encode (LW_NETKEY_SERIALIZED dst, LW_NETKEY * src)
+{
+  int i;
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      /*
+       * we translate each key press (stored as a logical or between
+       * 1,2,4 and 8) into a readable hexadecimal character. This
+       * makes debugging easier.
+       */
+      dst[i] = int_to_ascii_hexa (src->key_states[i]);
+    }
+
+  /*
+   * We store the command as is since it's already a character
+   */
+  dst[NB_TEAMS] = src->cmd;
+  /*
+   * We transform the argument since we assume it's a numeric arg
+   */
+  dst[NB_TEAMS + 1] = int_to_ascii_hexa (src->arg);
+
+  /*
+   * Now we serialize the "map checksum"
+   */
+  dst[NB_TEAMS + 2 + 0] = (src->checksum) & 0xFF;
+  dst[NB_TEAMS + 2 + 1] = (src->checksum >> 8) & 0xFF;
+  dst[NB_TEAMS + 2 + 2] = (src->checksum >> 16) & 0xFF;
+  dst[NB_TEAMS + 2 + 3] = (src->checksum >> 24) & 0xFF;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Un-serializes a LW_NETKEY struct from a buffer which has been
+ * received from the network.
+ */
+static void
+decode (LW_NETKEY * dst, LW_NETKEY_SERIALIZED src)
+{
+  int i;
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      /*
+       * we translate each key press (stored as a logical or between
+       * 1,2,4 and 8) from a readable hexadecimal character. This
+       * makes debugging easier.
+       */
+      dst->key_states[i] = ascii_hexa_to_int (src[i]);
+    }
+
+  /*
+   * We store the command as is since it's already a character
+   */
+  dst->cmd = src[NB_TEAMS];
+  /*
+   * We transform the argument since we assume it's a numeric arg
+   */
+  dst->arg = ascii_hexa_to_int (src[NB_TEAMS + 1]);
+
+  /*
+   * Now we serialize the "map checksum"
+   */
+  dst->checksum = ((unsigned int) src[NB_TEAMS + 2 + 3]) << 24
+    | ((unsigned int) src[NB_TEAMS + 2 + 2]) << 16
+    | ((unsigned int) src[NB_TEAMS + 2 + 1]) << 8
+    | ((unsigned int) src[NB_TEAMS + 2 + 0]);
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends a netkey information over the network
+ */
+int
+lw_netkey_send (int *sock, LW_NETKEY * netkey)
+{
+  int result;
+  LW_NETKEY_SERIALIZED netkey_serialized;
+
+  encode (netkey_serialized, netkey);
+
+  result = lw_sock_send_buffer (sock,
+				(char *) netkey_serialized,
+				LW_NETKEY_SERIALIZED_SIZE);
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Receives a netkey information from the network
+ */
+int
+lw_netkey_recv (int *sock, LW_NETKEY * netkey)
+{
+  int result;
+  LW_NETKEY_SERIALIZED netkey_serialized;
+
+  result = lw_sock_recv_buffer (sock,
+				(char *) netkey_serialized,
+				LW_NETKEY_SERIALIZED_SIZE);
+
+  decode (netkey, netkey_serialized);
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Returns true if at leat "num" keys are available on the socket
+ */
+int
+lw_netkey_peek (int *sock, int num)
+{
+  int result;
+
+  result = lw_sock_peek (sock, num * LW_NETKEY_SERIALIZED_SIZE);
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/netkey.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/netkey.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/netkey.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,92 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : netkey.h                                         */
+/* content       : functions to manipulate network key messages     */
+/* last update   : June 20th 2001                                   */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_NETKEY
+#define LIQUID_WAR_INCLUDE_NETKEY
+
+#include "base.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_NETKEY_CMD_NONE          'n'
+#define LW_NETKEY_CMD_QUIT          'q'
+#define LW_NETKEY_CMD_INCREASE_LAG  '+'
+#define LW_NETKEY_CMD_DECREASE_LAG  '-'
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+
+/*
+ * This structure is used to store the information about keys strokes
+ * sent over the network. The structure contains the keys plus
+ * 2 special fields: a command and a parameter.
+ */
+typedef struct
+{
+  int key_states[NB_TEAMS];	/* the keys states as in the cursor */
+  int cmd;			/* a special command                */
+  int arg;			/* an argument for the command      */
+  unsigned int checksum;
+}
+LW_NETKEY;
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+void lw_netkey_reset (LW_NETKEY * netkey);
+int lw_netkey_send (int *sock, LW_NETKEY * netkey);
+int lw_netkey_recv (int *sock, LW_NETKEY * netkey);
+int lw_netkey_peek (int *sock, int num);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/netmap.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/netmap.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/netmap.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,213 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : netmap.c                                         */
+/* content       : functions to transmit maps over the network      */
+/* last update   : June 30th 2001                                   */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "netmap.h"
+#include "log.h"
+#include "sock2gen.h"
+#include "serial.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_NETMAP_CHUNK_SIZE 64
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* static functions declaration                                     */
+/*==================================================================*/
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends a map over the network
+ */
+int
+lw_netmap_send (int *sock, void *netmap)
+{
+  int result = 0;
+  char *ptr;
+  unsigned char *header;
+  int size;
+  int sent;
+  int to_send;
+
+  ptr = (char *) netmap;
+  header = (unsigned char *) netmap;
+  if (lw_sock_send_buffer (sock, ptr, 8))
+    {
+      if (lw_sock_send_buffer (sock, ptr + 8, LW_MAP_SYSTEM_NAME_SIZE))
+	{
+	  if (lw_sock_send_buffer
+	      (sock, ptr + 8 + LW_MAP_SYSTEM_NAME_SIZE,
+	       LW_MAP_READABLE_NAME_SIZE))
+	    {
+	      lw_serial_get_map_header (netmap, &size, NULL, NULL);
+
+	      result = 1;
+	      sent = 0;
+	      while (sent < size && result)
+		{
+		  to_send = size - sent;
+		  if (to_send > LW_NETMAP_CHUNK_SIZE)
+		    {
+		      to_send = LW_NETMAP_CHUNK_SIZE;
+		    }
+		  if (lw_sock_send_buffer
+		      (sock,
+		       ptr + 8 + LW_MAP_SYSTEM_NAME_SIZE +
+		       LW_MAP_READABLE_NAME_SIZE + sent, to_send))
+		    {
+		      sent += to_send;
+		    }
+		  else
+		    {
+		      result = 0;
+		    }
+		}
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Receives a map from the network
+ */
+int
+lw_netmap_recv (int *sock, void **netmap)
+{
+  int result = 0;
+  char buffer[8 + LW_MAP_SYSTEM_NAME_SIZE + LW_MAP_READABLE_NAME_SIZE];
+  int size;
+  short w, h;
+  char *ptr;
+  int received;
+  int to_receive;
+
+  ptr = (char *) (*netmap);
+  if (ptr != NULL)
+    {
+      free (ptr);
+    }
+  ptr = NULL;
+
+  if (lw_sock_recv_buffer (sock, buffer, 8))
+    {
+      if (lw_sock_recv_buffer (sock, buffer + 8, LW_MAP_SYSTEM_NAME_SIZE))
+	{
+	  if (lw_sock_recv_buffer
+	      (sock, buffer + 8 + LW_MAP_SYSTEM_NAME_SIZE,
+	       LW_MAP_READABLE_NAME_SIZE))
+	    {
+	      lw_serial_get_map_header ((void *) buffer, &size, &w, &h);
+
+	      /*
+	       * A map under 3 bytes is reasonably not a "real" map...
+	       */
+	      if (size >= 10)
+		{
+		  ptr =
+		    malloc (size + 8 + LW_MAP_SYSTEM_NAME_SIZE +
+			    LW_MAP_READABLE_NAME_SIZE);
+		  if (ptr != NULL)
+		    {
+		      memcpy (ptr, buffer,
+			      8 + LW_MAP_SYSTEM_NAME_SIZE +
+			      LW_MAP_READABLE_NAME_SIZE);
+
+		      result = 1;
+		      received = 0;
+		      while (received < size && result)
+			{
+			  to_receive = size - received;
+			  if (to_receive > LW_NETMAP_CHUNK_SIZE)
+			    {
+			      to_receive = LW_NETMAP_CHUNK_SIZE;
+			    }
+
+			  if (lw_sock_recv_buffer
+			      (sock,
+			       ptr + 8 + LW_MAP_SYSTEM_NAME_SIZE +
+			       LW_MAP_READABLE_NAME_SIZE + received,
+			       to_receive))
+			    {
+			      received += to_receive;
+			    }
+			  else
+			    {
+			      result = 0;
+			    }
+			}
+		    }
+		}
+	    }
+	}
+    }
+
+  (*netmap) = (void *) ptr;
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/netmap.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/netmap.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/netmap.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,71 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : netmap.h                                         */
+/* content       : functions to transmit maps over the network      */
+/* last update   : June 30th 2001                                   */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_NETMAP
+#define LIQUID_WAR_INCLUDE_NETMAP
+
+#include "base.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+int lw_netmap_send (int *sock, void *netmap);
+int lw_netmap_recv (int *sock, void **netmap);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/netmess.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/netmess.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/netmess.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,472 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : netmess.c                                        */
+/* content       : functions to create and parse network messages   */
+/* last update   : April 14th 2001                                  */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+#include "netmess.h"
+
+/*==================================================================*/
+/* static functions declaration                                     */
+/*==================================================================*/
+
+static int eat_space (char **message);
+static int read_separator (char **message);
+static char *read_word (char **message);
+static int get_code (char **message);
+static int get_argc (char *message);
+static char **get_argv (char *message, int argc);
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * strcasecmp does not exists on win32, so we make it default to strcmp.
+ * It's not a big problem since case insensitive tests are usefull in
+ * developpement and network stuff is easier to test under UNIX anyway...
+ */
+#ifndef strcasecmp
+#define strcasecmp(A,B) strcmp((A),(B))
+#endif
+
+/*------------------------------------------------------------------*/
+/*
+ * Skip spaces, tabs and the likes.
+ */
+static int
+eat_space (char **message)
+{
+  int result = 0;
+
+  while (isspace (**message))
+    {
+      result++;
+      ++(*message);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Reads a separator token. The separator is ',' 
+ */
+static int
+read_separator (char **message)
+{
+  int result = 0;
+
+  eat_space (message);
+  if ((**message) == ',')
+    {
+      result++;
+      ++(*message);
+    }
+  eat_space (message);
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Reads a word, a number, basically what's between separators.
+ * The returned pointer must be disallocated with a "free".
+ */
+static char *
+read_word (char **message)
+{
+  char *begin = NULL;
+  char *result = NULL;
+  int len;
+  char quote_char;
+
+  eat_space (message);
+
+  quote_char = **message;
+
+  if (quote_char == '\"' || quote_char == '\'')
+    {
+      /*
+       * We handle strings quoted with ' or ".
+       * No escape character is handled yet...
+       */
+      ++(*message);
+
+      begin = *message;
+
+      while ((**message) != quote_char && (**message) != '\0')
+	{
+	  ++(*message);
+	}
+
+      len = (*message) - begin;
+
+      ++(*message);
+    }
+  else
+    {
+      begin = *message;
+
+      while ((!isspace (**message)) && (**message) != ','
+	     && (**message) != '\0')
+	{
+	  ++(*message);
+	}
+
+      len = (*message) - begin;
+    }
+
+  if (len >= 0)
+    {
+      result = (char *) malloc (len + 1);
+      if (result != NULL)
+	{
+	  if (len > 0)
+	    {
+	      strncpy (result, begin, len);
+	    }
+	  result[len] = 0;
+
+	  lw_netmess_cleanup_arg (result);
+	}
+    }
+  eat_space (message);
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Returns the code of the command.
+ */
+static int
+get_code (char **message)
+{
+  char *command;
+  int result = LW_NETMESS_CODE_UNKNOWN;
+
+  if (read_separator (message) == 0)
+    {
+      if ((command = read_word (message)) != NULL)
+	{
+	  if (strcasecmp (command, LW_NETMESS_TEXT_OK) == 0)
+	    {
+	      result = LW_NETMESS_CODE_OK;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_ERR) == 0)
+	    {
+	      result = LW_NETMESS_CODE_ERR;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_PING) == 0)
+	    {
+	      result = LW_NETMESS_CODE_PING;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_ECHO) == 0)
+	    {
+	      result = LW_NETMESS_CODE_ECHO;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_PROGRAM) == 0)
+	    {
+	      result = LW_NETMESS_CODE_PROGRAM;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_VERSION) == 0)
+	    {
+	      result = LW_NETMESS_CODE_VERSION;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_PASSWORD) == 0)
+	    {
+	      result = LW_NETMESS_CODE_PASSWORD;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_FREE) == 0)
+	    {
+	      result = LW_NETMESS_CODE_FREE;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_TEAM) == 0)
+	    {
+	      result = LW_NETMESS_CODE_TEAM;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_READY) == 0)
+	    {
+	      result = LW_NETMESS_CODE_READY;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_START) == 0)
+	    {
+	      result = LW_NETMESS_CODE_START;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_WAITING) == 0)
+	    {
+	      result = LW_NETMESS_CODE_WAITING;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_NEXT) == 0)
+	    {
+	      result = LW_NETMESS_CODE_NEXT;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_TEAMSTARTINFO) == 0)
+	    {
+	      result = LW_NETMESS_CODE_TEAMSTARTINFO;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_WHO) == 0)
+	    {
+	      result = LW_NETMESS_CODE_WHO;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_LOCAL) == 0)
+	    {
+	      result = LW_NETMESS_CODE_LOCAL;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_NETWORK) == 0)
+	    {
+	      result = LW_NETMESS_CODE_NETWORK;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_NOBODY) == 0)
+	    {
+	      result = LW_NETMESS_CODE_NOBODY;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_SENDMAP) == 0)
+	    {
+	      result = LW_NETMESS_CODE_SENDMAP;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_RECVMAP) == 0)
+	    {
+	      result = LW_NETMESS_CODE_RECVMAP;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_SENDCONFIG) == 0)
+	    {
+	      result = LW_NETMESS_CODE_SENDCONFIG;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_RECVCONFIG) == 0)
+	    {
+	      result = LW_NETMESS_CODE_RECVCONFIG;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_CHATTALK) == 0)
+	    {
+	      result = LW_NETMESS_CODE_CHATTALK;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_CHATLISTEN) == 0)
+	    {
+	      result = LW_NETMESS_CODE_CHATLISTEN;
+	    }
+	  else if (strcasecmp (command, LW_NETMESS_TEXT_QUIT) == 0)
+	    {
+	      result = LW_NETMESS_CODE_QUIT;
+	    }
+
+	  free (command);
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/* 
+ * Gets the number of arguments in the message.
+ * It's a little different from the C convention used in main(),
+ * since 0 means "0 args" (whereas in main() 0 args corresponds to argc==1).
+ */
+static int
+get_argc (char *message)
+{
+  int result = 0;
+  char *word = NULL;
+  int null_arg = 0;
+
+  if (read_separator (&message) == 0)
+    {
+      if (message[0] == '\0')
+	{
+	  null_arg = 1;
+	}
+
+      word = read_word (&message);
+      if (word != NULL)
+	{
+	  free (word);
+	  result = 1;
+	  while (read_separator (&message) == 1)
+	    {
+	      word = read_word (&message);
+	      if (word != NULL)
+		{
+		  free (word);
+		  result++;
+		}
+	    }
+	}
+    }
+
+  if (result == 1 && null_arg)
+    {
+      result = 0;
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Parses all the arguments of the message.
+ */
+static char **
+get_argv (char *message, int argc)
+{
+  char **result = NULL;
+  char *word;
+  int i = 0;
+
+  if (argc > 0 && read_separator (&message) == 0)
+    {
+      result = (char **) malloc (argc * sizeof (char *));
+      if (result != NULL)
+	{
+	  word = read_word (&message);
+	  if (word != NULL)
+	    {
+	      result[i] = word;
+	      i = 1;
+	      while (i < argc && read_separator (&message) == 1)
+		{
+		  word = read_word (&message);
+		  if (word != NULL)
+		    {
+		      result[i] = word;
+		      i++;
+		    }
+		}
+	    }
+	}
+      if (i != argc)
+	{
+	  free (result);
+	  result = NULL;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Parses and interprets a network message.
+ * The syntaxe must be "COMMAND arg1,arg2,arg3,...".
+ * This function should never fail, unless there are some problems
+ * in memory allocation. Parsing an invalid message should simply
+ * return a LW_NETMESS_CODE_UNKNOWN type with no args at all.
+ * It's important to free the obtained pointer with lw_netmess_free.
+ */
+LW_NETMESS *
+lw_netmess_read (char *message)
+{
+  LW_NETMESS *result = NULL;
+
+  result = (LW_NETMESS *) malloc (sizeof (LW_NETMESS));
+  if (result != NULL)
+    {
+      result->code = get_code (&message);
+      result->argc = get_argc (message);
+      result->argv = get_argv (message, result->argc);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * To be called after each successfull call to lw_netmess_read
+ * This function calls free() internally.
+ */
+void
+lw_netmess_free (LW_NETMESS * ptr)
+{
+  int i;
+
+  if (ptr != NULL)
+    {
+      if (ptr->argv != NULL)
+	{
+	  for (i = 0; i < ptr->argc; ++i)
+	    {
+	      free (ptr->argv[i]);
+	    }
+	  if (ptr->argc > 0)
+	    {
+	      free (ptr->argv);
+	    }
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Cleanups strings so that they can be used as arguments in
+ * network messages
+ */
+void
+lw_netmess_cleanup_arg (char *string)
+{
+  char *pos;
+  unsigned char c;
+
+  pos = string;
+  while ((c = *pos) != '\0')
+    {
+      if (c < 32 || c > 127 || strchr ("'\",", c))
+	{
+	  (*pos) = ' ';
+	}
+      pos++;
+    }
+}

Added: unstable/liquidwar/branches/upstream/current/src/netmess.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/netmess.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/netmess.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,139 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : netmess.h                                        */
+/* content       : functions to create and parse network messages   */
+/* last update   : April 14th 2001                                  */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_NETMESS
+#define LIQUID_WAR_INCLUDE_NETMESS
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+
+/*
+ * This structure is used to retrieve the informations about a
+ * network message. The advantage of using this is that it makes
+ * various checks about the syntax of messages and one can use
+ * C switches on the message code since it's an integer.
+ * Without this one would spent one's time writting boring code
+ * full of "strcmp" and the likes...
+ */
+typedef struct
+{
+  int argc;			/* the number of arguments                          */
+  int code;			/* the code of the command (ex: LW_NETMESS_CODE_OK) */
+  char **argv;			/* the parsed arguments, like in the main() func    */
+}
+LW_NETMESS;
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_NETMESS_CODE_UNKNOWN        0
+#define LW_NETMESS_CODE_OK             1
+#define LW_NETMESS_CODE_ERR            2
+#define LW_NETMESS_CODE_PING           3
+#define LW_NETMESS_CODE_ECHO           4
+#define LW_NETMESS_CODE_PROGRAM        5
+#define LW_NETMESS_CODE_VERSION        6
+#define LW_NETMESS_CODE_PASSWORD       7
+#define LW_NETMESS_CODE_FREE           8
+#define LW_NETMESS_CODE_TEAM           9
+#define LW_NETMESS_CODE_READY         10
+#define LW_NETMESS_CODE_START         11
+#define LW_NETMESS_CODE_WAITING       12
+#define LW_NETMESS_CODE_NEXT          13
+#define LW_NETMESS_CODE_TEAMSTARTINFO 14
+#define LW_NETMESS_CODE_WHO           15
+#define LW_NETMESS_CODE_LOCAL         16
+#define LW_NETMESS_CODE_NETWORK       17
+#define LW_NETMESS_CODE_NOBODY        18
+#define LW_NETMESS_CODE_SENDMAP       19
+#define LW_NETMESS_CODE_RECVMAP       20
+#define LW_NETMESS_CODE_SENDCONFIG    21
+#define LW_NETMESS_CODE_RECVCONFIG    22
+#define LW_NETMESS_CODE_CHATTALK      23
+#define LW_NETMESS_CODE_CHATLISTEN    24
+#define LW_NETMESS_CODE_QUIT          25
+
+#define LW_NETMESS_TEXT_OK            "OK"
+#define LW_NETMESS_TEXT_ERR           "ERR"
+#define LW_NETMESS_TEXT_PING          "PING"
+#define LW_NETMESS_TEXT_ECHO          "ECHO"
+#define LW_NETMESS_TEXT_PROGRAM       "PROGRAM"
+#define LW_NETMESS_TEXT_VERSION       "VERSION"
+#define LW_NETMESS_TEXT_PASSWORD      "PASSWORD"
+#define LW_NETMESS_TEXT_FREE          "FREE"
+#define LW_NETMESS_TEXT_TEAM          "TEAM"
+#define LW_NETMESS_TEXT_READY         "READY"
+#define LW_NETMESS_TEXT_START         "START"
+#define LW_NETMESS_TEXT_WAITING       "WAITING"
+#define LW_NETMESS_TEXT_NEXT          "NEXT"
+#define LW_NETMESS_TEXT_TEAMSTARTINFO "TEAMSTARTINFO"
+#define LW_NETMESS_TEXT_WHO           "WHO"
+#define LW_NETMESS_TEXT_LOCAL         "LOCAL"
+#define LW_NETMESS_TEXT_NETWORK       "NETWORK"
+#define LW_NETMESS_TEXT_NOBODY        "NOBODY"
+#define LW_NETMESS_TEXT_SENDMAP       "SENDMAP"
+#define LW_NETMESS_TEXT_RECVMAP       "RECVMAP"
+#define LW_NETMESS_TEXT_SENDCONFIG    "SENDCONFIG"
+#define LW_NETMESS_TEXT_RECVCONFIG    "RECVCONFIG"
+#define LW_NETMESS_TEXT_CHATTALK      "CHATTALK"
+#define LW_NETMESS_TEXT_CHATLISTEN    "CHATLISTEN"
+#define LW_NETMESS_TEXT_QUIT          "QUIT"
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+extern LW_NETMESS *lw_netmess_read (char *message);
+extern void lw_netmess_free (LW_NETMESS * ptr);
+extern void lw_netmess_cleanup_arg (char *string);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/netplay.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/netplay.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/netplay.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,514 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : netplay.c                                        */
+/* content       : function which launches a network game           */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+#include <stdlib.h>
+
+#include "back.h"
+#include "base.h"
+#include "config.h"
+#include "decal.h"
+#include "dialog.h"
+#include "help.h"
+#include "menu.h"
+#include "play.h"
+#include "disk.h"
+#include "protocol.h"
+#include "sockgen.h"
+#include "server.h"
+#include "network.h"
+#include "keyexch.h"
+#include "error.h"
+#include "internet.h"
+#include "netplay.h"
+#include "lang.h"
+#include "log.h"
+#include "connect.h"
+#include "thrdgen.h"
+#include "exit.h"
+#include "capture.h"
+#include "random.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_NETPLAY_DELAY 10
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+
+typedef struct
+{
+  int sock;
+  char address[LW_SOCK_IP_SIZE];
+  int port;
+  int running;
+  int allow_exit;
+  int free_data;
+  int result;
+}
+LW_NETPLAY_CONNECT_DATA;
+
+/*==================================================================*/
+/* static functions                                                 */
+/*==================================================================*/
+
+static int connect_on_server_start (int *sock, char *ip, int port);
+static int connect_on_server_continue (int sock);
+static void connect_on_server_start_callback (void *arg);
+static int connect_on_server_finish (int sock);
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * The equivalent of play_sequence, but for a network game.
+ * Basically, this is the function called when you press "play" 
+ * to launch a network game.
+ */
+int
+netplay_sequence ()
+{
+  int sock = -1;
+  int result = 0;
+
+  lw_config_set_current_rules_to_default ();
+
+  if (connect_on_server_start (&sock,
+			       CONFIG_SERVER_ADDRESS, CONFIG_SERVER_PORT))
+    {
+      if (connect_on_server_continue (sock))
+	{
+	  result = lw_connect_menu (sock);
+
+	  if (result == MENU_OK)
+	    {
+	      if (connect_on_server_finish (sock))
+		{
+		  LW_NETWORK_ON = 1;
+		  lw_network_attribute_colors ();
+		  lw_network_attribute_parts ();
+		  result = play_sequence_ex ();
+		}
+	    }
+	}
+    }
+
+  LW_KEYEXCH_SOCK = -1;
+  lw_sock_close (&sock);
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Opens the socket on the server. This is a little complex, for we
+ * fire an extra thread so that if things go slow, the player can
+ * use ESCAPE to stop everything.
+ */
+static int
+connect_on_server_start (int *sock, char *address, int port)
+{
+  int result = 1;
+  LW_NETPLAY_CONNECT_DATA *connect_data;
+  LW_NETPLAY_CONNECT_DATA connect_data_stack;
+  int esc_pressed = 0;
+  int dummy;
+
+  connect_data = (LW_NETPLAY_CONNECT_DATA *)
+    malloc (sizeof (LW_NETPLAY_CONNECT_DATA));
+  if (!connect_data)
+    {
+      /*
+       * Couldn't allocate, fallback on stack data
+       */
+      connect_data = &connect_data_stack;
+    }
+
+  connect_data->sock = -1;
+  strncpy (connect_data->address, address, sizeof (connect_data->address));
+  connect_data->address[sizeof (connect_data->address) - 1] = '\0';
+  connect_data->port = port;
+  connect_data->running = 0;
+  connect_data->allow_exit = 0;
+  connect_data->free_data = 1;
+  connect_data->result = 0;
+
+  display_center_message (lw_lang_string (LW_LANG_STRING_NETPLAY_CONNECT));
+
+  connect_data->running = 1;
+  if (connect_data != &connect_data_stack &&
+      lw_thread_start (connect_on_server_start_callback, connect_data))
+    {
+      /*
+       * Everything's OK, do nothing!
+       */
+    }
+  else
+    {
+      /*
+       * Memory or thread error, we're in trouble,
+       * we fallback on calling the function in the main thread
+       * with the data allocated in the stack.
+       */
+      connect_data->free_data = 0;
+      connect_on_server_start_callback (connect_data);
+    }
+
+  /*
+   * We wait until the thread is finished and/or the player
+   * pressed ESC
+   */
+  while (connect_data->running && !esc_pressed)
+    {
+      if (key[KEY_ESC])
+	{
+	  esc_pressed = 1;
+	}
+      /*
+       * We call keypressed() to force Allegro to call automatically
+       * poll_keyboard() if needed
+       */
+      dummy = keypressed ();
+      rest (LW_NETPLAY_DELAY);
+      lw_capture_dump_menu ();
+      my_exit_poll ();
+    }
+
+  result = connect_data->result;
+  *sock = connect_data->sock;
+
+  if (!result)
+    {
+      *sock = -1;
+      if (!esc_pressed)
+	{
+	  error_unable_to_connect ();
+	}
+    }
+
+  /*
+   * We tell the thread that it can exit whenever it wants,
+   * we don't care, it has its own data...
+   */
+  connect_data->allow_exit = 1;
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Callback used by the thread launched by connect_on_server_start
+ * to open the TCP/IP connection with the server
+ */
+static void
+connect_on_server_start_callback (void *arg)
+{
+  LW_NETPLAY_CONNECT_DATA *connect_data;
+
+  connect_data = (LW_NETPLAY_CONNECT_DATA *) arg;
+
+  connect_data->result = lw_sock_connect (&(connect_data->sock),
+					  connect_data->address,
+					  connect_data->port);
+  connect_data->running = 0;
+
+  /*
+   * Now we wait until the main threads tells us we can stop.
+   * It's important for we must not free the data too early...
+   */
+  while (!connect_data->allow_exit)
+    {
+      rest (LW_NETPLAY_DELAY);
+    }
+
+  if (connect_data->free_data)
+    {
+      free (connect_data);
+    }
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Exchanges some messages with the server,
+ * and displays message boxes to the player so that he has an idea
+ * of what's going on.
+ */
+static int
+connect_on_server_continue (int sock)
+{
+  int result = 1;
+  int free_teams;
+  int i;
+
+  if (result == 1)
+    {
+      display_center_message (lw_lang_string (LW_LANG_STRING_NETPLAY_PING));
+      if (!lw_protocol_do_ping (&sock))
+	{
+	  result = 0;
+	  error_not_a_liquidwar_server ();
+	}
+    }
+
+  if (result == 1)
+    {
+      display_center_message (lw_lang_string
+			      (LW_LANG_STRING_NETPLAY_CHECKPROGRAM));
+      if (!lw_protocol_tell_program (&sock, LW_PROGRAM))
+	{
+	  result = 0;
+	  error_not_a_liquidwar_server ();
+	}
+    }
+  if (result == 1)
+    {
+      display_center_message (lw_lang_string
+			      (LW_LANG_STRING_NETPLAY_CHECKVERSION));
+      if (!lw_protocol_tell_version (&sock, LW_VERSION))
+	{
+	  result = 0;
+	  error_wrong_version ();
+	}
+    }
+
+  if (result == 1)
+    {
+      display_center_message (lw_lang_string
+			      (LW_LANG_STRING_NETPLAY_SENDPASSWORD));
+      if (!lw_protocol_tell_password (&sock, CONFIG_PASSWORD))
+	{
+	  result = 0;
+	  error_bad_password ();
+	}
+    }
+
+  if (result == 1)
+    {
+      display_center_message (lw_lang_string
+			      (LW_LANG_STRING_NETPLAY_FREETEAMS));
+      if (lw_protocol_ask_free_teams (&sock, &free_teams))
+	{
+	  if (free_teams <= 0)
+	    {
+	      result = 0;
+	      error_server_full ();
+	    }
+	}
+      else
+	{
+	  result = 0;
+	  error_network_problem ();
+	}
+    }
+
+  if (result == 1)
+    {
+      display_center_message (lw_lang_string
+			      (LW_LANG_STRING_NETPLAY_RESERVETEAMS));
+      for (i = 0; i < NB_TEAMS && free_teams > 0 && result == 1; ++i)
+	{
+	  if (CONFIG_CONTROL_TYPE[i] == CONFIG_CONTROL_TYPE_HUMAN ||
+	      ((CONFIG_CONTROL_TYPE[i] == CONFIG_CONTROL_TYPE_CPU) &&
+	       CONFIG_ALLOW_NETWORK_BOTS))
+	    {
+	      if (lw_protocol_reserve_team (&sock, i,
+					    CONFIG_CONTROL_TYPE[i],
+					    CONFIG_PLAYER_NAME[i]))
+		{
+		  free_teams--;
+		}
+	      else
+		{
+		  result = 0;
+		  error_network_problem ();
+		}
+	    }
+	}
+    }
+
+  if (result == 1)
+    {
+      display_center_message (lw_lang_string
+			      (LW_LANG_STRING_NETPLAY_SENDCONFIG));
+      if (!lw_protocol_send_config (&sock))
+	{
+	  result = 0;
+	  error_network_problem ();
+	}
+    }
+
+  if (result == 1)
+    {
+      display_center_message (lw_lang_string
+			      (LW_LANG_STRING_NETPLAY_SENDMAP));
+      if (!lw_protocol_send_map
+	  (&sock,
+	   LW_RANDOM_ON ? LW_RANDOM_RAW_MAP :
+	   RAW_MAP_ORDERED[CONFIG_LEVEL_MAP]))
+	{
+	  result = 0;
+	  error_cant_send_map ();
+	}
+    }
+
+  if (result == 1)
+    {
+      display_center_message (lw_lang_string
+			      (LW_LANG_STRING_NETPLAY_WAITING));
+      if (!lw_protocol_i_am_ready (&sock))
+	{
+	  result = 0;
+	  error_network_problem ();
+	}
+    }
+
+  /*
+   * if the operation succeded, we set the global value LW_KEYEXCH_SOCK
+   * to the right socket, otherwise functions from lw_keyech won't work...
+   */
+  if (result)
+    {
+      LW_KEYEXCH_SOCK = sock;
+    }
+  else
+    {
+      LW_KEYEXCH_SOCK = -1;
+      lw_sock_close (&sock);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Retrieves informations from the server once all players are
+ * connected. Also displays information in a dialog box.
+ */
+static int
+connect_on_server_finish (int sock)
+{
+  int result = 1;
+  int i;
+
+  if (result == 1)
+    {
+      display_center_message (lw_lang_string
+			      (LW_LANG_STRING_NETPLAY_WHOPLAYS));
+      for (i = 0; i < NB_TEAMS && result == 1; ++i)
+	{
+	  if (!lw_protocol_ask_who (&sock, i, &(LW_NETWORK_INFO[i])))
+	    {
+	      result = 0;
+	      error_network_problem ();
+	    }
+	}
+    }
+
+  if (result == 1)
+    {
+      display_center_message (lw_lang_string
+			      (LW_LANG_STRING_NETPLAY_RECVCONFIG));
+      if (!lw_protocol_recv_config (&sock))
+	{
+	  result = 0;
+	  error_network_problem ();
+	}
+    }
+
+  if (result == 1)
+    {
+      if (!lw_netconf_check (&LW_CONFIG_CURRENT_RULES))
+	{
+	  result = 0;
+	  error_bad_config_range ();
+	}
+    }
+
+  if (result == 1)
+    {
+      display_center_message (lw_lang_string
+			      (LW_LANG_STRING_NETPLAY_RECVMAP));
+      if (!lw_protocol_recv_map (&sock, &LW_NETWORK_RAW_MAP))
+	{
+	  result = 0;
+	  error_cant_receive_map ();
+	}
+    }
+
+  if (result == 1)
+    {
+      display_center_message (lw_lang_string
+			      (LW_LANG_STRING_NETPLAY_WAITING));
+      if (!lw_protocol_i_am_ready (&sock))
+	{
+	  result = 0;
+	  error_network_problem ();
+	}
+    }
+
+  /*
+   * We close the socket if something failed
+   */
+  if (!result)
+    {
+      LW_KEYEXCH_SOCK = -1;
+      lw_sock_close (&sock);
+    }
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/netplay.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/netplay.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/netplay.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,67 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : netplay.h                                        */
+/* content       : function which launches a network game           */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_NETPLAY
+#define LIQUID_WAR_INCLUDE_NETPLAY
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int netplay_sequence (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/network.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/network.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/network.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,249 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : network.c                                        */
+/* content       : various network related stuff                    */
+/* last update   : may 8th 2001                                     */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdlib.h>
+
+#include <allegro.h>
+
+#include "network.h"
+#include "config.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_NETWORK_COLOR_NB               12
+#define LW_NETWORK_COLOR_DIST_MAXINT 1000000
+#define LW_NETWORK_COLOR_DIST_SCALE     1000
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+int LW_NETWORK_ON = 0;
+LW_WHO LW_NETWORK_INFO[NB_TEAMS];
+int LW_NETWORK_ERROR_DETECTED = 0;
+void *LW_NETWORK_RAW_MAP = NULL;
+
+/*==================================================================*/
+/* static funcs                                                     */
+/*==================================================================*/
+
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Returns the "distance" of 2 colors. For 2 adjacent which look
+ * about the sane, it is 1. For radicaly different colors, it is
+ * 6. If the colors are the same, it is 0.
+ */
+int
+distance_between_colors (int col1, int col2)
+{
+  int dist;
+
+  if (col1 < 0 || col2 < 0)
+    {
+      /*
+       * Now if one of the member was -1, we
+       * consider the colors are "far"
+       * from each other.
+       */
+      dist = 6;
+    }
+  else
+    {
+      dist = abs (col1 - col2);
+    }
+
+  if (dist > LW_NETWORK_COLOR_NB)
+    {
+      /*
+       * Normally we should never get here...
+       */
+      dist = LW_NETWORK_COLOR_NB / 2;
+    }
+
+  if (dist > LW_NETWORK_COLOR_NB / 2)
+    {
+      dist = LW_NETWORK_COLOR_NB - dist;
+    }
+
+  return dist;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Calculates the "most different color", considering the colors 
+ * already chosen in LW_NETWORK_INFO.
+ */
+int
+choose_different_color ()
+{
+  int color;
+  int closeness[LW_NETWORK_COLOR_NB];
+  int closeness_min;
+  int dist;
+  int i, j;
+
+  /*
+   * We calculate the "closeness" of each color
+   */
+  for (i = 0; i < LW_NETWORK_COLOR_NB; ++i)
+    {
+      closeness[i] = 0;
+      for (j = 0; j < NB_TEAMS; ++j)
+	{
+	  if (LW_NETWORK_INFO[j].active)
+	    {
+	      dist = distance_between_colors (LW_NETWORK_INFO[j].color, i);
+	      if (dist > 0)
+		{
+		  if (LW_NETWORK_INFO[j].network)
+		    {
+		      /*
+		       * We consider network color conflicts
+		       * to be less important than conflicts with
+		       * local colors, therefore we increase the
+		       * distance for network teams.
+		       */
+		      dist++;
+		    }
+		  closeness[i] += LW_NETWORK_COLOR_DIST_SCALE / (dist * dist);
+		}
+	      else
+		{
+		  closeness[i] = LW_NETWORK_COLOR_DIST_MAXINT;
+		}
+	    }
+	}
+    }
+
+  /*
+   * And now we pick up the one that has the less common points
+   * with existing colors.
+   */
+  closeness_min = LW_NETWORK_COLOR_DIST_MAXINT;
+  color = 0;
+  for (i = 0; i < LW_NETWORK_COLOR_NB; ++i)
+    {
+      if (closeness[i] < closeness_min)
+	{
+	  color = i;
+	  closeness_min = closeness[i];
+	}
+    }
+
+  return color;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Associates a color to each team 
+ */
+void
+lw_network_attribute_colors ()
+{
+  int i, color;
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      if (LW_NETWORK_INFO[i].active)
+	{
+	  if (LW_NETWORK_INFO[i].network)
+	    {
+	      /*
+	       * -1 is a temporary value which will be overwritten
+	       * by the _real_ value later
+	       */
+	      LW_NETWORK_INFO[i].color = -1;
+	    }
+	  else
+	    {
+	      LW_NETWORK_INFO[i].color = CONFIG_TEAM_COLOR[i];
+	    }
+	}
+    }
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      if (LW_NETWORK_INFO[i].active && LW_NETWORK_INFO[i].network)
+	{
+	  color = choose_different_color ();
+	  LW_NETWORK_INFO[i].color = color;
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Associates a part to each team 
+ */
+void
+lw_network_attribute_parts ()
+{
+  int i;
+  static int order[NB_TEAMS] = { 0, 5, 2, 3, 1, 4 };
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      if (LW_NETWORK_INFO[i].active)
+	{
+	  LW_NETWORK_INFO[i].part = order[LW_NETWORK_INFO[i].server_id];
+	}
+    }
+}

Added: unstable/liquidwar/branches/upstream/current/src/network.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/network.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/network.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,92 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : network.h                                        */
+/* content       : various network related stuff                    */
+/* last update   : may 8th 2001                                     */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_NETWORK
+#define LIQUID_WAR_INCLUDE_NETWORK
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "base.h"
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+
+typedef struct
+{
+  int active;
+  int network;
+  int server_id;
+  int control_type;
+  int color;
+  int part;
+  char name[NAME_SIZE + 1];
+}
+LW_WHO;
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+extern int LW_NETWORK_ON;
+extern LW_WHO LW_NETWORK_INFO[NB_TEAMS];
+extern int LW_NETWORK_ERROR_DETECTED;
+extern void *LW_NETWORK_RAW_MAP;
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+extern void lw_network_attribute_colors ();
+extern void lw_network_attribute_parts ();
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/options.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/options.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/options.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,197 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : options.c                                        */
+/* contenu       : choix des options                                */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+
+#include "back.h"
+#include "base.h"
+#include "config.h"
+#include "decal.h"
+#include "dialog.h"
+#include "disk.h"
+#include "graphics.h"
+#include "help.h"
+#include "menu.h"
+#include "options.h"
+#include "sound.h"
+#include "rules.h"
+#include "volume.h"
+#include "speeds.h"
+#include "language.h"
+#include "controls.h"
+#include "lang.h"
+#include "gfxmode.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+options (void)
+{
+  DIALOG d[12];
+  DIALOG_PLAYER *dp;
+  int i, choix = 4, retour = 0;
+  int old_gfx_menu;
+  int old_fullscreen;
+  int gfxmode_change = 0;
+
+  memset (d, 0, sizeof (d));
+
+  while (retour == 0)
+    {
+      for (i = 0; i < 6; ++i)
+	standard_button (d + i + 4, 0, i, 1, 8);
+      standard_button (d + 10, 0, 7, 1, 8);
+
+      quick_buttons (d);
+      d[4].dp = lw_lang_string (LW_LANG_STRING_OPTIONS_GRAPHICS);
+      d[5].dp = lw_lang_string (LW_LANG_STRING_OPTIONS_SOUND);
+      d[6].dp = lw_lang_string (LW_LANG_STRING_OPTIONS_RULES);
+      d[7].dp = lw_lang_string (LW_LANG_STRING_OPTIONS_SPEEDS);
+      d[8].dp = lw_lang_string (LW_LANG_STRING_OPTIONS_CONTROLS);
+      d[9].dp = lw_lang_string (LW_LANG_STRING_OPTIONS_LANGUAGE);
+      d[10].dp = lw_lang_string (LW_LANG_STRING_OPTIONS_DEFAULT);
+      d[11].proc = 0;
+
+      old_gfx_menu = CONFIG_GFX_MENU;
+      old_fullscreen = CONFIG_FULLSCREEN;
+
+      display_back_image ();
+      if (gfxmode_change)
+	{
+	  gfxmode_change = 0;
+	  display_back_image ();
+	  dp = my_init_dialog (d, choix);
+	  my_fade_in ();
+	}
+      else
+	{
+	  dp = my_init_dialog (d, choix);
+	}
+
+      show_mouse (screen);
+      while (my_update_dialog (dp))
+	;
+      choix = shutdown_dialog (dp);
+
+      play_click ();
+
+      switch (choix)
+	{
+	case -1:
+	case MENU_QUICK_BACK:
+	  retour = 1;
+	  break;
+	case MENU_QUICK_MAIN:
+	  retour = MENU_TOP;
+	  break;
+	case MENU_QUICK_QUIT:
+	  if (confirm_quit ())
+	    retour = MENU_EXIT;
+	  else
+	    display_back_image ();
+	  break;
+	case MENU_QUICK_PLAY:
+	  retour = MENU_PLAY;
+	  break;
+	case 4:
+	  retour = graphic_options ();
+	  break;
+	case 5:
+	  retour = sound_options ();
+	  break;
+	case 6:
+	  retour = rules_options ();
+	  break;
+	case 7:
+	  retour = speeds_options ();
+	  break;
+	case 8:
+	  retour = controls_options ();
+	  break;
+	case 9:
+	  retour = language_options ();
+	  break;
+	case 10:
+	  load_default_options ();
+
+	  /*
+	   * The volume might have changed, so we update it
+	   */
+	  WATER_VOLUME = CONFIG_WATER_VOLUME_MENU;
+	  /*
+	   * If the graphics settings changed, we reflect them
+	   */
+	  if (old_gfx_menu != CONFIG_GFX_MENU ||
+	      old_fullscreen != CONFIG_FULLSCREEN)
+	    {
+	      gfxmode_change = 1;
+	      set_resolution (CONFIG_GFX_MENU, 0, CONFIG_FULLSCREEN, NULL);
+	    }
+	  retour = 0;
+	  break;
+	}
+    }
+
+  if (retour > 0)
+    retour--;
+
+  return retour;
+}

Added: unstable/liquidwar/branches/upstream/current/src/options.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/options.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/options.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,68 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : options.h                                        */
+/* contenu       : choix des options                                */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_OPTIONS
+#define LIQUID_WAR_INCLUDE_OPTIONS
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int options (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/palette.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/palette.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/palette.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,421 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : palette.c                                        */
+/* contenu       : gestion de la palette de couleurs                */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "config.h"
+#include "decal.h"
+#include "disk.h"
+#include "palette.h"
+#include "network.h"
+#include "mouse.h"
+#include "texture.h"
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+#define BG_TEXTURE_DEFAULT_COLOR 120
+#define FG_TEXTURE_DEFAULT_COLOR 127
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+int COLORS_PER_TEAM = 0;
+PALETTE GLOBAL_PALETTE;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/* mise en place de la palette, si necessaire                       */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+static int
+sqrt255 (int i)
+{
+  int result;
+
+  result = fsqrt (i * 256) / 256;
+  if (result > 255)
+    result = 255;
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+static int
+sqr255 (int i)
+{
+  int result;
+
+  result = (i * i) / 256;
+  if (result > 255)
+    result = 255;
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+static void
+change_palette_brightness (PALETTE old_pal, PALETTE new_pal)
+{
+  int r, g, b;
+  int i;
+  int brightness;
+  RGB *rgb;
+
+  brightness = CONFIG_BRIGHTNESS - 8;
+  if (brightness != 0)
+    for (i = 0; i < 256; ++i)
+      {
+	rgb = old_pal + i;
+	r = rgb->r * 4;
+	g = rgb->g * 4;
+	b = rgb->b * 4;
+
+	if (brightness > 0)
+	  {
+	    r = (brightness * sqrt255 (r) + (8 - brightness) * r) / 8;
+	    g = (brightness * sqrt255 (g) + (8 - brightness) * g) / 8;
+	    b = (brightness * sqrt255 (b) + (8 - brightness) * b) / 8;
+	  }
+	if (brightness < 0)
+	  {
+	    r = (-brightness * sqr255 (r) + (8 + brightness) * r) / 8;
+	    g = (-brightness * sqr255 (g) + (8 + brightness) * g) / 8;
+	    b = (-brightness * sqr255 (b) + (8 + brightness) * b) / 8;
+	  }
+
+	rgb = new_pal + i;
+	rgb->r = r / 4;
+	rgb->g = g / 4;
+	rgb->b = b / 4;
+      }
+  else
+    for (i = 0; i < 256; ++i)
+      new_pal[i] = old_pal[i];
+}
+
+/*------------------------------------------------------------------*/
+void
+my_set_palette (void)
+{
+  PALETTE old_pal, corrected_pal;
+  int i, equal = 1;
+
+  change_palette_brightness (GLOBAL_PALETTE, corrected_pal);
+
+  get_palette (old_pal);
+  for (i = 0; i < 256 && equal; ++i)
+    {
+      equal = equal && (corrected_pal[i].r == old_pal[i].r);
+      equal = equal && (corrected_pal[i].g == old_pal[i].g);
+      equal = equal && (corrected_pal[i].b == old_pal[i].b);
+    }
+  if (!equal)
+    set_palette (corrected_pal);
+}
+
+/*------------------------------------------------------------------*/
+static void
+set_raw_texture_palette (void *ptr, int first)
+{
+  int i;
+  char *data;
+
+  data = ptr;
+  data += 4 + LW_TEXTURE_SYSTEM_NAME_SIZE;
+  for (i = first; i < first + 32; ++i)
+    {
+      GLOBAL_PALETTE[i].r = *(data++);
+      GLOBAL_PALETTE[i].g = *(data++);
+      GLOBAL_PALETTE[i].b = *(data++);
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+get_mono_texture_color (RGB * rgb, int num)
+{
+  int h1, s1, v1, r, g, b;
+  float h2, s2, v2;
+  float h[] = { 0, 20, 40, 70, 110, 150, 180, 210, 240, 270, 300, 330 };
+  float s[] = { 1, 0.7, 0.4, 1, 0.5, 1, 0.5, 1, 0.5, 1 };
+  float v[] = { 1, 1, 1, 0.8, 0.8, 0.6, 0.6, 0.3, 0.3, 0.1 };
+
+  h1 = num / 10;
+  s1 = num % 10;
+  v1 = s1;
+
+  if (h1 < 12)
+    {
+      h2 = h[h1];
+      s2 = s[s1];
+      v2 = v[v1];
+    }
+  else
+    {
+      h2 = 0;
+      s2 = 0;
+      v2 = 127 - num;
+      v2 /= 7.;
+    }
+
+  hsv_to_rgb (h2, s2, v2, &r, &g, &b);
+
+  rgb->r = r / 4;
+  rgb->g = g / 4;
+  rgb->b = b / 4;
+  /* *rgb=CHOOSE_PALETTE [32+num]; */
+}
+
+/*------------------------------------------------------------------*/
+static void
+set_mono_texture_palette (int num, int first)
+{
+  get_mono_texture_color (GLOBAL_PALETTE + first, num);
+}
+
+
+/*------------------------------------------------------------------*/
+void
+set_bg_texture_palette (int num)
+{
+  if (num < CHOOSE_COLOR_NUMBER)
+    {
+      set_mono_texture_palette (num, BG_TEXTURE_FIRST_COLOR);
+    }
+  else
+    {
+      if (num >= CHOOSE_COLOR_NUMBER
+	  && num < CHOOSE_COLOR_NUMBER + RAW_TEXTURE_NUMBER)
+	{
+	  if (LOADED_TEXTURE)
+	    {
+	      set_raw_texture_palette (RAW_TEXTURE
+				       [num - CHOOSE_COLOR_NUMBER],
+				       BG_TEXTURE_FIRST_COLOR);
+	    }
+	  else
+	    {
+	      set_mono_texture_palette (BG_TEXTURE_DEFAULT_COLOR,
+					BG_TEXTURE_FIRST_COLOR);
+	    }
+	}
+
+      if (num >= CHOOSE_COLOR_NUMBER + RAW_TEXTURE_NUMBER
+	  && num <
+	  CHOOSE_COLOR_NUMBER + RAW_TEXTURE_NUMBER + RAW_MAPTEX_NUMBER)
+	{
+	  if (LOADED_MAPTEX)
+	    {
+	      set_raw_texture_palette (RAW_MAPTEX
+				       [num -
+					(CHOOSE_COLOR_NUMBER +
+					 RAW_TEXTURE_NUMBER)],
+				       BG_TEXTURE_FIRST_COLOR);
+	    }
+	  else
+	    {
+	      set_mono_texture_palette (BG_TEXTURE_DEFAULT_COLOR,
+					BG_TEXTURE_FIRST_COLOR);
+	    }
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+set_fg_texture_palette (int num)
+{
+  if (num < CHOOSE_COLOR_NUMBER)
+    {
+      set_mono_texture_palette (num, FG_TEXTURE_FIRST_COLOR);
+    }
+  else
+    {
+      if (num >= CHOOSE_COLOR_NUMBER
+	  && num < CHOOSE_COLOR_NUMBER + RAW_TEXTURE_NUMBER)
+	{
+	  if (LOADED_TEXTURE)
+	    {
+	      set_raw_texture_palette (RAW_TEXTURE
+				       [num - CHOOSE_COLOR_NUMBER],
+				       FG_TEXTURE_FIRST_COLOR);
+	    }
+	  else
+	    {
+	      set_mono_texture_palette (FG_TEXTURE_DEFAULT_COLOR,
+					FG_TEXTURE_FIRST_COLOR);
+	    }
+	}
+
+      if (num >= CHOOSE_COLOR_NUMBER + RAW_TEXTURE_NUMBER
+	  && num <
+	  CHOOSE_COLOR_NUMBER + RAW_TEXTURE_NUMBER + RAW_MAPTEX_NUMBER)
+	{
+	  if (LOADED_MAPTEX)
+	    {
+	      set_raw_texture_palette (RAW_MAPTEX
+				       [num -
+					(CHOOSE_COLOR_NUMBER +
+					 RAW_TEXTURE_NUMBER)],
+				       FG_TEXTURE_FIRST_COLOR);
+	    }
+	  else
+	    {
+	      set_mono_texture_palette (FG_TEXTURE_DEFAULT_COLOR,
+					FG_TEXTURE_FIRST_COLOR);
+	    }
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+set_palette_for_choose_color (void)
+{
+  int i;
+
+  for (i = 0; i < 128; ++i)
+    get_mono_texture_color (GLOBAL_PALETTE + 128 + i, i);
+}
+
+/*------------------------------------------------------------------*/
+static void
+set_team_color (int teinte, int first, int num)
+{
+  int i, col, col_r, col_g, col_b, coeff, tot, last;
+
+  last = first + num - 1;
+
+  get_mono_texture_color (GLOBAL_PALETTE + last, teinte * 10);
+
+  col_r = GLOBAL_PALETTE[last].r;
+  col_g = GLOBAL_PALETTE[last].g;
+  col_b = GLOBAL_PALETTE[last].b;
+  tot = 8 * num - 7;
+  for (i = 0; i < num - 1; ++i)
+    {
+      coeff = num + 7 * i;
+      col = (col_r * coeff) / tot;
+      GLOBAL_PALETTE[first + i].r = col;
+      col = (col_g * coeff) / tot;
+      GLOBAL_PALETTE[first + i].g = col;
+      col = (col_b * coeff) / tot;
+      GLOBAL_PALETTE[first + i].b = col;
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+set_playing_teams_palette (void)
+{
+  int i, j, n, color, active;
+
+  COLORS_PER_TEAM = 128 / PLAYING_TEAMS;
+  for (i = 0, n = 0; i < NB_TEAMS; ++i)
+    {
+      color = 0;
+      active = 0;
+      if (LW_NETWORK_ON)
+	{
+	  for (j = 0; j < NB_TEAMS; ++j)
+	    {
+	      if (LW_NETWORK_INFO[j].active &&
+		  LW_NETWORK_INFO[j].server_id == i)
+		{
+		  active = 1;
+		  color = LW_NETWORK_INFO[j].color;
+		}
+	    }
+	}
+      else
+	{
+	  if (CONFIG_CONTROL_TYPE[i] != CONFIG_CONTROL_TYPE_OFF)
+	    {
+	      active = 1;
+	      color = CONFIG_TEAM_COLOR[i];
+	    }
+	}
+
+      if (active)
+	{
+	  COLOR_FIRST_ENTRY[n] = 128 + n * COLORS_PER_TEAM;
+	  set_team_color (color, COLOR_FIRST_ENTRY[n], COLORS_PER_TEAM);
+	  n++;
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+my_fade_out (void)
+{
+  fade_out (48);
+}
+
+/*------------------------------------------------------------------*/
+void
+my_fade_in (void)
+{
+  PALETTE pal;
+
+  change_palette_brightness (GLOBAL_PALETTE, pal);
+  fade_in (pal, 48);
+
+  lw_mouse_update_show_hide ();
+}

Added: unstable/liquidwar/branches/upstream/current/src/palette.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/palette.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/palette.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,93 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : palette.h                                        */
+/* contenu       : gestion des palettes de couleur                  */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_PALETTE
+#define LIQUID_WAR_INCLUDE_PALETTE
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#define CHOOSE_COLOR_NUMBER 128
+#define CHOOSE_COLOR_WHITE 120
+#define CHOOSE_COLOR_BLACK 127
+
+#define TEAM_FIRST_COLOR 128
+
+#define FG_TEXTURE_FIRST_COLOR 64
+#define BG_TEXTURE_FIRST_COLOR 96
+
+#define TEXTURE_COLOR_NUMBER 32
+
+#define MENU_BG 16
+#define MENU_FG 17
+
+extern PALETTE GLOBAL_PALETTE;
+extern int COLORS_PER_TEAM;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void my_set_palette (void);
+void set_bg_texture_palette (int num);
+void set_fg_texture_palette (int num);
+void set_palette_for_choose_color (void);
+void set_playing_teams_palette (void);
+void my_fade_out (void);
+void my_fade_in (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/parser.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/parser.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/parser.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,172 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : parser.c                                         */
+/* contenu       : lecture des parametres de ligne de commande      */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdlib.h>
+#include <string.h>
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#define MAX_ARGUMENT_NUMBER 256
+
+char *EXECUTABLE_NAME;
+
+static char *ARGUMENT_NAME[MAX_ARGUMENT_NUMBER];
+static char *ARGUMENT_VALUE[MAX_ARGUMENT_NUMBER];
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static int
+is_arg_marker (char c)
+{
+#ifdef UNIX
+  /*
+   * Under Unix, we do not accept / as an option key,
+   * since it is used for paths
+   */
+  return (c == '-');
+#else
+  return (c == '/' || c == '-');
+#endif
+}
+
+/*------------------------------------------------------------------*/
+void
+read_command_line (int argc, char **argv)
+{
+  int i, j;
+  char *str;
+
+  for (i = 0; i < MAX_ARGUMENT_NUMBER; ++i)
+    ARGUMENT_NAME[i] = ARGUMENT_VALUE[i] = "";
+
+  str = EXECUTABLE_NAME = argv[0];
+  while (*str)
+    {
+      if ((*str) == '/' || (*str) == '\\')
+	EXECUTABLE_NAME = (str + 1);
+      str++;
+    }
+
+  for (i = 1, j = 0; i < argc && j < MAX_ARGUMENT_NUMBER; ++i)
+    {
+      str = argv[i];
+      if (is_arg_marker (str[0]))
+	{
+	  ARGUMENT_NAME[j] = str + 1;
+	  if (i < argc - 1)
+	    {
+	      str = argv[i + 1];
+	      if (!is_arg_marker (str[0]))
+		{
+		  ARGUMENT_VALUE[j] = str;
+		  i++;
+		}
+	    }
+	  j++;
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+int
+exist_argument (char *str)
+{
+  int i, found = 0;
+
+  for (i = 0; i < MAX_ARGUMENT_NUMBER && !found; ++i)
+    found = !strcmp (str, ARGUMENT_NAME[i]);
+
+  return found;
+}
+
+/*------------------------------------------------------------------*/
+int
+exist_argument_value (char *str)
+{
+  int i, found = 0;
+
+  for (i = 0; i < MAX_ARGUMENT_NUMBER && !found; ++i)
+    found = (!strcmp (str, ARGUMENT_NAME[i]))
+      && (strcmp ("", ARGUMENT_VALUE[i]));
+
+  return found;
+}
+
+/*------------------------------------------------------------------*/
+char *
+get_argument_str (char *str)
+{
+  int i, place = 0, found = 0;
+
+  for (i = 0; i < MAX_ARGUMENT_NUMBER && !found; ++i)
+    if ((found = (!strcmp (str, ARGUMENT_NAME[i]))) != 0)
+      place = i;
+
+  if (found)
+    return ARGUMENT_VALUE[place];
+  else
+    return "";
+}
+
+/*------------------------------------------------------------------*/
+int
+get_argument_int (char *str)
+{
+  return (atoi (get_argument_str (str)));
+}

Added: unstable/liquidwar/branches/upstream/current/src/parser.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/parser.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/parser.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,74 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : parser.h                                         */
+/* contenu       : lecture des parametres de ligne de commande      */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_PARSER
+#define LIQUID_WAR_INCLUDE_PARSER
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+extern char *EXECUTABLE_NAME;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+void read_command_line (int argc, char **argv);
+int exist_argument (char *str);
+int exist_argument_value (char *str);
+char *get_argument_str (char *str);
+int get_argument_int (char *str);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/path.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/path.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/path.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,117 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : path.c                                           */
+/* content       : path and filenames manipulation                  */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "path.h"
+#include "startup.h"
+#include "macro.h"
+#include "log.h"
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Fonction used to extract the "system name" for maps and textures.
+ * System name is basically the filename without its path and
+ * extension.
+ */
+char *
+lw_path_get_system_name (const char *filename)
+{
+  char buf1[LW_STARTUP_MAX_PATH_LENGTH];
+  static char buf2[LW_STARTUP_MAX_PATH_LENGTH];
+  char *start;
+  char *end;
+  char *search;
+
+  LW_MACRO_STRCPY (buf1, filename);
+
+  if ((search = strrchr (buf1, '/')) != NULL ||
+      (search = strrchr (buf1, '\\')) != NULL)
+    {
+      start = search + 1;
+    }
+  else
+    {
+      start = buf1;
+    }
+
+  LW_MACRO_STRCPY (buf2, start);
+
+  if ((search = strchr (buf2, '.')) != NULL)
+    {
+      end = search;
+    }
+  else
+    {
+      end = buf2 + strlen (buf2);
+    }
+
+  if (search == NULL)
+    {
+      search = buf2 + strlen (buf2);
+    }
+
+  memset (search, 0, sizeof (buf2) - (search - buf2));
+
+  return buf2;
+}

Added: unstable/liquidwar/branches/upstream/current/src/path.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/path.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/path.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,71 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : path.h                                           */
+/* content       : path and filenames manipulation                  */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_PATH
+#define LIQUID_WAR_INCLUDE_PATH
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+char *lw_path_get_system_name (const char *filename);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/ping.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/ping.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/ping.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,241 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name    : ping.c                                                 */
+/* content : utility to calculate an approximate ping time          */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+#include "ping.h"
+#include "thrdgen.h"
+#include "ticker.h"
+#include "macro.h"
+#include "sockgen.h"
+#include "protocol.h"
+#include "log.h"
+#include "sockgen.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+/*
+ * Delay in msec used for polling loops
+ */
+#define LW_PING_DELAY      10
+
+/*
+ * Maximum delay for a ping test, here it's of 750 msec for the
+ * whole thing, ie connect + ping
+ */
+#define LW_PING_TEST_MAX 750
+
+/*
+ * Number of pings we'll use to calibrate
+ */
+#define LW_PING_NB_RETRIES 3
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+
+typedef struct
+{
+  int sock;
+  char address[LW_SOCK_IP_SIZE];
+  int port;
+  int allow_exit;
+  int done;
+  int result;
+}
+LW_PING_TRY_DATA;
+
+/*==================================================================*/
+/* static functions                                                 */
+/*==================================================================*/
+
+static void try_server_callback (void *arg);
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Tries to connect on a server and get an approximate ping time.
+ * The answer is given in msec. If -1, means that the server could
+ * not be reached.
+ */
+int
+lw_ping_try_server (char *address, int port)
+{
+  int result = -1;
+  LW_PING_TRY_DATA *try_data;
+  int start_time = 0;
+
+  try_data = (LW_PING_TRY_DATA *) malloc (sizeof (LW_PING_TRY_DATA));
+  if (try_data != NULL)
+    {
+      memset (try_data, 0, sizeof (LW_PING_TRY_DATA));
+
+      try_data->sock = -1;
+      LW_MACRO_STRCPY (try_data->address, address);
+      try_data->port = port;
+      try_data->allow_exit = 0;
+      try_data->result = -1;
+
+      if (lw_thread_start (try_server_callback, try_data))
+	{
+	  start_time = get_ticker ();
+	  while (try_data->done == 0 &&
+		 get_ticker () < start_time + LW_PING_TEST_MAX)
+	    {
+	      rest (LW_PING_DELAY);
+	    }
+	  result = try_data->result;
+	  try_data->allow_exit = 1;
+	}
+      else
+	{
+	  /*
+	   * The thread could not be launched...
+	   */
+	  free (try_data);
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Callback used by the thread launched by lw_ping_try_server
+ * to open the TCP/IP connection with the server and evaluate
+ * an approximate ping time.
+ */
+static void
+try_server_callback (void *arg)
+{
+  int result = 0;
+  LW_PING_TRY_DATA *try_data;
+  int start_time;
+  int global_start_time;
+  int delay[LW_PING_NB_RETRIES];
+  int i, n, sum;
+
+  try_data = (LW_PING_TRY_DATA *) arg;
+
+  for (i = 0; i < LW_PING_NB_RETRIES; ++i)
+    {
+      delay[i] = 0;
+    }
+
+  result = lw_sock_connect (&(try_data->sock),
+			    try_data->address, try_data->port);
+
+  if (result == 1)
+    {
+      /*
+       * OK we got connected on the server, now we time stuff.
+       */
+      n = 0;
+      global_start_time = get_ticker ();
+      for (i = 0; result == 1 &&
+	   i < LW_PING_NB_RETRIES &&
+	   get_ticker () < global_start_time + LW_PING_TEST_MAX; ++i)
+	{
+	  start_time = get_ticker ();
+	  result = lw_protocol_do_ping (&try_data->sock);
+	  if (result == 1)
+	    {
+	      delay[i] = get_ticker () - start_time;
+	      n = i + 1;
+	    }
+
+	  /*
+	   * We calculate an average ping from all the values we have
+	   */
+	  sum = 0;
+	  for (i = 0; i < n; ++i)
+	    {
+	      sum += delay[i];
+	    }
+	  if (n > 0)
+	    {
+	      try_data->result = sum / n;
+	    }
+	}
+
+      /*
+       * OK we're done the calling thread can abort
+       */
+      try_data->done = 1;
+
+      /*
+       * We're polite, we tell the server we quit.
+       */
+      if (result)
+	{
+	  lw_protocol_quit (&try_data->sock);
+	}
+      lw_sock_close (&try_data->sock);
+    }
+
+  while (!try_data->allow_exit)
+    {
+      /*
+       * We simply wait until the calling
+       * thread has the results it's waiting for.
+       */
+      rest (LW_PING_DELAY);
+    }
+
+  free (try_data);
+}

Added: unstable/liquidwar/branches/upstream/current/src/ping.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/ping.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/ping.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,67 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name    : ping.h                                                 */
+/* content : utility to calculate an approximate ping time          */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_PING
+#define LIQUID_WAR_INCLUDE_PING
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int lw_ping_try_server (char *address, int port);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/pion.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/pion.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/pion.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,255 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : pion.c                                           */
+/* contenu       : affichage des curseurs                           */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+#include "area.h"
+#include "base.h"
+#include "config.h"
+#include "cursor.h"
+#include "decal.h"
+#include "palette.h"
+#include "viewport.h"
+#include "pion.h"
+#include "time.h"
+
+/*==================================================================*/
+/* definitions de types                                             */
+/*==================================================================*/
+
+typedef struct
+{
+  int x;
+  int y;
+  int color;
+  int row;
+}
+CURSOR_POINT;
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#define CURSOR_CYCLE  256
+#define CURSOR_LIGHTS 2
+
+#define CURSOR_COLOR_NUMBER 32
+#define CURSOR_POINT_NUMBER 68
+
+#define CL_NUMBER  3
+
+#define CL_INSIDE  0
+#define CL_MIDDLE  1
+#define CL_MIDDLE2 2
+#define CL_OUTSIDE 3
+
+static CURSOR_POINT CURSOR_LAYOUT[CURSOR_POINT_NUMBER] =
+  { {0, -3, 0, CL_INSIDE}, {0, -4, 0, CL_MIDDLE2}, {0, -5, 0, CL_OUTSIDE},
+{1, -4, 1, CL_MIDDLE}, {1, -5, 1, CL_OUTSIDE},
+{1, -3, 2, CL_INSIDE}, {2, -4, 2, CL_OUTSIDE},
+{2, -3, 3, CL_MIDDLE}, {3, -4, 3, CL_OUTSIDE},
+{2, -2, 4, CL_INSIDE}, {3, -3, 4, CL_MIDDLE2},
+{3, -2, 5, CL_MIDDLE}, {4, -3, 5, CL_OUTSIDE},
+{3, -1, 6, CL_INSIDE}, {4, -2, 6, CL_OUTSIDE},
+{4, -1, 7, CL_MIDDLE}, {5, -1, 7, CL_OUTSIDE},
+
+{3, 0, 8, CL_INSIDE}, {4, 0, 8, CL_MIDDLE2}, {5, 0, 8, CL_OUTSIDE},
+{4, 1, 9, CL_MIDDLE}, {5, 1, 9, CL_OUTSIDE},
+{3, 1, 10, CL_INSIDE}, {4, 2, 10, CL_OUTSIDE},
+{3, 2, 11, CL_MIDDLE}, {4, 3, 11, CL_OUTSIDE},
+{2, 2, 12, CL_INSIDE}, {3, 3, 12, CL_MIDDLE2},
+{2, 3, 13, CL_MIDDLE}, {3, 4, 13, CL_OUTSIDE},
+{1, 3, 14, CL_INSIDE}, {2, 4, 14, CL_OUTSIDE},
+{1, 4, 15, CL_MIDDLE}, {1, 5, 15, CL_OUTSIDE},
+
+{-0, 3, 16, CL_INSIDE}, {-0, 4, 16, CL_MIDDLE2}, {-0, 5, 16, CL_OUTSIDE},
+{-1, 4, 17, CL_MIDDLE}, {-1, 5, 17, CL_OUTSIDE},
+{-1, 3, 18, CL_INSIDE}, {-2, 4, 18, CL_OUTSIDE},
+{-2, 3, 19, CL_MIDDLE}, {-3, 4, 19, CL_OUTSIDE},
+{-2, 2, 20, CL_INSIDE}, {-3, 3, 20, CL_MIDDLE2},
+{-3, 2, 21, CL_MIDDLE}, {-4, 3, 21, CL_OUTSIDE},
+{-3, 1, 22, CL_INSIDE}, {-4, 2, 22, CL_OUTSIDE},
+{-4, 1, 23, CL_MIDDLE}, {-5, 1, 23, CL_OUTSIDE},
+
+{-3, -0, 8, CL_INSIDE}, {-4, -0, 24, CL_MIDDLE2}, {-5, -0, 25, CL_OUTSIDE},
+{-4, -1, 25, CL_MIDDLE}, {-5, -1, 26, CL_OUTSIDE},
+{-3, -1, 10, CL_INSIDE}, {-4, -2, 27, CL_OUTSIDE},
+{-3, -2, 27, CL_MIDDLE}, {-4, -3, 28, CL_OUTSIDE},
+{-2, -2, 12, CL_INSIDE}, {-3, -3, 28, CL_MIDDLE2},
+{-2, -3, 29, CL_MIDDLE}, {-3, -4, 29, CL_OUTSIDE},
+{-1, -3, 14, CL_INSIDE}, {-2, -4, 30, CL_OUTSIDE},
+{-1, -4, 31, CL_MIDDLE}, {-1, -5, 31, CL_OUTSIDE}
+};
+
+static char CURSOR_GRAPHIC_MEMORY[NB_TEAMS][CURSOR_POINT_NUMBER];
+
+static char CURSOR_COLOR_MAP[CURSOR_COLOR_NUMBER];
+static char CURSOR_COLOR_BACK[CURSOR_COLOR_NUMBER];
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+void
+init_disp_cursor (void)
+{
+  int i, x, y, color_back;
+
+  for (i = 0; i < CURSOR_COLOR_NUMBER; ++i)
+    {
+      color_back = 0;
+      while (color_back < FG_TEXTURE_FIRST_COLOR
+	     || color_back >= FG_TEXTURE_FIRST_COLOR + 32)
+	{
+	  x = random () % CURRENT_AREA_W;
+	  y = random () % CURRENT_AREA_H;
+	  color_back = getpixel (CURRENT_AREA_BACK, x, y);
+	}
+      CURSOR_COLOR_BACK[i] = color_back;
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+disp_cursor (int number)
+{
+  int i, x, y, x0, y0, color_offset;
+
+  x0 = CURRENT_CURSOR[number].x;
+  y0 = CURRENT_CURSOR[number].y;
+  color_offset = COLOR_FIRST_ENTRY[CURRENT_CURSOR[number].team];
+
+
+  for (i = 0; i < CURSOR_POINT_NUMBER; ++i)
+    {
+      x = x0 + CURSOR_LAYOUT[i].x;
+      y = y0 + CURSOR_LAYOUT[i].y;
+      CURSOR_GRAPHIC_MEMORY[number][i] = getpixel (CURRENT_AREA_DISP, x, y);
+      switch (CURSOR_LAYOUT[i].row)
+	{
+	case CL_OUTSIDE:
+	case CL_INSIDE:
+	case CL_MIDDLE:
+	  putpixel (CURRENT_AREA_DISP, x, y,
+		    CURSOR_COLOR_MAP[CURSOR_LAYOUT[i].color] + color_offset);
+	  break;
+	case CL_MIDDLE2:
+	  putpixel (CURRENT_AREA_DISP, x, y,
+		    CURSOR_COLOR_BACK[CURSOR_LAYOUT[i].color]);
+	  break;
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+undisp_cursor (int number)
+{
+  int i, x0, y0;
+
+  x0 = CURRENT_CURSOR[number].x;
+  y0 = CURRENT_CURSOR[number].y;
+
+  for (i = 0; i < CURSOR_POINT_NUMBER; ++i)
+    {
+      putpixel (CURRENT_AREA_DISP,
+		x0 + CURSOR_LAYOUT[i].x,
+		y0 + CURSOR_LAYOUT[i].y, CURSOR_GRAPHIC_MEMORY[number][i]);
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+disp_all_cursors (void)
+{
+  int i, degrad_size, fp, ip;
+
+  degrad_size = CURSOR_COLOR_NUMBER / (2 * CURSOR_LIGHTS);
+  ip = ((GLOBAL_TICKER * COLORS_PER_TEAM) / CURSOR_CYCLE)
+    % (COLORS_PER_TEAM * 2);
+  fp = 0;
+
+  for (i = 0; i < CURSOR_COLOR_NUMBER; ++i)
+    {
+      if (ip < COLORS_PER_TEAM)
+	CURSOR_COLOR_MAP[i] = ip;
+      else
+	CURSOR_COLOR_MAP[i] = 2 * COLORS_PER_TEAM - 1 - ip;
+
+      fp += COLORS_PER_TEAM;
+      while (fp >= degrad_size)
+	{
+	  fp -= degrad_size;
+	  ip++;
+	}
+      while (ip >= 2 * COLORS_PER_TEAM)
+	ip -= 2 * COLORS_PER_TEAM;
+    }
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    if (CURRENT_CURSOR[i].active)
+      disp_cursor (i);
+}
+
+/*------------------------------------------------------------------*/
+void
+undisp_all_cursors (void)
+{
+  int i;
+
+  for (i = NB_TEAMS - 1; i >= 0; --i)
+    if (CURRENT_CURSOR[i].active)
+      undisp_cursor (i);
+}

Added: unstable/liquidwar/branches/upstream/current/src/pion.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/pion.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/pion.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,66 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : pion.h                                           */
+/* contenu       : affichage des curseurs                           */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_PION
+#define LIQUID_WAR_INCLUDE_PION
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void init_disp_cursor (void);
+void disp_all_cursors (void);
+void undisp_all_cursors (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/play.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/play.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/play.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,278 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : play.c                                           */
+/* contenu       : fonction play du menu principal                  */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+#include <allegro.h>
+
+#include "back.h"
+#include "config.h"
+#include "decal.h"
+#include "dialog.h"
+#include "error.h"
+#include "game.h"
+#include "gfxmode.h"
+#include "palette.h"
+#include "maptex.h"
+#include "play.h"
+#include "score.h"
+#include "sound.h"
+#include "sock2gen.h"
+#include "keyexch.h"
+#include "music.h"
+#include "lang.h"
+#include "mouse.h"
+#include "log.h"
+#include "network.h"
+#include "random.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * this function is basically what is launched when one presses
+ * the play button. in fact it performs initializations and sanity
+ * checks and then launches the game function located in game.c
+ */
+int
+play_sequence (void)
+{
+  int result;
+
+  lw_config_set_current_rules_to_default ();
+
+  result = play_sequence_ex ();
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Internal version of play_sequence, used for network games
+ */
+int
+play_sequence_ex (void)
+{
+  char *message;
+  int result, retour = 0;
+  DIALOG d[2];
+  DIALOG_PLAYER *dp;
+  int flip_enabled = 0;
+
+  memset (d, 0, sizeof (d));
+
+  d[1].proc = 0;
+
+  /*
+   * we clear the screen by blitting the Liquid War 5 logo
+   */
+  display_back_image ();
+  /*
+   * we display a "Get ready!" message so that the user does not worry
+   * about what's going on
+   */
+  main_message (d, lw_lang_string (LW_LANG_STRING_PLAY_GETREADY));
+  /*
+   * we call update dialog artificially so that the "Get ready"
+   * message is actually blitted on the screen
+   */
+  dp = my_init_dialog (d, 0);
+  my_update_dialog (dp);
+  shutdown_dialog (dp);
+
+  /*
+   * we set up the 256 color palette so that it corresponds to
+   * the textures the user has chosen
+   */
+  lw_maptex_set_fg_palette (CONFIG_LEVEL_MAP, CONFIG_LEVEL_FG,
+			    LW_NETWORK_ON, LW_RANDOM_ON,
+			    CONFIG_USE_DEFAULT_TEXTURE);
+  lw_maptex_set_bg_palette (CONFIG_LEVEL_MAP, CONFIG_LEVEL_BG,
+			    LW_NETWORK_ON, LW_RANDOM_ON,
+			    CONFIG_USE_DEFAULT_TEXTURE);
+  /*
+   * we calculate how many teams are playing
+   */
+  calc_playing_teams ();
+  /*
+   * we set up the Allegro palette and LW's palette parameters so that
+   * an optimized number of colors is used for each team's fighters
+   */
+  set_playing_teams_palette ();
+
+  /*
+   * if there's only one team selected we stop right away and quit
+   */
+  if (PLAYING_TEAMS < 2)
+    {
+      free_game_memory ();
+      error_not_enough_teams ();
+    }
+  else
+    {
+      /*
+       * we launch init_game from the game module, this function may fail
+       * and if it does it returns a string containing the error message
+       */
+      if (!(message = init_game ()))
+	{
+	  /*
+	   * we set up the sound of waves a little louder so that the player
+	   * understands he's playing *now*
+	   */
+	  WATER_VOLUME = CONFIG_WATER_VOLUME_GAME;
+	  /*
+	   * fade out cause we're going to switch video modes
+	   */
+	  my_fade_out ();
+
+	  /*
+	   * we change the resolution, but only if the game resolution is
+	   * actually different from the menu resolution
+	   */
+	  if (need_to_change_mode (CONFIG_GFX_GAME,
+				   CONFIG_GFX_MENU, CONFIG_PAGE_FLIP))
+	    result = set_resolution (CONFIG_GFX_GAME,
+				     CONFIG_PAGE_FLIP,
+				     CONFIG_FULLSCREEN, &flip_enabled);
+
+	  lw_mouse_hide ();
+
+	  /*
+	   * the blank round function initializes the double-buffer system
+	   * and the main display target, it might fail because of lacking memory
+	   */
+	  if (!blank_round ())
+	    {
+	      /*
+	       * fiat lux
+	       */
+	      my_fade_in ();
+
+	      /*
+	       * start playing some music
+	       */
+	      start_music ();
+
+	      /*
+	       * OK, here we go, let's enter the main game loop
+	       */
+	      game ();
+
+	      /*
+	       * stop the music
+	       */
+	      stop_music ();
+	    }
+
+	  /*
+	   * let's be clean 8-)
+	   */
+	  free_game_memory ();
+
+	  /*
+	   * we close the network socket abruptly
+	   */
+	  lw_sock_close (&LW_KEYEXCH_SOCK);
+
+	  /*
+	   * we turn the volume down
+	   */
+	  WATER_VOLUME = CONFIG_WATER_VOLUME_MENU;
+
+	  /*
+	   * fade out before video mode switching
+	   */
+	  my_fade_out ();
+	  /*
+	   * again, we change the video mode only if it is really required
+	   */
+	  if (need_to_change_mode (CONFIG_GFX_GAME,
+				   CONFIG_GFX_MENU,
+				   CONFIG_PAGE_FLIP && flip_enabled))
+	    result =
+	      set_resolution (CONFIG_GFX_MENU, 0, CONFIG_FULLSCREEN, NULL);
+
+	  lw_mouse_show ();
+
+	  /*
+	   * displays the 3 tubes with the score
+	   */
+	  retour = display_scores ();
+	}
+      else
+	{
+	  /*
+	   * the main reason why init_game should fail is a lack of big data
+	   * this can be cured by selecting a smaller level or increasing the
+	   * amount of data reserved at startup (command line parameter)
+	   */
+	  free_game_memory ();
+
+	  /*
+	   * we close the network socket abruptly
+	   */
+	  lw_sock_close (&LW_KEYEXCH_SOCK);
+
+	  error_not_enough_big_data ();
+	}
+    }
+
+  return retour;
+}

Added: unstable/liquidwar/branches/upstream/current/src/play.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/play.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/play.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,69 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : play.h                                           */
+/* contenu       : fonction play du menu principal                  */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_PLAY
+#define LIQUID_WAR_INCLUDE_PLAY
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int play_sequence (void);
+int play_sequence_ex (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/popupgen.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/popupgen.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/popupgen.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,72 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name    : popupgen.h                                             */
+/* content : handles system popup windows                           */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_POPUPGEN
+#define LIQUID_WAR_INCLUDE_POPUPGEN
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void lw_popup_init_fail (void);
+void lw_popup_mem_trouble (void);
+void lw_popup_big_data (void);
+void lw_popup_load_fail (void);
+void lw_popup_custom_fail (void);
+void lw_popup_graphics_fail (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/popupw32.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/popupw32.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/popupw32.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,145 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name    : popupw32.c                                             */
+/* content : popup windows used under the win32 platform            */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#ifdef WIN32
+#include <windows.h>
+#endif
+
+#include "popupgen.h"
+#include "lang.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_POPUP_ERROR_FLAGS MB_OK|MB_ICONEXCLAMATION
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+void
+lw_popup_init_fail ()
+{
+  HWND hwnd;
+
+  hwnd = (HWND) win_get_window ();
+  MessageBox (hwnd,
+	      lw_lang_string (LW_LANG_STRING_POPUP_INITFAIL),
+	      lw_lang_string (LW_LANG_STRING_APPNAME), LW_POPUP_ERROR_FLAGS);
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_popup_mem_trouble (void)
+{
+  HWND hwnd;
+
+  hwnd = (HWND) win_get_window ();
+  MessageBox (hwnd,
+	      lw_lang_string (LW_LANG_STRING_POPUP_MEMTROUBLE),
+	      lw_lang_string (LW_LANG_STRING_APPNAME), LW_POPUP_ERROR_FLAGS);
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_popup_big_data (void)
+{
+  HWND hwnd;
+
+  hwnd = (HWND) win_get_window ();
+  MessageBox (hwnd,
+	      lw_lang_string (LW_LANG_STRING_POPUP_BIGDATA),
+	      lw_lang_string (LW_LANG_STRING_APPNAME), LW_POPUP_ERROR_FLAGS);
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_popup_load_fail (void)
+{
+  HWND hwnd;
+
+  hwnd = (HWND) win_get_window ();
+  MessageBox (hwnd,
+	      lw_lang_string (LW_LANG_STRING_POPUP_LOADFAIL),
+	      lw_lang_string (LW_LANG_STRING_APPNAME), LW_POPUP_ERROR_FLAGS);
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_popup_custom_fail (void)
+{
+  HWND hwnd;
+
+  hwnd = (HWND) win_get_window ();
+  MessageBox (hwnd,
+	      lw_lang_string (LW_LANG_STRING_POPUP_CUSTOMFAIL),
+	      lw_lang_string (LW_LANG_STRING_APPNAME), LW_POPUP_ERROR_FLAGS);
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_popup_graphics_fail (void)
+{
+  HWND hwnd;
+
+  hwnd = (HWND) win_get_window ();
+  MessageBox (hwnd,
+	      lw_lang_string (LW_LANG_STRING_POPUP_GRAPHICSFAIL),
+	      lw_lang_string (LW_LANG_STRING_APPNAME), LW_POPUP_ERROR_FLAGS);
+}

Added: unstable/liquidwar/branches/upstream/current/src/profile.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/profile.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/profile.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,155 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : profile.c                                        */
+/* contenu       : chronometrage des fonctions                      */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+#include "profile.h"
+#include "ticker.h"
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+typedef struct
+{
+  int start;
+  int record_number;
+  int total_time;
+}
+PROFILE_REC;
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#define PROFILE_LIMIT 20
+
+static PROFILE_REC PROFILE_DATA[MAX_PROFILE];
+static int DISPLAY_NUMBER;
+static int LOGIC_NUMBER;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+void
+reset_all_profile (void)
+{
+  int i;
+
+  for (i = 0; i < MAX_PROFILE; ++i)
+    reset_profile (i);
+}
+
+/*------------------------------------------------------------------*/
+void
+reset_profile (int indice)
+{
+  DISPLAY_NUMBER = LOGIC_NUMBER = 0;
+  PROFILE_DATA[indice].record_number = PROFILE_DATA[indice].total_time = 0;
+}
+
+/*------------------------------------------------------------------*/
+void
+start_profile (int indice)
+{
+  PROFILE_DATA[indice].start = get_ticker ();
+}
+
+/*------------------------------------------------------------------*/
+void
+stop_profile (int indice)
+{
+  PROFILE_DATA[indice].record_number++;
+  PROFILE_DATA[indice].total_time += get_ticker ()
+    - PROFILE_DATA[indice].start;
+  if (PROFILE_DATA[indice].record_number >= PROFILE_LIMIT)
+    {
+      PROFILE_DATA[indice].record_number /= 2;
+      PROFILE_DATA[indice].total_time /= 2;
+    }
+}
+
+/*------------------------------------------------------------------*/
+int
+get_profile (int indice)
+{
+  if (PROFILE_DATA[indice].record_number > 0)
+    return (PROFILE_DATA[indice].total_time
+	    / PROFILE_DATA[indice].record_number);
+  else
+    return 0;
+}
+
+/*------------------------------------------------------------------*/
+void
+update_logic_rate (int logic_number)
+{
+  DISPLAY_NUMBER++;
+  LOGIC_NUMBER += logic_number;
+
+  if (DISPLAY_NUMBER > PROFILE_LIMIT)
+    {
+      DISPLAY_NUMBER /= 2;
+      LOGIC_NUMBER /= 2;
+    }
+}
+
+/*------------------------------------------------------------------*/
+int
+get_logic_rate (void)
+{
+  return ((get_profile (GLOBAL_PROFILE) * DISPLAY_NUMBER) / LOGIC_NUMBER);
+}

Added: unstable/liquidwar/branches/upstream/current/src/profile.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/profile.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/profile.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,78 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : profile.h                                        */
+/* contenu       : chronometrage des fonctions                      */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_PROFILE
+#define LIQUID_WAR_INCLUDE_PROFILE
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+#define SPREAD_PROFILE   0
+#define MOVE_PROFILE     1
+#define DISP_PROFILE     2
+#define FLIP_PROFILE     3
+#define GLOBAL_PROFILE   4
+
+#define MAX_PROFILE 256
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void reset_all_profile (void);
+void reset_profile (int indice);
+void start_profile (int indice);
+void stop_profile (int indice);
+int get_profile (int indice);
+void update_logic_rate (int logic_number);
+int get_logic_rate (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/protocol.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/protocol.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/protocol.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,657 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : protocol.c                                       */
+/* content       : messages sent by the client when connecting      */
+/* last update   : April 16th 2001                                  */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "config.h"
+#include "sock2gen.h"
+#include "netmess.h"
+#include "netmap.h"
+#include "netconf.h"
+#include "protocol.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* static functions                                                 */
+/*==================================================================*/
+
+static int recv_ok (int *sock);
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static int
+recv_ok (int *sock)
+{
+  int result = 0;
+  char message[LW_SOCK_MESSAGE_SIZE];
+  int ret = 0;
+  LW_NETMESS *netmess;
+
+  while (*sock >= 0 && (ret = lw_sock_recv_str (sock, message)) == 0);
+  if (*sock >= 0 && ret > 0)
+    {
+      netmess = lw_netmess_read (message);
+      if (netmess != NULL)
+	{
+	  if (netmess->code == LW_NETMESS_CODE_OK && netmess->argc == 0)
+	    {
+	      result = 1;
+	    }
+	  lw_netmess_free (netmess);
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends a dummy "PING" message to the server, to check that the
+ * connection is working OK.
+ */
+int
+lw_protocol_do_ping (int *sock)
+{
+  int result = 0;
+
+  if (*sock >= 0 && lw_sock_send_str (sock, LW_NETMESS_TEXT_PING))
+    {
+      if (recv_ok (sock))
+	{
+	  result = 1;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends the name of the running client to the server. This is to
+ * prevent a liquidwar client to connect itself on something else
+ * than a real liquidwar server.
+ */
+int
+lw_protocol_tell_program (int *sock, char *program)
+{
+  int result = 0;
+  char message[LW_SOCK_MESSAGE_SIZE];
+
+  LW_MACRO_SPRINTF2 (message, "%s '%s'", LW_NETMESS_TEXT_PROGRAM, program);
+  if (*sock >= 0 && lw_sock_send_str (sock, message))
+    {
+      if (recv_ok (sock))
+	{
+	  result = 1;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends the version of the client to the server.
+ */
+int
+lw_protocol_tell_version (int *sock, char *version)
+{
+  int result = 0;
+  char message[LW_SOCK_MESSAGE_SIZE];
+
+  LW_MACRO_SPRINTF2 (message, "%s '%s'", LW_NETMESS_TEXT_VERSION, version);
+  if (*sock >= 0 && lw_sock_send_str (sock, message))
+    {
+      if (recv_ok (sock))
+	{
+	  result = 1;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends the game password to the server.
+ */
+int
+lw_protocol_tell_password (int *sock, char *password)
+{
+  int result = 0;
+  char message[LW_SOCK_MESSAGE_SIZE];
+
+  LW_MACRO_SPRINTF2 (message, "%s '%s'", LW_NETMESS_TEXT_PASSWORD, password);
+  if (*sock >= 0 && lw_sock_send_str (sock, message))
+    {
+      if (recv_ok (sock))
+	{
+	  result = 1;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Asks the server how many players can connect to it.
+ */
+int
+lw_protocol_ask_free_teams (int *sock, int *nb)
+{
+  int result = 0;
+  char message[LW_SOCK_MESSAGE_SIZE];
+  int ret = 0;
+  LW_NETMESS *netmess;
+
+  *nb = 0;
+  if (*sock >= 0 && lw_sock_send_str (sock, LW_NETMESS_TEXT_FREE))
+    {
+      while (*sock >= 0 && (ret = lw_sock_recv_str (sock, message)) == 0);
+      if (*sock >= 0 && ret > 0)
+	{
+	  netmess = lw_netmess_read (message);
+	  if (netmess != NULL)
+	    {
+	      if (netmess->code == LW_NETMESS_CODE_OK && netmess->argc == 1)
+		{
+		  *nb = atoi (netmess->argv[0]);
+		  result = 1;
+		}
+	      lw_netmess_free (netmess);
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Inform the server that this player will be playing.
+ */
+int
+lw_protocol_reserve_team (int *sock, int num, int control_type, char *name)
+{
+  int result = 0;
+  char message[LW_SOCK_MESSAGE_SIZE];
+
+  LW_MACRO_SPRINTF4 (message, "%s %d,%d,'%s'",
+		     LW_NETMESS_TEXT_TEAM, num, control_type, name);
+  if (*sock >= 0 && lw_sock_send_str (sock, message))
+    {
+      if (recv_ok (sock))
+	{
+	  result = 1;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Ask the server who is playing on a given channel
+ */
+int
+lw_protocol_ask_who (int *sock, int num, LW_WHO * who)
+{
+  int result = 0;
+  char message[LW_SOCK_MESSAGE_SIZE];
+  int ret = 0;
+  LW_NETMESS *netmess;
+
+  who->active = 0;
+  who->network = 0;
+  who->server_id = -1;
+  who->name[0] = '\0';
+
+  LW_MACRO_SPRINTF2 (message, "%s %d", LW_NETMESS_TEXT_WHO, num);
+  if (*sock >= 0 && lw_sock_send_str (sock, message))
+    {
+      while (*sock >= 0 && (ret = lw_sock_recv_str (sock, message)) == 0);
+      if (*sock >= 0 && ret > 0)
+	{
+	  netmess = lw_netmess_read (message);
+	  if (netmess != NULL)
+	    {
+	      switch (netmess->code)
+		{
+		case LW_NETMESS_CODE_NOBODY:
+		  if (netmess->argc == 0)
+		    {
+		      /*
+		       * We leave the server id to the default -1 value
+		       */
+		      result = 1;
+		    }
+		  break;
+		case LW_NETMESS_CODE_NETWORK:
+		  who->network = 1;
+		  /*
+		   * no "break" here since the only difference between
+		   * the LOCAL and NETWORK messages is that the network
+		   * flag is set to 1 in the "NETWORK" case.
+		   */
+		case LW_NETMESS_CODE_LOCAL:
+		  if (netmess->argc == 3)
+		    {
+		      who->active = 1;
+		      who->server_id = atoi (netmess->argv[0]);
+		      who->control_type = atoi (netmess->argv[1]);
+		      strncpy (who->name, netmess->argv[2], NAME_SIZE);
+		      who->name[NAME_SIZE] = '\0';
+		      result = 1;
+		    }
+		  break;
+		}
+	      lw_netmess_free (netmess);
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends the selected map to the server
+ */
+int
+lw_protocol_send_map (int *sock, void *map)
+{
+  int result = 0;
+
+  if (*sock >= 0 && lw_sock_send_str (sock, LW_NETMESS_TEXT_SENDMAP))
+    {
+      if (lw_netmap_send (sock, map))
+	{
+	  if (recv_ok (sock))
+	    {
+	      result = 1;
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Receives the map from the server
+ */
+int
+lw_protocol_recv_map (int *sock, void **map)
+{
+  int result = 0;
+
+  if (*sock >= 0 && lw_sock_send_str (sock, LW_NETMESS_TEXT_RECVMAP))
+    {
+      if (lw_netmap_recv (sock, map))
+	{
+	  if (recv_ok (sock))
+	    {
+	      result = 1;
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends the config to the server
+ */
+int
+lw_protocol_send_config (int *sock)
+{
+  int result = 0;
+  LW_NETCONF config;
+
+  if (*sock >= 0 && lw_sock_send_str (sock, LW_NETMESS_TEXT_SENDCONFIG))
+    {
+
+      memcpy (&config, &LW_CONFIG_CURRENT_RULES, sizeof (LW_NETCONF));
+
+      if (lw_netconf_send (sock, &config))
+	{
+	  if (recv_ok (sock))
+	    {
+	      result = 1;
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Receives the config from the server
+ */
+int
+lw_protocol_recv_config (int *sock)
+{
+  int result = 0;
+  LW_NETCONF config;
+
+  if (*sock >= 0 && lw_sock_send_str (sock, LW_NETMESS_TEXT_RECVCONFIG))
+    {
+      if (lw_netconf_recv (sock, &config))
+	{
+	  if (recv_ok (sock))
+	    {
+	      memcpy (&LW_CONFIG_CURRENT_RULES, &config, sizeof (LW_NETCONF));
+
+	      result = 1;
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Tell the server that the client is ready to play
+ */
+int
+lw_protocol_i_am_ready (int *sock)
+{
+  int result = 0;
+
+  if (*sock >= 0 && lw_sock_send_str (sock, LW_NETMESS_TEXT_READY))
+    {
+      if (recv_ok (sock))
+	{
+	  result = 1;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Tells the server one is waiting for the game to start
+ */
+int
+lw_protocol_waiting (int *sock, int *waited_teams)
+{
+  int result = 0;
+  char message[LW_SOCK_MESSAGE_SIZE];
+  int ret = 0;
+  LW_NETMESS *netmess;
+
+  /*
+   * Previous versions of LW used to set "waited teams" to
+   * 0 here. This caused weird bugs since this affectation
+   * is done in a separate thread, so the main thread would
+   * see "waited_teams==0" and then would try to start a game...
+   * All this ended in an "Error processing WHO 0" on the server.
+   * So it's very important *not* to set it to 0. We do not need
+   * to set it to any value in fact...
+   */
+  /*
+   * (*waited_teams)=NB_TEAMS;
+   */
+
+  if (*sock >= 0 && lw_sock_send_str (sock, LW_NETMESS_TEXT_WAITING))
+    {
+      while (*sock >= 0 && (ret = lw_sock_recv_str (sock, message)) == 0);
+      if (*sock >= 0 && ret > 0)
+	{
+	  netmess = lw_netmess_read (message);
+	  if (netmess != NULL)
+	    {
+	      if (netmess->code == LW_NETMESS_CODE_OK && netmess->argc == 1)
+		{
+		  *waited_teams = atoi (netmess->argv[0]);
+		  result = 1;
+		}
+	      lw_netmess_free (netmess);
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Forces the server to start the game
+ */
+int
+lw_protocol_force_start (int *sock)
+{
+  int result = 0;
+
+  if (*sock >= 0 && lw_sock_send_str (sock, LW_NETMESS_TEXT_START))
+    {
+      if (recv_ok (sock))
+	{
+	  result = 1;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends a "NEXT" message
+ */
+int
+lw_protocol_next (int *sock)
+{
+  int result = 0;
+
+  if (*sock >= 0 && lw_sock_send_str (sock, LW_NETMESS_TEXT_NEXT))
+    {
+      if (recv_ok (sock))
+	{
+	  result = 1;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends a "TEAMSTARTINFO" message
+ */
+int
+lw_protocol_ask_teamstartinfo (int *sock, int team,
+			       LW_TEAMSTARTINFO * team_start_info)
+{
+  int result = 0;
+  char message[LW_SOCK_MESSAGE_SIZE];
+  int ret = 0;
+  LW_NETMESS *netmess;
+
+  lw_teamstartinfo_reset (team_start_info);
+
+  LW_MACRO_SPRINTF2 (message, "%s %d", LW_NETMESS_TEXT_TEAMSTARTINFO, team);
+  if (*sock >= 0 && lw_sock_send_str (sock, message))
+    {
+      while (*sock >= 0 && (ret = lw_sock_recv_str (sock, message)) == 0);
+      if (*sock >= 0 && ret > 0)
+	{
+	  netmess = lw_netmess_read (message);
+	  if (netmess != NULL)
+	    {
+	      switch (netmess->code)
+		{
+		case LW_NETMESS_CODE_OK:
+		  if (netmess->argc == 3)
+		    {
+		      team_start_info->active = atoi (netmess->argv[0]);
+		      team_start_info->start = atoi (netmess->argv[1]);
+		      strncpy (team_start_info->name, netmess->argv[2],
+			       NAME_SIZE);
+		      team_start_info->name[NAME_SIZE] = '\0';
+
+		      result = 1;
+		    }
+		  break;
+		}
+	      lw_netmess_free (netmess);
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends a "CHATTALK" message
+ */
+int
+lw_protocol_chat_talk (int *sock, char *text)
+{
+  int result = 0;
+  char message[LW_SOCK_MESSAGE_SIZE];
+
+  LW_MACRO_SPRINTF2 (message, "%s '%s'", LW_NETMESS_TEXT_CHATTALK, text);
+
+  if (*sock >= 0 && lw_sock_send_str (sock, message))
+    {
+      if (recv_ok (sock))
+	{
+	  result = 1;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends a "CHATLISTEN" message
+ */
+int
+lw_protocol_chat_listen (int *sock, LW_CHAT_HISTORY * chat_history)
+{
+  int result = 0;
+  char message[LW_SOCK_MESSAGE_SIZE];
+  int ret = 0;
+  LW_NETMESS *netmess;
+
+  if (*sock >= 0 && lw_sock_send_str (sock, LW_NETMESS_TEXT_CHATLISTEN))
+    {
+      while (*sock >= 0 && (ret = lw_sock_recv_str (sock, message)) == 0);
+      if (*sock >= 0 && ret > 0)
+	{
+	  netmess = lw_netmess_read (message);
+	  if (netmess != NULL)
+	    {
+	      switch (netmess->code)
+		{
+		case LW_NETMESS_CODE_OK:
+		  switch (netmess->argc)
+		    {
+		    case 0:
+		      /*
+		       * No message, we do nothing
+		       */
+		      result = 1;
+		      break;
+		    case 2:
+		      /*
+		       * Message received, enqueue it
+		       */
+		      lw_chat_push (chat_history,
+				    netmess->argv[0], netmess->argv[1]);
+		      result = 1;
+		      break;
+		    }
+		  break;
+		}
+	      lw_netmess_free (netmess);
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends a "QUIT" message to the server, in case it wants to make
+ * the difference between a client that disconnects on purpose
+ * and someones that has network problems.
+ */
+int
+lw_protocol_quit (int *sock)
+{
+  int result = 0;
+
+  lw_sock_send_str (sock, LW_NETMESS_TEXT_QUIT);
+
+  /*
+   * We leave result to 0, the sockets needs to be closed wether
+   * the QUIT message was sent or not.
+   */
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/protocol.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/protocol.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/protocol.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,102 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : protocol.h                                       */
+/* content       : messages sent by the client when connecting      */
+/* last update   : April 16th 2001                                  */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_PROTOCOL
+#define LIQUID_WAR_INCLUDE_PROTOCOL
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "network.h"
+#include "startinf.h"
+#include "chat.h"
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+/*
+ * IMPORTANT: there's one good reason sock is passed as a pointer
+ * in all these functions. In fact, the code uses constructs like
+ * *(data->sock) = 0 (mostly in connect.c) to intercept network
+ * calls, stop them, and treat GUI stuff and network code in
+ * separate threads. Previous releases of LW (< 5.6.3) didn't do
+ * that, but the bug appeared when trying to release 5.6.3 with
+ * Allegro 4.2 and GCC 4. This is an ugly hack, but hopefully works..
+ */
+
+int lw_protocol_do_ping (int *sock);
+int lw_protocol_tell_version (int *sock, char *version);
+int lw_protocol_tell_program (int *sock, char *program);
+int lw_protocol_tell_password (int *sock, char *password);
+int lw_protocol_ask_free_teams (int *sock, int *nb);
+int lw_protocol_reserve_team (int *sock, int num,
+			      int control_type, char *name);
+int lw_protocol_ask_who (int *sock, int num, LW_WHO * who);
+int lw_protocol_send_map (int *sock, void *map);
+int lw_protocol_recv_map (int *sock, void **map);
+int lw_protocol_send_config (int *sock);
+int lw_protocol_recv_config (int *sock);
+int lw_protocol_i_am_ready (int *sock);
+int lw_protocol_waiting (int *sock, int *waited_teams);
+int lw_protocol_force_start (int *sock);
+int lw_protocol_next (int *sock);
+int lw_protocol_ask_teamstartinfo (int *sock, int team,
+				   LW_TEAMSTARTINFO * team_start_info);
+int lw_protocol_chat_talk (int *sock, char *text);
+int lw_protocol_chat_listen (int *sock, LW_CHAT_HISTORY * chat_history);
+int lw_protocol_quit (int *sock);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/random.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/random.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/random.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,213 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : random.c                                         */
+/* content       : wrapper for the functions in ../utils/lwmpagen/  */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+
+#include <stdio.h>
+#include <allegro.h>
+
+#include "random.h"
+#include "alleg2.h"
+#include "map.h"
+#include "config.h"
+#include "disk.h"
+#include "log.h"
+#include "macro.h"
+#include "startup.h"
+#include "init.h"
+#include "exec2.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_RANDOM_RUN_DELAY 100
+#define LW_RANDOM_RUN_RETRIES 50
+#ifdef UNIX
+#define LW_RANDOM_COMMAND_END " > /dev/null 2>&1"
+#else
+#define LW_RANDOM_COMMAND_END ""
+#endif
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+void *LW_RANDOM_RAW_MAP = NULL;
+int LW_RANDOM_ON = 0;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Generates a black&white palette which is suitable for 
+ * the game to handle nicely maps generated by lwmapgen. Basically
+ * all we need is color 0 == black and color 2555 = white, but
+ * we do a full grayscale, just to say the palette is not full of
+ * garbage.
+ */
+static void
+generate_bw_palette (PALETTE pal)
+{
+  int i;
+
+  for (i = 0; i < 256; ++i)
+    {
+      pal[i].r = i;
+      pal[i].g = i;
+      pal[i].b = i;
+    }
+}
+
+/*------------------------------------------------------------------*/
+static BITMAP *
+generate_bitmap ()
+{
+  BITMAP *bmp;
+  PALETTE pal;
+
+  char filename[LW_STARTUP_MAX_PATH_LENGTH];
+  char command[LW_STARTUP_MAX_PATH_LENGTH];
+
+  int size;
+  int ok = 0;
+
+  size = random () % 6;
+
+  LW_MACRO_SPRINTF1 (filename, "%s.bmp", tmpnam (NULL));
+  LW_MACRO_SPRINTF4 (command,
+		     "%s --out %s --size %d%s",
+		     STARTUP_GEN_PATH, filename, size, LW_RANDOM_COMMAND_END);
+
+  log_print_str ("Generating random map with command: \"");
+  log_print_str (command);
+  log_print_str ("\"");
+
+  ok = lw_exec2_run (STARTUP_GEN_PATH, command);
+#ifdef WIN32
+  {
+    /*
+     * Under Windows we need to wait a bit until the map generator is done
+     * with generating the map, until an easy way is found to "wait until the
+     * program is finished".
+     */
+    int i;
+
+    for (i = 0; i < LW_RANDOM_RUN_RETRIES && !exists (filename); ++i)
+      {
+	rest (LW_RANDOM_RUN_DELAY);
+      }
+  }
+#endif
+  display_success (ok);
+
+  if (ok)
+    {
+      bmp = load_bitmap (filename, pal);
+    }
+  else
+    {
+      bmp = NULL;
+    }
+
+  delete_file (filename);
+
+#ifdef WIN32
+  {
+    /*
+     * Sometimes files aren't deleted properly on Windows, so we wait
+     * "a little more" just to be sure.
+     */
+    int i;
+
+    for (i = 0; i < LW_RANDOM_RUN_RETRIES && exists (filename); ++i)
+      {
+	rest (LW_RANDOM_RUN_DELAY);
+	delete_file (filename);
+      }
+  }
+#endif
+
+  return bmp;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_random_generate_map ()
+{
+  BITMAP *bmp;
+  PALETTE pal;
+  void *raw_map = NULL;
+  int result = 0;
+
+  bmp = generate_bitmap ();
+  generate_bw_palette (pal);
+
+  if (bmp)
+    {
+      raw_map = lw_map_archive_raw_bmp (bmp, pal, "lwmapgen");
+    }
+
+  if (raw_map)
+    {
+      if (LW_RANDOM_RAW_MAP)
+	{
+	  free (LW_RANDOM_RAW_MAP);
+	}
+      LW_RANDOM_RAW_MAP = raw_map;
+      result = 1;
+    }
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/random.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/random.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/random.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,78 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : random.h                                         */
+/* content       : wrapper for the functions in ../utils/lwmpagen/  */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_RANDOM
+#define LIQUID_WAR_INCLUDE_RANDOM
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+void *LW_RANDOM_RAW_MAP;
+int LW_RANDOM_ON;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int lw_random_generate_map ();
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/rules.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/rules.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/rules.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,300 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : rules.c                                          */
+/* contenu       : choix des regles de jeu                          */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+#include <stdio.h>
+
+#include "advanced.h"
+#include "config.h"
+#include "dialog.h"
+#include "disk.h"
+#include "help.h"
+#include "menu.h"
+#include "rules.h"
+#include "sound.h"
+#include "time.h"
+#include "lang.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+#define LW_RULES_CIS_SIZE   30
+#define LW_RULES_TIME_SIZE  14
+#define LW_RULES_MMR_SIZE   50
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static void
+write_cis_setting (DIALOG * d)
+{
+  char *str;
+
+  str = d->dp;
+  LW_MACRO_SNPRINTF2 (str,
+		      LW_RULES_CIS_SIZE,
+		      "%s x%d",
+		      lw_lang_string (LW_LANG_STRING_RULES_CURSOR),
+		      CONFIG_CURSOR_INCREASE_SPEED + 1);
+}
+
+/*------------------------------------------------------------------*/
+static int
+slider_cis (void *dp3, int d2)
+{
+  DIALOG *d;
+
+  d = dp3;
+
+  CONFIG_CURSOR_INCREASE_SPEED = d2;
+  write_cis_setting (d);
+
+  scare_mouse ();
+  my_textbox_proc (MSG_DRAW, d, 0);
+  unscare_mouse ();
+
+  play_click ();
+
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+static void
+write_time_setting (DIALOG * d)
+{
+  char *str;
+
+  str = d->dp;
+  start_play_time ();
+  write_time (TIME_LEFT, str + 8);
+}
+
+/*------------------------------------------------------------------*/
+static int
+slider_time (void *dp3, int d2)
+{
+  DIALOG *d;
+
+  d = dp3;
+
+  CONFIG_GAME_TIME = d2;
+  /*
+   * Following line needed because start_play_time() uses the
+   * value in LW_CONFIG_CURRENT_RULES
+   */
+  LW_CONFIG_CURRENT_RULES.game_time = CONFIG_GAME_TIME;
+
+  write_time_setting (d);
+
+  scare_mouse ();
+  my_textbox_proc (MSG_DRAW, d, 0);
+  unscare_mouse ();
+
+  play_click ();
+
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+static void
+write_mmr_setting (DIALOG * d)
+{
+  char *str;
+
+  str = d->dp;
+  LW_MACRO_SNPRINTF3 (str,
+		      LW_RULES_MMR_SIZE,
+		      "%s%dx%d",
+		      lw_lang_string (LW_LANG_STRING_RULES_MINMAPRES),
+		      MIN_MAP_RES_W[CONFIG_MIN_MAP_RES],
+		      MIN_MAP_RES_H[CONFIG_MIN_MAP_RES]);
+}
+
+/*------------------------------------------------------------------*/
+static int
+slider_mmr (void *dp3, int d2)
+{
+  DIALOG *d;
+
+  d = dp3;
+
+  CONFIG_MIN_MAP_RES = d2;
+  write_mmr_setting (d);
+
+  scare_mouse ();
+  my_textbox_proc (MSG_DRAW, d, 0);
+  unscare_mouse ();
+
+  play_click ();
+
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+int
+rules_options (void)
+{
+  int *temp;
+  DIALOG d[15];
+  int i, choix = 4, retour = 0;
+  static int y_pos[4] = { 0, 1, 2, 3 };
+  char cis_buffer[LW_RULES_CIS_SIZE];
+  char time_str[LW_RULES_TIME_SIZE];
+  char mmr_buffer[LW_RULES_MMR_SIZE];
+
+  memset (d, 0, sizeof (d));
+
+  LW_MACRO_SPRINTF1 (time_str, "%-8s00:00",
+		     lw_lang_string (LW_LANG_STRING_RULES_TIME));
+
+  for (i = 0; i < 4; ++i)
+    {
+      standard_button (d + i + 4, 0, y_pos[i], 2, 8);
+      d[i + 4].proc = my_textbox_proc;
+    }
+  for (i = 0; i < 4; ++i)
+    {
+      standard_button (d + i + 8, 1, y_pos[i], 2, 8);
+      d[i + 8].proc = my_slider_proc;
+    }
+
+  standard_button (d + 12, 0, 5, 1, 8);
+  d[12].dp = lw_lang_string (LW_LANG_STRING_RULES_ADVANCED);
+
+  standard_button (d + 13, 0, 7, 1, 8);
+  d[13].dp = lw_lang_string (LW_LANG_STRING_RULES_DEFAULT);
+
+  quick_buttons (d);
+  d[4].dp = time_str;
+  d[5].dp = lw_lang_string (LW_LANG_STRING_RULES_ARMYSIZE);
+  d[6].dp = cis_buffer;
+  d[7].dp = mmr_buffer;
+  d[8].d1 = 16;
+  d[9].d1 = 32;
+  d[10].d1 = 2;
+  d[11].d1 = 8;
+  d[8].dp3 = &CONFIG_GAME_TIME;
+  d[9].dp3 = &CONFIG_FIGHTER_NUMBER;
+  d[10].dp3 = &CONFIG_CURSOR_INCREASE_SPEED;
+  d[11].dp3 = &CONFIG_MIN_MAP_RES;
+  for (i = 8; i < 12; ++i)
+    {
+      d[i].dp = NULL;
+      d[i].dp2 = slider_int;
+      temp = d[i].dp3;
+      d[i].d2 = *temp;
+    }
+  d[8].dp2 = slider_time;
+  d[8].dp3 = d + 4;
+  d[10].dp2 = slider_cis;
+  d[10].dp3 = d + 6;
+  d[11].dp2 = slider_mmr;
+  d[11].dp3 = d + 7;
+
+  write_time_setting (d + 4);
+  write_cis_setting (d + 6);
+  write_mmr_setting (d + 7);
+
+  d[14].proc = 0;
+
+  while (retour == 0)
+    {
+      choix = my_do_dialog (d, choix);
+      switch (choix)
+	{
+	case -1:
+	case MENU_QUICK_BACK:
+	  retour = 1;
+	  break;
+	case MENU_QUICK_MAIN:
+	  retour = MENU_TOP;
+	  break;
+	case MENU_QUICK_QUIT:
+	  if (confirm_quit ())
+	    retour = MENU_EXIT;
+	  break;
+	case MENU_QUICK_PLAY:
+	  retour = MENU_PLAY;
+	  break;
+	case 12:
+	  retour = advanced_options ();
+	  break;
+	case 13:
+	  load_default_rules ();
+
+	  /*
+	   * Needed because the slider function works in a weird way
+	   */
+	  LW_CONFIG_CURRENT_RULES.game_time = CONFIG_GAME_TIME;
+
+	  d[8].d2 = CONFIG_GAME_TIME;
+	  d[9].d2 = CONFIG_FIGHTER_NUMBER;
+	  d[10].d2 = CONFIG_CURSOR_INCREASE_SPEED;
+	  d[11].d2 = CONFIG_MIN_MAP_RES;
+	  write_time_setting (d + 4);
+	  write_cis_setting (d + 6);
+	  write_mmr_setting (d + 7);
+	  break;
+	}
+    }
+
+  if (retour > 0)
+    retour--;
+
+  return retour;
+}

Added: unstable/liquidwar/branches/upstream/current/src/rules.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/rules.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/rules.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,67 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : rules.h                                          */
+/* contenu       : choix des regles de jeu                          */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_RULES
+#define LIQUID_WAR_INCLUDE_RULES
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int rules_options (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/score.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/score.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/score.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,448 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : score.c                                          */
+/* contenu       : calcul et affichage des scores                   */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "army.h"
+#include "back.h"
+#include "base.h"
+#include "config.h"
+#include "cursor.h"
+#include "decal.h"
+#include "dialog.h"
+#include "disk.h"
+#include "help.h"
+#include "menu.h"
+#include "score.h"
+#include "sound.h"
+#include "ticker.h"
+#include "log.h"
+#include "lang.h"
+#include "checksum.h"
+#include "startup.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_SCORE_TOMBOLA_MAX         500
+#define LW_SCORE_DISP_BUFFER_SIZE     33
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+int LW_SCORE_TOMBOLA_RESULT[NB_TEAMS];
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static int
+get_cursor (int classement)
+{
+  int i, j, indice_curseur = -1;
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    if (CURRENT_CURSOR[i].active && CURRENT_CURSOR[i].loose_time < 0)
+      {
+	CURRENT_CURSOR[i].score_order = 1;
+
+	for (j = 0; j < i; ++j)
+	  if (CURRENT_CURSOR[j].active &&
+	      ACTIVE_FIGHTERS[CURRENT_CURSOR[i].team]
+	      <= ACTIVE_FIGHTERS[CURRENT_CURSOR[j].team])
+	    CURRENT_CURSOR[i].score_order++;
+	for (j = i + 1; j < NB_TEAMS; ++j)
+	  if (CURRENT_CURSOR[j].active &&
+	      ACTIVE_FIGHTERS[CURRENT_CURSOR[i].team]
+	      < ACTIVE_FIGHTERS[CURRENT_CURSOR[j].team])
+	    CURRENT_CURSOR[i].score_order++;
+      }
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      if (CURRENT_CURSOR[i].score_order == classement
+	  && (CURRENT_CURSOR[i].active || CURRENT_CURSOR[i].loose_time >= 0))
+	indice_curseur = i;
+    }
+
+  return indice_curseur;
+}
+
+/*------------------------------------------------------------------*/
+static void
+write_score (int indice, char *buffer, int fill_level)
+{
+  int time, min, sec, pourmille, pourcent, decimale;
+  int tombola;
+
+  if (indice >= 0)
+    {
+      if (fill_level < 0)
+	fill_level = 0;
+      if (fill_level > 1000)
+	fill_level = 1000;
+
+      if (!STARTUP_TOMBOLA)
+	{
+	  if (CURRENT_CURSOR[indice].score_order == 1 && PLAYING_TEAMS == 1)
+	    {
+	      LW_MACRO_STRNCPY (buffer,
+				lw_lang_string (LW_LANG_STRING_SCORE_WINNER),
+				LW_SCORE_DISP_BUFFER_SIZE);
+	    }
+	  else
+	    {
+	      if (CURRENT_CURSOR[indice].loose_time <= 0)
+		{
+		  pourmille =
+		    (ACTIVE_FIGHTERS[CURRENT_CURSOR[indice].team] *
+		     fill_level) / CURRENT_ARMY_SIZE;
+		  pourcent = pourmille / 10;
+		  decimale = pourmille % 10;
+		  LW_MACRO_SNPRINTF2 (buffer,
+				      LW_SCORE_DISP_BUFFER_SIZE,
+				      "%d.%01d%%", pourcent, decimale);
+		}
+	      else
+		{
+		  time =
+		    (CURRENT_CURSOR[indice].loose_time * fill_level) / 1000;
+		  min = time / 60;
+		  sec = time % 60;
+		  LW_MACRO_SNPRINTF2 (buffer,
+				      LW_SCORE_DISP_BUFFER_SIZE,
+				      "%02d:%02d", min, sec);
+		}
+	    }
+	}
+      else
+	{
+	  /*
+	   * OK, we're in "tombola" mode, so we display a random
+	   * number instead of the score.
+	   */
+
+	  tombola = (LW_SCORE_TOMBOLA_RESULT[indice] * fill_level) / 1000;
+	  LW_MACRO_SNPRINTF1 (buffer,
+			      LW_SCORE_DISP_BUFFER_SIZE, "%03d", tombola);
+	}
+    }
+  else
+    {
+      LW_MACRO_SNPRINTF0 (buffer, LW_SCORE_DISP_BUFFER_SIZE, "");
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+init_tombola ()
+{
+  int i;
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      LW_SCORE_TOMBOLA_RESULT[i] = random () % LW_SCORE_TOMBOLA_MAX + 1;
+    }
+}
+
+/*------------------------------------------------------------------*/
+static int
+draw_score_bitmap (BITMAP * bitmap, int cursor, int ellipse_h, int fill_level)
+{
+  int w, h;
+  int color1 = 0, color2 = 0;
+  int y_rect1, y_rect2, x_mid;
+  int to_be_filled, to_be_drawn;
+
+  w = bitmap->w;
+  if (!(w & 1))
+    w -= 1;
+  h = bitmap->h;
+  y_rect1 = ellipse_h / 2;
+  y_rect2 = h - y_rect1 - 1;
+  x_mid = w / 2;
+  if (cursor < 0)
+    fill_level = 0;
+  else
+    {
+      color1 = CURRENT_CURSOR[cursor].color_entry + COLORS_PER_TEAM / 2;
+      color2 = CURRENT_CURSOR[cursor].color_entry + COLORS_PER_TEAM - 1;
+    }
+  if (fill_level < 0)
+    fill_level = 0;
+  to_be_filled = fill_level ? 1 : 0;
+  to_be_drawn = fill_level > 1000 ? 0 : 1;
+  if (fill_level > 1000)
+    fill_level = 1000;
+
+  if (to_be_drawn)
+    {
+      fill_level = 1000 - fill_level;
+      fill_level *= h - 3 * y_rect1;
+      fill_level /= 1000;
+      fill_level += 2 * y_rect1;
+
+      rectfill (bitmap, 0, 0, w, h, 0);
+
+      if (to_be_filled)
+	ellipsefill (bitmap, x_mid, y_rect2, x_mid, ellipse_h / 2, color1);
+      ellipse (bitmap, x_mid, y_rect2, x_mid, ellipse_h / 2, MENU_FG);
+      if (to_be_filled)
+	{
+	  rectfill (bitmap, 1, fill_level, x_mid * 2 - 1, y_rect2 - 1,
+		    color1);
+	  ellipsefill (bitmap, x_mid, fill_level, x_mid - 1,
+		       ellipse_h / 2 - 1, color2);
+	}
+
+      vline (bitmap, 0, y_rect1, y_rect2, MENU_FG);
+      vline (bitmap, x_mid * 2, y_rect1, y_rect2, MENU_FG);
+
+      ellipse (bitmap, x_mid, y_rect1, x_mid, ellipse_h / 2, MENU_FG);
+    }
+  return to_be_drawn;
+}
+
+/*------------------------------------------------------------------*/
+int
+display_scores (void)
+{
+  int last_draw_done = 0;
+  int first_ticker, diff_ticker;
+  int retour = 0, choix = MENU_QUICK_MAIN;
+  DIALOG d[11];
+  DIALOG_PLAYER *dp;
+  char buf[3][LW_SCORE_DISP_BUFFER_SIZE];
+  char buf_old[3][LW_SCORE_DISP_BUFFER_SIZE];
+  int x[3];
+  int h[3];
+  int w, y;
+  int ellipse_h;
+  int i;
+  int cursor[3];
+  BITMAP *eprouvette[3];
+  int time_delay[3] = { 500, 2500, 1500 };
+  int fill_level;
+  int done[3];
+
+  memset (d, 0, sizeof (d));
+
+  quick_buttons (d);
+
+  for (i = 0; i < 3; ++i)
+    {
+      standard_small_button (d + i + 4, i, 10, 3, 11);
+      d[i + 4].proc = my_textbox_proc;
+    }
+
+  d[4].dp = "";
+  d[5].dp = "";
+  d[6].dp = "";
+
+  standard_button (d + 7, 0, 4, 3, 11);
+  standard_button (d + 8, 1, 0, 3, 11);
+  standard_button (d + 9, 2, 2, 3, 11);
+
+  for (i = 0; i < 3; ++i)
+    {
+      d[i + 7].proc = my_textbox_proc;
+      d[i + 7].flags = D_HIDDEN;
+    }
+
+  d[7].dp = "";
+  d[8].dp = "";
+  d[9].dp = "";
+
+  d[10].proc = NULL;
+
+  init_tombola ();
+
+  ellipse_h = d[4].h;
+  y = d[4].y - menu_real_y (MENU_H_SPACE);
+  h[1] = 2 * y - SCREEN_H;
+  h[0] = h[1] / 2;
+  h[2] = (3 * h[1]) / 4;
+  w = d[4].w;
+  x[0] = d[4].x;
+  x[1] = d[5].x;
+  x[2] = d[6].x;
+
+  cursor[0] = get_cursor (3);
+  cursor[1] = get_cursor (1);
+  cursor[2] = get_cursor (2);
+
+  for (i = 0; i < 3; ++i)
+    {
+      done[i] = 0;
+      write_score (cursor[i], buf[i], 0);
+      buf_old[i][0] = '\0';
+      eprouvette[i] = my_create_bitmap (w, h[i]);
+    }
+
+  d[MENU_QUICK_QUIT].flags = D_HIDDEN;
+  d[MENU_QUICK_PLAY].flags = D_HIDDEN;
+
+  display_back_image ();
+  dp = my_init_dialog (d, 0);
+  my_update_dialog (dp);
+  shutdown_dialog (dp);
+
+  my_fade_in ();
+
+  play_win ();
+  first_ticker = get_ticker ();
+
+  while (retour == 0)
+    {
+      if (!last_draw_done)
+	{
+	  dp = my_init_dialog (d, choix);
+	  while (my_update_dialog (dp) && !last_draw_done)
+	    {
+	      scare_mouse ();
+	      diff_ticker = get_ticker () - first_ticker;
+	      if (cursor[0] < 0)
+		diff_ticker += 1000;
+
+	      for (i = 0; i < 3; ++i)
+		{
+		  if (!done[i])
+		    {
+		      fill_level = diff_ticker - time_delay[i];
+		      if (draw_score_bitmap
+			  (eprouvette[i], cursor[i], ellipse_h, fill_level))
+			{
+			  draw_sprite (screen, eprouvette[i], x[i], y - h[i]);
+			  if (fill_level > 0)
+			    {
+			      write_score (cursor[i], buf[i], fill_level);
+			      if (strcmp (buf[i], buf_old[i]) != 0)
+				{
+				  d[4 + i].dp = buf[i];
+				  d[4 + i].proc (MSG_DRAW, d + 4 + i, 0);
+				  LW_MACRO_STRCPY (buf_old[i], buf[i]);
+				}
+			    }
+			}
+		      else
+			{
+			  if (i == 1)
+			    {
+			      last_draw_done = 1;
+			    }
+
+			  d[7 + i].dp = CURRENT_CURSOR[cursor[i]].name;
+			  d[7 + i].flags = 0;
+			  d[7 + i].proc (MSG_DRAW, d + 7 + i, 0);
+
+			  done[i] = 1;
+			}
+		    }
+		}
+	      unscare_mouse ();
+
+	      rest (10);
+	    }
+	  choix = shutdown_dialog (dp);
+	}
+
+      if (last_draw_done)
+	{
+	  scare_mouse ();
+	  for (i = 0; i < 3; ++i)
+	    draw_sprite (screen, eprouvette[i], x[i], y - h[i]);
+	  unscare_mouse ();
+
+	  d[MENU_QUICK_QUIT].flags = D_EXIT;
+	  d[MENU_QUICK_PLAY].flags = D_EXIT;
+	  choix = my_do_dialog_no_clear (d,
+					 last_draw_done == 1 ? MENU_QUICK_BACK
+					 : choix);
+	  last_draw_done = 2;
+	}
+
+      switch (choix)
+	{
+	case -1:
+	case MENU_QUICK_BACK:
+	  retour = 1;
+	  break;
+	case MENU_QUICK_MAIN:
+	  retour = MENU_TOP;
+	  break;
+	case MENU_QUICK_QUIT:
+	  if (confirm_quit ())
+	    retour = MENU_EXIT;
+	  else
+	    display_back_image ();
+	  break;
+	case MENU_QUICK_PLAY:
+	  retour = MENU_PLAY;
+	  break;
+	}
+    }
+
+  for (i = 0; i < 3; ++i)
+    destroy_bitmap (eprouvette[i]);
+  if (retour > 0)
+    retour--;
+
+  return retour;
+}

Added: unstable/liquidwar/branches/upstream/current/src/score.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/score.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/score.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,68 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : score.h                                          */
+/* contenu       : calcul et affichage des scores                   */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_SCORE
+#define LIQUID_WAR_INCLUDE_SCORE
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int display_scores (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/serial.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/serial.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/serial.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,222 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name    : serial.c                                               */
+/* content : routines used to (un)serialize values                  */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "serial.h"
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+/*
+ * If you define LW_SERIAL_WRONG_BYTE_ORDER, the game will
+ * be compiledd with the "other" byte order. This is for testing
+ * only, do *not* used for release build, _even_ when compiling on
+ * a Mac. The purpose of this constant is testing, to check that
+ * there are no bugs. Should you compile a release with this flag
+ * set to 1, you would not be able to play in networked mode with
+ * other players using the "standard" byte order.
+ */
+//#define LW_SERIAL_WRONG_ENDIANESS
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*
+ * Here's an ugly serialization of ints and shorts.
+ * Usefull to make the game work on Mac OS X and possible
+ * any platform that does not have PC-like endianess
+ */
+
+/*------------------------------------------------------------------*/
+int
+lw_serial_get_int (void *raw)
+{
+  int i = 0;
+  unsigned char *ptr;
+
+  ptr = (unsigned char *) raw;
+
+#ifndef LW_SERIAL_WRONG_ENDIANESS
+  i = ((unsigned int) ptr[3]) << 24
+    | ((unsigned int) ptr[2]) << 16
+    | ((unsigned int) ptr[1]) << 8 | ((unsigned int) ptr[0]);
+#else
+  i = ((unsigned int) ptr[0]) << 24
+    | ((unsigned int) ptr[1]) << 16
+    | ((unsigned int) ptr[2]) << 8 | ((unsigned int) ptr[3]);
+#endif
+
+  return i;
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_serial_set_int (void *raw, int i)
+{
+  unsigned char *ptr;
+
+  ptr = (unsigned char *) raw;
+
+#ifndef LW_SERIAL_WRONG_ENDIANESS
+  ptr[0] = 0xFF & i;
+  ptr[1] = 0xFF & i >> 8;
+  ptr[2] = 0xFF & i >> 16;
+  ptr[3] = i >> 24;
+#else
+  ptr[3] = 0xFF & i;
+  ptr[2] = 0xFF & i >> 8;
+  ptr[1] = 0xFF & i >> 16;
+  ptr[0] = i >> 24;
+#endif
+}
+
+/*------------------------------------------------------------------*/
+short
+lw_serial_get_short (void *raw)
+{
+  short s = 0;
+  unsigned char *ptr;
+
+  ptr = (unsigned char *) raw;
+
+#ifndef LW_SERIAL_WRONG_ENDIANESS
+  s = ((unsigned int) ptr[1]) << 8 | ((unsigned int) ptr[0]);
+#else
+  s = ((unsigned int) ptr[0]) << 8 | ((unsigned int) ptr[1]);
+#endif
+
+  return s;
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_serial_set_short (void *raw, int s)
+{
+  unsigned char *ptr;
+
+  ptr = (unsigned char *) raw;
+
+#ifndef LW_SERIAL_WRONG_ENDIANESS
+  ptr[0] = 0xFF & s;
+  ptr[1] = 0xFF & s >> 8;
+#else
+  ptr[1] = 0xFF & s;
+  ptr[0] = 0xFF & s >> 8;
+#endif
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_serial_get_map_header (void *raw_map, int *size, short *w, short *h)
+{
+  char *header;
+
+  header = (char *) raw_map;
+
+  if (size != NULL)
+    {
+      (*size) = lw_serial_get_int (header);
+    }
+  if (w != NULL)
+    {
+      (*w) = lw_serial_get_short (header + 4);
+    }
+  if (h != NULL)
+    {
+      (*h) = lw_serial_get_short (header + 6);
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_serial_set_map_header (void *raw_map, int size, short w, short h)
+{
+  char *header;
+
+  header = (char *) raw_map;
+
+  lw_serial_set_int (header, size);
+  lw_serial_set_short (header + 4, w);
+  lw_serial_set_short (header + 6, h);
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_serial_get_texture_header (void *raw_texture, short *w, short *h)
+{
+  char *header;
+
+  header = (char *) raw_texture;
+
+  if (w != NULL)
+    {
+      (*w) = lw_serial_get_short (header + 0);
+    }
+  if (h != NULL)
+    {
+      (*h) = lw_serial_get_short (header + 2);
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_serial_set_texture_header (void *raw_texture, short w, short h)
+{
+  char *header;
+
+  header = (char *) raw_texture;
+
+  lw_serial_set_short (header + 0, w);
+  lw_serial_set_short (header + 2, h);
+}

Added: unstable/liquidwar/branches/upstream/current/src/serial.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/serial.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/serial.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,82 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name    : serial.h                                               */
+/* content : routines used to (un)serialize values                  */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_SERIAL
+#define LIQUID_WAR_INCLUDE_SERIAL
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_MAP_SYSTEM_NAME_SIZE 16
+#define LW_MAP_READABLE_NAME_SIZE 32
+
+#define LW_TEXTURE_SYSTEM_NAME_SIZE 16
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int lw_serial_get_int (void *raw);
+void lw_serial_set_int (void *raw, int i);
+short lw_serial_get_short (void *raw);
+void lw_serial_set_short (void *raw, int s);
+void lw_serial_get_map_header (void *raw_map, int *size, short *w, short *h);
+void lw_serial_set_map_header (void *raw_map, int size, short w, short h);
+void lw_serial_get_texture_header (void *raw_texture, short *w, short *h);
+void lw_serial_set_texture_header (void *raw_texture, short w, short h);
+
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/server.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/server.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/server.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,438 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : server.c                                         */
+/* content       : main source for the liquidwar-server executable  */
+/* last update   : April 14th 2001                                  */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "server.h"
+#include "netmess.h"
+#include "sockgen.h"
+#include "parser.h"
+#include "basicopt.h"
+#include "srvcont.h"
+#include "log.h"
+#include "wwwsrv.h"
+#include "thrdgen.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_SERVER_IDENT_LAG        "lag"
+#define LW_SERVER_IDENT_PORT       "port"
+#define LW_SERVER_IDENT_METASERVER "metaserver"
+#define LW_SERVER_IDENT_PUBLIC     "public"
+#define LW_SERVER_IDENT_PRIVATE    "private"
+#define LW_SERVER_IDENT_PASSWORD   "password"
+#define LW_SERVER_IDENT_COMMENT    "comment"
+#define LW_SERVER_IDENT_LOG        "log"
+#define LW_SERVER_IDENT_CALLBACK   "callback"
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+static int get_nb_teams ();
+static int get_lag ();
+static int get_port ();
+static int get_privacy (char *metaserver);
+static char *get_metaserver ();
+static char *get_password ();
+static char *get_comment ();
+static char *get_callback ();
+
+/*------------------------------------------------------------------*/
+/*
+ * This function returns how many teams there must be. Basically,
+ * it checks the command line parameters, and if the number
+ * of teams has not be told, then it prompts the user for it.
+ */
+static int
+get_nb_teams ()
+{
+  int i;
+  char str_i[33];
+  int result = 0;
+  char c;
+
+  for (i = 1; i <= NB_TEAMS; ++i)
+    {
+      LW_MACRO_SPRINTF1 (str_i, "%d", i);
+      if (exist_argument (str_i))
+	{
+	  result = i;
+	}
+    }
+
+  if (result < 2 || result > NB_TEAMS)
+    {
+      log_print_str ("How many teams will connect to this server? ");
+
+      while ((c = getchar ()) == '\n');
+
+      if (c >= '2' && c <= '0' + NB_TEAMS)
+	{
+	  result = c - '0';
+
+	  log_print_str ("Use \"-");
+	  log_print_int (result);
+	  log_println_str ("\" to get rid of this question.");
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * This function returns the server lag.
+ * This parameter is quite important, since it's the number of rounds
+ * which will elapse between the moment when the client sends his
+ * key strokes and the moment when he will receive them back from
+ * the server, along with the information from other players.
+ */
+static int
+get_lag ()
+{
+  int result = LW_SERVER_DEFAULT_LAG;
+
+  if (exist_argument (LW_SERVER_IDENT_LAG))
+    {
+      result = get_argument_int (LW_SERVER_IDENT_LAG);
+      if (result < 0)
+	{
+	  result = 0;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Returns the port which should be used to communicate with clients
+ */
+static int
+get_port ()
+{
+  int result = LW_SERVER_DEFAULT_PORT;
+
+  if (exist_argument (LW_SERVER_IDENT_PORT))
+    {
+      result = get_argument_int (LW_SERVER_IDENT_PORT);
+      if (result <= 0)
+	{
+	  result = LW_SERVER_DEFAULT_PORT;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * This function returns 1 if the server should register on
+ * the meta server and 0 if it should not do it
+ */
+static int
+get_privacy (char *metaserver)
+{
+  int result = 0;
+  int chosen = 0;
+  char c;
+
+  if (exist_argument (LW_SERVER_IDENT_PUBLIC))
+    {
+      /*
+       * The command line explicitely says -public,
+       * we register on the metaserver
+       */
+      chosen = 1;
+      result = 1;
+    }
+
+  if (exist_argument (LW_SERVER_IDENT_PRIVATE))
+    {
+      /*
+       * The command line explicitely says -private,
+       * we do not register on the metaserver
+       */
+      chosen = 1;
+    }
+
+  if (!chosen)
+    {
+      /*
+       * no command line option, we ask the question
+       * interactively
+       */
+      log_print_str ("Register on \"");
+      log_print_str (metaserver);
+      log_print_str ("\" (y/n)? ");
+
+      while ((c = getchar ()) == '\n');
+
+      if (c == 'y' || c == 'Y')
+	{
+	  result = 1;
+	}
+
+      if (result)
+	{
+	  log_println_str ("Use \"-public\" to get rid of this question.");
+	}
+      else
+	{
+	  log_println_str ("Use \"-private\" to get rid of this question.");
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Returns the metaserver name
+ */
+static char *
+get_metaserver ()
+{
+  char *result = LW_SERVER_DEFAULT_METASERVER;
+
+  if (exist_argument (LW_SERVER_IDENT_METASERVER))
+    {
+      result = get_argument_str (LW_SERVER_IDENT_METASERVER);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Returns the password associated to the server
+ */
+static char *
+get_password ()
+{
+  char *result = "";
+
+  result = get_argument_str (LW_SERVER_IDENT_PASSWORD);
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Returns the comment associated to the server
+ */
+static char *
+get_comment ()
+{
+  char *result = "";
+
+  result = get_argument_str (LW_SERVER_IDENT_COMMENT);
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Returns the log file name
+ */
+char *
+lw_server_get_log ()
+{
+  char *result = "";
+
+  result = get_argument_str (LW_SERVER_IDENT_LOG);
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Returns the callback script/program called when a client connects
+ * on the server.
+ */
+static char *
+get_callback ()
+{
+  char *result = "";
+
+  result = get_argument_str (LW_SERVER_IDENT_CALLBACK);
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Exits the program and cleans up a few things
+ */
+void
+lw_server_exit (int code)
+{
+  lw_sock_exit ();
+
+  log_exit ();
+
+  exit (code);
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Main function, launches the server.
+ * Here we don't need to use the END_OF_MAIN() hack of Allegro, since
+ * under windows the game will be compiled as a console App
+ * (no WinMain needed) and we don't use Allegro at all here anyway...
+ */
+int
+main (int argc, char **argv)
+{
+  int retcode = 0;
+  LW_SRVCONT cont;
+  LW_WWWSRV_DATA www_data;
+  char *metaserver;
+  int nb_teams;
+  int port;
+  int res = 1;
+
+  lw_sock_init ();
+
+  read_command_line (argc, argv);
+
+  /*
+   * we initialize the log _after_ read_command_line for
+   * a special log file might have been specified
+   */
+  log_init ();
+
+  if (lw_basicopt_process ("Liquid War Server"))
+    {
+      nb_teams = get_nb_teams ();
+
+      if (nb_teams >= 2 && nb_teams <= NB_TEAMS)
+	{
+	  port = get_port ();
+	  metaserver = get_metaserver ();
+	  /* 
+	   * we initialize the www_data struct which will contain
+	   * all the informations to be transmitted to the metaserver
+	   */
+	  lw_wwwsrv_init (&www_data,
+			  get_privacy (metaserver),
+			  0,
+			  metaserver,
+			  port, 0, 0, get_password (), get_comment ());
+
+	  log_flush ();
+	  log_set_server_mode (1);
+
+	  /*
+	   * a good old infinite loop, the server has to be stopped
+	   * with CTRL-C
+	   */
+	  while (1)
+	    {
+	      if (lw_srvcont_wait_teams (&cont,
+					 &www_data,
+					 nb_teams,
+					 port,
+					 get_password (), get_callback ()))
+		{
+		  if (lw_srvcont_tell_who (&cont))
+		    {
+		      if (lw_srvcont_final_ok (&cont))
+			{
+			  res = lw_srvcont_replicate_keys
+			    (&cont, &www_data, get_lag (), get_password ());
+			}
+		    }
+		}
+	      lw_srvcont_close (&cont);
+
+	      log_flush ();
+	    }
+	}
+      else
+	{
+	  log_println_str ("Not enough or too many teams!");
+	}
+    }
+  else
+    {
+      /*
+       * we exit with a normal code (--help or --version)
+       */
+
+      lw_server_exit (0);
+    }
+
+  /*
+   * If we get here, there necessarily an error
+   */
+  lw_server_exit (1);
+
+  /*
+   * Non-reachable code, but GCC would complain if we did not
+   * return something...
+   */
+
+  return retcode;
+}

Added: unstable/liquidwar/branches/upstream/current/src/server.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/server.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/server.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,71 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : server.h                                         */
+/* content       : main source for the liquidwar-server executable  */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_SERVER
+#define LIQUID_WAR_INCLUDE_SERVER
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_SERVER_DEFAULT_ADDRESS     "127.0.0.1"
+#define LW_SERVER_DEFAULT_PORT        8035
+#define LW_SERVER_DEFAULT_LAG         6
+#define LW_SERVER_DEFAULT_METASERVER  "www.ufoot.org/metaserver/"
+
+#define LW_SERVER_METASERVER_PROTOCOL "1.0"
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+char *lw_server_get_log ();
+void lw_server_exit (int code);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/sock2cli.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/sock2cli.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/sock2cli.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,201 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : sock2cli.c                                       */
+/* content       : wrapper functions used on the client             */
+/* last update   : July  2md 2001                                   */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "sock2gen.h"
+#include "ticker.h"
+
+/*==================================================================*/
+/* defines                                                          */
+/*==================================================================*/
+
+#ifdef WIN32
+/*
+ * There are some problems with network under Windows, I suspect this
+ * is due to the fact W98 has some poor support network, and for some
+ * unexplained reasons map send/recv goes very slow, even on a LAN.
+ * So I set a higher value to the client timeout, hoping it will solve
+ * the problem.
+ */
+#define LW_SOCK2CLI_TIMEOUT_MSEC        30000
+#else
+/*
+ * there's a 12 sec timeout by default on the client
+ */
+#define LW_SOCK2CLI_TIMEOUT_MSEC        15000
+#endif
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* static functions                                                 */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_peek (int *sock, int len)
+{
+  int result = 0;
+
+  if (*sock >= 0)
+    {
+      result = lw_sock_peek_ex (sock, len);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_send_str (int *sock, char *str)
+{
+  int result = 0;
+  int limit_ticker;
+
+  /*
+   * Now when allegro is running all standard sleep() or select()
+   * UNIX functions do not work because allegro's timer messes
+   * things up. Therefore we do our own dirty ugly select...
+   */
+  limit_ticker = get_ticker () + LW_SOCK2CLI_TIMEOUT_MSEC;
+  while (limit_ticker > get_ticker () && !result && *sock >= 0)
+    {
+      if (lw_sock_send_str_ex (sock, str))
+	{
+	  result = 1;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_recv_str (int *sock, char *str)
+{
+  int result = 0;
+  int limit_ticker;
+
+  /*
+   * Now when allegro is running all standard sleep() or select()
+   * UNIX functions do not work because allegro's timer messes
+   * things up. Therefore we do our own dirty ugly select...
+   */
+  limit_ticker = get_ticker () + LW_SOCK2CLI_TIMEOUT_MSEC;
+  while (limit_ticker > get_ticker () && !result && *sock >= 0)
+    {
+      if (lw_sock_recv_str_ex (sock, str))
+	{
+	  result = 1;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_send_buffer (int *sock, char *buffer, int len)
+{
+  int result = 0;
+  int limit_ticker;
+
+  /*
+   * Now when allegro is running all standard sleep() or select()
+   * UNIX functions do not work because allegro's timer messes
+   * things up. Therefore we do our own dirty ugly select...
+   */
+  limit_ticker = get_ticker () + LW_SOCK2CLI_TIMEOUT_MSEC;
+  while (limit_ticker > get_ticker () && !result && *sock >= 0)
+    {
+      if (lw_sock_send_buffer_ex (sock, buffer, len))
+	{
+	  result = 1;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_recv_buffer (int *sock, char *buffer, int len)
+{
+  int result = 0;
+  int limit_ticker;
+
+  /*
+   * Now when allegro is running all standard sleep() or select()
+   * UNIX functions do not work because allegro's timer messes
+   * things up. Therefore we do our own dirty ugly select...
+   */
+  limit_ticker = get_ticker () + LW_SOCK2CLI_TIMEOUT_MSEC;
+  while (limit_ticker > get_ticker () && !result && *sock >= 0)
+    {
+      if (lw_sock_peek_ex (sock, len))
+	{
+	  if (lw_sock_recv_buffer_ex (sock, buffer, len))
+	    {
+	      result = 1;
+	    }
+	}
+    }
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/sock2gen.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/sock2gen.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/sock2gen.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,78 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : sock2gen.h                                       */
+/* content       : wrapper functions which differ on client/server  */
+/* last update   : July  2md 2001                                   */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_SOCK2GEN
+#define LIQUID_WAR_INCLUDE_SOCK2GEN
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "sockgen.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int lw_sock_peek (int *sock, int len);
+int lw_sock_send_str (int *sock, char *str);
+int lw_sock_recv_str (int *sock, char *str);
+int lw_sock_send_buffer (int *sock, char *buffer, int len);
+int lw_sock_recv_buffer (int *sock, char *buffer, int len);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/sock2srv.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/sock2srv.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/sock2srv.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,126 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : sock2srv.c                                       */
+/* content       : wrapper functions used on the server             */
+/* last update   : July  2md 2001                                   */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "sock2gen.h"
+
+/*==================================================================*/
+/* defines                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* static functions                                                 */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_peek (int *sock, int len)
+{
+  int result = 0;
+
+  result = lw_sock_peek_ex (sock, len);
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_send_str (int *sock, char *str)
+{
+  int result = 0;
+
+  result = lw_sock_send_str_ex (sock, str);
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_recv_str (int *sock, char *str)
+{
+  int result = 0;
+
+  result = lw_sock_recv_str_ex (sock, str);
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_send_buffer (int *sock, char *buffer, int len)
+{
+  int result = 0;
+
+  result = lw_sock_send_buffer_ex (sock, buffer, len);
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_recv_buffer (int *sock, char *buffer, int len)
+{
+  int result = 0;
+
+  result = lw_sock_recv_buffer_ex (sock, buffer, len);
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/sockdos.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/sockdos.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/sockdos.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,141 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : sockdos.c                                        */
+/* content       : fake DOS network support to avoid link failure   */
+/* last update   : April 13th 2001                                  */
+/********************************************************************/
+
+/*
+ * This file contains empty functions even if DOS releases of LW
+ * have no network support. It permits safe linking.
+ */
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+int LW_SOCK_LOG = 0;
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_init ()
+{
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_exit ()
+{
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_listen (int *sock, char *ip, int port)
+{
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_accept (int *new_sock, char *ip, int *port, int listening_sock)
+{
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_connect (int *sock, char *ip, int port)
+{
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_peek_ex (int sock, int len)
+{
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_send_str_ex (int sock, char *str)
+{
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_recv_str_ex (int sock, char *str)
+{
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_send_buffer_ex (int sock, char *buffer, int len)
+{
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_recv_buffer_ex (int sock, char *buffer, int len)
+{
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+int
+lw_sock_close (int *sock)
+{
+  return 0;
+}

Added: unstable/liquidwar/branches/upstream/current/src/sockex.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/sockex.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/sockex.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,703 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : sockw32.c                                        */
+/* content       : simple wrappers on the winsock API               */
+/* last update   : April 13th 2001                                  */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#ifdef WIN32
+#include <winsock.h>
+#else
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <signal.h>
+#endif
+
+#include <stdlib.h>
+#include <time.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+
+#include "sockgen.h"
+#include "log.h"
+
+/*==================================================================*/
+/* defines                                                          */
+/*==================================================================*/
+
+#define LW_SOCK_RECV_SEC                  8
+#define LW_SOCK_RECV_USEC                 0
+#define LW_SOCK_SEND_SEC                  8
+#define LW_SOCK_SEND_USEC                 0
+
+#define LW_SOCK_SEND_BUFFER_SIZE        100
+#define LW_SOCK_RECV_BUFFER_SIZE        200
+
+/*==================================================================*/
+/* macros                                                           */
+/*==================================================================*/
+
+#ifndef MIN
+#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
+#endif
+#ifndef MAX
+#define MAX(a, b)  (((a) > (b)) ? (a) : (b))
+#endif
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* static fonctions                                                 */
+/*==================================================================*/
+
+static void clean_buffer (char *buffer, int len);
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Cleans up a message buffer from all characters which are not
+ * plain standard ASCII. Used for logging information.
+ */
+static void
+clean_buffer (char *buffer, int len)
+{
+  int i;
+
+  for (i = 0; i < len; ++i)
+    {
+      if (!isalnum (buffer[i]) && buffer[i] != '-' && buffer[i] != '+')
+	{
+	  buffer[i] = '.';
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Returns true if the given number bytes is available on the socket
+ */
+int
+lw_sock_peek_ex (int *sock, int len)
+{
+  int result = 0;
+  int res;
+  fd_set read;
+  struct timeval tv;
+  char buffer[LW_SOCK_MESSAGE_SIZE];
+  int sock_copy;
+
+  if ((sock_copy = *sock) >= 0)
+    {
+      if (len <= LW_SOCK_MESSAGE_SIZE - 1)
+	{
+	  FD_ZERO (&read);
+	  FD_SET (sock_copy, &read);
+	  tv.tv_sec = 0;
+	  tv.tv_usec = 0;
+	  res = select (sock_copy + 1, &read, NULL, NULL, &tv);
+	  if (res > 0)
+	    {
+	      if (FD_ISSET (sock_copy, &read))
+		{
+		  /* 
+		   * First we test if there's enough data available
+		   */
+		  if (recv (sock_copy, buffer, len, MSG_PEEK) == len)
+		    {
+		      result = 1;
+		    }
+		}
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends a string on the network.
+ * The advantage of this function over a raw "send" is that it does
+ * a "strlen" automatically to know the length of the string, and
+ * adds a tailing CR+LF so that the message is "telnet/http compliant"
+ */
+int
+lw_sock_send_str_ex (int *sock, char *str)
+{
+  int result = 0;
+  int len;
+  char buffer[LW_SOCK_MESSAGE_SIZE];
+  int sock_copy;
+  fd_set write;
+  struct timeval tv;
+  int res;
+  int total_sent;
+  int sent;
+#ifdef WIN32
+  int winerr;
+#endif
+
+  if ((sock_copy = *sock) >= 0)
+    {
+      result = 1;
+
+      /*
+       * We put the string in a buffer, since we'll probably have
+       * to modify it (cut if it's too long, add a tailing CR+LF).
+       */
+      len = strlen (str);
+      len = MIN (len, LW_SOCK_MESSAGE_SIZE - 3);
+      strncpy (buffer, str, len);
+      buffer[len] = '\x0d';
+      ++len;
+      buffer[len] = '\x0a';
+      ++len;
+      buffer[len] = '\0';
+
+      total_sent = 0;
+      while (total_sent < len && result && (sock_copy = *sock) >= 0)
+	{
+	  FD_ZERO (&write);
+	  FD_SET (sock_copy, &write);
+	  tv.tv_sec = LW_SOCK_SEND_SEC;
+	  tv.tv_usec = LW_SOCK_SEND_USEC;
+
+	  errno = 0;
+	  res = select (sock_copy + 1, NULL, &write, NULL, &tv);
+
+	  switch (res)
+	    {
+	    case -1:
+#ifdef WIN32
+	      winerr = WSAGetLastError ();
+	      if (winerr != WSAEINTR && winerr != WSAENOBUFS)
+		{
+		  result = 0;
+		}
+#else
+	      if (errno != EINTR && errno != ENOBUFS)
+		{
+		  result = 0;
+		}
+#endif
+	      break;
+	    case 1:
+	      if (FD_ISSET (sock_copy, &write))
+		{
+		  sent =
+		    send (sock_copy, buffer + total_sent, len - total_sent,
+			  0);
+		  if (sent > 0 && sent <= len - total_sent)
+		    {
+		      total_sent += sent;
+		    }
+		  else
+		    {
+		      result = 0;
+		    }
+		}
+	      break;
+	    default:
+	      result = 0;
+	    }
+	}
+
+      if (LW_SOCK_LOG)
+	{
+	  switch (result)
+	    {
+	    case 1:
+	      log_print_int (sock_copy);
+	      log_print_str (" > \"");
+	      log_print_str (str);
+	      log_print_str ("\"");
+	      log_println ();
+	      log_flush ();
+	      break;
+	    case 0:
+	      log_print_int (sock_copy);
+	      log_print_str (" > timeout!");
+	      log_println ();
+	      break;
+	    default:
+	      log_print_int (sock_copy);
+	      log_print_str (" > unexpected error!");
+	      log_println ();
+	      break;
+	    }
+	}
+    }
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Receives some data from the network.
+ * A tailing "\n" is expected. The routine handles both chr(10) and chr(13)
+ * correctly so that the program can be used with telnet under UNIX or
+ * windows without much trouble.
+ * This tailing "\n" is removed, so the return string is just the exact
+ * message which has been send with sock_send.
+ * Buffer must be able to accept at least LW_SOCK_MESSAGE_SIZE chars.
+ * Note that the function will not block forever, if there's no incoming
+ * for more than a #define specified amount of time, it will return
+ * an error.
+ */
+int
+lw_sock_recv_str_ex (int *sock, char *str)
+{
+  int result = 0;
+  int pos, l;
+  int cr_found;
+  char *cr;
+  fd_set read;
+  int sock_copy;
+  struct timeval tv;
+  int res;
+#ifdef WIN32
+  int winerr;
+#endif
+
+  str[0] = '\0';
+
+  if ((sock_copy = *sock) >= 0)
+    {
+      result = 1;
+
+      /*
+       * We keep on trying to get data until
+       * - we get a '\n' character
+       * - the size of incoming data exceeds LW_SOCK_MESSAGE_SIZE
+       * - there's a reception low level error
+       */
+      cr_found = 0;
+      pos = 0;
+      while (!cr_found && pos < LW_SOCK_MESSAGE_SIZE - 1 && result > 0
+	     && (sock_copy = *sock) >= 0)
+	{
+	  FD_ZERO (&read);
+	  FD_SET (sock_copy, &read);
+	  tv.tv_sec = LW_SOCK_RECV_SEC;
+	  tv.tv_usec = LW_SOCK_RECV_USEC;
+
+	  errno = 0;
+	  res = select (sock_copy + 1, &read, NULL, NULL, &tv);
+
+	  switch (res)
+	    {
+	    case -1:
+#ifdef WIN32
+	      winerr = WSAGetLastError ();
+	      if (winerr != WSAEINTR)
+		{
+		  result = 0;
+		}
+#else
+	      if (errno != EINTR)
+		{
+		  result = 0;
+		}
+#endif
+	      break;
+	    case 1:
+	      /*
+	       * We check that the event we just received concerns the socket
+	       * we are polling. If the event is not for us, let's consider
+	       * everything is fine...
+	       */
+	      if (!FD_ISSET (sock_copy, &read))
+		{
+		  result = 1;
+		}
+	      else
+		{
+		  /*
+		   * We get the caracters one by one. This is a performance
+		   * killer but we don't care since this routine is only
+		   * used at the very beginning of the game, when the players
+		   * are connecting themselves. And it has the *big* advantage
+		   * that "netkeys" are not eaten up by this routine. More
+		   * precisely, there's used to be a bug because when reading
+		   * the final "OK" message, the clients read some netkeys
+		   * along with it, which caused some network inconsistency
+		   * since the messages had "disappeared".
+		   */
+		  if ((l = recv (sock_copy, str + pos, 1, 0)) <= 0)
+		    {
+		      /*
+		       * OK, now we have received a message on this socket
+		       * but there's no data. In most of the cases this means
+		       * the socket is dead, so we return -1 instead of 0
+		       * so that the caller can make the difference between
+		       * a timeout (0) and a dead socket (-1).
+		       */
+		      result = -1;
+		    }
+		  else
+		    {
+		      /*
+		       * pos is an offset in the buffer. It is used to keep a
+		       * trace of where new data should be appended in case we
+		       * have to call recv several times to retrieve the whole
+		       * message.
+		       */
+		      pos += l;
+		      /*
+		       * We add a tailing '\0' so that the string is "C compliant"
+		       */
+		      str[pos] = 0;
+		      /*
+		       * We seek for character 10, which should be '\n'
+		       */
+		      if ((cr = strchr (str, '\x0a')) != NULL)
+			{
+			  cr_found = 1;
+			  /*
+			   * We handle the special character '13' for very often,
+			   * especially when using telnet, the strings come
+			   * with char(13)chr(10) at the end. So if it happens
+			   * that after removing the 10 there's still a 13, then
+			   * we remove the 13 as well.
+			   */
+			  if ((cr - str) >= 1 && (*(cr - 1)) == '\x0d')
+			    {
+			      /*
+			       * Let's cut this ugly "ascii 13" character
+			       * along with "ascii 10"
+			       */
+			      (*(cr - 1)) = 0;
+			    }
+			  else
+			    {
+			      /*
+			       * No "ascii 13" in sight, simply remove "ascii 10"
+			       */
+			      (*cr) = 0;
+			    }
+			}
+		      result = 1;
+		    }
+		}
+	      break;
+	    default:
+	      result = 0;
+	    }
+	}
+
+      if (LW_SOCK_LOG)
+	{
+	  switch (result)
+	    {
+	    case 1:
+	      log_print_int (sock_copy);
+	      log_print_str (" < \"");
+	      log_print_str (str);
+	      log_print_str ("\"");
+	      log_println ();
+	      log_flush ();
+	      break;
+	    case 0:
+	      log_print_int (sock_copy);
+	      log_print_str (" < timeout!");
+	      log_println ();
+	      break;
+	    case -1:
+	      log_print_int (sock_copy);
+	      log_print_str (" < closed!");
+	      log_println ();
+	      break;
+	    default:
+	      log_print_int (sock_copy);
+	      log_print_str (" < unexpected error!");
+	      log_println ();
+	      break;
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends a buffer on the network.
+ * Only a standard send wrapper
+ */
+int
+lw_sock_send_buffer_ex (int *sock, char *buffer, int len)
+{
+  int result = 0;
+  char trace[LW_SOCK_MESSAGE_SIZE];
+  fd_set write;
+  struct timeval tv;
+  int sock_copy;
+  int res;
+  int total_sent;
+  int sent;
+#ifdef WIN32
+  int winerr;
+#endif
+
+  if ((sock_copy = *sock) >= 0)
+    {
+      result = 1;
+
+      if (len <= LW_SOCK_MESSAGE_SIZE - 1)
+	{
+	  total_sent = 0;
+	  while (total_sent < len && result && (sock_copy = *sock) >= 0)
+	    {
+	      FD_ZERO (&write);
+	      FD_SET (sock_copy, &write);
+	      tv.tv_sec = LW_SOCK_SEND_SEC;
+	      tv.tv_usec = LW_SOCK_SEND_USEC;
+
+	      errno = 0;
+	      res = select (sock_copy + 1, NULL, &write, NULL, &tv);
+
+	      switch (res)
+		{
+		case -1:
+#ifdef WIN32
+		  winerr = WSAGetLastError ();
+		  if (winerr != WSAEINTR && winerr != WSAENOBUFS)
+		    {
+		      result = 0;
+		    }
+#else
+		  if (errno != EINTR && errno != ENOBUFS)
+		    {
+		      result = 0;
+		    }
+#endif
+		  break;
+		case 1:
+		  if (FD_ISSET (sock_copy, &write))
+		    {
+		      sent = send (sock_copy,
+				   buffer + total_sent,
+				   MIN (len - total_sent,
+					LW_SOCK_SEND_BUFFER_SIZE), 0);
+		      if (sent > 0 && sent <= len - total_sent)
+			{
+			  total_sent += sent;
+			}
+		      else
+			{
+			  result = 0;
+			}
+		    }
+		  break;
+		default:
+		  result = 0;
+		}
+	    }
+
+	  if (LW_SOCK_LOG)
+	    {
+	      if (result)
+		{
+		  strncpy (trace, buffer, len);
+		  trace[len] = '\0';
+		  log_print_int (sock_copy);
+		  log_print_str (" > [");
+		  clean_buffer (trace, len);
+		  log_print_str (trace);
+		  log_print_str ("]");
+		  log_println ();
+		  log_flush ();
+		}
+	      else
+		{
+		  log_print_int (sock_copy);
+		  log_print_str (" > timeout!");
+		  log_println ();
+		}
+	    }
+	}
+      else
+	{
+	  result = 0;
+	  if (LW_SOCK_LOG)
+	    {
+	      log_print_int (sock_copy);
+	      log_print_str (" > message too large!");
+	      log_println ();
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Receives a buffer on the network.
+ * Only a standard recv wrapper
+ */
+int
+lw_sock_recv_buffer_ex (int *sock, char *buffer, int len)
+{
+  int result = 0;
+  char trace[LW_SOCK_MESSAGE_SIZE];
+  int res;
+  fd_set read;
+  struct timeval tv;
+  int sock_copy;
+  int total_received;
+  int received;
+#ifdef WIN32
+  int winerr;
+#endif
+
+  memset (buffer, 0, len);
+
+  if ((sock_copy = *sock) >= 0)
+    {
+      result = 1;
+
+      if (len <= LW_SOCK_MESSAGE_SIZE - 1)
+	{
+	  total_received = 0;
+	  while (total_received < len && result && (sock_copy = *sock) >= 0)
+	    {
+	      FD_ZERO (&read);
+	      FD_SET (sock_copy, &read);
+	      tv.tv_sec = LW_SOCK_RECV_SEC;
+	      tv.tv_usec = LW_SOCK_RECV_USEC;
+
+	      errno = 0;
+	      res = select (sock_copy + 1, &read, NULL, NULL, &tv);
+
+	      switch (res)
+		{
+		case -1:
+#ifdef WIN32
+		  winerr = WSAGetLastError ();
+		  if (winerr != WSAEINTR)
+		    {
+		      result = 0;
+		    }
+#else
+		  if (errno != EINTR)
+		    {
+		      result = 0;
+		    }
+#endif
+		  break;
+		case 1:
+		  if (FD_ISSET (sock_copy, &read))
+		    {
+		      received = recv (sock_copy,
+				       buffer + total_received,
+				       MIN (len - total_received,
+					    LW_SOCK_RECV_BUFFER_SIZE), 0);
+		      if (received > 0 && received <= len - total_received)
+			{
+			  total_received += received;
+			}
+		      else
+			{
+			  result = 0;
+			}
+		    }
+		  break;
+		default:
+		  result = 0;
+		}
+	    }
+
+	  if (LW_SOCK_LOG)
+	    {
+	      if (result)
+		{
+		  strncpy (trace, buffer, len);
+		  trace[len] = '\0';
+		  log_print_int (sock_copy);
+		  log_print_str (" < [");
+		  clean_buffer (trace, len);
+		  log_print_str (trace);
+		  log_print_str ("]");
+		  log_println ();
+		  log_flush ();
+		}
+	      else
+		{
+		  log_print_int (sock_copy);
+		  log_print_str (" < timeout!");
+		  log_println ();
+		}
+	    }
+	}
+      else
+	{
+	  result = 0;
+	  if (LW_SOCK_LOG)
+	    {
+	      log_print_int (sock_copy);
+	      log_print_str (" < message too large!");
+	      log_println ();
+	    }
+	}
+    }
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/sockgen.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/sockgen.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/sockgen.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,72 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : sockgen.h                                        */
+/* contenu       : wrapper on unix or windows socket functions      */
+/* last update   : March 13th 2001                                  */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_SOCKGEN
+#define LIQUID_WAR_INCLUDE_SOCKGEN
+
+#define LW_SOCK_MESSAGE_SIZE            1000
+#define LW_SOCK_IP_SIZE                   16
+
+int lw_sock_init ();
+int lw_sock_exit ();
+int lw_sock_listen (int *sock, int port);
+int lw_sock_accept (int *new_sock, char *ip, int *port,
+		    int listening_sock, int wait);
+int lw_sock_connect (int *sock, char *ip, int port);
+int lw_sock_peek_ex (int *sock, int len);
+int lw_sock_send_str_ex (int *sock, char *str);
+int lw_sock_recv_str_ex (int *sock, char *str);
+int lw_sock_send_buffer_ex (int *sock, char *buffer, int len);
+int lw_sock_recv_buffer_ex (int *sock, char *buffer, int len);
+int lw_sock_close (int *sock);
+
+extern int LW_SOCK_LOG;
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/sockunix.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/sockunix.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/sockunix.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,327 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : sockunix.c                                       */
+/* content       : simple wrappers on the POSIX socket API          */
+/* last update   : April 13th 2001                                  */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <time.h>
+#include <string.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <ctype.h>
+
+#include "sockgen.h"
+#include "log.h"
+
+/*==================================================================*/
+/* defines                                                          */
+/*==================================================================*/
+
+#define LW_SOCK_NB_BACKLOG               10
+#define LW_SOCK_ACCEPT_SEC                1
+#define LW_SOCK_ACCEPT_USEC               0
+
+/*==================================================================*/
+/* macros                                                           */
+/*==================================================================*/
+
+#ifndef MIN
+#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
+#endif
+#ifndef MAX
+#define MAX(a, b)  (((a) > (b)) ? (a) : (b))
+#endif
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+int LW_SOCK_LOG = 0;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Useless on UNIX, this function is usefull on Microsh*t Windozs
+ * where one has to "initialize" the winsock api 8-(
+ */
+int
+lw_sock_init ()
+{
+  int result = 1;
+
+  /*
+   * Well, it seems that SIGPIPE is sent to the application when
+   * there's a brutal socket close or things like that, so we
+   * just trap it and do nothing. Normally, the socket functions
+   * should return an error anyway...
+   */
+  if (signal (SIGPIPE, SIG_IGN) == SIG_ERR)
+    {
+      result = 0;
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Useless on UNIX.
+ */
+int
+lw_sock_exit ()
+{
+  int result = 1;
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Creates, binds and prepares a TCP socket for listening.
+ * This is usefull on the server.
+ */
+int
+lw_sock_listen (int *sock, int port)
+{
+  int result = 0;
+  struct sockaddr_in name;
+  int enable = 1;
+
+  *sock = socket (AF_INET, SOCK_STREAM, 0);
+  if (*sock >= 0)
+    {
+      setsockopt (*sock, SOL_SOCKET, SO_REUSEADDR,
+		  (char *) &enable, sizeof (int));
+
+      name.sin_family = AF_INET;
+      name.sin_addr.s_addr = INADDR_ANY;
+      name.sin_port = htons (port);
+      if (bind (*sock, (struct sockaddr *) &name, sizeof name) >= 0)
+	{
+	  if (listen ((*sock), LW_SOCK_NB_BACKLOG) >= 0)
+	    {
+	      result = 1;
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Accepts an incoming connexion from a program which has issued a
+ * connect. Usefull on the server.
+ */
+int
+lw_sock_accept (int *new_sock, char *ip, int *port,
+		int listening_sock, int wait)
+{
+  int result = 0;
+  struct sockaddr_in name;
+  socklen_t namelen = sizeof (struct sockaddr_in);
+  fd_set read;
+  struct timeval tv;
+  int res;
+  int enable = 1;
+  int disable = 0;
+  struct linger li;
+
+  *new_sock = -1;
+  ip[0] = '\0';
+  *port = 0;
+
+  if (listening_sock >= 0)
+    {
+      FD_ZERO (&read);
+      FD_SET (listening_sock, &read);
+      if (wait)
+	{
+	  tv.tv_sec = LW_SOCK_ACCEPT_SEC;
+	  tv.tv_usec = LW_SOCK_ACCEPT_USEC;
+	}
+      else
+	{
+	  tv.tv_sec = 0;
+	  tv.tv_usec = 0;
+	}
+      res = select (listening_sock + 1, &read, NULL, NULL, &tv);
+      if (res >= 1)
+	{
+	  (*new_sock) =
+	    accept (listening_sock, (struct sockaddr *) &name, &namelen);
+	  if ((*new_sock) >= 0)
+	    {
+	      li.l_onoff = 0;
+	      li.l_linger = 0;
+	      setsockopt (*new_sock, SOL_SOCKET, SO_KEEPALIVE,
+			  (char *) &enable, sizeof (int));
+	      setsockopt (*new_sock, SOL_SOCKET, SO_OOBINLINE,
+			  (char *) &disable, sizeof (int));
+	      setsockopt (*new_sock, SOL_SOCKET, SO_LINGER,
+			  (char *) &li, sizeof (struct linger));
+
+	      fcntl (*new_sock, F_SETFL, O_NONBLOCK, 0);
+
+	      strncpy (ip, inet_ntoa (name.sin_addr), LW_SOCK_IP_SIZE - 1);
+	      ip[LW_SOCK_IP_SIZE - 1] = 0;
+	      (*port) = (int) ntohs (name.sin_port);
+
+	      result = 1;
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Establishes a connection. The remote must have called sock_listen
+ * first and must confirm the acceptation with a sock_accept.
+ * Usefull on the client. 
+ */
+int
+lw_sock_connect (int *sock, char *ip, int port)
+{
+  int result = 0;
+  struct sockaddr_in name;
+  int enable = 1;
+  int disable = 0;
+  struct linger li;
+
+  *sock = socket (AF_INET, SOCK_STREAM, 0);
+  if (*sock >= 0)
+    {
+      name.sin_family = AF_INET;
+      name.sin_addr.s_addr = INADDR_ANY;
+      name.sin_port = 0;
+      if (bind (*sock, (struct sockaddr *) &name, sizeof name) >= 0)
+	{
+	  name.sin_family = AF_INET;
+	  if (inet_aton (ip, &name.sin_addr) != 0)
+	    {
+	      name.sin_port = htons (port);
+	      if (connect ((*sock), (struct sockaddr *) &name, sizeof name) >=
+		  0)
+		{
+		  /*
+		   * Added this code copied/paste from accept.
+		   * don'tknow if it's usefull
+		   */
+		  li.l_onoff = 0;
+		  li.l_linger = 0;
+		  setsockopt (*sock, SOL_SOCKET, SO_KEEPALIVE,
+			      (char *) &enable, sizeof (int));
+		  setsockopt (*sock, SOL_SOCKET, SO_OOBINLINE,
+			      (char *) &disable, sizeof (int));
+		  setsockopt (*sock, SOL_SOCKET, SO_LINGER,
+			      (char *) &li, sizeof (struct linger));
+
+		  fcntl (*sock, F_SETFL, O_NONBLOCK, 0);
+
+		  result = 1;
+		}
+	    }
+	}
+    }
+
+  return result;
+}
+
+
+/*------------------------------------------------------------------*/
+/*
+ * Closes a socket for good.
+ */
+int
+lw_sock_close (int *sock)
+{
+  int result = 0;
+  int sock_to_close;
+
+  /*
+   * We set *sock to 0 before we close it. This should reduce 
+   * thread problems
+   */
+  sock_to_close = *sock;
+  (*sock) = -1;
+
+  if (shutdown (sock_to_close, 2) != 0)
+    {
+      /*
+       * We could print a warning here.
+       */
+    }
+
+  if (close (sock_to_close) != 0)
+    {
+      /*
+       * Strange error, was the socket really opened?
+       */
+    }
+  else
+    {
+      result = 1;
+    }
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/sockw32.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/sockw32.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/sockw32.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,327 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : sockw32.c                                        */
+/* content       : simple wrappers on the winsock API               */
+/* last update   : April 13th 2001                                  */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#ifdef WIN32
+#include <winsock.h>
+#endif
+#include <stdlib.h>
+#include <time.h>
+#include <string.h>
+#include <ctype.h>
+
+#include "sockgen.h"
+#include "log.h"
+
+/*==================================================================*/
+/* defines                                                          */
+/*==================================================================*/
+
+#define LW_SOCK_NB_BACKLOG               10
+#define LW_SOCK_ACCEPT_SEC                1
+#define LW_SOCK_ACCEPT_USEC               0
+
+#define LW_DESIRED_WINSOCK_VERSION 0x0101
+
+/*==================================================================*/
+/* macros                                                           */
+/*==================================================================*/
+
+#ifndef MIN
+#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
+#endif
+#ifndef MAX
+#define MAX(a, b)  (((a) > (b)) ? (a) : (b))
+#endif
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+int LW_SOCK_LOG = 0;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Useless on UNIX, this function is usefull on Microsh*t Windozs
+ * where one has to "initialize" the winsock api 8-(
+ */
+int
+lw_sock_init ()
+{
+  int result = 0;
+  int err;
+  WSADATA wsadata;
+
+  err = WSAStartup (LW_DESIRED_WINSOCK_VERSION, &wsadata);
+
+  if (err != 0)
+    {
+      if (LW_SOCK_LOG)
+	{
+	  log_println_str ("Unable to initialize winsock API");
+	}
+    }
+  else
+    {
+      result = 1;
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Useless on UNIX.
+ */
+int
+lw_sock_exit ()
+{
+  int result = 1;
+
+  WSACleanup ();
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Creates, binds and prepares a TCP socket for listening.
+ * This is usefull on the server.
+ */
+int
+lw_sock_listen (int *sock, int port)
+{
+  int result = 0;
+  struct sockaddr_in name;
+  int enable = 1;
+
+  *sock = socket (AF_INET, SOCK_STREAM, 0);
+  if (*sock >= 0)
+    {
+      setsockopt (*sock, SOL_SOCKET, SO_REUSEADDR,
+		  (char *) &enable, sizeof (int));
+
+      name.sin_family = AF_INET;
+      name.sin_addr.s_addr = INADDR_ANY;
+      name.sin_port = htons ((short) port);
+      if (bind (*sock, (struct sockaddr *) &name, sizeof name) >= 0)
+	{
+	  if (listen ((*sock), LW_SOCK_NB_BACKLOG) >= 0)
+	    {
+	      result = 1;
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Accepts an incoming connexion from a program which has issued a
+ * connect. Usefull on the server.
+ */
+int
+lw_sock_accept (int *new_sock, char *ip, int *port,
+		int listening_sock, int wait)
+{
+  int result = 0;
+  struct sockaddr_in name;
+  int namelen = sizeof (struct sockaddr_in);
+  fd_set read;
+  struct timeval tv;
+  int res;
+  int enable = 1;
+  int disable = 0;
+  struct linger li;
+
+  *new_sock = -1;
+  ip[0] = '\0';
+  *port = 0;
+
+  if (listening_sock >= 0)
+    {
+      FD_ZERO (&read);
+      FD_SET (listening_sock, &read);
+      if (wait)
+	{
+	  tv.tv_sec = LW_SOCK_ACCEPT_SEC;
+	  tv.tv_usec = LW_SOCK_ACCEPT_USEC;
+	}
+      else
+	{
+	  tv.tv_sec = 0;
+	  tv.tv_usec = 0;
+	}
+      res = select (listening_sock + 1, &read, NULL, NULL, &tv);
+      if (res >= 1)
+	{
+	  (*new_sock) =
+	    accept (listening_sock, (struct sockaddr *) &name, &namelen);
+	  if ((*new_sock) >= 0)
+	    {
+	      li.l_onoff = 0;
+	      li.l_linger = 0;
+	      setsockopt (*new_sock, SOL_SOCKET, SO_KEEPALIVE,
+			  (char *) &enable, sizeof (int));
+	      setsockopt (*new_sock, SOL_SOCKET, SO_OOBINLINE,
+			  (char *) &disable, sizeof (int));
+	      setsockopt (*new_sock, SOL_SOCKET, SO_LINGER,
+			  (char *) &li, sizeof (struct linger));
+
+	      ioctlsocket (*new_sock, FIONBIO, &disable);
+
+	      strncpy (ip, inet_ntoa (name.sin_addr), LW_SOCK_IP_SIZE - 1);
+	      ip[LW_SOCK_IP_SIZE - 1] = 0;
+	      (*port) = (int) ntohs (name.sin_port);
+
+	      result = 1;
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Establishes a connection. The remote must have called sock_listen
+ * first and must confirm the acceptation with a sock_accept.
+ * Usefull on the client. 
+ */
+int
+lw_sock_connect (int *sock, char *ip, int port)
+{
+  int result = 0;
+  struct sockaddr_in name;
+  int enable = 1;
+  int disable = 0;
+  struct linger li;
+
+  *sock = socket (AF_INET, SOCK_STREAM, 0);
+  if (*sock >= 0)
+    {
+      name.sin_family = AF_INET;
+      name.sin_addr.s_addr = INADDR_ANY;
+      name.sin_port = 0;
+      if (bind (*sock, (struct sockaddr *) &name, sizeof name) >= 0)
+	{
+	  name.sin_family = AF_INET;
+	  name.sin_addr.s_addr = inet_addr (ip);
+	  name.sin_port = htons ((short) port);
+	  if (connect ((*sock), (struct sockaddr *) &name, sizeof name) >= 0)
+	    {
+	      /*
+	       * Added this code copied/paste from accept.
+	       * don'tknow if it's usefull
+	       */
+	      li.l_onoff = 0;
+	      li.l_linger = 0;
+	      setsockopt (*sock, SOL_SOCKET, SO_KEEPALIVE,
+			  (char *) &enable, sizeof (int));
+	      setsockopt (*sock, SOL_SOCKET, SO_OOBINLINE,
+			  (char *) &disable, sizeof (int));
+	      setsockopt (*sock, SOL_SOCKET, SO_LINGER,
+			  (char *) &li, sizeof (struct linger));
+
+	      ioctlsocket (*sock, FIONBIO, &disable);
+
+	      result = 1;
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Closes a socket for good.
+ */
+int
+lw_sock_close (int *sock)
+{
+  int result = 0;
+  int sock_to_close;
+
+  /*
+   * We set *sock to 0 before we close it. This should reduce 
+   * thread problems
+   */
+  sock_to_close = *sock;
+  (*sock) = -1;
+
+  if (shutdown (sock_to_close, 2) != 0)
+    {
+      /*
+       * We could print a warning here.
+       */
+    }
+
+  if (closesocket (sock_to_close) != 0)
+    {
+      /*
+       * Strange error, was the socket really opened?
+       */
+    }
+  else
+    {
+      result = 1;
+    }
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/sound.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/sound.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/sound.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,224 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : sound.c                                          */
+/* content       : low-level sound routines                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "config.h"
+#include "disk.h"
+#include "sound.h"
+#include "mutxgen.h"
+#include "log.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+int WATER_VOLUME = 0;
+
+#define HASARD_SIZE 1024
+static int HASARD_VALUE[HASARD_SIZE];
+static int HASARD_INDEX;
+
+static int SOUND_VOLUME_VALUES[17] = { 0,
+  8, 10, 13, 16,
+  20, 25, 32, 40,
+  51, 64, 81, 101,
+  128, 161, 204, 255
+};
+
+static int WATER_DELAY = 2000;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/* mise en place des bruits de fond                                 */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+static void
+water_handler (void)
+{
+  int pan;
+  int hasard;
+
+  HASARD_INDEX++;
+  HASARD_INDEX = HASARD_INDEX % HASARD_SIZE;
+
+  if (WATER_VOLUME > 0)
+    {
+      if (HASARD_INDEX % 2)
+	pan = 192;
+      else
+	pan = 64;
+
+      hasard = HASARD_VALUE[HASARD_INDEX] % SAMPLE_WATER_NUMBER;
+      play_sample (SAMPLE_WATER[hasard],
+		   SOUND_VOLUME_VALUES[WATER_VOLUME], pan, 1000, 0);
+    }
+}
+
+END_OF_FUNCTION (water_handler);
+
+/*------------------------------------------------------------------*/
+int
+start_water (void)
+{
+  int result = 1;
+  int i;
+
+  for (i = 0; i < HASARD_SIZE; ++i)
+    HASARD_VALUE[i] = random () + i;
+
+  if (LOADED_WATER)
+    {
+      WATER_VOLUME = CONFIG_WATER_VOLUME_MENU;
+
+      LOCK_FUNCTION (water_handler);
+      LOCK_VARIABLE (HASARD_INDEX);
+      LOCK_VARIABLE (HASARD_VALUE);
+      LOCK_VARIABLE (SAMPLE_WATER);
+      LOCK_VARIABLE (WATER_VOLUME);
+      LOCK_VARIABLE (SOUND_VOLUME_VALUES);
+
+#ifdef DOS
+      _go32_dpmi_lock_data (HASARD_VALUE, HASARD_SIZE * sizeof (int));
+      _go32_dpmi_lock_data (SOUND_VOLUME_VALUES, 17 * sizeof (int));
+#endif
+
+      result = install_int_ex (water_handler, MSEC_TO_TIMER (WATER_DELAY));
+      water_handler ();
+    }
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+void
+stop_water (void)
+{
+  remove_int (water_handler);
+}
+
+/*------------------------------------------------------------------*/
+static void
+my_play_sample (SAMPLE * s, int vol)
+{
+  if (vol > 0)
+    play_sample (s, SOUND_VOLUME_VALUES[vol - 1], 128, 1000, 0);
+}
+
+/*------------------------------------------------------------------*/
+void
+play_click (void)
+{
+  static LW_MUTEX_DATA mutex = { NULL };
+
+  if (LOADED_SFX)
+    {
+      /*
+       * We use a mutex for play_click since playing several clicks
+       * together makes no sense. Additionnally, weird bugs (crashes...)
+       * under windows when cycling "too fast" within the maps make
+       * me think that it could be related to playing too many sounds
+       * simultaneously from several threads.
+       */
+      if (lw_mutex_trylock (&mutex))
+	{
+	  my_play_sample (SAMPLE_SFX_CLICK, CONFIG_CLICK_VOLUME);
+	  lw_mutex_unlock (&mutex);
+	}
+      else
+	{
+	  log_println_str ("Warning: too many calls to \"play_click\"...");
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+play_go (void)
+{
+  if (LOADED_SFX)
+    my_play_sample (SAMPLE_SFX_GO, CONFIG_SFX_VOLUME);
+}
+
+/*------------------------------------------------------------------*/
+void
+play_win (void)
+{
+  if (LOADED_SFX)
+    my_play_sample (SAMPLE_SFX_WIN, CONFIG_SFX_VOLUME);
+}
+
+/*------------------------------------------------------------------*/
+void
+play_time (void)
+{
+  if (LOADED_SFX)
+    my_play_sample (SAMPLE_SFX_TIME, CONFIG_SFX_VOLUME);
+}
+
+/*------------------------------------------------------------------*/
+void
+play_loose (void)
+{
+  if (LOADED_SFX)
+    my_play_sample (SAMPLE_SFX_LOOSE, CONFIG_SFX_VOLUME);
+}
+
+/*------------------------------------------------------------------*/
+void
+play_connect (void)
+{
+  if (LOADED_SFX)
+    my_play_sample (SAMPLE_SFX_CONNECT, CONFIG_SFX_VOLUME);
+}

Added: unstable/liquidwar/branches/upstream/current/src/sound.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/sound.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/sound.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,73 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : sound.h                                          */
+/* content       : low-level sound routines                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_SOUND
+#define LIQUID_WAR_INCLUDE_SOUND
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+extern int WATER_VOLUME;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int start_water (void);
+void stop_water (void);
+
+void play_click (void);
+void play_go (void);
+void play_win (void);
+void play_time (void);
+void play_loose (void);
+void play_connect (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/speeds.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/speeds.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/speeds.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,241 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : speeds.c                                         */
+/* contenu       : menu used to set up speeds                       */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+#include <stdio.h>
+
+#include "advanced.h"
+#include "config.h"
+#include "dialog.h"
+#include "disk.h"
+#include "help.h"
+#include "menu.h"
+#include "rules.h"
+#include "sound.h"
+#include "time.h"
+#include "lang.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_SPEEDS_FPS_SIZE 33
+#define LW_SPEEDS_RPS_SIZE 33
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static void
+write_fps_setting (DIALOG * d)
+{
+  char *str;
+
+  str = d->dp;
+  if (DISPLAY_DELAY_MIN[CONFIG_FRAMES_PER_SEC_LIMIT] != 0)
+    {
+      LW_MACRO_SNPRINTF2 (str,
+			  LW_SPEEDS_FPS_SIZE,
+			  "%d %s",
+			  1000 /
+			  (DISPLAY_DELAY_MIN[CONFIG_FRAMES_PER_SEC_LIMIT]),
+			  lw_lang_string (LW_LANG_STRING_SPEEDS_FPS));
+    }
+  else
+    {
+      LW_MACRO_SNPRINTF0 (str,
+			  LW_SPEEDS_FPS_SIZE,
+			  lw_lang_string (LW_LANG_STRING_SPEEDS_NOFPSLIMIT));
+    }
+}
+
+/*------------------------------------------------------------------*/
+static int
+slider_fps (void *dp3, int d2)
+{
+  DIALOG *d;
+
+  d = dp3;
+
+  CONFIG_FRAMES_PER_SEC_LIMIT = d2;
+  write_fps_setting (d);
+
+  scare_mouse ();
+  my_textbox_proc (MSG_DRAW, d, 0);
+  unscare_mouse ();
+
+  play_click ();
+
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+static void
+write_rps_setting (DIALOG * d)
+{
+  char *str;
+
+  str = d->dp;
+  if (LOGIC_DELAY_MIN[CONFIG_ROUNDS_PER_SEC_LIMIT] != 0)
+    {
+      LW_MACRO_SNPRINTF2 (str,
+			  LW_SPEEDS_RPS_SIZE,
+			  "%d %s",
+			  1000 /
+			  (LOGIC_DELAY_MIN[CONFIG_ROUNDS_PER_SEC_LIMIT]),
+			  lw_lang_string (LW_LANG_STRING_SPEEDS_RPS));
+    }
+  else
+    {
+      LW_MACRO_SNPRINTF0 (str,
+			  LW_SPEEDS_RPS_SIZE,
+			  lw_lang_string (LW_LANG_STRING_SPEEDS_NORPSLIMIT));
+    }
+}
+
+/*------------------------------------------------------------------*/
+static int
+slider_rps (void *dp3, int d2)
+{
+  DIALOG *d;
+
+  d = dp3;
+
+  CONFIG_ROUNDS_PER_SEC_LIMIT = d2;
+  write_rps_setting (d);
+
+  scare_mouse ();
+  my_textbox_proc (MSG_DRAW, d, 0);
+  unscare_mouse ();
+
+  play_click ();
+
+  return 0;
+}
+
+/*------------------------------------------------------------------*/
+int
+speeds_options (void)
+{
+  int *temp;
+  DIALOG d[9];
+  int i, choix = 4, retour = 0;
+  char fps_buffer[LW_SPEEDS_FPS_SIZE];
+  char rps_buffer[LW_SPEEDS_RPS_SIZE];
+
+  memset (d, 0, sizeof (d));
+
+  for (i = 0; i < 2; ++i)
+    {
+      standard_button (d + i + 4, 0, i, 2, 2);
+      d[i + 4].proc = my_textbox_proc;
+    }
+  for (i = 0; i < 2; ++i)
+    {
+      standard_button (d + i + 6, 1, i, 2, 2);
+      d[i + 6].proc = my_slider_proc;
+    }
+
+  quick_buttons (d);
+  d[4].dp = fps_buffer;
+  d[5].dp = rps_buffer;
+  d[6].d1 = 8;
+  d[7].d1 = 8;
+  d[6].dp3 = &CONFIG_FRAMES_PER_SEC_LIMIT;
+  d[7].dp3 = &CONFIG_ROUNDS_PER_SEC_LIMIT;
+  for (i = 0; i < 2; ++i)
+    {
+      d[i + 6].dp = NULL;
+      d[i + 6].dp2 = slider_int;
+      temp = d[i + 6].dp3;
+      d[i + 6].d2 = *temp;
+      d[i + 6].dp3 = d + i + 4;
+    }
+
+  d[6].dp2 = slider_fps;
+  d[7].dp2 = slider_rps;
+
+  write_fps_setting (d + 4);
+  write_rps_setting (d + 5);
+
+  d[8].proc = 0;
+
+  while (retour == 0)
+    {
+      choix = my_do_dialog (d, choix);
+      switch (choix)
+	{
+	case -1:
+	case MENU_QUICK_BACK:
+	  retour = 1;
+	  break;
+	case MENU_QUICK_MAIN:
+	  retour = MENU_TOP;
+	  break;
+	case MENU_QUICK_QUIT:
+	  if (confirm_quit ())
+	    retour = MENU_EXIT;
+	  break;
+	case MENU_QUICK_PLAY:
+	  retour = MENU_PLAY;
+	  break;
+	}
+    }
+
+  if (retour > 0)
+    retour--;
+
+  return retour;
+}

Added: unstable/liquidwar/branches/upstream/current/src/speeds.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/speeds.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/speeds.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,67 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : speeds.h                                         */
+/* contenu       : menu used to set up speeds                       */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_SPEEDS
+#define LIQUID_WAR_INCLUDE_SPEEDS
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int speeds_options (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/spread.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/spread.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/spread.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,87 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : spread.h                                         */
+/* contenu       : etalement du gradient accelere                   */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_SPREAD
+#define LIQUID_WAR_INCLUDE_SPREAD
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "mesh.h"
+#include "asm.h"
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+extern void LW_ASM_FUNC boost_gradient_down_2 (MESH * first,
+					       int size, int offset);
+extern void LW_ASM_FUNC boost_gradient_down_3 (MESH * first,
+					       int size, int offset);
+extern void LW_ASM_FUNC boost_gradient_down_4 (MESH * first,
+					       int size, int offset);
+extern void LW_ASM_FUNC boost_gradient_down_5 (MESH * first,
+					       int size, int offset);
+extern void LW_ASM_FUNC boost_gradient_down_6 (MESH * first,
+					       int size, int offset);
+
+extern void LW_ASM_FUNC boost_gradient_up_2 (MESH * first,
+					     int size, int offset);
+extern void LW_ASM_FUNC boost_gradient_up_3 (MESH * first,
+					     int size, int offset);
+extern void LW_ASM_FUNC boost_gradient_up_4 (MESH * first,
+					     int size, int offset);
+extern void LW_ASM_FUNC boost_gradient_up_5 (MESH * first,
+					     int size, int offset);
+extern void LW_ASM_FUNC boost_gradient_up_6 (MESH * first,
+					     int size, int offset);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/spread.s
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/spread.s	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/spread.s	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,959 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : spread.s                                         */
+/* contenu       : etalement du gradient accelere                   */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+
+/*typedef union                 */
+/*        {                     */
+/*         int time;            */
+/*         struct               */
+/*          {                   */
+/*           short x;           */
+/*           short y;           */
+/*          } cursor;           */
+/*        } MESH_UPDATE;        */
+
+/*typedef struct                */
+/*        {                     */
+/*         int dir :8;          */
+/*         int grad:24;         */
+/*        } MESH_STATE;         */
+
+/*typedef struct                  */
+/*        {                       */
+/*         MESH_UPDATE update;    */
+/*         MESH_STATE state;      */
+/*        } MESH_INFO;            */
+
+/*typedef struct                     */
+/*        {                          */
+/*         char decal_for_dir :8;    */
+/*         int  size          :24;   */
+/*        } MESH_SIDE;               */
+
+/*typedef struct                        */
+/*        {                             */
+/*         short x;                     */
+/*         short y;                     */
+/*         MESH_SIDE side;              */
+/*         MESH_INFO info[NB_TEAMS];    */
+/*         void *link[NB_DIRS];         */
+/*        } MESH;                       */
+
+
+.equ SIZE_OF_MESH,104
+
+.equ OFFSET_TO_GRAD_0,12
+.equ OFFSET_TO_GRAD_1,20
+.equ OFFSET_TO_GRAD_2,28
+.equ OFFSET_TO_GRAD_3,36
+.equ OFFSET_TO_GRAD_4,44
+.equ OFFSET_TO_GRAD_5,52
+
+.equ SQUARE_SIZE_INC,4
+
+.equ ARG_FIRST,8
+.equ ARG_SIZE,12
+.equ ARG_OFFSET,16
+
+.text
+
+/*  il y a de maniere tres bourrine 5*2 procedures attachees chacune   */
+/*  a l'etalement de 2,3,4,5 ou 6 gradients, le code est le meme       */
+/*  dans chacune d'elle a l'exception d'une constante.                 */
+/* la moitie des fonctions etale les gradients dans un sens,           */
+/*  l'autre moitie les etale dans l'autre sens                         */
+
+
+/*==================================================================*/
+/* premiere serie de fonctions, etalement des gradients vers le bas */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/* void boost_gradient_down_2 (MESH *first, int size, int offset);  */
+/*------------------------------------------------------------------*/
+
+.globl _boost_gradient_down_2
+.globl boost_gradient_down_2
+   .align 4
+_boost_gradient_down_2:
+boost_gradient_down_2:
+   pushl %ebp
+   movl %esp, %ebp
+   pushl %eax
+   pushl %ebx
+   pushl %ecx
+   pushl %edx
+   pushl %esi
+   pushl %edi
+   pushw %es 
+
+   movl  ARG_FIRST(%ebp),%esi      /* esi pointeur sur mesh courant*/
+   movl  ARG_SIZE(%ebp),%ecx      /* ecx prend la taille de la boucle */
+   movl  ARG_OFFSET(%ebp),%ebx    /* ebx prend l'offset de direction */
+
+main_loop_gd_2:
+
+   add   %ebx,%esi
+   movl  (%esi),%edi
+   sub   %ebx,%esi
+
+   cmp   $0,%edi
+   je    skip_gd_2_1
+
+   movl  OFFSET_TO_GRAD_0(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_0(%edi),%eax     /* GPF sous win ICI */
+   jae   skip_gd_2_0
+   movl  %eax,%ds:OFFSET_TO_GRAD_0(%edi)
+
+skip_gd_2_0:
+
+   movl  OFFSET_TO_GRAD_1(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_1(%edi),%eax
+   jae   skip_gd_2_1
+   movl  %eax,%ds:OFFSET_TO_GRAD_1(%edi)
+
+skip_gd_2_1:
+
+   addl  $SIZE_OF_MESH,%esi
+
+   loopl main_loop_gd_2
+
+   popw %es
+   popl %edi
+   popl %esi
+   popl %edx
+   popl %ecx
+   popl %ebx
+   popl %eax
+/*   movl %ebp, %esp*/
+   popl %ebp
+   ret
+
+/*------------------------------------------------------------------*/
+/* void boost_gradient_down_3 (MESH *first, int size, int offset);  */
+/*------------------------------------------------------------------*/
+
+.globl _boost_gradient_down_3
+.globl boost_gradient_down_3
+   .align 4
+_boost_gradient_down_3:
+boost_gradient_down_3:
+   pushl %ebp
+   movl %esp, %ebp
+   pushl %eax
+   pushl %ebx
+   pushl %ecx
+   pushl %edx
+   pushl %esi
+   pushl %edi
+   pushw %es 
+
+   movl  ARG_FIRST(%ebp),%esi      /* esi pointeur sur mesh courant*/
+   movl  ARG_SIZE(%ebp),%ecx      /* ecx prend la taille de la boucle */
+   movl  ARG_OFFSET(%ebp),%ebx    /* ebx prend l'offset de direction */
+
+main_loop_gd_3:
+
+   add   %ebx,%esi
+   movl  (%esi),%edi
+   sub   %ebx,%esi
+
+   cmp   $0,%edi
+   je    skip_gd_3_2
+
+   movl  OFFSET_TO_GRAD_0(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_0(%edi),%eax
+   jae   skip_gd_3_0
+   movl  %eax,%ds:OFFSET_TO_GRAD_0(%edi)
+
+skip_gd_3_0:
+
+   movl  OFFSET_TO_GRAD_1(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_1(%edi),%eax
+   jae   skip_gd_3_1
+   movl  %eax,%ds:OFFSET_TO_GRAD_1(%edi)
+
+skip_gd_3_1:
+
+   movl  OFFSET_TO_GRAD_2(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_2(%edi),%eax
+   jae   skip_gd_3_2
+   movl  %eax,%ds:OFFSET_TO_GRAD_2(%edi)
+
+skip_gd_3_2:
+
+   addl  $SIZE_OF_MESH,%esi
+
+   loopl main_loop_gd_3
+
+   popw %es
+   popl %edi
+   popl %esi
+   popl %edx
+   popl %ecx
+   popl %ebx
+   popl %eax
+/*   movl %ebp, %esp*/
+   popl %ebp
+   ret
+
+/*------------------------------------------------------------------*/
+/* void boost_gradient_down_4 (MESH *first, int size, int offset);  */
+/*------------------------------------------------------------------*/
+
+.globl _boost_gradient_down_4
+.globl boost_gradient_down_4
+   .align 4
+_boost_gradient_down_4:
+boost_gradient_down_4:
+   pushl %ebp
+   movl %esp, %ebp
+   pushl %eax
+   pushl %ebx
+   pushl %ecx
+   pushl %edx
+   pushl %esi
+   pushl %edi
+   pushw %es 
+
+   movl  ARG_FIRST(%ebp),%esi      /* esi pointeur sur mesh courant*/
+   movl  ARG_SIZE(%ebp),%ecx      /* ecx prend la taille de la boucle */
+   movl  ARG_OFFSET(%ebp),%ebx    /* ebx prend l'offset de direction */
+
+main_loop_gd_4:
+
+   add   %ebx,%esi
+   movl  (%esi),%edi
+   sub   %ebx,%esi
+
+   cmp   $0,%edi
+   je    skip_gd_4_3
+
+   movl  OFFSET_TO_GRAD_0(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_0(%edi),%eax
+   jae   skip_gd_4_0
+   movl  %eax,%ds:OFFSET_TO_GRAD_0(%edi)
+
+skip_gd_4_0:
+
+   movl  OFFSET_TO_GRAD_1(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_1(%edi),%eax
+   jae   skip_gd_4_1
+   movl  %eax,%ds:OFFSET_TO_GRAD_1(%edi)
+
+skip_gd_4_1:
+
+   movl  OFFSET_TO_GRAD_2(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_2(%edi),%eax
+   jae   skip_gd_4_2
+   movl  %eax,%ds:OFFSET_TO_GRAD_2(%edi)
+
+skip_gd_4_2:
+
+   movl  OFFSET_TO_GRAD_3(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_3(%edi),%eax
+   jae   skip_gd_4_3
+   movl  %eax,%ds:OFFSET_TO_GRAD_3(%edi)
+
+skip_gd_4_3:
+
+   addl  $SIZE_OF_MESH,%esi
+
+   loopl main_loop_gd_4
+
+   popw %es
+   popl %edi
+   popl %esi
+   popl %edx
+   popl %ecx
+   popl %ebx
+   popl %eax
+/*   movl %ebp, %esp*/
+   popl %ebp
+   ret
+
+/*------------------------------------------------------------------*/
+/* void boost_gradient_down_5 (MESH *first, int size, int offset);  */
+/*------------------------------------------------------------------*/
+
+.globl _boost_gradient_down_5
+.globl boost_gradient_down_5
+   .align 4
+_boost_gradient_down_5:
+boost_gradient_down_5:
+   pushl %ebp
+   movl %esp, %ebp
+   pushl %eax
+   pushl %ebx
+   pushl %ecx
+   pushl %edx
+   pushl %esi
+   pushl %edi
+   pushw %es 
+
+   movl  ARG_FIRST(%ebp),%esi      /* esi pointeur sur mesh courant*/
+   movl  ARG_SIZE(%ebp),%ecx      /* ecx prend la taille de la boucle */
+   movl  ARG_OFFSET(%ebp),%ebx    /* ebx prend l'offset de direction */
+
+main_loop_gd_5:
+
+   add   %ebx,%esi
+   movl  (%esi),%edi
+   sub   %ebx,%esi
+
+   cmp   $0,%edi
+   je    skip_gd_5_4
+
+   movl  OFFSET_TO_GRAD_0(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_0(%edi),%eax
+   jae   skip_gd_5_0
+   movl  %eax,%ds:OFFSET_TO_GRAD_0(%edi)
+
+skip_gd_5_0:
+
+   movl  OFFSET_TO_GRAD_1(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_1(%edi),%eax
+   jae   skip_gd_5_1
+   movl  %eax,%ds:OFFSET_TO_GRAD_1(%edi)
+
+skip_gd_5_1:
+
+   movl  OFFSET_TO_GRAD_2(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_2(%edi),%eax
+   jae   skip_gd_5_2
+   movl  %eax,%ds:OFFSET_TO_GRAD_2(%edi)
+
+skip_gd_5_2:
+
+   movl  OFFSET_TO_GRAD_3(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_3(%edi),%eax
+   jae   skip_gd_5_3
+   movl  %eax,%ds:OFFSET_TO_GRAD_3(%edi)
+
+skip_gd_5_3:
+
+   movl  OFFSET_TO_GRAD_4(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_4(%edi),%eax
+   jae   skip_gd_5_4
+   movl  %eax,%ds:OFFSET_TO_GRAD_4(%edi)
+
+skip_gd_5_4:
+
+   addl  $SIZE_OF_MESH,%esi
+
+   loopl main_loop_gd_5
+
+   popw %es
+   popl %edi
+   popl %esi
+   popl %edx
+   popl %ecx
+   popl %ebx
+   popl %eax
+/*   movl %ebp, %esp*/
+   popl %ebp
+   ret
+
+
+/*------------------------------------------------------------------*/
+/* void boost_gradient_down_6 (MESH *first, int size, int offset);  */
+/*------------------------------------------------------------------*/
+
+.globl _boost_gradient_down_6
+.globl boost_gradient_down_6
+   .align 4
+_boost_gradient_down_6:
+boost_gradient_down_6:
+   pushl %ebp
+   movl %esp, %ebp
+   pushl %eax
+   pushl %ebx
+   pushl %ecx
+   pushl %edx
+   pushl %esi
+   pushl %edi
+   pushw %es 
+
+   movl  ARG_FIRST(%ebp),%esi      /* esi pointeur sur mesh courant*/
+   movl  ARG_SIZE(%ebp),%ecx      /* ecx prend la taille de la boucle */
+   movl  ARG_OFFSET(%ebp),%ebx    /* ebx prend l'offset de direction */
+
+main_loop_gd_6:
+
+   add   %ebx,%esi
+   movl  (%esi),%edi
+   sub   %ebx,%esi
+
+   cmp   $0,%edi
+   je    skip_gd_6_5
+
+   movl  OFFSET_TO_GRAD_0(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_0(%edi),%eax
+   jae   skip_gd_6_0
+   movl  %eax,%ds:OFFSET_TO_GRAD_0(%edi)
+
+skip_gd_6_0:
+
+   movl  OFFSET_TO_GRAD_1(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_1(%edi),%eax
+   jae   skip_gd_6_1
+   movl  %eax,%ds:OFFSET_TO_GRAD_1(%edi)
+
+skip_gd_6_1:
+
+   movl  OFFSET_TO_GRAD_2(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_2(%edi),%eax
+   jae   skip_gd_6_2
+   movl  %eax,%ds:OFFSET_TO_GRAD_2(%edi)
+
+skip_gd_6_2:
+
+   movl  OFFSET_TO_GRAD_3(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_3(%edi),%eax
+   jae   skip_gd_6_3
+   movl  %eax,%ds:OFFSET_TO_GRAD_3(%edi)
+
+skip_gd_6_3:
+
+   movl  OFFSET_TO_GRAD_4(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_4(%edi),%eax
+   jae   skip_gd_6_4
+   movl  %eax,%ds:OFFSET_TO_GRAD_4(%edi)
+
+skip_gd_6_4:
+
+   movl  OFFSET_TO_GRAD_5(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_5(%edi),%eax
+   jae   skip_gd_6_5
+   movl  %eax,%ds:OFFSET_TO_GRAD_5(%edi)
+
+skip_gd_6_5:
+
+   addl  $SIZE_OF_MESH,%esi
+
+   loopl main_loop_gd_6
+
+   popw %es
+   popl %edi
+   popl %esi
+   popl %edx
+   popl %ecx
+   popl %ebx
+   popl %eax
+/*   movl %ebp, %esp*/
+   popl %ebp
+   ret
+
+
+/*==================================================================*/
+/* deuxieme serie de fonctions, etalement des gradients vers le haut*/
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/* void boost_gradient_up_2 (MESH *first, int size, int offset);  */
+/*------------------------------------------------------------------*/
+
+.globl _boost_gradient_up_2
+.globl boost_gradient_up_2
+   .align 4
+_boost_gradient_up_2:
+boost_gradient_up_2:
+   pushl %ebp
+   movl %esp, %ebp
+   pushl %eax
+   pushl %ebx
+   pushl %ecx
+   pushl %edx
+   pushl %esi
+   pushl %edi
+   pushw %es 
+
+   movl  ARG_FIRST(%ebp),%esi      /* esi pointeur sur mesh courant*/
+   movl  ARG_SIZE(%ebp),%ecx      /* ecx prend la taille de la boucle */
+   movl  ARG_OFFSET(%ebp),%ebx    /* ebx prend l'offset de direction */
+
+main_loop_gu_2:
+
+   add   %ebx,%esi
+   movl  (%esi),%edi
+   sub   %ebx,%esi
+
+   cmp   $0,%edi
+   je    skip_gu_2_1
+
+   movl  OFFSET_TO_GRAD_0(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_0(%edi),%eax
+   jae   skip_gu_2_0
+   movl  %eax,%ds:OFFSET_TO_GRAD_0(%edi)
+
+skip_gu_2_0:
+
+   movl  OFFSET_TO_GRAD_1(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_1(%edi),%eax
+   jae   skip_gu_2_1
+   movl  %eax,%ds:OFFSET_TO_GRAD_1(%edi)
+
+skip_gu_2_1:
+
+   subl  $SIZE_OF_MESH,%esi
+
+   loopl main_loop_gu_2
+
+   popw %es
+   popl %edi
+   popl %esi
+   popl %edx
+   popl %ecx
+   popl %ebx
+   popl %eax
+/*   movl %ebp, %esp*/
+   popl %ebp
+   ret
+
+/*------------------------------------------------------------------*/
+/* void boost_gradient_up_3 (MESH *first, int size, int offset);  */
+/*------------------------------------------------------------------*/
+
+.globl _boost_gradient_up_3
+.globl boost_gradient_up_3
+   .align 4
+_boost_gradient_up_3:
+boost_gradient_up_3:
+   pushl %ebp
+   movl %esp, %ebp
+   pushl %eax
+   pushl %ebx
+   pushl %ecx
+   pushl %edx
+   pushl %esi
+   pushl %edi
+   pushw %es 
+
+   movl  ARG_FIRST(%ebp),%esi      /* esi pointeur sur mesh courant*/
+   movl  ARG_SIZE(%ebp),%ecx      /* ecx prend la taille de la boucle */
+   movl  ARG_OFFSET(%ebp),%ebx    /* ebx prend l'offset de direction */
+
+main_loop_gu_3:
+
+   add   %ebx,%esi
+   movl  (%esi),%edi
+   sub   %ebx,%esi
+
+   cmp   $0,%edi
+   je    skip_gu_3_2
+
+   movl  OFFSET_TO_GRAD_0(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_0(%edi),%eax
+   jae   skip_gu_3_0
+   movl  %eax,%ds:OFFSET_TO_GRAD_0(%edi)
+
+skip_gu_3_0:
+
+   movl  OFFSET_TO_GRAD_1(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_1(%edi),%eax
+   jae   skip_gu_3_1
+   movl  %eax,%ds:OFFSET_TO_GRAD_1(%edi)
+
+skip_gu_3_1:
+
+   movl  OFFSET_TO_GRAD_2(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_2(%edi),%eax
+   jae   skip_gu_3_2
+   movl  %eax,%ds:OFFSET_TO_GRAD_2(%edi)
+
+skip_gu_3_2:
+
+   subl  $SIZE_OF_MESH,%esi
+
+   loopl main_loop_gu_3
+
+   popw %es
+   popl %edi
+   popl %esi
+   popl %edx
+   popl %ecx
+   popl %ebx
+   popl %eax
+/*   movl %ebp, %esp*/
+   popl %ebp
+   ret
+
+/*------------------------------------------------------------------*/
+/* void boost_gradient_up_4 (MESH *first, int size, int offset);  */
+/*------------------------------------------------------------------*/
+
+.globl _boost_gradient_up_4
+.globl boost_gradient_up_4
+   .align 4
+_boost_gradient_up_4:
+boost_gradient_up_4:
+   pushl %ebp
+   movl %esp, %ebp
+   pushl %eax
+   pushl %ebx
+   pushl %ecx
+   pushl %edx
+   pushl %esi
+   pushl %edi
+   pushw %es 
+
+   movl  ARG_FIRST(%ebp),%esi      /* esi pointeur sur mesh courant*/
+   movl  ARG_SIZE(%ebp),%ecx      /* ecx prend la taille de la boucle */
+   movl  ARG_OFFSET(%ebp),%ebx    /* ebx prend l'offset de direction */
+
+main_loop_gu_4:
+
+   add   %ebx,%esi
+   movl  (%esi),%edi
+   sub   %ebx,%esi
+
+   cmp   $0,%edi
+   je    skip_gu_4_3
+
+   movl  OFFSET_TO_GRAD_0(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_0(%edi),%eax
+   jae   skip_gu_4_0
+   movl  %eax,%ds:OFFSET_TO_GRAD_0(%edi)
+
+skip_gu_4_0:
+
+   movl  OFFSET_TO_GRAD_1(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_1(%edi),%eax
+   jae   skip_gu_4_1
+   movl  %eax,%ds:OFFSET_TO_GRAD_1(%edi)
+
+skip_gu_4_1:
+
+   movl  OFFSET_TO_GRAD_2(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_2(%edi),%eax
+   jae   skip_gu_4_2
+   movl  %eax,%ds:OFFSET_TO_GRAD_2(%edi)
+
+skip_gu_4_2:
+
+   movl  OFFSET_TO_GRAD_3(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_3(%edi),%eax
+   jae   skip_gu_4_3
+   movl  %eax,%ds:OFFSET_TO_GRAD_3(%edi)
+
+skip_gu_4_3:
+
+   subl  $SIZE_OF_MESH,%esi
+
+   loopl main_loop_gu_4
+
+   popw %es
+   popl %edi
+   popl %esi
+   popl %edx
+   popl %ecx
+   popl %ebx
+   popl %eax
+/*   movl %ebp, %esp*/
+   popl %ebp
+   ret
+
+/*------------------------------------------------------------------*/
+/* void boost_gradient_up_5 (MESH *first, int size, int offset);  */
+/*------------------------------------------------------------------*/
+
+.globl _boost_gradient_up_5
+.globl boost_gradient_up_5
+   .align 4
+_boost_gradient_up_5:
+boost_gradient_up_5:
+   pushl %ebp
+   movl %esp, %ebp
+   pushl %eax
+   pushl %ebx
+   pushl %ecx
+   pushl %edx
+   pushl %esi
+   pushl %edi
+   pushw %es 
+
+   movl  ARG_FIRST(%ebp),%esi      /* esi pointeur sur mesh courant*/
+   movl  ARG_SIZE(%ebp),%ecx      /* ecx prend la taille de la boucle */
+   movl  ARG_OFFSET(%ebp),%ebx    /* ebx prend l'offset de direction */
+
+main_loop_gu_5:
+
+   add   %ebx,%esi
+   movl  (%esi),%edi
+   sub   %ebx,%esi
+
+   cmp   $0,%edi
+   je    skip_gu_5_4
+
+   movl  OFFSET_TO_GRAD_0(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_0(%edi),%eax
+   jae   skip_gu_5_0
+   movl  %eax,%ds:OFFSET_TO_GRAD_0(%edi)
+
+skip_gu_5_0:
+
+   movl  OFFSET_TO_GRAD_1(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_1(%edi),%eax
+   jae   skip_gu_5_1
+   movl  %eax,%ds:OFFSET_TO_GRAD_1(%edi)
+
+skip_gu_5_1:
+
+   movl  OFFSET_TO_GRAD_2(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_2(%edi),%eax
+   jae   skip_gu_5_2
+   movl  %eax,%ds:OFFSET_TO_GRAD_2(%edi)
+
+skip_gu_5_2:
+
+   movl  OFFSET_TO_GRAD_3(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_3(%edi),%eax
+   jae   skip_gu_5_3
+   movl  %eax,%ds:OFFSET_TO_GRAD_3(%edi)
+
+skip_gu_5_3:
+
+   movl  OFFSET_TO_GRAD_4(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_4(%edi),%eax
+   jae   skip_gu_5_4
+   movl  %eax,%ds:OFFSET_TO_GRAD_4(%edi)
+
+skip_gu_5_4:
+
+   subl  $SIZE_OF_MESH,%esi
+
+   loopl main_loop_gu_5
+
+   popw %es
+   popl %edi
+   popl %esi
+   popl %edx
+   popl %ecx
+   popl %ebx
+   popl %eax
+/*   movl %ebp, %esp*/
+   popl %ebp
+   ret
+
+
+/*------------------------------------------------------------------*/
+/* void boost_gradient_up_6 (MESH *first, int size, int offset);  */
+/*------------------------------------------------------------------*/
+
+.globl _boost_gradient_up_6
+.globl boost_gradient_up_6
+   .align 4
+_boost_gradient_up_6:
+boost_gradient_up_6:
+   pushl %ebp
+   movl %esp, %ebp
+   pushl %eax
+   pushl %ebx
+   pushl %ecx
+   pushl %edx
+   pushl %esi
+   pushl %edi
+   pushw %es 
+
+   movl  ARG_FIRST(%ebp),%esi      /* esi pointeur sur mesh courant*/
+   movl  ARG_SIZE(%ebp),%ecx      /* ecx prend la taille de la boucle */
+   movl  ARG_OFFSET(%ebp),%ebx    /* ebx prend l'offset de direction */
+
+main_loop_gu_6:
+
+   add   %ebx,%esi
+   movl  (%esi),%edi
+   sub   %ebx,%esi
+
+   cmp   $0,%edi
+   je    skip_gu_6_5
+
+   movl  OFFSET_TO_GRAD_0(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_0(%edi),%eax
+   jae   skip_gu_6_0
+   movl  %eax,%ds:OFFSET_TO_GRAD_0(%edi)
+
+skip_gu_6_0:
+
+   movl  OFFSET_TO_GRAD_1(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_1(%edi),%eax
+   jae   skip_gu_6_1
+   movl  %eax,%ds:OFFSET_TO_GRAD_1(%edi)
+
+skip_gu_6_1:
+
+   movl  OFFSET_TO_GRAD_2(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_2(%edi),%eax
+   jae   skip_gu_6_2
+   movl  %eax,%ds:OFFSET_TO_GRAD_2(%edi)
+
+skip_gu_6_2:
+
+   movl  OFFSET_TO_GRAD_3(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_3(%edi),%eax
+   jae   skip_gu_6_3
+   movl  %eax,%ds:OFFSET_TO_GRAD_3(%edi)
+
+skip_gu_6_3:
+
+   movl  OFFSET_TO_GRAD_4(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_4(%edi),%eax
+   jae   skip_gu_6_4
+   movl  %eax,%ds:OFFSET_TO_GRAD_4(%edi)
+
+skip_gu_6_4:
+
+   movl  OFFSET_TO_GRAD_5(%esi),%edx
+   movl  SQUARE_SIZE_INC(%esi),%eax
+   add   %edx,%eax
+   cmp   OFFSET_TO_GRAD_5(%edi),%eax
+   jae   skip_gu_6_5
+   movl  %eax,%ds:OFFSET_TO_GRAD_5(%edi)
+
+skip_gu_6_5:
+
+   subl  $SIZE_OF_MESH,%esi
+
+   loopl main_loop_gu_6
+
+   popw %es
+   popl %edi
+   popl %esi
+   popl %edx
+   popl %ecx
+   popl %ebx
+   popl %eax
+/*   movl %ebp, %esp*/
+   popl %ebp
+   ret
+
+
+
+
+
+

Added: unstable/liquidwar/branches/upstream/current/src/srvchan.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/srvchan.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/srvchan.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,1450 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : srvchan.c                                        */
+/* content       : handles a server network channel                 */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "srvchan.h"
+#include "netmess.h"
+#include "log.h"
+#include "netmap.h"
+#include "netconf.h"
+#include "sock2gen.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* Constants                                                        */
+/*==================================================================*/
+
+/*==================================================================*/
+/* static functions                                                 */
+/*==================================================================*/
+
+static void reset (LW_SRVCHAN * chan);
+static int handle_team (LW_SRVCHAN * chan, LW_NETMESS * mess,
+			int *free_teams);
+static int handle_ready (LW_SRVCHAN * chan, LW_NETMESS * mess);
+static int handle_start (LW_SRVCHAN * chan, LW_NETMESS * mess);
+static int handle_waiting (LW_SRVCHAN * chan,
+			   LW_NETMESS * mess, int free_teams);
+static int handle_next (LW_SRVCHAN * chan, LW_NETMESS * mess, int *next);
+static int handle_teamstartinfo (LW_SRVCHAN * chan, LW_NETMESS * mess,
+				 LW_TEAMSTARTINFO * team_start_info);
+static int handle_chattalk (LW_SRVCHAN * chan, LW_NETMESS * mess,
+			    LW_CHAT_HISTORY * chat);
+static int handle_chatlisten (LW_SRVCHAN * chan, LW_NETMESS * mess);
+static int handle_who (LW_SRVCHAN * chan, LW_NETMESS * mess);
+static int handle_sendmap (LW_SRVCHAN * chan, LW_NETMESS * mess, void **map);
+static int handle_recvmap (LW_SRVCHAN * chan, LW_NETMESS * mess, void *map);
+static int handle_sendconfig (LW_SRVCHAN * chan, LW_NETMESS * mess,
+			      LW_NETCONF * config);
+static int handle_recvconfig (LW_SRVCHAN * chan, LW_NETMESS * mess,
+			      LW_NETCONF * config);
+
+/*------------------------------------------------------------------*/
+/*
+ * Resets the LW_SRVCHAN struct
+ */
+static void
+reset (LW_SRVCHAN * chan)
+{
+  int i;
+
+  memset (chan, 0, sizeof (LW_SRVCHAN));
+
+  chan->sock = -1;
+  chan->ip[0] = '\0';
+  chan->port = 0;
+  chan->program_ok = 0;
+  chan->version_ok = 0;
+  chan->password_ok = 0;
+  chan->ready_ok = 0;
+  chan->start = 0;
+  chan->map = NULL;
+  memset (&(chan->config), 0, sizeof (LW_NETCONF));
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      lw_srvteam_reset (&(chan->team[i]));
+    }
+  lw_chat_reset (&(chan->chat));
+  chan->checksum_recv = 0;
+  chan->checksum_send = 0;
+  chan->normal_quit = 0;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "PING" message
+ */
+int
+lw_srvchan_handle_ping (int sock, LW_NETMESS * mess)
+{
+  int result = 0;
+
+  LW_MACRO_NOP (mess);
+
+  /*
+   * It's a ping, we answer OK everytime
+   */
+  lw_sock_send_str (&sock, LW_NETMESS_TEXT_OK);
+  result = 1;
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "ECHO" message
+ */
+int
+lw_srvchan_handle_echo (int sock, LW_NETMESS * mess)
+{
+  int result = 0;
+  char answer[LW_SOCK_MESSAGE_SIZE];
+  int i;
+
+  /*
+   * echo, we rebuild the original message
+   * from the information we have in the LW_NETMESS
+   * struct, and resend it to the client
+   */
+  LW_MACRO_STRCPY (answer, LW_NETMESS_TEXT_ECHO);
+  i = 0;
+  while (i < mess->argc)
+    {
+      if (i == 0)
+	{
+	  LW_MACRO_STRCAT (answer, " ");
+	}
+      else
+	{
+	  LW_MACRO_STRCAT (answer, ",");
+	}
+      LW_MACRO_STRCAT (answer, mess->argv[i]);
+      i++;
+    }
+  lw_sock_send_str (&sock, answer);
+  result = 1;
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "PROGRAM" message
+ */
+int
+lw_srvchan_handle_program (int sock, LW_NETMESS * mess, int *ok)
+{
+  int result = 0;
+
+  if (mess->argc == 1)
+    {
+      /*
+       * OK, there's an argument, we check if it's the good prog name.
+       * This prevents form accepting random connections: if the client
+       * is not really a liquidwar client, it will be thrown away
+       */
+      if (strcmp (mess->argv[0], LW_PROGRAM) == 0)
+	{
+	  (*ok) = 1;
+	  result = 1;
+	}
+    }
+
+  /*
+   * Now we send feedback on the network
+   */
+  if (result)
+    {
+      lw_sock_send_str (&sock, LW_NETMESS_TEXT_OK);
+    }
+  else
+    {
+      lw_sock_send_str (&sock, LW_NETMESS_TEXT_ERR);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "VERSION" message
+ */
+int
+lw_srvchan_handle_version (int sock, LW_NETMESS * mess, int *ok)
+{
+  int result = 0;
+
+  if (mess->argc == 1)
+    {
+      /*
+       * OK, there's an argument, we check if it's the good version.
+       * This prevents form accepting random connections: if the client
+       * is not a liquidwar client with the right version number, it will
+       * be thrown away...
+       */
+      if (strcmp (mess->argv[0], LW_VERSION) == 0)
+	{
+	  (*ok) = 1;
+	  result = 1;
+	}
+    }
+
+  /*
+   * Now we send feedback on the network
+   */
+  if (result)
+    {
+      lw_sock_send_str (&sock, LW_NETMESS_TEXT_OK);
+    }
+  else
+    {
+      lw_sock_send_str (&sock, LW_NETMESS_TEXT_ERR);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "PASSWORD" message
+ */
+int
+lw_srvchan_handle_password (int sock, LW_NETMESS * mess,
+			    int *ok, char *password)
+{
+  int result = 0;
+
+  switch (mess->argc)
+    {
+    case 1:
+      /*
+       * OK, there's an argument, we check if it's the good password.
+       */
+      if (strncmp (mess->argv[0], password, PASSWORD_SIZE) == 0)
+	{
+	  (*ok) = 1;
+	  result = 1;
+	}
+      break;
+    }
+
+  if (!strcmp (password, ""))
+    {
+      /*
+       * OK, now the server's password is "", so we consider any
+       * that any password from the client is OK.
+       */
+      (*ok) = 1;
+      result = 1;
+    }
+
+  /*
+   * Now we send feedback on the network
+   */
+  if (result)
+    {
+      lw_sock_send_str (&sock, LW_NETMESS_TEXT_OK);
+    }
+  else
+    {
+      lw_sock_send_str (&sock, LW_NETMESS_TEXT_ERR);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "FREE" message
+ */
+int
+lw_srvchan_handle_free (int sock, LW_NETMESS * mess, int free_teams, int *ok)
+{
+  int result = 0;
+  char answer[LW_SOCK_MESSAGE_SIZE];
+
+  LW_MACRO_NOP (mess);
+
+  LW_MACRO_SPRINTF2 (answer, "%s %d", LW_NETMESS_TEXT_OK, free_teams);
+
+  lw_sock_send_str (&sock, answer);
+
+  (*ok) = 1;
+  result = 1;
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "TEAM" message
+ */
+static int
+handle_team (LW_SRVCHAN * chan, LW_NETMESS * mess, int *free_teams)
+{
+  int result = 0;
+  int i;
+
+  if (mess->argc == 3)
+    {
+      /*
+       * OK, there are 3 arguments
+       * - arg 1 is the team index
+       * - arg 2 is the "control_type" parameter 
+       * - arg 3 is the team name
+       */
+      i = atoi (mess->argv[0]);
+      if (i >= 0 && i < NB_TEAMS)
+	{
+	  if (!chan->team[i].active)
+	    {
+	      /*
+	       * The message from the client makes sense, we
+	       * return OK
+	       */
+	      result = 1;
+
+	      /*
+	       * Now we activate the team only if there's still
+	       * room. If not we still return OK but the "WHO"
+	       * message will later inform the client that some
+	       * of his requests have been cancelled...
+	       */
+	      if ((*free_teams) > 0)
+		{
+		  (*free_teams)--;
+		  chan->team[i].active = 1;
+
+		  chan->team[i].control_type = atoi (mess->argv[1]);
+		  strncpy (chan->team[i].name, mess->argv[2], NAME_SIZE);
+		  chan->team[i].name[NAME_SIZE] = '\0';
+
+		  log_print_str ("Team \"");
+		  log_print_str (mess->argv[2]);
+		  log_print_str ("\" on client \"");
+		  log_print_str (chan->ip);
+		  log_print_str (":");
+		  log_print_int (chan->port);
+		  log_println_str ("\" accepted");
+		}
+	      else
+		{
+		  log_print_str ("Team \"");
+		  log_print_str (mess->argv[2]);
+		  log_print_str ("\" on client \"");
+		  log_print_str (chan->ip);
+		  log_print_str (":");
+		  log_print_int (chan->port);
+		  log_println_str ("\" refused!");
+		}
+	    }
+	}
+    }
+
+  /*
+   * Now we send feedback on the network
+   */
+  if (result)
+    {
+      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_OK);
+    }
+  else
+    {
+      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_ERR);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "WHO" message
+ */
+static int
+handle_who (LW_SRVCHAN * chan, LW_NETMESS * mess)
+{
+  int result = 0;
+  int i;
+  char answer[LW_SOCK_MESSAGE_SIZE];
+
+  if (mess->argc == 1)
+    {
+      /*
+       * OK, there's an argument, we interpret it as a number
+       */
+      i = atoi (mess->argv[0]);
+      if (i >= 0 && i < NB_TEAMS)
+	{
+	  LW_MACRO_SPRINTF1 (answer, "%s", LW_NETMESS_TEXT_ERR);
+
+	  if (chan->team[i].active)
+	    {
+	      if (chan->team[i].network)
+		{
+		  LW_MACRO_SPRINTF4 (answer,
+				     "%s %d,%d,'%s'",
+				     LW_NETMESS_TEXT_NETWORK,
+				     chan->team[i].server_id,
+				     chan->team[i].control_type,
+				     chan->team[i].name);
+		}
+	      else
+		{
+		  LW_MACRO_SPRINTF4 (answer,
+				     "%s %d,%d,'%s'",
+				     LW_NETMESS_TEXT_LOCAL,
+				     chan->team[i].server_id,
+				     chan->team[i].control_type,
+				     chan->team[i].name);
+		}
+	    }
+	  else
+	    {
+	      LW_MACRO_SPRINTF1 (answer, "%s", LW_NETMESS_TEXT_NOBODY);
+	    }
+
+	  lw_sock_send_str (&(chan->sock), answer);
+	  result = 1;
+	}
+    }
+
+  /*
+   * Now we send feedback on the network
+   */
+  if (!result)
+    {
+      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_ERR);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "READY" message
+ */
+static int
+handle_ready (LW_SRVCHAN * chan, LW_NETMESS * mess)
+{
+  int result = 0;
+
+  LW_MACRO_NOP (mess);
+
+  /*
+   * Here we do not return "OK" yet. In fact we will return
+   * "OK" on the network later, when all the clients will be
+   * connected, this way the "OK" answer to the "READY" message
+   * is the signal for game start
+   */
+  chan->ready_ok = 1;
+  result = 1;
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "START" message
+ */
+static int
+handle_start (LW_SRVCHAN * chan, LW_NETMESS * mess)
+{
+  int result = 0;
+
+  LW_MACRO_NOP (mess);
+
+  /*
+   * Here we just acknowledge the fact that the client required
+   * the game to start right away
+   */
+  chan->start = 1;
+  result = 1;
+
+  /*
+   * Now we send feedback on the network
+   */
+  if (result)
+    {
+      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_OK);
+    }
+  else
+    {
+      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_ERR);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "WAITING" message
+ */
+static int
+handle_waiting (LW_SRVCHAN * chan, LW_NETMESS * mess, int free_teams)
+{
+  int result = 0;
+  char answer[LW_SOCK_MESSAGE_SIZE];
+
+  LW_MACRO_NOP (mess);
+
+  /*
+   * Here we answer the client the number of free teams
+   */
+  result = 1;
+
+  LW_MACRO_SPRINTF2 (answer, "%s %d", LW_NETMESS_TEXT_OK, free_teams);
+
+  /*
+   * Now we send feedback on the network
+   */
+  if (result)
+    {
+      lw_sock_send_str (&(chan->sock), answer);
+    }
+  else
+    {
+      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_ERR);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "NEXT" message
+ */
+static int
+handle_next (LW_SRVCHAN * chan, LW_NETMESS * mess, int *next)
+{
+  int result = 0;
+
+  LW_MACRO_NOP (chan);
+  LW_MACRO_NOP (mess);
+
+  /*
+   * Here we do not return "OK" yet.
+   * The point is that the "NEXT" message is like the "READY"
+   * message, it gets an answer when the server decides to
+   * talk to the client again.
+   */
+  (*next) = 1;
+  result = 1;
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "TEAMSTARTINFO" message
+ */
+static int
+handle_teamstartinfo (LW_SRVCHAN * chan, LW_NETMESS * mess,
+		      LW_TEAMSTARTINFO * team_start_info)
+{
+  int result = 0;
+  int i;
+  char answer[LW_SOCK_MESSAGE_SIZE];
+
+  if (mess->argc == 1)
+    {
+      /*
+       * OK, there's an argument, we interpret it as a number
+       */
+      i = atoi (mess->argv[0]);
+      if (i >= 0 && i < NB_TEAMS)
+	{
+	  LW_MACRO_SPRINTF4 (answer,
+			     "%s %d,%d,'%s'",
+			     LW_NETMESS_TEXT_OK,
+			     team_start_info[i].active,
+			     team_start_info[i].start,
+			     team_start_info[i].name);
+
+	  lw_sock_send_str (&(chan->sock), answer);
+
+	  result = 1;
+	}
+    }
+
+  /*
+   * Now we send feedback on the network
+   */
+  if (!result)
+    {
+      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_ERR);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "CHATTALK" message
+ */
+static int
+handle_chattalk (LW_SRVCHAN * chan, LW_NETMESS * mess, LW_CHAT_HISTORY * chat)
+{
+  int result = 0;
+
+  if (mess->argc == 1)
+    {
+      /*
+       * OK, there's an argument, we interpret it as a message.
+       * Note that we push the message in a common chat history
+       * struct, to share it with others.
+       */
+      log_print_str ("Client \"");
+      log_print_str (chan->ip);
+      log_print_str (":");
+      log_print_int (chan->port);
+      log_print_str ("\" says \"");
+      log_print_str (mess->argv[0]);
+      log_println_str ("\"");
+
+      lw_chat_push (chat, chan->team[0].name, mess->argv[0]);
+
+      result = 1;
+    }
+
+  /*
+   * Now we send feedback on the network
+   */
+  if (result)
+    {
+      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_OK);
+    }
+  else
+    {
+      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_ERR);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "CHATLISTEN" message
+ */
+static int
+handle_chatlisten (LW_SRVCHAN * chan, LW_NETMESS * mess)
+{
+  int result = 0;
+  char answer[LW_SOCK_MESSAGE_SIZE];
+  LW_CHAT_MESSAGE message;
+
+  if (mess->argc == 0)
+    {
+      if (lw_chat_pop (&(chan->chat), &message))
+	{
+	  /*
+	   * OK, there's a message in the queue, we send it
+	   */
+	  LW_MACRO_SPRINTF3 (answer,
+			     "%s '%s','%s'",
+			     LW_NETMESS_TEXT_OK,
+			     message.author, message.content);
+	}
+      else
+	{
+	  LW_MACRO_SPRINTF0 (answer, LW_NETMESS_TEXT_OK);
+	}
+
+      lw_sock_send_str (&(chan->sock), answer);
+
+      result = 1;
+    }
+
+  /*
+   * Send error message if needed
+   */
+  if (!result)
+    {
+      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_ERR);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "SENDMAP" message
+ */
+static int
+handle_sendmap (LW_SRVCHAN * chan, LW_NETMESS * mess, void **map)
+{
+  int result = 0;
+
+  LW_MACRO_NOP (mess);
+
+  result = lw_netmap_recv (&(chan->sock), map);
+
+  /*
+   * Now we send feedback on the network
+   */
+  if (result)
+    {
+      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_OK);
+    }
+  else
+    {
+      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_ERR);
+    }
+
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "RECVMAP" message
+ */
+static int
+handle_recvmap (LW_SRVCHAN * chan, LW_NETMESS * mess, void *map)
+{
+  int result = 0;
+
+  LW_MACRO_NOP (mess);
+
+  result = lw_netmap_send (&(chan->sock), map);
+
+  /*
+   * Now we send feedback on the network
+   */
+  if (result)
+    {
+      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_OK);
+    }
+  else
+    {
+      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_ERR);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "SENDCONFIG" message
+ */
+static int
+handle_sendconfig (LW_SRVCHAN * chan, LW_NETMESS * mess, LW_NETCONF * config)
+{
+  int result = 0;
+
+  LW_MACRO_NOP (mess);
+
+  result = lw_netconf_recv (&(chan->sock), config);
+
+  /*
+   * Now we send feedback on the network
+   */
+  if (result)
+    {
+      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_OK);
+    }
+  else
+    {
+      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_ERR);
+    }
+
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "RECVCONFIG" message
+ */
+static int
+handle_recvconfig (LW_SRVCHAN * chan, LW_NETMESS * mess, LW_NETCONF * config)
+{
+  int result = 0;
+
+  LW_MACRO_NOP (mess);
+
+  result = lw_netconf_send (&(chan->sock), config);
+
+  /*
+   * Now we send feedback on the network
+   */
+  if (result)
+    {
+      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_OK);
+    }
+  else
+    {
+      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_ERR);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles the "QUIT" message
+ */
+int
+lw_srvchan_handle_quit (int sock, LW_NETMESS * mess, int *normal_quit)
+{
+  int result = 0;
+
+  LW_MACRO_NOP (sock);
+  LW_MACRO_NOP (mess);
+
+  /*
+   * We flag the client as having quitted the server "normally".
+   * This allow calling functions to make the difference between
+   * a client that decided to leave on purpose from a client
+   * that was disconnected because of lag or something.
+   */
+  (*normal_quit) = 1;
+
+  /*
+   * Here we do nothing and simply return an error, this will
+   * cause the system to close the socket automatically...
+   */
+  result = -1;
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * handles an unknown message
+ */
+int
+lw_srvchan_handle_unknown (int sock, LW_NETMESS * mess)
+{
+  int result = 0;
+
+  LW_MACRO_NOP (mess);
+
+  /*
+   * We answer ERR all the time
+   */
+  lw_sock_send_str (&sock, LW_NETMESS_TEXT_ERR);
+
+  /*
+   * Since we return 0, the connection will be closed...
+   */
+  return result;
+}
+
+/*==================================================================*/
+/* global functions                                                 */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Waits for a client to connect, returns 1 if successfull, 0 if not
+ */
+int
+lw_srvchan_wait_teams (LW_SRVCHAN * chan, int *free_teams,
+		       int sock, void **map, LW_NETCONF * config,
+		       char *password)
+{
+  int result = 0;
+  int ret;
+  int ret_mess = 1;
+  char message[LW_SOCK_MESSAGE_SIZE];
+  LW_NETMESS *mess;
+  int free_received = 0;
+  reset (chan);
+
+  if (lw_sock_accept (&(chan->sock), chan->ip, &(chan->port), sock, 1))
+    {
+      log_print_str ("Connection from \"");
+      log_print_str (chan->ip);
+      log_print_str (":");
+      log_print_int (chan->port);
+      log_print_str ("\"");
+      log_println ();
+      log_flush ();
+
+      while ((!chan->ready_ok) && ret_mess &&
+	     ((ret = lw_sock_recv_str (&(chan->sock), message)) >= 0))
+	{
+	  if (ret > 0)
+	    {
+	      mess = lw_netmess_read (message);
+	      if (mess != NULL)
+		{
+		  /*
+		   * switch to handle the different possible messages
+		   */
+		  switch (mess->code)
+		    {
+		    case LW_NETMESS_CODE_PING:
+		      ret_mess = lw_srvchan_handle_ping (chan->sock, mess);
+		      break;
+		    case LW_NETMESS_CODE_ECHO:
+		      ret_mess = lw_srvchan_handle_echo (chan->sock, mess);
+		      break;
+		    case LW_NETMESS_CODE_PROGRAM:
+		      ret_mess = lw_srvchan_handle_program (chan->sock, mess,
+							    &(chan->
+							      program_ok));
+		      break;
+		    case LW_NETMESS_CODE_VERSION:
+		      ret_mess = lw_srvchan_handle_version (chan->sock, mess,
+							    &(chan->
+							      version_ok));
+		      break;
+		    case LW_NETMESS_CODE_PASSWORD:
+		      ret_mess = lw_srvchan_handle_password (chan->sock, mess,
+							     &(chan->
+							       password_ok),
+							     password);
+		      break;
+		    case LW_NETMESS_CODE_FREE:
+		      ret_mess = lw_srvchan_handle_free (chan->sock, mess,
+							 *free_teams,
+							 &free_received);
+		      break;
+		    case LW_NETMESS_CODE_TEAM:
+		      ret_mess = handle_team (chan, mess, free_teams);
+		      break;
+		    case LW_NETMESS_CODE_READY:
+		      ret_mess = handle_ready (chan, mess);
+		      break;
+		    case LW_NETMESS_CODE_SENDMAP:
+		      ret_mess = handle_sendmap (chan, mess, map);
+		      break;
+		    case LW_NETMESS_CODE_SENDCONFIG:
+		      ret_mess = handle_sendconfig (chan, mess, config);
+		      break;
+		    case LW_NETMESS_CODE_QUIT:
+		      ret_mess = lw_srvchan_handle_quit (chan->sock, mess,
+							 &(chan->
+							   normal_quit));
+		      break;
+		    default:
+		      ret_mess = lw_srvchan_handle_unknown (sock, mess);
+		      break;
+		    }
+
+		  /*
+		   * lw_netmess_free must *not* be forgetted 
+		   */
+		  lw_netmess_free (mess);
+
+		  if (!ret_mess)
+		    {
+		      log_print_str ("Error processing \"");
+		      log_print_str (message);
+		      log_print_str ("\"");
+		      log_println ();
+		    }
+		}
+	      else
+		{
+		  log_println_str ("Serious memory problem 8-(");
+		  ret_mess = 0;
+		}
+	    }
+	}
+
+      if (chan->program_ok &&
+	  chan->version_ok && chan->password_ok && chan->ready_ok && ret_mess)
+	{
+	  result = 1;
+
+	  log_print_str ("Client \"");
+	  log_print_str (chan->ip);
+	  log_print_str (":");
+	  log_print_int (chan->port);
+	  log_println_str ("\" accepted");
+
+	  /* 
+	   * We play a little sound for people who have the server
+	   * opened on a console and want it to beep when someone
+	   * connects
+	   */
+	  log_beep ();
+	}
+      else
+	{
+	  if (chan->ready_ok)
+	    {
+	      /*
+	       * Now if we are here it means we have received a "READY"
+	       * message, but still the client did not send the correct
+	       * messages before => we send an "ERR" messageon the
+	       * network for consistency, since the client did not receive
+	       * any message to his "READY" query yet.
+	       */
+	      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_ERR);
+	    }
+	  lw_sock_close (&(chan->sock));
+
+	  log_print_str ("Client \"");
+	  log_print_str (chan->ip);
+	  log_print_str (":");
+	  log_print_int (chan->port);
+	  if (chan->normal_quit)
+	    {
+	      log_println_str ("\" disconnected (probably a ping)");
+	    }
+	  else
+	    {
+	      log_println_str ("\" rejected!");
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends informations to the client on a regular basis, once it's
+ * connected and waiting for the game to start
+ */
+int
+lw_srvchan_keepalive (LW_SRVCHAN * chan,
+		      int waited_teams,
+		      LW_TEAMSTARTINFO * team_start_info,
+		      LW_CHAT_HISTORY * chat)
+{
+  int result = 0;
+  int ret;
+  int ret_mess = 1;
+  char message[LW_SOCK_MESSAGE_SIZE];
+  LW_NETMESS *mess;
+  int next = 0;
+
+  /*
+   * we set ready_ok back to false since we will wait for
+   * another ready message
+   */
+  chan->ready_ok = 0;
+
+  /*
+   * We first answer the "READY" message which had been sent by the
+   * client a possibly long time ago.
+   */
+  if (lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_OK))
+    {
+      while ((!chan->ready_ok) && (!next) && ret_mess &&
+	     ((ret = lw_sock_recv_str (&(chan->sock), message)) >= 0))
+	{
+	  if (ret > 0)
+	    {
+	      mess = lw_netmess_read (message);
+	      if (mess != NULL)
+		{
+		  /*
+		   * switch to handle the different possible messages
+		   */
+		  switch (mess->code)
+		    {
+		    case LW_NETMESS_CODE_PING:
+		      ret_mess = lw_srvchan_handle_ping (chan->sock, mess);
+		      break;
+		    case LW_NETMESS_CODE_ECHO:
+		      ret_mess = lw_srvchan_handle_echo (chan->sock, mess);
+		      break;
+		    case LW_NETMESS_CODE_START:
+		      ret_mess = handle_start (chan, mess);
+		      break;
+		    case LW_NETMESS_CODE_WAITING:
+		      ret_mess = handle_waiting (chan, mess, waited_teams);
+		      break;
+		    case LW_NETMESS_CODE_NEXT:
+		      ret_mess = handle_next (chan, mess, &next);
+		      break;
+		    case LW_NETMESS_CODE_TEAMSTARTINFO:
+		      ret_mess = handle_teamstartinfo (chan, mess,
+						       team_start_info);
+		      break;
+		    case LW_NETMESS_CODE_CHATTALK:
+		      ret_mess = handle_chattalk (chan, mess, chat);
+		      break;
+		    case LW_NETMESS_CODE_CHATLISTEN:
+		      ret_mess = handle_chatlisten (chan, mess);
+		      break;
+		    case LW_NETMESS_CODE_READY:
+		      ret_mess = handle_ready (chan, mess);
+		      break;
+		    case LW_NETMESS_CODE_QUIT:
+		      ret_mess = lw_srvchan_handle_quit (chan->sock, mess,
+							 &(chan->
+							   normal_quit));
+		      break;
+		    default:
+		      ret_mess = lw_srvchan_handle_unknown (chan->sock, mess);
+		      break;
+		    }
+
+		  /*
+		   * lw_netmess_free must *not* be forgetted 
+		   */
+		  lw_netmess_free (mess);
+
+		  if (!ret_mess)
+		    {
+		      log_print_str ("Error processing \"");
+		      log_print_str (message);
+		      log_print_str ("\"");
+		      log_println ();
+		    }
+		}
+	      else
+		{
+		  log_println_str ("Serious memory problem 8-(");
+		  ret_mess = 0;
+		}
+	    }
+	}
+
+      if ((chan->ready_ok || next) && ret_mess)
+	{
+	  result = 1;
+	  if (chan->ready_ok)
+	    {
+	      log_print_str ("Client \"");
+	      log_print_str (chan->ip);
+	      log_print_str (":");
+	      log_print_int (chan->port);
+	      log_println_str ("\" ready");
+	    }
+	}
+      else
+	{
+	  if (chan->ready_ok || next)
+	    {
+	      /*
+	       * Now if we are here it means we have received a "READY"
+	       * message, but still the client did not send the correct
+	       * messages before => we send an "ERR" messageon the
+	       * network for consistency, since the client did not receive
+	       * any message to his "READY" query yet.
+	       */
+	      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_ERR);
+	    }
+	  lw_sock_close (&(chan->sock));
+
+	  //log_println_str("Player KO");
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Answers OK to a client, and waits for the "WHO" message 
+ */
+int
+lw_srvchan_tell_who (LW_SRVCHAN * chan, void *map, LW_NETCONF * config)
+{
+  int result = 0;
+  int ret;
+  int ret_mess = 1;
+  char message[LW_SOCK_MESSAGE_SIZE];
+  LW_NETMESS *mess;
+
+  log_print_str ("Sending info to \"");
+  log_print_str (chan->ip);
+  log_print_str (":");
+  log_print_int (chan->port);
+  log_print_str ("\"");
+  log_println ();
+
+  /*
+   * we set ready_ok back to false since we will wait for
+   * another ready message
+   */
+  chan->ready_ok = 0;
+
+  /*
+   * We first answer the "READY" message which had been sent by the
+   * client a possibly long time ago.
+   */
+
+  if (lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_OK))
+    {
+      while ((!chan->ready_ok) && ret_mess &&
+	     ((ret = lw_sock_recv_str (&(chan->sock), message)) >= 0))
+	{
+	  if (ret > 0)
+	    {
+	      mess = lw_netmess_read (message);
+	      if (mess != NULL)
+		{
+		  /*
+		   * switch to handle the different possible messages
+		   */
+		  switch (mess->code)
+		    {
+		    case LW_NETMESS_CODE_PING:
+		      ret_mess = lw_srvchan_handle_ping (chan->sock, mess);
+		      break;
+		    case LW_NETMESS_CODE_ECHO:
+		      ret_mess = lw_srvchan_handle_echo (chan->sock, mess);
+		      break;
+		    case LW_NETMESS_CODE_WHO:
+		      ret_mess = handle_who (chan, mess);
+		      break;
+		    case LW_NETMESS_CODE_READY:
+		      ret_mess = handle_ready (chan, mess);
+		      break;
+		    case LW_NETMESS_CODE_RECVMAP:
+		      ret_mess = handle_recvmap (chan, mess, map);
+		      break;
+		    case LW_NETMESS_CODE_RECVCONFIG:
+		      ret_mess = handle_recvconfig (chan, mess, config);
+		      break;
+		    default:
+		      ret_mess = lw_srvchan_handle_unknown (chan->sock, mess);
+		      break;
+		    }
+
+		  /*
+		   * lw_netmess_free must *not* be forgetted 
+		   */
+		  lw_netmess_free (mess);
+
+		  if (!ret_mess)
+		    {
+		      log_print_str ("Error processing \"");
+		      log_print_str (message);
+		      log_print_str ("\"");
+		      log_println ();
+		    }
+		}
+	      else
+		{
+		  log_println_str ("Serious memory problem 8-(");
+		  ret_mess = 0;
+		}
+	    }
+	}
+
+      if (chan->ready_ok && ret_mess)
+	{
+	  result = 1;
+	  //      log_println_str("Player OK");
+	}
+      else
+	{
+	  if (chan->ready_ok)
+	    {
+	      /*
+	       * Now if we are here it means we have received a "READY"
+	       * message, but still the client did not send the correct
+	       * messages before => we send an "ERR" messageon the
+	       * network for consistency, since the client did not receive
+	       * any message to his "READY" query yet.
+	       */
+	      lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_ERR);
+	    }
+	  lw_sock_close (&(chan->sock));
+
+	  //log_println_str("Player KO");
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends the final "OK" message before streaming
+ */
+int
+lw_srvchan_final_ok (LW_SRVCHAN * chan)
+{
+  int result = 0;
+
+  if (lw_sock_send_str (&(chan->sock), LW_NETMESS_TEXT_OK))
+    {
+      result = 1;
+    }
+  else
+    {
+      lw_sock_close (&(chan->sock));
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Returns the index of the team associated to a given server team id
+ */
+int
+lw_srvchan_find_team_by_server_id (LW_SRVCHAN * chan, int server_id)
+{
+  int result = -1;
+  int i;
+
+  for (i = 0; i < NB_TEAMS && result < 0; ++i)
+    {
+      if (chan->team[i].active && chan->team[i].server_id == server_id)
+	{
+	  result = i;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Returns the index of the first inactive team
+ */
+int
+lw_srvchan_find_first_free_team (LW_SRVCHAN * chan)
+{
+  int result = -1;
+  int i;
+
+  for (i = 0; i < NB_TEAMS && result < 0; ++i)
+    {
+      if (!(chan->team[i].active))
+	{
+	  result = i;
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Closes everything and frees the resources
+ */
+void
+lw_srvchan_close (LW_SRVCHAN * chan)
+{
+  lw_sock_close (&(chan->sock));
+
+  if (chan->map != NULL)
+    {
+      free (chan->map);
+      chan->map = NULL;
+    }
+
+  reset (chan);
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Receives key presses from a computer.
+ * The keys come in the "computer's order" ie one still has to
+ * sort them by server id. 
+ */
+int
+lw_srvchan_recv_keys (LW_SRVCHAN * chan, LW_NETKEY * netkey)
+{
+  int result = 0;
+  int i;
+  LW_NETKEY chan_netkey;
+
+  lw_netkey_reset (&chan_netkey);
+
+  result = lw_netkey_recv (&(chan->sock), &chan_netkey);
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      if (chan->team[i].active && !chan->team[i].network)
+	{
+	  netkey->key_states[chan->team[i].server_id] =
+	    chan_netkey.key_states[i];
+	}
+    }
+
+  netkey->cmd = chan_netkey.cmd;
+  netkey->arg = chan_netkey.arg;
+  chan->checksum_recv = chan_netkey.checksum;
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends key presses to a computer.
+ * The keys must be send in the "computer's order" ie they must
+ * be sorted first. 
+ */
+int
+lw_srvchan_send_keys (LW_SRVCHAN * chan, LW_NETKEY * netkey)
+{
+  int result = 0;
+  int i;
+  LW_NETKEY chan_netkey;
+
+  lw_netkey_reset (&chan_netkey);
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      if (chan->team[i].active)
+	{
+	  chan_netkey.key_states[i] =
+	    netkey->key_states[chan->team[i].server_id];
+	}
+    }
+
+  chan_netkey.cmd = netkey->cmd;
+  chan_netkey.arg = netkey->arg;
+  chan_netkey.checksum = chan->checksum_send;
+
+  result = lw_netkey_send (&(chan->sock), &chan_netkey);
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/srvchan.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/srvchan.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/srvchan.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,121 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : srvchan.h                                        */
+/* content       : handles a server network channel                 */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_SRVCHAN
+#define LIQUID_WAR_INCLUDE_SRVCHAN
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "base.h"
+#include "sockgen.h"
+#include "srvteam.h"
+#include "netkey.h"
+#include "netconf.h"
+#include "startinf.h"
+#include "netmess.h"
+#include "chat.h"
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+
+typedef struct
+{
+  int sock;
+  char ip[LW_SOCK_IP_SIZE];
+  int port;
+  int program_ok;
+  int version_ok;
+  int password_ok;
+  int ready_ok;
+  int nb_local_teams;
+  int start;
+  void *map;
+  LW_NETCONF config;
+  LW_SRVTEAM team[NB_TEAMS];
+  LW_CHAT_HISTORY chat;
+  unsigned int checksum_recv;
+  unsigned int checksum_send;
+  int normal_quit;
+}
+LW_SRVCHAN;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int lw_srvchan_wait_teams (LW_SRVCHAN * chan, int *free_teams,
+			   int sock, void **map, LW_NETCONF * config,
+			   char *password);
+int lw_srvchan_keepalive (LW_SRVCHAN * chan, int waited_teams,
+			  LW_TEAMSTARTINFO * team_start_info,
+			  LW_CHAT_HISTORY * chat);
+int lw_srvchan_tell_who (LW_SRVCHAN * chan, void *map, LW_NETCONF * config);
+int lw_srvchan_final_ok (LW_SRVCHAN * chan);
+int lw_srvchan_find_team_by_server_id (LW_SRVCHAN * chan, int server_id);
+int lw_srvchan_find_first_free_team (LW_SRVCHAN * chan);
+void lw_srvchan_close (LW_SRVCHAN * chan);
+int lw_srvchan_recv_keys (LW_SRVCHAN * chan, LW_NETKEY * netkey);
+int lw_srvchan_send_keys (LW_SRVCHAN * chan, LW_NETKEY * netkey);
+
+int lw_srvchan_handle_ping (int sock, LW_NETMESS * mess);
+int lw_srvchan_handle_echo (int sock, LW_NETMESS * mess);
+int lw_srvchan_handle_program (int sock, LW_NETMESS * mess, int *ok);
+int lw_srvchan_handle_version (int sock, LW_NETMESS * mess, int *ok);
+int lw_srvchan_handle_password (int sock, LW_NETMESS * mess,
+				int *ok, char *password);
+int lw_srvchan_handle_free (int sock, LW_NETMESS * mess,
+			    int free_teams, int *ok);
+int lw_srvchan_handle_unknown (int sock, LW_NETMESS * mess);
+int lw_srvchan_handle_quit (int sock, LW_NETMESS * mess, int *normal_quit);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/srvcont.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/srvcont.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/srvcont.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,1169 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : srvcont.c                                        */
+/* content       : global controler of the network channels         */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "srvcont.h"
+#include "srvchan.h"
+#include "sockgen.h"
+#include "sock2gen.h"
+#include "log.h"
+#include "server.h"
+#include "netkey.h"
+#include "srvtime.h"
+#include "startinf.h"
+#include "thrdgen.h"
+#include "macro.h"
+#include "execgen.h"
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+typedef struct
+{
+  int sock;
+  char ip[LW_SOCK_IP_SIZE];
+  int port;
+  int *thread_running;
+  char password[PASSWORD_SIZE + 1];
+}
+LW_SRVCONT_REJECT_DATA;
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_SRVCONT_INCREASE_LAG_LIMIT 10
+#define LW_SRVCONT_DECREASE_LAG_LIMIT 20
+
+#define LW_SRVCONT_DISPLAY_STATE_DELAY 60
+#define LW_SRVCONT_REGISTER_DELAY      90
+
+/*==================================================================*/
+/* static functions                                                 */
+/*==================================================================*/
+
+static void reset (LW_SRVCONT * cont);
+static int distribute_teams (LW_SRVCONT * cont);
+static void recalc_nb_teams (LW_SRVCONT * cont);
+static void find_chan_and_team_by_server_id (LW_SRVCONT * cont,
+					     int server_id,
+					     int *chan, int *team);
+static int send_lag_key_presses (LW_SRVCONT * cont, int lag);
+static int reject_new_clients (LW_SRVCONT * cont, char *password);
+static void reject_new_clients_callback (void *args);
+static void disconnect_client (LW_SRVCONT * cont, int i, char *reason);
+
+/*------------------------------------------------------------------*/
+/*
+ * Resets the LW_SRVCONT struct
+ */
+static void
+reset (LW_SRVCONT * cont)
+{
+  memset (cont, 0, sizeof (LW_SRVCONT));
+
+  cont->sock = -1;
+  cont->nb_teams = 0;
+  cont->nb_chans = 0;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Affects consistent values to all the teams
+ */
+static int
+distribute_teams (LW_SRVCONT * cont)
+{
+  int result = 1;
+  int i, j, k;
+  int i_orig, j_orig;
+  int asm_algorithm;
+
+  /*
+   * The first step is to attribute a unique number to each
+   * local team for each channel.
+   */
+  k = 0;
+  for (i = 0; i < cont->nb_chans; ++i)
+    {
+      for (j = 0; j < NB_TEAMS; ++j)
+	{
+	  if (cont->chan[i].team[j].active)
+	    {
+	      cont->chan[i].team[j].server_id = k++;
+	    }
+	}
+    }
+
+  /*
+   * Now k should be equal to the number of available teams,
+   * or it means there's a serious error...
+   */
+  if (k != cont->nb_teams)
+    {
+      log_println_str ("Unable to attribute teams!");
+      result = 0;
+    }
+
+  /*
+   * The second step is to define which teams in each channel
+   * will be the "network" teams.
+   */
+  for (i = 0; i < cont->nb_chans; ++i)
+    {
+      for (k = 0; k < cont->nb_teams; ++k)
+	{
+	  if (lw_srvchan_find_team_by_server_id (&(cont->chan[i]), k) < 0)
+	    {
+	      j = lw_srvchan_find_first_free_team (&(cont->chan[i]));
+	      if (j >= 0)
+		{
+		  cont->chan[i].team[j].active = 1;
+		  cont->chan[i].team[j].network = 1;
+		  cont->chan[i].team[j].server_id = k;
+		}
+	      else
+		{
+		  result = 0;
+		  log_println_str ("Unable to find a free team!");
+		}
+	    }
+	}
+    }
+
+  /*
+   * Third step, we copy the team names and other parameters in all
+   * the teams structures. This is redundant information but it
+   * will save useless CPU waste later...
+   */
+  for (i = 0; i < cont->nb_chans; ++i)
+    {
+      for (j = 0; j < NB_TEAMS; ++j)
+	{
+	  if (cont->chan[i].team[j].active)
+	    {
+	      find_chan_and_team_by_server_id (cont,
+					       cont->chan[i].team[j].
+					       server_id, &i_orig, &j_orig);
+	      if (i_orig >= 0 && j_orig >= 0)
+		{
+		  /*
+		   * Now we check that we're not uselessely copying
+		   * stuff from the same struct. It's a waste of time
+		   * and can cause some bugs depending on the implementation
+		   * of the LW_MACRO_STRCPY macro.
+		   */
+		  if (i_orig != i || j_orig != j)
+		    {
+		      LW_MACRO_STRCPY (cont->chan[i].team[j].name,
+				       cont->chan[i_orig].team[j_orig].name);
+		      cont->chan[i].team[j].control_type =
+			cont->chan[i_orig].team[j_orig].control_type;
+		    }
+		}
+	      else
+		{
+		  result = 0;
+		  log_println_str ("Unable to find a free team!");
+		}
+	    }
+	}
+    }
+
+  /*
+   * Last step, we check if the "asm_algorithm" parameter should be
+   * enabled. Indeed, it must be enabled on _all_ computers or on
+   * none of them...
+   */
+  asm_algorithm = 1;
+  for (i = 0; i < cont->nb_chans; ++i)
+    {
+      asm_algorithm = (cont->chan[i].config.asm_algorithm && asm_algorithm);
+    }
+  for (i = 0; i < cont->nb_chans; ++i)
+    {
+      cont->chan[i].config.asm_algorithm = asm_algorithm;
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Calculates the cont->nb_teams value
+ */
+static void
+recalc_nb_teams (LW_SRVCONT * cont)
+{
+  int i, j;
+
+  cont->nb_teams = 0;
+  for (i = 0; i < cont->nb_chans; ++i)
+    {
+      for (j = 0; j < NB_TEAMS; ++j)
+	{
+	  if (cont->chan[i].team[j].active)
+	    {
+	      cont->nb_teams++;
+	    }
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Gets the chan and team index for a given server id
+ */
+static void
+find_chan_and_team_by_server_id (LW_SRVCONT * cont,
+				 int server_id, int *chan, int *team)
+{
+  int i;
+  int j;
+
+  *chan = *team = -1;
+  for (i = 0; i < cont->nb_chans; ++i)
+    {
+      for (j = 0; j < NB_TEAMS; ++j)
+	{
+	  if (cont->chan[i].team[j].active &&
+	      (cont->chan[i].team[j].server_id == server_id) &&
+	      !(cont->chan[i].team[j].network))
+	    {
+	      (*chan) = i;
+	      (*team) = j;
+	    }
+	}
+    }
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Prepares the LW_TEAMSTARTINFO structures
+ */
+static void
+prepare_team_start_info (LW_TEAMSTARTINFO * team_start_info,
+			 LW_SRVCONT * cont)
+{
+  int i, j, k;
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      lw_teamstartinfo_reset (team_start_info + i);
+    }
+
+  k = 0;
+  for (i = 0; i < cont->nb_chans; ++i)
+    {
+      for (j = 0; j < NB_TEAMS; ++j)
+	{
+	  if (cont->chan[i].team[j].active && k < NB_TEAMS)
+	    {
+	      team_start_info[k].active = 1;
+	      team_start_info[k].start = cont->chan[i].start;
+	      LW_MACRO_STRCPY (team_start_info[k].name,
+			       cont->chan[i].team[j].name);
+	      k++;
+	    }
+	}
+    }
+}
+
+/*==================================================================*/
+/* global functions                                                 */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/* 
+ * Waits for a given number of teams to connect
+ */
+int
+lw_srvcont_wait_teams (LW_SRVCONT * cont,
+		       LW_WWWSRV_DATA * www_data,
+		       int nb_teams, int port, char *password, char *callback)
+{
+  int free_teams = 0;
+  int result = 0;
+  int i;
+  int start;
+  int started = 0;
+  LW_TEAMSTARTINFO team_start_info[NB_TEAMS];
+  int cur_time, last_time;
+  int display_waiting_for = 1;
+  LW_CHAT_HISTORY chat;
+  LW_CHAT_MESSAGE chat_mess;
+
+  reset (cont);
+
+  cur_time = last_time = lw_srvtime_seconds ();
+
+  lw_chat_reset (&chat);
+
+  /*
+   * We register the server on the metaserver for the
+   * first time, with 0 active teams.
+   */
+  www_data->busy_players = cont->nb_teams;
+  www_data->max_players = nb_teams;
+  www_data->log = 1;
+  lw_wwwsrv_register (www_data);
+
+  if (lw_sock_listen (&(cont->sock), port))
+    {
+      log_print_str ("Listening on port ");
+      log_print_int (port);
+      log_println_str ("...");
+      log_flush ();
+
+      /*
+       * Now we just wait until there are enough teams connected
+       */
+      while (!started)
+	{
+	  free_teams = nb_teams - cont->nb_teams;
+
+	  if (display_waiting_for)
+	    {
+	      log_print_str ("Waiting for ");
+	      log_print_int (free_teams);
+	      if (free_teams > 1)
+		{
+		  log_print_str (" teams...");
+		}
+	      else
+		{
+		  log_print_str (" team...");
+		}
+	      log_println ();
+
+	      display_waiting_for = 0;
+	    }
+
+	  if (lw_srvchan_wait_teams (&(cont->chan[cont->nb_chans]),
+				     &free_teams,
+				     cont->sock,
+				     &(cont->chan[cont->nb_chans].map),
+				     &(cont->chan[cont->nb_chans].config),
+				     password))
+	    {
+	      if (cont->nb_teams == 0)
+		{
+		  /*
+		   * OK, this guy is the first one to connect on
+		   * the server, so we'll fire the "callback" script/program
+		   */
+		  if (callback && strlen (callback))
+		    {
+		      log_print_str ("Executing \"");
+		      log_print_str (callback);
+		      log_println_str ("\"");
+		      lw_exec_cmd (callback);
+		    }
+		}
+	      cont->nb_teams = nb_teams - free_teams;
+	      ++(cont->nb_chans);
+	      display_waiting_for = 1;
+	    }
+
+	  /*
+	   * Now we check if me must force a game start
+	   */
+	  start = 1;
+	  for (i = 0; i < cont->nb_chans; ++i)
+	    {
+	      start = start && cont->chan[i].start;
+	    }
+	  if (cont->nb_teams >= 2 && (start || cont->nb_teams >= nb_teams))
+	    {
+	      if (cont->nb_teams < nb_teams)
+		{
+		  /*
+		   * OK, all the players have pressed the "start" button and there
+		   * are at least 2 playing teams -> we start the game!
+		   */
+		  nb_teams = cont->nb_teams;
+		  log_print_str ("Starting game with only ");
+		  log_print_int (cont->nb_teams);
+		  log_println_str (" teams");
+		}
+	      free_teams = 0;
+	    }
+
+	  /*
+	   * The official start signal is: free_teams is set to 0.
+	   * We use an extra flag "started" in case free_teams would
+	   * be recalculated
+	   */
+	  if (free_teams <= 0)
+	    {
+	      free_teams = 0;
+	      started = 1;
+	    }
+
+
+	  /*
+	   * We replicate chat messages
+	   */
+	  while (lw_chat_pop (&chat, &chat_mess))
+	    {
+	      for (i = 0; i < cont->nb_chans; ++i)
+		{
+		  lw_chat_push (&(cont->chan[i].chat),
+				chat_mess.author, chat_mess.content);
+		}
+	    }
+
+	  /*
+	   * now we send feedback to all the connected teams
+	   */
+	  prepare_team_start_info (team_start_info, cont);
+	  /*
+	   * loop with a step of -1 to handle correcty the
+	   * possible disconnection of players
+	   */
+	  for (i = cont->nb_chans - 1; i >= 0; --i)
+	    {
+	      if (!lw_srvchan_keepalive (&(cont->chan[i]),
+					 free_teams, team_start_info, &chat))
+		{
+		  /*
+		   * There's an error with this client, so 
+		   * we're simply going to disconnect it...
+		   */
+		  disconnect_client (cont, i, "keepalive failed");
+
+		  display_waiting_for = 1;
+		}
+	    }
+	  recalc_nb_teams (cont);
+
+	  www_data->busy_players = cont->nb_teams;
+	  www_data->max_players = nb_teams;
+
+	  /*
+	   * We register the server again since the number of 
+	   * connected teams might have changed
+	   */
+	  cur_time = lw_srvtime_seconds ();
+	  if (cur_time - last_time > LW_SRVCONT_REGISTER_DELAY
+	      || display_waiting_for)
+	    {
+	      www_data->log = 0;
+	      lw_wwwsrv_register (www_data);
+	      last_time = cur_time;
+	    }
+	}
+
+      /*
+       * For now the server is a "blocking" server which is never statisfied
+       * until the good number of players has connected itself, so if we
+       * get here it means the operation has been successfull
+       */
+      result = 1;
+    }
+  else
+    {
+      log_print_str ("Unable to bind socket on port ");
+      log_print_int (port);
+      log_println ("!");
+
+      /*
+       * We consider this a fatal error and quit the program
+       * right away.
+       */
+      lw_server_exit (1);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/* 
+ * Tells the teams about what the other teams are
+ */
+int
+lw_srvcont_tell_who (LW_SRVCONT * cont)
+{
+  int i;
+  int result = 0;
+
+  if (distribute_teams (cont))
+    {
+      result = 1;
+      for (i = cont->nb_chans - 1; i >= 0; --i)
+	{
+	  if (!lw_srvchan_tell_who (&(cont->chan[i]),
+				    cont->chan[0].map,
+				    &(cont->chan[0].config)))
+	    {
+	      /*
+	       * There's been an error exchanging data with this team
+	       * so we decide to "close" it.
+	       */
+	      disconnect_client (cont, i, "can't send game info");
+	    }
+	}
+
+      /*
+       * We start the game only if there are more than 1 channels opened...
+       */
+      if (cont->nb_chans > 0)
+	{
+	  result = 1;
+	}
+    }
+
+  return result;
+}
+
+
+/*------------------------------------------------------------------*/
+/* 
+ * Sends a final OK message to all the clients
+ */
+int
+lw_srvcont_final_ok (LW_SRVCONT * cont)
+{
+  int i;
+  int result = 0;
+
+  for (i = cont->nb_chans - 1; i >= 0; --i)
+    {
+      if (!lw_srvchan_final_ok (&(cont->chan[i])))
+	{
+	  disconnect_client (cont, i, "can't send final ok");
+	}
+    }
+
+  /*
+   * We start the game only if there are more than 1 channels opened...
+   */
+  if (cont->nb_chans > 0)
+    {
+      result = 1;
+    }
+
+  if (result)
+    {
+      log_print_str ("Game start");
+      log_println ();
+    }
+  else
+    {
+      log_print_str ("Unable to start game");
+      log_println ();
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Sends a serie of blank key presses to create an artificial lag.
+ * This lag is usefull, since this way, a few game cycles will 
+ * have to be run before a real key press comes back to a given
+ * player. This leaves times for other players to send their own
+ * key presses and this way the game can run smoothly.
+ */
+static int
+send_lag_key_presses (LW_SRVCONT * cont, int lag)
+{
+  int result = 1;
+  int i, j;
+  LW_NETKEY netkey;
+
+  lw_netkey_reset (&netkey);
+
+  for (j = 0; j < lag && result; ++j)
+    {
+      for (i = cont->nb_chans - 1; i >= 0; --i)
+	{
+	  /*
+	   * We put the checksum to 1, to inform the clients that
+	   * everything is OK
+	   */
+	  cont->chan[i].checksum_send = 1;
+	  if (!lw_srvchan_send_keys (&(cont->chan[i]), &netkey))
+	    {
+	      disconnect_client (cont, i, "error sending lag keys");
+	    }
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/* 
+ * Checks if the checksums from the clients are all the same
+ */
+int
+check_checksum (LW_SRVCONT * cont)
+{
+  int i, j;
+  int ok = 1;
+  int nb_diff;
+
+  for (i = 0; i < cont->nb_chans; ++i)
+    {
+      cont->chan[i].checksum_send = 1;
+      nb_diff = 0;
+
+      /*
+       * We do not check checksums if there's only 1 connected client.
+       */
+      if (cont->nb_chans >= 2)
+	{
+	  for (j = 0; j < cont->nb_chans; ++j)
+	    {
+	      if (cont->chan[i].checksum_recv != cont->chan[j].checksum_recv)
+		{
+		  ok = 0;
+		  nb_diff++;
+		}
+	    }
+
+	  /*
+	   * Now if this channel has a different checksum
+	   * than everyone else, we consider there's an error
+	   * on it. But if there's at least one channel that
+	   * has the same checksum, we consider it's OK
+	   * (for this channel only of course...)
+	   */
+	  if (nb_diff >= cont->nb_chans - 1)
+	    {
+	      cont->chan[i].checksum_send = 0;
+
+	      log_print_str ("Checksum error on client \"");
+	      log_print_str (cont->chan[i].ip);
+	      log_print_str (":");
+	      log_print_int (cont->chan[i].port);
+	      log_print_str ("\" (");
+	      log_print_int (cont->chan[i].checksum_recv);
+	      log_print_str (")");
+	      log_println ();
+	    }
+	}
+    }
+
+  return ok;
+}
+
+/*------------------------------------------------------------------*/
+/* 
+ * Sends a final OK message to all the clients
+ */
+int
+lw_srvcont_replicate_keys (LW_SRVCONT * cont,
+			   LW_WWWSRV_DATA * www_data, int lag, char *password)
+{
+  int result = 1;
+  LW_NETKEY netkey;
+  int i;
+  int increase_lag_counter = 0;
+  int decrease_lag_counter = 0;
+  int all_clients_request_increase_lag;
+  int all_clients_request_decrease_lag;
+  int a_client_requests_increase_lag;
+  int a_client_requests_decrease_lag;
+  int rounds = 0;
+  int last_rounds = 0;
+  int average_lag = 0;
+  time_t start, start2, end;
+  double elapsed;
+  int lag_key_presses_to_send = 0;
+  int skip_keys;
+
+  www_data->log = 1;
+  lw_wwwsrv_register (www_data);
+
+  lag_key_presses_to_send = lag;
+
+  start2 = start = lw_srvtime_seconds ();
+
+  while (cont->nb_chans > 0)
+    {
+      lw_netkey_reset (&netkey);
+
+      /*
+       * We still listen on the listening socket, to reject
+       * newcomers since the game already started
+       */
+      reject_new_clients (cont, password);
+
+      all_clients_request_increase_lag = 1;
+      all_clients_request_decrease_lag = 1;
+      a_client_requests_increase_lag = 0;
+      a_client_requests_decrease_lag = 0;
+
+      /*
+       * First we get the informations from all the players
+       */
+      for (i = cont->nb_chans - 1; i >= 0; --i)
+	{
+	  if (lw_srvchan_recv_keys (&(cont->chan[i]), &netkey))
+	    {
+	      /*
+	       * if at least a client does not request a lag
+	       * increase, then we don't do it
+	       */
+	      if (netkey.cmd == LW_NETKEY_CMD_INCREASE_LAG)
+		{
+		  a_client_requests_increase_lag = 1;
+		}
+	      else
+		{
+		  all_clients_request_increase_lag = 0;
+		}
+
+	      /*
+	       * if at least a client does not request a lag
+	       * decrease, then we don't do it
+	       */
+	      if (netkey.cmd == LW_NETKEY_CMD_DECREASE_LAG)
+		{
+		  a_client_requests_decrease_lag = 1;
+		}
+	      else
+		{
+		  all_clients_request_decrease_lag = 0;
+		}
+	    }
+	  else
+	    {
+	      /*
+	       * There's been an error receiving data from this team
+	       * so we decide to "close" it.
+	       */
+	      disconnect_client (cont, i, "no more keys");
+	    }
+	}
+
+      /*
+       * we reset the cmd and arg fields
+       */
+      netkey.cmd = LW_NETKEY_CMD_NONE;
+      netkey.arg = 0;
+
+      /*
+       * We check if the checksums are OK
+       */
+      check_checksum (cont);
+
+      /*
+       * we use a counter system, so that all client must answer
+       * "yes we want a lag increase" several times in a row
+       * before we actually update the lag
+       */
+      if (all_clients_request_increase_lag)
+	{
+	  increase_lag_counter++;
+	}
+      else
+	{
+	  increase_lag_counter = 0;
+	}
+
+      /*
+       * we use a counter system, so that all client must answer
+       * "yes we want a lag decrease" several times in a row
+       * before we actually update the lag
+       */
+      if (a_client_requests_decrease_lag)
+	{
+	  decrease_lag_counter++;
+	}
+      else
+	{
+	  decrease_lag_counter = 0;
+	}
+
+      /*
+       * If we need to increase the lag, we send blank key presses
+       */
+      if (increase_lag_counter >= LW_SRVCONT_INCREASE_LAG_LIMIT
+	  && lag_key_presses_to_send == 0)
+	{
+	  increase_lag_counter = 0;
+	  lag++;
+	  lag_key_presses_to_send++;
+	}
+
+
+      /*
+       * If we need to decrease the lag, we simply do not send
+       * the key presses...
+       */
+      skip_keys = 0;
+      if (decrease_lag_counter >= LW_SRVCONT_DECREASE_LAG_LIMIT)
+	{
+	  decrease_lag_counter = 0;
+	  lag--;
+	  if (lag_key_presses_to_send > 0)
+	    {
+	      /*
+	       * We cancel the planified lag keys
+	       */
+	      lag_key_presses_to_send--;
+	    }
+	  else
+	    {
+	      /*
+	       * No lag keys planned, we skip the current keys
+	       */
+	      skip_keys = 1;
+	    }
+	}
+
+      if (!skip_keys)
+	{
+	  /*
+	   * Now we send the information to all the players
+	   */
+	  for (i = cont->nb_chans - 1; i >= 0; --i)
+	    {
+	      if (!lw_srvchan_send_keys (&(cont->chan[i]), &netkey))
+		{
+		  /*
+		   * There's been an error receiving data from this team
+		   * so we decide to "close" it.
+		   */
+		  disconnect_client (cont, i, "error sending keys");
+		}
+	    }
+	}
+
+      /*
+       * We send the lag key presses 1 by 1. This is a way
+       * to synchronize correctly at the beginning of a game.
+       */
+      if (lag_key_presses_to_send > 0)
+	{
+	  lag_key_presses_to_send--;
+	  send_lag_key_presses (cont, 1);
+	}
+
+      rounds++;
+      last_rounds++;
+      average_lag += lag;
+
+      end = lw_srvtime_seconds ();
+      elapsed = end - start;
+
+      if (((int) elapsed) > LW_SRVCONT_DISPLAY_STATE_DELAY)
+	{
+	  if (rounds <= 0)
+	    {
+	      rounds = 1;
+	    }
+	  if (last_rounds <= 0)
+	    {
+	      last_rounds = 1;
+	    }
+
+	  log_print_int (rounds);
+	  log_print_str (" rounds, ");
+	  log_print_int (last_rounds / ((int) elapsed));
+	  log_print_str (" rounds/sec, average lag is ");
+	  log_print_int (average_lag / last_rounds);
+	  log_println ();
+
+	  start = end;
+	  last_rounds = 0;
+	  average_lag = 0;
+	}
+
+      if (end - start2 > LW_SRVCONT_REGISTER_DELAY)
+	{
+	  start2 += LW_SRVCONT_REGISTER_DELAY;
+
+	  www_data->log = 0;
+	  lw_wwwsrv_register (www_data);
+	}
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/* 
+ * Closes everything and frees the resources
+ */
+void
+lw_srvcont_close (LW_SRVCONT * cont)
+{
+  int i;
+
+  lw_sock_close (&(cont->sock));
+
+  log_print_str ("Game over");
+  log_println ();
+
+  for (i = 0; i < cont->nb_chans; ++i)
+    {
+      lw_srvchan_close (&(cont->chan[i]));
+    }
+
+  reset (cont);
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Launches a thread which will handle new connections while
+ * other players are playing.
+ */
+static int
+reject_new_clients (LW_SRVCONT * cont, char *password)
+{
+  int result = 0;
+  static LW_SRVCONT_REJECT_DATA data;
+  static int thread_running = 0;
+
+  /*
+   * If there's already a thread answering to a client, we do nothing,
+   * for we can answer later, and it makes programming easier and
+   * safer. In any case, the answer we're going to give to the client
+   * is: "there's no room for you guy" so it's not that bad to be
+   * a little late when answering.
+   */
+  if (!thread_running)
+    {
+      data.sock = -1;
+      data.ip[0] = '\0';
+      data.port = 0;
+      data.thread_running = &thread_running;
+      strncpy (data.password, password, PASSWORD_SIZE);
+      data.password[PASSWORD_SIZE] = '\0';
+
+      if (lw_sock_accept (&(data.sock), data.ip, &(data.port), cont->sock, 0))
+	{
+	  thread_running = 1;
+	  result =
+	    lw_thread_start (reject_new_clients_callback, (void *) &data);
+	  if (!result)
+	    {
+	      lw_sock_close (&(data.sock));
+	      thread_running = 0;
+	    }
+	}
+      else
+	{
+	  /*
+	   * privacy is set to 0, we do not tell anyone about this server
+	   */
+	  result = 1;
+	}
+    }
+  else
+    {
+      result = 1;
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Main function of the server thread which tries to connect
+ * on the metaserver
+ */
+static void
+reject_new_clients_callback (void *args)
+{
+  LW_SRVCONT_REJECT_DATA data;
+  int ret;
+  int ret_mess = 1;
+  char message[LW_SOCK_MESSAGE_SIZE];
+  LW_NETMESS *mess;
+  int program = 0;
+  int version = 0;
+  int password = 0;
+  int free_received = 0;
+  int normal_quit = 0;
+
+  memcpy (&data, args, sizeof (LW_SRVCONT_REJECT_DATA));
+
+  log_print_str ("Connection from \"");
+  log_print_str (data.ip);
+  log_print_str (":");
+  log_print_int (data.port);
+  log_print_str ("\"");
+  log_println ();
+  log_flush ();
+
+  while ((!free_received) && ret_mess &&
+	 ((ret = lw_sock_recv_str (&(data.sock), message)) >= 0))
+    {
+      if (ret > 0)
+	{
+	  mess = lw_netmess_read (message);
+	  if (mess != NULL)
+	    {
+	      /*
+	       * switch to handle the different possible messages
+	       */
+	      switch (mess->code)
+		{
+		case LW_NETMESS_CODE_PING:
+		  ret_mess = lw_srvchan_handle_ping (data.sock, mess);
+		  break;
+		case LW_NETMESS_CODE_ECHO:
+		  ret_mess = lw_srvchan_handle_echo (data.sock, mess);
+		  break;
+		case LW_NETMESS_CODE_PROGRAM:
+		  ret_mess =
+		    lw_srvchan_handle_program (data.sock, mess, &program);
+		  break;
+		case LW_NETMESS_CODE_VERSION:
+		  ret_mess =
+		    lw_srvchan_handle_version (data.sock, mess, &version);
+		  break;
+		case LW_NETMESS_CODE_PASSWORD:
+		  ret_mess =
+		    lw_srvchan_handle_password (data.sock, mess, &password,
+						data.password);
+		  break;
+		case LW_NETMESS_CODE_FREE:
+		  ret_mess =
+		    lw_srvchan_handle_free (data.sock, mess, 0,
+					    &free_received);
+		  break;
+		case LW_NETMESS_CODE_QUIT:
+		  ret_mess =
+		    lw_srvchan_handle_quit (data.sock, mess, &normal_quit);
+		  break;
+		default:
+		  ret_mess = lw_srvchan_handle_unknown (data.sock, mess);
+		  break;
+		}
+
+	      /*
+	       * lw_netmess_free must *not* be forgetted 
+	       */
+	      lw_netmess_free (mess);
+
+	      if (!ret_mess)
+		{
+		  log_print_str ("Error processing \"");
+		  log_print_str (message);
+		  log_print_str ("\"");
+		  log_println ();
+		}
+	    }
+	  else
+	    {
+	      log_println_str ("Serious memory problem 8-(");
+	      ret_mess = 0;
+	    }
+	}
+    }
+
+  log_print_str ("Refusing \"");
+  log_print_str (data.ip);
+  log_print_str (":");
+  log_print_int (data.port);
+  log_print_str ("\"");
+  if (normal_quit)
+    {
+      /*
+       * If the client quitted with a normal "QUIT" message, then
+       * we mention in the log that it was probably simply pinging.
+       */
+      log_print_str (" (probably a ping)");
+    }
+  log_println ();
+
+  lw_sock_close (&(data.sock));
+  (*(data.thread_running)) = 0;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Disconnects a client. This code supposes that the caller function
+ * is executing a loop with a step of -1 (ie a "reverse" loop).
+ */
+static void
+disconnect_client (LW_SRVCONT * cont, int i, char *reason)
+{
+  int j;
+
+  log_print_str ("Disconnecting \"");
+  log_print_str (cont->chan[i].ip);
+  log_print_str (":");
+  log_print_int (cont->chan[i].port);
+  log_print_str ("\" (");
+  if (cont->chan[i].normal_quit)
+    {
+      /*
+       * The client decided to quit, therefore this is not
+       * an error, we mark it as such
+       */
+      log_print_str ("decided to quit");
+    }
+  else
+    {
+      log_print_str (reason);
+    }
+  log_println_str (")");
+
+  lw_srvchan_close (&(cont->chan[i]));
+  for (j = i + 1; j < cont->nb_chans; ++j)
+    {
+      cont->chan[j - 1] = cont->chan[j];
+    }
+  cont->nb_chans--;
+}

Added: unstable/liquidwar/branches/upstream/current/src/srvcont.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/srvcont.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/srvcont.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,91 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : srvcont.h                                        */
+/* content       : global controler of the network channels         */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_SRVCONT
+#define LIQUID_WAR_INCLUDE_SRVCONT
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "base.h"
+#include "srvchan.h"
+#include "netconf.h"
+#include "wwwsrv.h"
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+
+typedef struct
+{
+  int sock;
+  int nb_teams;
+  int nb_chans;
+  LW_SRVCHAN chan[NB_TEAMS];
+}
+LW_SRVCONT;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int lw_srvcont_wait_teams (LW_SRVCONT * cont,
+			   LW_WWWSRV_DATA * www_data,
+			   int nb_teams, int port,
+			   char *password, char *callback);
+int lw_srvcont_tell_who (LW_SRVCONT * cont);
+int lw_srvcont_final_ok (LW_SRVCONT * cont);
+int lw_srvcont_replicate_keys (LW_SRVCONT * cont,
+			       LW_WWWSRV_DATA * www_data,
+			       int lag, char *password);
+void lw_srvcont_close (LW_SRVCONT * cont);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/srvteam.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/srvteam.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/srvteam.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,78 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : srvteam.c                                        */
+/* content       : handles a team on the server                     */
+/* last update   : May 8th 2001                                     */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "srvteam.h"
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Resets the LW_SRVTEAM struct
+ */
+void
+lw_srvteam_reset (LW_SRVTEAM * team)
+{
+  memset (team, 0, sizeof (LW_SRVTEAM));
+
+  team->active = 0;
+  team->network = 0;
+  team->server_id = 0;
+  team->control_type = 0;
+  team->name[0] = '\0';
+}

Added: unstable/liquidwar/branches/upstream/current/src/srvteam.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/srvteam.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/srvteam.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,80 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : srvteam.h                                        */
+/* content       : handles a team on the server                     */
+/* last update   : May 8th 2001                                     */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_SRVTEAM
+#define LIQUID_WAR_INCLUDE_SRVTEAM
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "base.h"
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+
+typedef struct
+{
+  int active;
+  int network;
+  int server_id;
+  int control_type;
+  char name[NAME_SIZE + 1];
+}
+LW_SRVTEAM;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void lw_srvteam_reset (LW_SRVTEAM * team);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/srvtime.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/srvtime.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/srvtime.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,80 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : srvtime.c                                        */
+/* content       : utilities to manage time on the server           */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#ifdef WIN32
+#include <windows.h>
+#else
+#include <time.h>
+#endif
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * returns the "CPU time" in seconds
+ */
+int
+lw_srvtime_seconds ()
+{
+  int result;
+
+#ifdef WIN32
+  result = GetTickCount () / 1000;
+#else
+  result = time (NULL);
+#endif
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/srvtime.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/srvtime.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/srvtime.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,59 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : srvtime.h                                        */
+/* content       : utilities to manage time on the server           */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_SRVTIME
+#define LIQUID_WAR_INCLUDE_SRVTIME
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+int lw_srvtime_seconds ();
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/startinf.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/startinf.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/startinf.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,73 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : startinf.c                                       */
+/* content       : struct used to transmit network start info       */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "startinf.h"
+#include "log.h"
+
+/*==================================================================*/
+/* functions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Resets the LW_TEAMSTARTINFO struct
+ */
+void
+lw_teamstartinfo_reset (LW_TEAMSTARTINFO * teamstartinfo)
+{
+  memset (teamstartinfo, 0, sizeof (LW_TEAMSTARTINFO));
+}

Added: unstable/liquidwar/branches/upstream/current/src/startinf.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/startinf.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/startinf.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,73 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : startinf.h                                       */
+/* content       : struct used to transmit network start info       */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_STARTINF
+#define LIQUID_WAR_INCLUDE_STARTINF
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "base.h"
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+
+typedef struct
+{
+  int active;
+  int start;
+  char name[NAME_SIZE + 1];
+}
+LW_TEAMSTARTINFO;
+
+void lw_teamstartinfo_reset (LW_TEAMSTARTINFO * teamstartinfo);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/startup.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/startup.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/startup.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,468 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : startup.c                                        */
+/* contenu       : parametres de demarrage                          */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "parser.h"
+#include "startup.h"
+#include "server.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#define IDENT_MEM                 "mem"
+#define IDENT_NOBACK              "noback"
+#define IDENT_NOTEXTURE           "notex"
+#define IDENT_NOWATER             "nowater"
+#define IDENT_NOSFX               "nosfx"
+#define IDENT_NOMUSIC             "nomusic"
+#define IDENT_NOCUSTOM            "nocustom"
+#define IDENT_NOSOUND             "silent"
+#define IDENT_NOSVGA              "vga"
+#define IDENT_NOASM               "c"
+#define IDENT_NOJOY               "nojoy"
+#define IDENT_STOP                "stop"
+#define IDENT_SAFE                "safe"
+#define IDENT_NICE                "nice"
+#define IDENT_AUTO                "auto"
+#define IDENT_CHECK               "check"
+#define IDENT_CFG                 "cfg"
+#define IDENT_DAT                 "dat"
+#define IDENT_MAP                 "map"
+#define IDENT_TEX                 "tex"
+#define IDENT_MID                 "mid"
+#define IDENT_SRV                 "server"
+#define IDENT_GEN                 "mapgen"
+#define IDENT_METASERVER          "metaserver"
+#define IDENT_CAPTURE             "capture"
+#define IDENT_TOMBOLA             "tombola"
+
+#define STARTUP_MAX_METASERVER_LENGTH      200
+
+#ifdef DOS
+int STARTUP_BIG_DATA = 8;
+#else
+int STARTUP_BIG_DATA = 16;
+#endif
+int STARTUP_DIGI_CARD = DIGI_AUTODETECT;
+int STARTUP_MIDI_CARD = MIDI_AUTODETECT;
+int STARTUP_JOYSTICK_ON = 1;
+int STARTUP_BACK_STATE = 1;
+int STARTUP_TEXTURE_STATE = 1;
+int STARTUP_WATER_STATE = 1;
+int STARTUP_SFX_STATE = 1;
+int STARTUP_MUSIC_STATE = 1;
+int STARTUP_CUSTOM_STATE = 1;
+int STARTUP_ASM = 1;
+int STARTUP_SVGA = 1;
+int STARTUP_STOP = 0;
+int STARTUP_AUTO = 0;
+int STARTUP_CHECK = 0;
+int STARTUP_CAPTURE = 0;
+int STARTUP_TOMBOLA = 0;
+
+#ifdef UNIX
+static char *DEFAULT_CFG_PATH = CONFIG_UNIX_CFG;
+static char *DEFAULT_LOG_PATH = "";
+static char *DEFAULT_DAT_PATH = CONFIG_UNIX_DAT;
+static char *DEFAULT_MAP_PATH = CONFIG_UNIX_MAP;
+static char *DEFAULT_TEX_PATH = CONFIG_UNIX_TEX;
+static char *DEFAULT_MID_PATH = CONFIG_UNIX_MID;
+static char *DEFAULT_SRV_PATH = CONFIG_UNIX_SRV;
+static char *DEFAULT_GEN_PATH = CONFIG_UNIX_GEN;
+#else
+#ifdef WIN32
+static char *DEFAULT_CFG_PATH = "data/lwwin.cfg";
+static char *DEFAULT_LOG_PATH = "data/lwwin.log";
+static char *DEFAULT_SRV_PATH = "lwwinsrv.exe";
+static char *DEFAULT_GEN_PATH = "lwwinmap.exe";
+#endif
+#ifdef DOS
+static char *DEFAULT_CFG_PATH = "data/lwdos.cfg";
+static char *DEFAULT_LOG_PATH = "data/lwdos.log";
+static char *DEFAULT_SRV_PATH = "";
+static char *DEFAULT_GEN_PATH = "";
+#endif
+static char *DEFAULT_DAT_PATH = "data/lw.dat";
+static char *DEFAULT_MAP_PATH = "custom/map/";
+static char *DEFAULT_TEX_PATH = "custom/texture/";
+static char *DEFAULT_MID_PATH = "custom/music/";
+#endif
+
+static char *DEFAULT_METASERVER = LW_SERVER_DEFAULT_METASERVER;
+
+char STARTUP_CFG_PATH[LW_STARTUP_MAX_PATH_LENGTH];
+char STARTUP_DAT_PATH[LW_STARTUP_MAX_PATH_LENGTH];
+char STARTUP_LOG_PATH[LW_STARTUP_MAX_PATH_LENGTH];
+char STARTUP_MAP_PATH[LW_STARTUP_MAX_PATH_LENGTH];
+char STARTUP_TEX_PATH[LW_STARTUP_MAX_PATH_LENGTH];
+char STARTUP_MID_PATH[LW_STARTUP_MAX_PATH_LENGTH];
+char STARTUP_SRV_PATH[LW_STARTUP_MAX_PATH_LENGTH];
+char STARTUP_GEN_PATH[LW_STARTUP_MAX_PATH_LENGTH];
+
+char STARTUP_METASERVER[STARTUP_MAX_METASERVER_LENGTH];
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static void
+set_bigdata_size (void)
+{
+  int bigd;
+
+  if (exist_argument_value (IDENT_MEM))
+    {
+      bigd = get_argument_int (IDENT_MEM);
+      if (bigd < 1)
+	bigd = 1;
+      if (bigd > LW_STARTUP_MEM_MAX)
+	bigd = LW_STARTUP_MEM_MAX;
+      STARTUP_BIG_DATA = bigd;
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+set_joystick (void)
+{
+  if (exist_argument (IDENT_NOJOY))
+    STARTUP_JOYSTICK_ON = 0;
+}
+
+/*------------------------------------------------------------------*/
+static void
+set_load_states (void)
+{
+  if (exist_argument (IDENT_NOBACK))
+    STARTUP_BACK_STATE = 0;
+  if (exist_argument (IDENT_NOTEXTURE))
+    STARTUP_TEXTURE_STATE = 0;
+
+  if (exist_argument (IDENT_NOWATER) || exist_argument (IDENT_NOSOUND))
+    STARTUP_WATER_STATE = 0;
+  if (exist_argument (IDENT_NOSFX) || exist_argument (IDENT_NOSOUND))
+    STARTUP_SFX_STATE = 0;
+
+  if (exist_argument (IDENT_NOSOUND)
+      || (exist_argument (IDENT_NOSFX) && exist_argument (IDENT_NOWATER)))
+    STARTUP_DIGI_CARD = DIGI_NONE;
+
+  if (exist_argument (IDENT_NOMUSIC) || (exist_argument (IDENT_NOSOUND)))
+    {
+      STARTUP_MUSIC_STATE = 0;
+      STARTUP_MIDI_CARD = MIDI_NONE;
+    }
+
+  if (exist_argument (IDENT_NOCUSTOM))
+    STARTUP_CUSTOM_STATE = 0;
+}
+
+/*------------------------------------------------------------------*/
+static void
+set_graphic_possibilities (void)
+{
+  if (exist_argument (IDENT_NOSVGA))
+    STARTUP_SVGA = 0;
+}
+
+/*------------------------------------------------------------------*/
+static void
+set_c_or_asm (void)
+{
+  if (exist_argument (IDENT_NOASM))
+    STARTUP_ASM = 0;
+}
+
+/*------------------------------------------------------------------*/
+static void
+set_stop (void)
+{
+  if (exist_argument (IDENT_STOP))
+    STARTUP_STOP = 1;
+}
+
+/*------------------------------------------------------------------*/
+static void
+set_auto_check (void)
+{
+  if (exist_argument (IDENT_AUTO))
+    {
+      STARTUP_AUTO = 1;
+      STARTUP_CHECK = 0;
+    }
+  if (exist_argument (IDENT_CHECK))
+    {
+      STARTUP_AUTO = 0;
+      STARTUP_CHECK = 1;
+      STARTUP_STOP = 1;
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+set_safe (void)
+{
+  if (exist_argument (IDENT_NICE))
+    {
+      STARTUP_BIG_DATA = 4096;
+      STARTUP_SVGA = 0;
+    }
+
+  if (exist_argument (IDENT_SAFE))
+    {
+      STARTUP_JOYSTICK_ON = 0;
+      STARTUP_BIG_DATA = 1024;
+      STARTUP_DIGI_CARD = DIGI_NONE;
+      STARTUP_BACK_STATE = 0;
+      STARTUP_TEXTURE_STATE = 0;
+      STARTUP_WATER_STATE = 0;
+      STARTUP_SFX_STATE = 0;
+      STARTUP_MUSIC_STATE = 0;
+      STARTUP_CUSTOM_STATE = 0;
+      STARTUP_SVGA = 0;
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+correct_path_dir (char *path)
+{
+  int l;
+  char c;
+
+  l = strlen (path);
+  if (l > 0)
+    {
+      c = path[l - 1];
+      if (c == '/' || c == '\\')
+	{
+	  path[--l] = 0;
+	}
+    }
+
+  fix_filename_case (path);
+  fix_filename_slashes (path);
+}
+
+/*------------------------------------------------------------------*/
+static void
+correct_path_file (char *path)
+{
+  fix_filename_case (path);
+  fix_filename_slashes (path);
+}
+
+/*------------------------------------------------------------------*/
+static void
+set_path (void)
+{
+  char home_path[512];
+  char *home_env = NULL;
+
+  if (exist_argument_value (IDENT_CFG))
+    {
+      LW_MACRO_STRCPY (STARTUP_CFG_PATH, get_argument_str (IDENT_CFG));
+    }
+  else
+    {
+#ifdef UNIX
+      home_env = getenv ("HOME");
+      if (home_env != NULL)
+	{
+	  LW_MACRO_SPRINTF1 (home_path, "%s/", home_env);
+	}
+      else
+	{
+	  home_env = "";
+	  LW_MACRO_STRCPY (home_path, home_env);
+	}
+#else
+      home_env = "";
+      LW_MACRO_STRCPY (home_path, home_env);
+#endif
+      LW_MACRO_SPRINTF2 (STARTUP_CFG_PATH, "%s%s", home_path,
+			 DEFAULT_CFG_PATH);
+    }
+
+  LW_MACRO_STRCPY (STARTUP_LOG_PATH, DEFAULT_LOG_PATH);
+
+  if (exist_argument_value (IDENT_DAT))
+    {
+      LW_MACRO_STRCPY (STARTUP_DAT_PATH, get_argument_str (IDENT_DAT));
+    }
+  else
+    {
+      LW_MACRO_STRCPY (STARTUP_DAT_PATH, DEFAULT_DAT_PATH);
+    }
+
+  if (exist_argument_value (IDENT_TEX))
+    {
+      LW_MACRO_STRCPY (STARTUP_TEX_PATH, get_argument_str (IDENT_TEX));
+    }
+  else
+    {
+      LW_MACRO_STRCPY (STARTUP_TEX_PATH, DEFAULT_TEX_PATH);
+    }
+
+  if (exist_argument_value (IDENT_MAP))
+    {
+      LW_MACRO_STRCPY (STARTUP_MAP_PATH, get_argument_str (IDENT_MAP));
+    }
+  else
+    {
+      LW_MACRO_STRCPY (STARTUP_MAP_PATH, DEFAULT_MAP_PATH);
+    }
+
+  if (exist_argument_value (IDENT_MID))
+    {
+      LW_MACRO_STRCPY (STARTUP_MID_PATH, get_argument_str (IDENT_MID));
+    }
+  else
+    {
+      LW_MACRO_STRCPY (STARTUP_MID_PATH, DEFAULT_MID_PATH);
+    }
+  if (exist_argument_value (IDENT_SRV))
+    {
+      LW_MACRO_STRCPY (STARTUP_SRV_PATH, get_argument_str (IDENT_SRV));
+    }
+  else
+    {
+      LW_MACRO_STRCPY (STARTUP_SRV_PATH, DEFAULT_SRV_PATH);
+    }
+  if (exist_argument_value (IDENT_GEN))
+    {
+      LW_MACRO_STRCPY (STARTUP_GEN_PATH, get_argument_str (IDENT_GEN));
+    }
+  else
+    {
+      LW_MACRO_STRCPY (STARTUP_GEN_PATH, DEFAULT_GEN_PATH);
+    }
+
+
+  correct_path_file (STARTUP_CFG_PATH);
+  correct_path_file (STARTUP_LOG_PATH);
+  correct_path_file (STARTUP_DAT_PATH);
+  correct_path_dir (STARTUP_TEX_PATH);
+  correct_path_dir (STARTUP_MAP_PATH);
+  correct_path_dir (STARTUP_MID_PATH);
+  correct_path_file (STARTUP_SRV_PATH);
+  correct_path_file (STARTUP_GEN_PATH);
+}
+
+/*------------------------------------------------------------------*/
+static void
+set_metaserver (void)
+{
+  if (exist_argument_value (IDENT_METASERVER))
+    {
+      LW_MACRO_STRCPY (STARTUP_METASERVER,
+		       get_argument_str (IDENT_METASERVER));
+    }
+  else
+    {
+      LW_MACRO_STRCPY (STARTUP_METASERVER, DEFAULT_METASERVER);
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+set_misc (void)
+{
+  if (exist_argument (IDENT_CAPTURE))
+    {
+      STARTUP_CAPTURE = 1;
+    }
+  if (exist_argument (IDENT_TOMBOLA))
+    {
+      STARTUP_TOMBOLA = 1;
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+set_various_hacks (void)
+{
+#ifndef ASM
+  /*
+   * important to set it to 0, even if assembly code is not compiled
+   * in, for we want the program to be able to tell others that it
+   * can't do any assembly, in a network game for instance.
+   */
+  STARTUP_ASM = 0;
+#endif
+}
+
+/*------------------------------------------------------------------*/
+void
+set_startup (void)
+{
+  set_joystick ();
+  set_load_states ();
+  set_graphic_possibilities ();
+  set_c_or_asm ();
+  set_path ();
+  set_stop ();
+  set_safe ();
+  set_auto_check ();
+  set_bigdata_size ();
+  set_metaserver ();
+  set_misc ();
+  set_various_hacks ();
+}

Added: unstable/liquidwar/branches/upstream/current/src/startup.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/startup.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/startup.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,106 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : startup.h                                        */
+/* contenu       : parametres de demarrage                          */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_STARTUP
+#define LIQUID_WAR_INCLUDE_STARTUP
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_STARTUP_MEM_MAX  128
+#define LW_STARTUP_MEM_STEP   8
+
+#define LW_STARTUP_MAX_PATH_LENGTH           1000
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+extern int STARTUP_BIG_DATA;
+extern int STARTUP_DIGI_CARD;
+extern int STARTUP_MIDI_CARD;
+extern int STARTUP_JOYSTICK_ON;
+extern int STARTUP_BACK_STATE;
+extern int STARTUP_TEXTURE_STATE;
+extern int STARTUP_WATER_STATE;
+extern int STARTUP_SFX_STATE;
+extern int STARTUP_MUSIC_STATE;
+extern int STARTUP_CUSTOM_STATE;
+extern int STARTUP_ASM;
+extern int STARTUP_SVGA;
+extern int STARTUP_STOP;
+extern int STARTUP_AUTO;
+extern int STARTUP_CHECK;
+extern int STARTUP_CAPTURE;
+extern int STARTUP_TOMBOLA;
+
+extern char STARTUP_CFG_PATH[];
+extern char STARTUP_DAT_PATH[];
+extern char STARTUP_LOG_PATH[];
+extern char STARTUP_MAP_PATH[];
+extern char STARTUP_TEX_PATH[];
+extern char STARTUP_MID_PATH[];
+extern char STARTUP_SRV_PATH[];
+extern char STARTUP_GEN_PATH[];
+
+extern char STARTUP_METASERVER[];
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+void set_startup (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/team.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/team.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/team.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,493 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : team.c                                           */
+/* content       : menu used to choose teams                        */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+#include <ctype.h>
+
+#include "back.h"
+#include "config.h"
+#include "dialog.h"
+#include "disk.h"
+#include "help.h"
+#include "joystick.h"
+#include "keyboard.h"
+#include "menu.h"
+#include "mouse.h"
+#include "sound.h"
+#include "team.h"
+#include "log.h"
+#include "lang.h"
+#include "netmess.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+static char *MENU_KEY_NAMES[] = {
+  "None",
+  "A",
+  "B",
+  "C",
+  "D",
+  "E",
+  "F",
+  "G",
+  "H",
+  "I",
+  "J",
+  "K",
+  "L",
+  "M",
+  "N",
+  "O",
+  "P",
+  "Q",
+  "R",
+  "S",
+  "T",
+  "U",
+  "V",
+  "W",
+  "X",
+  "Y",
+  "Z",
+  "0",
+  "1",
+  "2",
+  "3",
+  "4",
+  "5",
+  "6",
+  "7",
+  "8",
+  "9",
+  "Pad0",
+  "Pad1",
+  "Pad2",
+  "Pad3",
+  "Pad4",
+  "Pad5",
+  "Pad6",
+  "Pad7",
+  "Pad8",
+  "Pad9",
+  "F1",
+  "F2",
+  "F3",
+  "F4",
+  "F5",
+  "F6",
+  "F7",
+  "F8",
+  "F9",
+  "F10",
+  "F11",
+  "F12",
+  "ESC",
+  "~",
+  "-",
+  "=",
+  "Back",
+  "Tab",
+  "{",
+  "}",
+  "Enter",
+  ":",
+  "'",
+  "\\",
+  "\\",
+  ",",
+  ".",
+  "/",
+  "Space",
+  "Ins",
+  "Del",
+  "Home",
+  "End",
+  "Pgup",
+  "Pgdn",
+  "<",
+  ">",
+  "/\\",
+  "\\/",
+  "Pad/",
+  "*",
+  "Pad-",
+  "Pad+",
+  "Pad.",
+  "PadE",
+  "PScr",
+  "Pause",
+  "LShf",
+  "RShf",
+  "LCnt",
+  "RCnt",
+  "Alt",
+  "Altgr",
+  "LWin",
+  "RWin",
+  "Menu",
+  "SLock",
+  "NLock",
+  "CLock",
+  "None",
+  "None",
+  "None",
+  "None",
+  "J1/\\",
+  "J1>",
+  "J1\\/",
+  "J1<",
+  "J1B1",
+  "J1B2",
+  "J1B3",
+  "J1B4",
+  "J2/\\",
+  "J2>",
+  "J2\\/",
+  "J2<",
+  "J2B1",
+  "J2B2",
+  "M/\\",
+  "M>",
+  "M\\/",
+  "M<"
+};
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+static void
+cleanup_player_names ()
+{
+  int i;
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      lw_netmess_cleanup_arg (CONFIG_PLAYER_NAME[i]);
+    }
+}
+
+/*------------------------------------------------------------------*/
+static int
+suppress_conflicting_color (int color, int replacement_color)
+{
+  int i, n = -1;
+
+  for (i = 0; i < NB_TEAMS; ++i)
+    {
+      if (CONFIG_TEAM_COLOR[i] == color)
+	{
+	  CONFIG_TEAM_COLOR[n = i] = replacement_color;
+	}
+    }
+
+  return n;
+}
+
+/*------------------------------------------------------------------*/
+static char *
+get_key_name (int num)
+{
+  if (MENU_KEY_NAMES[num] != NULL)
+    return MENU_KEY_NAMES[num];
+  else
+    return "None";
+}
+
+/*------------------------------------------------------------------*/
+static void
+change_key (DIALOG * d, int *val)
+{
+  lw_mouse_reset_control ();
+  wait_no_key ();
+  (*val) = wait_key_pressed ();
+  play_click ();
+  clear_keybuf ();
+  d->dp = get_key_name (*val);
+}
+
+/*------------------------------------------------------------------*/
+static void
+update_team_box (DIALOG * d, int number)
+{
+  switch (CONFIG_CONTROL_TYPE[number])
+    {
+    case CONFIG_CONTROL_TYPE_OFF:
+      d[15].dp = lw_lang_string (LW_LANG_STRING_TEAM_OFF);
+      break;
+    case CONFIG_CONTROL_TYPE_HUMAN:
+      d[15].dp = lw_lang_string (LW_LANG_STRING_TEAM_HUMAN);
+      break;
+    case CONFIG_CONTROL_TYPE_CPU:
+      d[15].dp = lw_lang_string (LW_LANG_STRING_TEAM_CPU);
+      break;
+    default:
+      d[15].dp = "???";
+    }
+  if (CONFIG_CONTROL_TYPE[number] == CONFIG_CONTROL_TYPE_OFF)
+    {
+      d[0].bg = MENU_BG;
+    }
+  else
+    {
+      d[0].bg = 128 + (CONFIG_TEAM_COLOR[number]) * 10;
+    }
+}
+
+/*------------------------------------------------------------------*/
+static void
+redraw_team_box (DIALOG * d, int number)
+{
+  int i;
+
+  update_team_box (d, number);
+
+  scare_mouse ();
+  for (i = 0; i < 20; ++i)
+    {
+      (d + i)->proc (MSG_DRAW, d + i, 0);
+    }
+  unscare_mouse ();
+}
+
+/*------------------------------------------------------------------*/
+static void
+team_param (DIALOG * d, int x, int y, int number)
+{
+  int w1, w2, w3, h, i;
+
+  d[0].x = x;
+  d[0].y = y;
+
+  w1 = (menu_real_x (MENU_W_TEAM - 2 * MENU_W_SPACE) + 2) / 12;
+  w2 = (menu_real_x (MENU_W_TEAM - 2 * MENU_W_SPACE) + 2) / 2;
+  w3 = menu_real_x (MENU_W_TEAM - 2 * MENU_W_SPACE) + 2;
+  h = (menu_real_y (MENU_H_TEAM - 2 * MENU_H_SPACE) + 2) / 6;
+
+  x += 2 + menu_real_x (MENU_W_SPACE);
+  y += 2 + menu_real_y (MENU_H_SPACE);
+
+  for (i = 0; i < 20; ++i)
+    {
+      d[i].proc = my_button_proc;
+      d[i].key = 0;
+      d[i].dp = "";
+      d[i].flags = D_EXIT;
+      d[i].h = h - 2;
+      color_one_dialog (d + i);
+    }
+
+  d[0].proc = d_box_proc;
+  d[0].w = menu_real_x (MENU_W_TEAM);
+  d[0].h = menu_real_y (MENU_H_TEAM);
+
+  d[1].proc = d_box_proc;
+  d[1].x = d[2].x = x;
+  d[1].y = d[2].y = y;
+  d[1].w = d[2].w = w3 - 2;
+
+  for (i = 2; i < 14; ++i)
+    {
+      d[i].x = x + (i - 2) * w1;
+      d[i].y = y + 2 * h;
+      d[i].w = w1 - 2;
+      d[i].bg = 128 + (i - 2) * 10;
+    }
+
+  for (i = 16; i < 20; ++i)
+    d[i].w = w2 - 2;
+
+  d[14].x = d[1].x + 1;
+  d[14].y = d[1].y + 1;
+  d[14].w = d[1].w - 2;
+
+  d[15].x = x + w2 / 4;
+  d[15].y = y + h;
+  d[15].w = (3 * w2) / 2 - 2;
+
+  d[14].proc = my_edit_proc;
+  d[14].dp = CONFIG_PLAYER_NAME[number];
+  d[14].d1 = NAME_SIZE;
+  d[14].flags = 0;
+
+  d[16].x = d[19].x = x + w2 / 2;
+  d[17].x = x;
+  d[18].x = x + w2;
+  d[16].y = y + 3 * h;
+  d[17].y = d[18].y = y + 4 * h;
+  d[19].y = y + 5 * h;
+
+  d[16].dp = get_key_name (CONFIG_KEY_UP[number]);
+  d[17].dp = get_key_name (CONFIG_KEY_LEFT[number]);
+  d[18].dp = get_key_name (CONFIG_KEY_RIGHT[number]);
+  d[19].dp = get_key_name (CONFIG_KEY_DOWN[number]);
+
+  update_team_box (d, number);
+}
+
+/*------------------------------------------------------------------*/
+int
+choose_teams (void)
+{
+  int retour = 0;
+  DIALOG d[125];
+  int i, choix = 0;
+  int x1, x2, x3, y1, y2;
+  int button_team, button_type;
+
+  memset (d, 0, sizeof (d));
+
+  quick_buttons (d);
+
+  x1 = (MENU_VIRTUAL_W - (3 * MENU_W_TEAM + 2 * MENU_W_SPACE)) / 2;
+  x2 = x1 + MENU_W_TEAM + MENU_W_SPACE;
+  x3 = x2 + MENU_W_TEAM + MENU_W_SPACE;
+  y1 = (MENU_VIRTUAL_H - (2 * MENU_H_TEAM + MENU_H_SPACE)) / 2;
+  y2 = y1 + MENU_H_TEAM + MENU_H_SPACE;
+
+  x1 = menu_real_x (x1);
+  x2 = menu_real_x (x2);
+  x3 = menu_real_x (x3);
+  y1 = menu_real_y (y1);
+  y2 = menu_real_y (y2);
+
+  team_param (d + 4, x1, y1, 0);
+  team_param (d + 24, x2, y1, 1);
+  team_param (d + 44, x3, y1, 2);
+  team_param (d + 64, x1, y2, 3);
+  team_param (d + 84, x2, y2, 4);
+  team_param (d + 104, x3, y2, 5);
+
+  d[124].proc = NULL;
+
+  set_palette_for_choose_color ();
+  my_set_palette ();
+  display_back_image ();
+
+  while (retour == 0)
+    {
+      choix = my_do_dialog_no_clear (d, choix);
+      switch (choix)
+	{
+	case -1:
+	case MENU_QUICK_BACK:
+	  retour = 1;
+	  break;
+	case MENU_QUICK_MAIN:
+	  retour = MENU_TOP;
+	  break;
+	case MENU_QUICK_QUIT:
+	  if (confirm_quit ())
+	    retour = MENU_EXIT;
+	  else
+	    display_back_image ();
+	  break;
+	case MENU_QUICK_PLAY:
+	  retour = MENU_PLAY;
+	  break;
+	default:
+	  button_team = (choix - 4) / 20;
+	  button_type = (choix - 4) % 20;
+	  switch (button_type)
+	    {
+	    case 15:
+	      switch (CONFIG_CONTROL_TYPE[button_team])
+		{
+		case CONFIG_CONTROL_TYPE_OFF:
+		  CONFIG_CONTROL_TYPE[button_team] =
+		    CONFIG_CONTROL_TYPE_HUMAN;
+		  break;
+		case CONFIG_CONTROL_TYPE_HUMAN:
+		  CONFIG_CONTROL_TYPE[button_team] = CONFIG_CONTROL_TYPE_CPU;
+		  break;
+		default:
+		  CONFIG_CONTROL_TYPE[button_team] = CONFIG_CONTROL_TYPE_OFF;
+		}
+	      redraw_team_box (d + 4 + 20 * button_team, button_team);
+	      break;
+	    case 16:
+	      change_key (d + choix, &CONFIG_KEY_UP[button_team]);
+	      break;
+	    case 17:
+	      change_key (d + choix, &CONFIG_KEY_LEFT[button_team]);
+	      break;
+	    case 18:
+	      change_key (d + choix, &CONFIG_KEY_RIGHT[button_team]);
+	      break;
+	    case 19:
+	      change_key (d + choix, &CONFIG_KEY_DOWN[button_team]);
+	      break;
+	    default:
+	      if (button_type >= 2 && button_type < 14)
+		{
+		  i = suppress_conflicting_color
+		    (button_type - 2, CONFIG_TEAM_COLOR[button_team]);
+		  if (i >= 0)
+		    redraw_team_box (d + 4 + 20 * i, i);
+		  CONFIG_TEAM_COLOR[button_team] = button_type - 2;
+		  redraw_team_box (d + 4 + 20 * button_team, button_team);
+		}
+	    }
+	}
+    }
+
+  cleanup_player_names ();
+
+  if (retour > 0)
+    retour--;
+
+  return retour;
+}

Added: unstable/liquidwar/branches/upstream/current/src/team.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/team.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/team.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,68 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : team.h                                           */
+/* contenu       : choix des equipes                                */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_TEAM
+#define LIQUID_WAR_INCLUDE_TEAM
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int choose_teams (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/texture.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/texture.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/texture.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,452 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : texture.c                                        */
+/* contenu       : lecture des textures depuis la memoire           */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "base.h"
+#include "alleg2.h"
+#include "bigdata.h"
+#include "texture.h"
+#include "disk.h"
+#include "palette.h"
+#include "startup.h"
+#include "log.h"
+#include "serial.h"
+#include "macro.h"
+#include "path.h"
+#include "serial.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_TEXTURE_RANDOM_MAX_RETRIES 10000
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/* gestion des bitmaps des textures                                 */
+/*------------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------*/
+static int
+find_color (PALETTE pal, RGB rgb)
+{
+  int i, found = -1;
+
+  for (i = 0; i < 256 && found < 0; ++i)
+    if (pal[i].r == rgb.r && pal[i].g == rgb.g && pal[i].b == rgb.b)
+      found = i;
+
+  return found;
+}
+
+/*-----------------------------------------------------------------*/
+static int
+exist_color (PALETTE pal, RGB rgb)
+{
+  return (find_color (pal, rgb) >= 0);
+}
+
+/*-----------------------------------------------------------------*/
+static int
+recalculate_number_of_colors (int max_number, BITMAP * bmp, PALETTE pal)
+{
+  int i, x, y, n = 1;
+  RGB color;
+  PALETTE pal2;
+
+  color = pal[getpixel (bmp, 0, 0)];
+
+  for (i = 0; i < 256; ++i)
+    pal2[i] = color;
+
+  for (y = 0; y < bmp->h && n < max_number; ++y)
+    for (x = 0; x < bmp->w && n < max_number; ++x)
+      {
+	color = pal[getpixel (bmp, x, y)];
+	if (!exist_color (pal2, color))
+	  pal2[n++] = color;
+      }
+  return n;
+}
+
+/*-----------------------------------------------------------------*/
+static void
+create_new_palette (PALETTE dst,
+		    PALETTE src,
+		    BITMAP * bmp, int first_color, int number_of_colors)
+{
+  int i, x, y, index;
+  int nb_retries = 0;
+  RGB color;
+
+  x = random () % bmp->w;
+  y = random () % bmp->h;
+  color = src[getpixel (bmp, x, y)];
+
+  for (i = 0; i < 256; ++i)
+    dst[i] = color;
+
+  for (i = 1; i < number_of_colors;)
+    {
+      x = random () % bmp->w;
+      y = random () % bmp->h;
+      index = getpixel (bmp, x, y);
+      color = src[index];
+      if ((!exist_color (dst, color)) ||
+	  (nb_retries > LW_TEXTURE_RANDOM_MAX_RETRIES))
+	{
+	  dst[first_color + (i++)] = color;
+	  nb_retries = 0;
+	}
+      else
+	{
+	  nb_retries++;
+	}
+    }
+}
+
+/*-----------------------------------------------------------------*/
+static void
+correct_palette (PALETTE pal, int first_color, int number_of_colors)
+{
+  int i;
+
+  for (i = 0; i < first_color; ++i)
+    {
+      pal[i].r = 0;
+      pal[i].g = 0;
+      pal[i].b = 0;
+    }
+  for (i = first_color + number_of_colors; i < 256; ++i)
+    {
+      pal[i].r = 63;
+      pal[i].g = 63;
+      pal[i].b = 63;
+    }
+}
+
+/*-----------------------------------------------------------------*/
+static void
+create_converted_bitmap (BITMAP * bmp,
+			 PALETTE dst,
+			 PALETTE src, int first_color, int number_of_colors)
+{
+  char corres[256];
+  int i, x, y, index;
+
+  for (i = 0; i < 256; ++i)
+    corres[i] = bestfit_color (dst, src[i].r, src[i].g, src[i].b);
+  for (y = 0; y < bmp->h; ++y)
+    for (x = 0; x < bmp->w; ++x)
+      {
+	index = corres[getpixel (bmp, x, y)];
+	index = (index < first_color ||
+		 index >= first_color + number_of_colors) ?
+	  first_color : index;
+	putpixel (bmp, x, y, index);
+      }
+}
+
+/*------------------------------------------------------------------*/
+static void
+red8col (BITMAP * bmp, PALETTE pal, int first_color, int number_of_colors)
+{
+  PALETTE pal2;
+  int i;
+
+  for (i = 0; i < 256; ++i)
+    pal2[i] = pal[i];
+
+  number_of_colors = recalculate_number_of_colors
+    (number_of_colors, bmp, pal);
+  create_new_palette (pal, pal2, bmp, first_color, number_of_colors);
+  create_converted_bitmap (bmp, pal, pal2, first_color, number_of_colors);
+  correct_palette (pal, first_color, number_of_colors);
+}
+
+/*------------------------------------------------------------------*/
+static void
+texture_8to5 (BITMAP * bmp, PALETTE pal, void *result,
+	      int first_color, int number_of_colors, char *filename)
+{
+  char *buffer;
+  int pos = 0, pos8 = 0, x, y, i;
+  char octet[5], toadd;
+  int coul;
+  char system_name_buffer[LW_TEXTURE_SYSTEM_NAME_SIZE + 1];
+
+  lw_serial_set_texture_header (result, (short) bmp->w, (short) bmp->h);
+
+  buffer = ((char *) result) + 2 * sizeof (short);
+
+  /*
+   * We store the system name
+   */
+  memset (system_name_buffer, 0, sizeof (system_name_buffer));
+  LW_MACRO_STRCPY (system_name_buffer, lw_path_get_system_name (filename));
+  memcpy (buffer, system_name_buffer, LW_TEXTURE_SYSTEM_NAME_SIZE);
+  buffer += LW_TEXTURE_SYSTEM_NAME_SIZE;
+
+  for (i = 0; i < number_of_colors; ++i)
+    {
+      buffer[pos++] = pal[first_color + i].r;
+      buffer[pos++] = pal[first_color + i].g;
+      buffer[pos++] = pal[first_color + i].b;
+    }
+
+  for (i = 0; i < 5; ++i)
+    octet[i] = 0;
+
+  for (y = 0; y < bmp->h; ++y)
+    for (x = 0; x < bmp->w; ++x)
+      {
+	coul = getpixel (bmp, x, y) - first_color;
+	toadd = 1 << pos8;
+	octet[0] |= (coul & 1) ? toadd : 0;
+	octet[1] |= (coul & 2) ? toadd : 0;
+	octet[2] |= (coul & 4) ? toadd : 0;
+	octet[3] |= (coul & 8) ? toadd : 0;
+	octet[4] |= (coul & 16) ? toadd : 0;
+
+	if (pos8 == 7 || (y == bmp->h - 1 && x == bmp->w - 1))
+	  {
+	    for (i = 0; i < 5; ++i)
+	      {
+		buffer[pos++] = octet[i];
+		octet[i] = 0;
+	      }
+	    pos8 = 0;
+	  }
+	else
+	  pos8++;
+      }
+}
+
+/*------------------------------------------------------------------*/
+void *
+lw_texture_archive_raw (const char *filename)
+{
+  int i, w, h, size = 0;
+  BITMAP *bmp;
+  PALETTE pal;
+  char *result = NULL, *temp = NULL;
+
+  bmp = load_bitmap (filename, pal);
+  if (bmp)
+    {
+      w = bmp->w;
+      h = bmp->h;
+      if (w > 0 && h > 0)
+	{
+	  temp = malloc (size =
+			 2 * sizeof (short)
+			 + LW_TEXTURE_SYSTEM_NAME_SIZE
+			 + 3 * TEXTURE_COLOR_NUMBER + ((w * h + 7) / 8) * 5);
+	  if (temp)
+	    {
+	      red8col (bmp, pal, 0, TEXTURE_COLOR_NUMBER);
+	      texture_8to5 (bmp, pal, temp, 0, TEXTURE_COLOR_NUMBER,
+			    (char *) filename);
+	    }
+	}
+      destroy_bitmap (bmp);
+    }
+  if (temp)
+    {
+      result = malloc (size);
+      if (result)
+	{
+	  for (i = 0; i < size; ++i)
+	    {
+	      result[i] = temp[i];
+	    }
+	}
+      free (temp);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+static BITMAP *
+create_raw_texture (void *ptr, int first)
+{
+  int x, y, pos8 = 0, color;
+  char totest, *data;
+  BITMAP *result;
+  short w, h;
+
+  data = ptr;
+  lw_serial_get_texture_header (data, &w, &h);
+  data += 2 * sizeof (short) + LW_TEXTURE_SYSTEM_NAME_SIZE + 3 * 32;
+
+  result = my_create_bitmap (w, h);
+  if (result)
+    for (y = 0; y < h; ++y)
+      for (x = 0; x < w; ++x)
+	{
+	  totest = 1 << pos8;
+	  color = first + ((data[0] & totest) ? 1 : 0)
+	    + ((data[1] & totest) ? 2 : 0)
+	    + ((data[2] & totest) ? 4 : 0)
+	    + ((data[3] & totest) ? 8 : 0) + ((data[4] & totest) ? 16 : 0);
+	  putpixel (result, x, y, color);
+	  if (pos8 == 7)
+	    {
+	      data += 5;
+	      pos8 = 0;
+	    }
+	  else
+	    pos8++;
+	}
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+static void *
+get_raw_texture (int num)
+{
+  void *texture = NULL;
+
+  if (num > RAW_TEXTURE_NUMBER + RAW_MAPTEX_NUMBER + CHOOSE_COLOR_NUMBER - 1)
+    num = RAW_TEXTURE_NUMBER + RAW_MAPTEX_NUMBER + CHOOSE_COLOR_NUMBER - 1;
+
+  if (num >= CHOOSE_COLOR_NUMBER
+      && num < CHOOSE_COLOR_NUMBER + RAW_TEXTURE_NUMBER && LOADED_TEXTURE)
+    {
+      texture = RAW_TEXTURE[num - CHOOSE_COLOR_NUMBER];
+    }
+
+  if (num >= CHOOSE_COLOR_NUMBER + RAW_TEXTURE_NUMBER
+      && num < CHOOSE_COLOR_NUMBER + RAW_TEXTURE_NUMBER + RAW_MAPTEX_NUMBER
+      && LOADED_MAPTEX)
+    {
+      texture = RAW_MAPTEX[num - (CHOOSE_COLOR_NUMBER + RAW_TEXTURE_NUMBER)];
+    }
+
+  return texture;
+}
+
+/*------------------------------------------------------------------*/
+static BITMAP *
+create_mono_texture (int first)
+{
+  BITMAP *result;
+
+  result = my_create_bitmap (1, 1);
+  putpixel (result, 0, 0, first);
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+static BITMAP *
+create_texture (int num, int first)
+{
+  BITMAP *result;
+  void *texture;
+
+  texture = get_raw_texture (num);
+
+  if (texture)
+    {
+      result = create_raw_texture (texture, first);
+    }
+  else
+    {
+      result = create_mono_texture (first);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+BITMAP *
+lw_texture_create_bg (int num)
+{
+  return create_texture (num, BG_TEXTURE_FIRST_COLOR);
+}
+
+/*------------------------------------------------------------------*/
+BITMAP *
+lw_texture_create_fg (int num)
+{
+  return create_texture (num, FG_TEXTURE_FIRST_COLOR);
+}
+
+/*------------------------------------------------------------------*/
+char *
+lw_texture_get_system_name (int num)
+{
+  static char result[LW_MAP_SYSTEM_NAME_SIZE + 1];
+  void *raw_texture;
+  char *char_ptr;
+
+  raw_texture = get_raw_texture (num);
+
+  LW_MACRO_MEMSET0 (result);
+  if (raw_texture)
+    {
+      char_ptr = (char *) raw_texture;
+      memcpy (result, char_ptr + 4, LW_TEXTURE_SYSTEM_NAME_SIZE);
+    }
+  else
+    {
+      LW_MACRO_SPRINTF1 (result, "Color %d", num);
+    }
+  result[sizeof (result) - 1] = '\0';
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/texture.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/texture.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/texture.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,76 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : texture.h                                        */
+/* contenu       : lecture des textures en memoire                  */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_TEXTURE
+#define LIQUID_WAR_INCLUDE_TEXTURE
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+#include "texture.h"
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+#define LW_TEXTURE_SYSTEM_NAME_SIZE 16
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void *lw_texture_archive_raw (const char *filename);
+BITMAP *lw_texture_create_bg (int num);
+BITMAP *lw_texture_create_fg (int num);
+char *lw_texture_get_system_name (int num);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/thrddos.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/thrddos.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/thrddos.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,86 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : thrddos.c                                        */
+/* content       : provides fake thread support under DOS           */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "thrdgen.h"
+
+/*==================================================================*/
+/* defines                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* macros                                                           */
+/*==================================================================*/
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Starts a new thread using the given callback
+ */
+int
+lw_thread_start (void (*func) (void *), void *args)
+{
+  int result = 0;
+
+  /*
+   * There's no thread support under DOS 8-/
+   */
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/thrdgen.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/thrdgen.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/thrdgen.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,55 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : thrdgen.h                                        */
+/* content       : cross platform API to handle basic threads       */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_THRDGEN
+#define LIQUID_WAR_INCLUDE_THRDGEN
+
+int lw_thread_start (void (*func) (void *), void *args);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/thrdunix.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/thrdunix.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/thrdunix.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,93 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : thrdunix.c                                       */
+/* content       : provides basic thread support under unix         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <pthread.h>
+
+#include "thrdgen.h"
+
+/*==================================================================*/
+/* defines                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* macros                                                           */
+/*==================================================================*/
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Starts a new thread using the given callback
+ */
+int
+lw_thread_start (void (*func) (void *), void *args)
+{
+  pthread_t thread;
+  int result = 0;
+
+  if (pthread_create (&thread, NULL, (void *(*)(void *)) func, args) == 0)
+    {
+      if (pthread_detach (thread) == 0)
+	{
+	  result = 1;
+	}
+    }
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/thrdw32.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/thrdw32.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/thrdw32.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,91 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : thrdunix.c                                       */
+/* content       : provides basic thread support under windows      */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#ifdef WIN32
+#include <process.h>
+#endif
+
+#include "thrdgen.h"
+
+/*==================================================================*/
+/* defines                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* macros                                                           */
+/*==================================================================*/
+
+/*==================================================================*/
+/* globals                                                          */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Starts a new thread using the given callback
+ */
+int
+lw_thread_start (void (*func) (void *), void *args)
+{
+  int result = 0;
+
+  if (_beginthread (func, 0, args) != 0)
+    {
+      result = 1;
+    }
+
+  return result;
+}

Added: unstable/liquidwar/branches/upstream/current/src/ticker.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/ticker.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/ticker.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,120 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : ticker.c                                         */
+/* contenu       : gestion d'un compteur de milliemes de seconde    */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+#include "ticker.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#ifdef DOS
+#define TICKER_STEP 5
+#else
+#define TICKER_STEP 10
+#endif
+static int TICKER_VALUE = 0;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+
+/*------------------------------------------------------------------*/
+/* mise en place du chrono                                          */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+static void
+ticker_handler (void)
+{
+  TICKER_VALUE += TICKER_STEP;
+}
+
+END_OF_FUNCTION (ticker_handler);
+
+/*------------------------------------------------------------------*/
+int
+start_ticker (void)
+{
+  int result = 0;
+  //#ifdef DOS
+  LOCK_FUNCTION (ticker_handler);
+  LOCK_VARIABLE (TICKER_VALUE);
+
+  result = install_int_ex (ticker_handler, MSEC_TO_TIMER (TICKER_STEP));
+  //#endif
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+void
+stop_ticker (void)
+{
+  //#ifdef DOS
+  remove_int (ticker_handler);
+  //#endif
+}
+
+/*------------------------------------------------------------------*/
+int
+get_ticker (void)
+{
+  //#ifdef DOS
+  return TICKER_VALUE;
+  //#else
+  //return ++TICKER_VALUE;
+  //#endif
+}

Added: unstable/liquidwar/branches/upstream/current/src/ticker.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/ticker.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/ticker.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,66 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : ticker.h                                         */
+/* contenu       : gestion d'un compteur de milliemes de secondes   */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_TICKER
+#define LIQUID_WAR_INCLUDE_TICKER
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int start_ticker (void);
+void stop_ticker (void);
+int get_ticker (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/time.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/time.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/time.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,148 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : time.c                                           */
+/* contenu       : gestion du temps de jeu                          */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "code.h"
+#include "config.h"
+#include "sound.h"
+#include "ticker.h"
+#include "time.h"
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+static int TIME_TABLE[17] = { 15, 30, 45, 60,
+  90, 120, 150, 180,
+  240, 300, 360, 480,
+  600, 900, 1200, 1800,
+  3600
+};
+static int TICKER_PAUSED;
+static int TICKER_START;
+static int TICKER_PAUSE_START;
+static int BELL_RINGING;
+
+int TIME_ELAPSED;
+int TIME_LEFT;
+int GLOBAL_TICKER;
+int GLOBAL_CLOCK = 0;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+void
+update_play_time (void)
+{
+  GLOBAL_TICKER = get_ticker () - TICKER_START;
+  if (PAUSE_ON)
+    {
+      if (TICKER_PAUSE_START == 0)
+	TICKER_PAUSE_START = get_ticker ();
+    }
+  else
+    {
+      if (TICKER_PAUSE_START != 0)
+	{
+	  TICKER_PAUSED += get_ticker () - TICKER_PAUSE_START;
+	  TICKER_PAUSE_START = 0;
+	}
+      else
+	TIME_ELAPSED = (get_ticker () - TICKER_START - TICKER_PAUSED) / 1000;
+    }
+  TIME_LEFT = TIME_TABLE[LW_CONFIG_CURRENT_RULES.game_time] - TIME_ELAPSED;
+
+  if (TIME_LEFT < 0)
+    TIME_LEFT = 0;
+  if (TIME_LEFT <= 5 && BELL_RINGING == 0)
+    {
+      BELL_RINGING = 1;
+      play_time ();
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+start_play_time (void)
+{
+  GLOBAL_CLOCK = 2;
+  TICKER_START = get_ticker ();
+  TICKER_PAUSED = 0;
+  TICKER_PAUSE_START = 0;
+  TIME_ELAPSED = 0;
+  TIME_LEFT = TIME_TABLE[LW_CONFIG_CURRENT_RULES.game_time] + 1;
+  BELL_RINGING = 0;
+  update_play_time ();
+}
+
+/*------------------------------------------------------------------*/
+void
+write_time (int time, char *buffer)
+{
+  int min, sec;
+
+  min = time / 60;
+  sec = time % 60;
+  buffer[0] = '0' + min / 10;
+  buffer[1] = '0' + min % 10;
+  buffer[2] = ':';
+  buffer[3] = '0' + sec / 10;
+  buffer[4] = '0' + sec % 10;
+  buffer[5] = 0;
+}

Added: unstable/liquidwar/branches/upstream/current/src/time.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/time.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/time.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,79 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : time.h                                           */
+/* contenu       : gestion du temps de jeu                          */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_TIME
+#define LIQUID_WAR_INCLUDE_TIME
+
+/*==================================================================*/
+/* constantes                                                       */
+/*==================================================================*/
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+extern int TIME_ELAPSED;
+extern int TIME_LEFT;
+extern int GLOBAL_TICKER;
+extern int GLOBAL_CLOCK;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void update_play_time (void);
+void start_play_time (void);
+void write_time (int time, char *buffer);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/viewport.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/viewport.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/viewport.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,235 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : viewport.c                                       */
+/* contenu       : gestion de l'aire de jeu et du page flipping     */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+#include "area.h"
+#include "alleg2.h"
+#include "config.h"
+#include "gfxmode.h"
+#include "palette.h"
+#include "viewport.h"
+#include "info.h"
+#include "distor.h"
+#include "log.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+int PAGE_FLIP_H = 0;
+BITMAP *NEXT_SCREEN = NULL;
+
+static int VIEWPORT_X = 0;
+static int VIEWPORT_Y = 0;
+static int VIEWPORT_W = 0;
+static int VIEWPORT_H = 0;
+
+static int VIEWPORT_CHANGE_REGISTERED = 0;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+void
+rect_for_viewport (void)
+{
+  rect (screen, VIEWPORT_X - 1, VIEWPORT_Y - 1 + PAGE_FLIP_H,
+	VIEWPORT_X + VIEWPORT_W,
+	VIEWPORT_Y + VIEWPORT_H + PAGE_FLIP_H, MENU_FG);
+}
+
+/*------------------------------------------------------------------*/
+static void
+init_viewport_size (int x, int y, int w, int h)
+{
+  int scale_w;
+  int scale_h;
+
+  static int viewport_sizes[7] = { 18, 24, 27, 30, 33, 35, 36 };
+
+  scale_w = 10 * w;
+  scale_h = 10 * h;
+
+  if (CONFIG_VIEWPORT_SIZE >= 8)
+    {
+      VIEWPORT_W = scale_w;
+      VIEWPORT_H = scale_h;
+    }
+
+  if (CONFIG_VIEWPORT_SIZE > 0 && CONFIG_VIEWPORT_SIZE < 8)
+    {
+      if (scale_w * CURRENT_AREA_H < scale_h * CURRENT_AREA_W)
+	{
+	  VIEWPORT_W = (scale_w * (viewport_sizes[CONFIG_VIEWPORT_SIZE - 1]))
+	    / viewport_sizes[6];
+	  VIEWPORT_H = (VIEWPORT_W * CURRENT_AREA_H) / CURRENT_AREA_W;
+	}
+      else
+	{
+	  VIEWPORT_H = (scale_h * (viewport_sizes[CONFIG_VIEWPORT_SIZE - 1]))
+	    / viewport_sizes[6];
+	  VIEWPORT_W = (VIEWPORT_H * CURRENT_AREA_W) / CURRENT_AREA_H;
+	}
+    }
+
+  if (CONFIG_VIEWPORT_SIZE <= 0)
+    {
+      VIEWPORT_W = CURRENT_AREA_W;
+      VIEWPORT_H = CURRENT_AREA_H;
+      while (VIEWPORT_W > w || VIEWPORT_H > h)
+	{
+	  VIEWPORT_W /= 2;
+	  VIEWPORT_H /= 2;
+	}
+    }
+  else
+    {
+      VIEWPORT_W *= w;
+      VIEWPORT_H *= h;
+
+      VIEWPORT_W /= scale_w;
+      VIEWPORT_H /= scale_h;
+    }
+
+  VIEWPORT_X = x + ((w - VIEWPORT_W) / 8) * 4;
+  VIEWPORT_Y = y + (h - VIEWPORT_H) / 2;
+}
+
+/*------------------------------------------------------------------*/
+BITMAP *
+page_flip (void)
+{
+  int old_h, new_h;
+  int x, y, w, h;
+
+  if (CONFIG_PAGE_FLIP && VIRTUAL_H >= (2 * SCREEN_H))
+    {
+      if (NEXT_SCREEN)
+	{
+	  destroy_bitmap (NEXT_SCREEN);
+	}
+
+      lw_info_get_room_for_viewport (&x, &y, &w, &h);
+      init_viewport_size (x, y, w, h);
+
+      old_h = PAGE_FLIP_H;
+      new_h = old_h ? 0 : SCREEN_H;
+
+      scroll_screen (0, old_h);
+      set_clip_rect (screen, 0, new_h, SCREEN_W - 1, new_h + SCREEN_H - 1);
+
+      PAGE_FLIP_H = new_h;
+
+      NEXT_SCREEN = create_sub_bitmap (screen, VIEWPORT_X,
+				       VIEWPORT_Y + new_h,
+				       VIEWPORT_W, VIEWPORT_H);
+    }
+  else
+    {
+      PAGE_FLIP_H = 0;
+      if (VIEWPORT_CHANGE_REGISTERED || !NEXT_SCREEN)
+	{
+	  scroll_screen (0, 0);
+	  set_clip_rect (screen, 0, 0, SCREEN_W - 1, SCREEN_H - 1);
+
+	  lw_info_get_room_for_viewport (&x, &y, &w, &h);
+	  init_viewport_size (x, y, w, h);
+
+	  NEXT_SCREEN = create_sub_bitmap (screen, VIEWPORT_X,
+					   VIEWPORT_Y,
+					   VIEWPORT_W, VIEWPORT_H);
+	}
+    }
+
+  if (VIEWPORT_CHANGE_REGISTERED > 0)
+    {
+      rect_for_viewport ();
+      init_distorsion_displayer ();
+      VIEWPORT_CHANGE_REGISTERED--;
+    }
+
+  return (NEXT_SCREEN);
+}
+
+/*------------------------------------------------------------------*/
+void
+last_flip (void)
+{
+  if (NEXT_SCREEN)
+    {
+      if (CONFIG_PAGE_FLIP && VIRTUAL_H >= (2 * SCREEN_H))
+	{
+	  set_clip_rect (screen, 0, 0, SCREEN_W - 1, SCREEN_H - 1);
+	  if (!PAGE_FLIP_H)
+	    {
+	      blit (screen, screen, 0, SCREEN_H, 0, 0, SCREEN_W, SCREEN_H);
+	      scroll_screen (0, 0);
+	    }
+	  else
+	    PAGE_FLIP_H = 0;
+	}
+
+      destroy_bitmap (NEXT_SCREEN);
+      NEXT_SCREEN = NULL;
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+lw_viewport_register_change (int count)
+{
+  VIEWPORT_CHANGE_REGISTERED = count;
+}

Added: unstable/liquidwar/branches/upstream/current/src/viewport.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/viewport.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/viewport.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,80 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : viewport.h                                       */
+/* contenu       : gestion de l'aire de jeu, du page flipping       */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_VIEWPORT
+#define LIQUID_WAR_INCLUDE_VIEWPORT
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#define MAX_W_DISPLAY 1024
+#define MAX_H_DISPLAY 768
+
+extern int PAGE_FLIP_H;
+extern int MODEX_SCALE;
+extern BITMAP *NEXT_SCREEN;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void rect_for_viewport (void);
+BITMAP *page_flip (void);
+void last_flip (void);
+void lw_viewport_register_change (int count);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/volume.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/volume.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/volume.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,150 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : volume.c                                         */
+/* contenu       : reglage du volume du son                         */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+
+#include "back.h"
+#include "config.h"
+#include "dialog.h"
+#include "disk.h"
+#include "help.h"
+#include "menu.h"
+#include "sound.h"
+#include "volume.h"
+#include "lang.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+sound_options (void)
+{
+  int *temp;
+  DIALOG d[15];
+  int i, choix = 4, retour = 0;
+  static int y_pos[5] = { 0, 2, 4, 5, 7 };
+
+  memset (d, 0, sizeof (d));
+
+  for (i = 0; i < 5; ++i)
+    {
+      standard_button (d + i + 4, 0, y_pos[i], 2, 8);
+      d[i + 4].proc = my_textbox_proc;
+    }
+  for (i = 0; i < 5; ++i)
+    {
+      standard_button (d + i + 9, 1, y_pos[i], 2, 8);
+      d[i + 9].proc = my_slider_proc;
+    }
+
+  quick_buttons (d);
+
+  d[4].dp = lw_lang_string (LW_LANG_STRING_VOLUME_SFX);
+  d[5].dp = lw_lang_string (LW_LANG_STRING_VOLUME_CLICK);
+  d[6].dp = lw_lang_string (LW_LANG_STRING_VOLUME_GAMEWATER);
+  d[7].dp = lw_lang_string (LW_LANG_STRING_VOLUME_MENUWATER);
+  d[8].dp = lw_lang_string (LW_LANG_STRING_VOLUME_MUSIC);
+  d[9].dp3 = &CONFIG_SFX_VOLUME;
+  d[10].dp3 = &CONFIG_CLICK_VOLUME;
+  d[11].dp3 = &CONFIG_WATER_VOLUME_GAME;
+  d[12].dp3 = &WATER_VOLUME;
+  d[13].dp3 = &CONFIG_MUSIC_VOLUME;
+  for (i = 9; i < 14; ++i)
+    {
+      d[i].d1 = 16;
+      d[i].dp = NULL;
+      d[i].dp2 = slider_int;
+      temp = d[i].dp3;
+      d[i].d2 = *temp;
+    }
+
+  d[14].proc = 0;
+
+  while (retour == 0)
+    {
+      choix = my_do_dialog (d, choix);
+      switch (choix)
+	{
+	case -1:
+	case MENU_QUICK_BACK:
+	  retour = 1;
+	  break;
+	case MENU_QUICK_MAIN:
+	  retour = MENU_TOP;
+	  break;
+	case MENU_QUICK_QUIT:
+	  if (confirm_quit ())
+	    retour = MENU_EXIT;
+	  else
+	    display_back_image ();
+	  break;
+	case MENU_QUICK_PLAY:
+	  retour = MENU_PLAY;
+	  break;
+	}
+    }
+
+  CONFIG_WATER_VOLUME_MENU = WATER_VOLUME;	// realign current volume
+  // and config volume
+  if (retour > 0)
+    retour--;
+
+  return retour;
+}

Added: unstable/liquidwar/branches/upstream/current/src/volume.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/volume.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/volume.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,68 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : volume.h                                         */
+/* contenu       : reglage du volume du son                         */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_VOLUME
+#define LIQUID_WAR_INCLUDE_VOLUME
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int sound_options (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/watchdog.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/watchdog.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/watchdog.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,148 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : watchdog.c                                       */
+/* contenu       : gestion des codes secrets pendant le jeu         */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <allegro.h>
+#include <string.h>
+
+#include "watchdog.h"
+#include "log.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+#define WATCHDOG_NUMBER 10
+#define WATCHDOG_BUFFER_SIZE 1024
+#define WATCHDOG_MAX_WORD 64
+#define WATCHDOG_KEYWORD "ufoot"
+
+char WATCHDOG_ASCII[256];
+char WATCHDOG_SCANCODE[128];
+static int WATCHDOG_BUFFER[WATCHDOG_BUFFER_SIZE];
+static int WATCHDOG_KEYS_IN_BUFFER;
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+void
+watchdog_update ()
+{
+  int i, n, old_pos;
+
+  old_pos = WATCHDOG_KEYS_IN_BUFFER;
+
+  for (i = 0; i < 256; ++i)
+    WATCHDOG_ASCII[i] = 0;
+  for (i = 0; i < 128; ++i)
+    WATCHDOG_SCANCODE[i] = 0;
+
+  if ((n = (WATCHDOG_KEYS_IN_BUFFER - WATCHDOG_MAX_WORD)) > WATCHDOG_MAX_WORD)
+    {
+      for (i = n; i < WATCHDOG_KEYS_IN_BUFFER; ++i)
+	WATCHDOG_BUFFER[i - n] = WATCHDOG_BUFFER[i];
+      WATCHDOG_KEYS_IN_BUFFER -= n;
+      old_pos -= n;
+    }
+
+  while (keypressed () && WATCHDOG_KEYS_IN_BUFFER < WATCHDOG_BUFFER_SIZE)
+    {
+      WATCHDOG_BUFFER[WATCHDOG_KEYS_IN_BUFFER++] = readkey ();
+    }
+
+  for (i = old_pos; i < WATCHDOG_KEYS_IN_BUFFER; ++i)
+    {
+      WATCHDOG_ASCII[WATCHDOG_BUFFER[i] & 0xFF] = 1;
+      WATCHDOG_SCANCODE[WATCHDOG_BUFFER[i] >> 8] = 1;
+    }
+}
+
+/*------------------------------------------------------------------*/
+void
+watchdog_reset ()
+{
+  WATCHDOG_KEYS_IN_BUFFER = 0;
+
+  watchdog_update ();
+}
+
+/*------------------------------------------------------------------*/
+int
+watchdog_is_keyword (char *keyword)
+{
+  int i, j, l, n, found = 0;
+  char pattern[WATCHDOG_MAX_WORD + 1];
+
+  LW_MACRO_SPRINTF2 (pattern, "%s%s", WATCHDOG_KEYWORD, keyword);
+
+  l = strlen (pattern);
+  n = WATCHDOG_KEYS_IN_BUFFER - l + 1;
+  for (i = 0; i < n && !found; ++i)
+    {
+      j = 0;
+      while (pattern[j] &&
+	     pattern[j] == ((char) WATCHDOG_BUFFER[i + j] & 0xFF))
+	{
+	  j++;
+	}
+      found = !pattern[j];
+    }
+
+  if (found)
+    WATCHDOG_BUFFER[i] |= 0xFF;
+
+  return found;
+}

Added: unstable/liquidwar/branches/upstream/current/src/watchdog.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/watchdog.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/watchdog.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,73 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : watchdog.h                                       */
+/* contenu       : gestion des codes secrets pendant le jeu         */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_WATCHDOG
+#define LIQUID_WAR_INCLUDE_WATCHDOG
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+extern char WATCHDOG_ASCII[256];
+extern char WATCHDOG_SCANCODE[128];
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void watchdog_update ();
+void watchdog_reset ();
+int watchdog_is_keyword (char *keyword);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/wave.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/wave.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/wave.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,162 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : wave.c                                           */
+/* contenu       : choix des options de vagues                      */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+
+#include "back.h"
+#include "config.h"
+#include "dialog.h"
+#include "disk.h"
+#include "help.h"
+#include "menu.h"
+#include "wave.h"
+#include "lang.h"
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions                                                        */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+int
+wave_options (void)
+{
+  int *temp;
+  DIALOG d[24];
+  DIALOG_PLAYER *dp;
+  int i, j, k, choix = 4, retour = 0;
+
+  memset (d, 0, sizeof (d));
+
+  display_back_image ();
+  for (i = 0; i < 5; ++i)
+    for (j = 0; j < 4; ++j)
+      if (i > 0 || j > 0)
+	{
+	  k = i * 4 + j + 3;
+	  standard_small_button (d + k, j, i, 4, 5);
+	  if (i > 0 && j > 0)
+	    {
+	      d[k].proc = my_slider_proc;
+	      d[k].dp = NULL;
+	      d[k].dp2 = slider_int;
+	      switch (j)
+		{
+		case 1:
+		  d[k].d1 = 16;
+		  d[k].dp3 = &(CONFIG_WAVE_AMPLI[i - 1]);
+		  break;
+		case 2:
+		  d[k].d1 = 4;
+		  d[k].dp3 = &(CONFIG_WAVE_NUMBER[i - 1]);
+		  break;
+		case 3:
+		  d[k].d1 = 16;
+		  d[k].dp3 = &(CONFIG_WAVE_SPEED[i - 1]);
+		  break;
+		}
+	      temp = d[k].dp3;
+	      d[k].d2 = *temp;
+	    }
+	  else
+	    d[k].proc = my_textbox_proc;
+	}
+  d[23].proc = NULL;
+
+  quick_buttons (d);
+  d[4].dp = lw_lang_string (LW_LANG_STRING_WAVE_AMPLI);
+  d[5].dp = lw_lang_string (LW_LANG_STRING_WAVE_NUMBER);
+  d[6].dp = lw_lang_string (LW_LANG_STRING_WAVE_SPEED);
+  d[7].dp = lw_lang_string (LW_LANG_STRING_WAVE_WX);
+  d[11].dp = lw_lang_string (LW_LANG_STRING_WAVE_HY);
+  d[15].dp = lw_lang_string (LW_LANG_STRING_WAVE_WY);
+  d[19].dp = lw_lang_string (LW_LANG_STRING_WAVE_HX);
+
+  display_back_image ();
+  while (retour == 0)
+    {
+      dp = my_init_dialog (d, choix);
+      while (my_update_dialog (dp))
+	;
+      choix = shutdown_dialog (dp);
+      //choix=my_do_dialog (d,choix);
+      switch (choix)
+	{
+	case -1:
+	case MENU_QUICK_BACK:
+	  retour = 1;
+	  break;
+	case MENU_QUICK_MAIN:
+	  retour = MENU_TOP;
+	  break;
+	case MENU_QUICK_QUIT:
+	  if (confirm_quit ())
+	    retour = MENU_EXIT;
+	  else
+	    display_back_image ();
+	  break;
+	case MENU_QUICK_PLAY:
+	  retour = MENU_PLAY;
+	  break;
+	}
+    }
+
+  if (retour > 0)
+    retour--;
+
+  return retour;
+}

Added: unstable/liquidwar/branches/upstream/current/src/wave.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/wave.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/wave.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,68 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : wave.h                                           */
+/* contenu       : choix des options de vague                       */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_WAVE
+#define LIQUID_WAR_INCLUDE_WAVE
+
+/*==================================================================*/
+/* types                                                            */
+/*==================================================================*/
+
+/*==================================================================*/
+/* variables globales                                               */
+/*==================================================================*/
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int wave_options (void);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/wwwcli.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/wwwcli.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/wwwcli.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,439 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : wwwcli.c                                         */
+/* content       : client code used to contact www.ufoot.org        */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <string.h>
+#include <ctype.h>
+#include <stdio.h>
+
+#include "wwwcli.h"
+#include "startup.h"
+#include "log.h"
+#include "httputil.h"
+#include "init.h"
+#include "server.h"
+#include "macro.h"
+#include "ping.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_WWWCLI_HTTP_CONTENT_SIZE 100000
+#define LW_WWWCLI_HTTP_URL_SIZE (URL_SIZE + 200)
+
+#define LW_WWWCLI_URL_LIST "list.php3"
+#define LW_WWWCLI_TEMP_BUFFER_SIZE 100
+
+/*
+ * If a line is shorter than this, we consider it as an empty
+ * line, this avoids errors with useless stupid malformatted lines
+ */
+#define LW_WWWCLI_MIN_LINE_SIZE 20
+
+/*==================================================================*/
+/* static functions                                                 */
+/*==================================================================*/
+
+static int parse_line (LW_WWWCLI_DATA * result, char **str);
+static void skip_space (char **str);
+static int read_string (char *result, char **str, int size);
+static int read_int (int *result, char **str);
+static int read_separator (char **str);
+static int read_eol (char **str);
+static int read_eol_n (char **str, int n);
+static void next_line (char **str);
+
+/*==================================================================*/
+/* global functions                                                 */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Main function of the server thread which tries to connect
+ * on the metaserver
+ */
+int
+lw_wwwcli_get_games (LW_WWWCLI_DATA * buffer, int *size)
+{
+  int result = 0;
+  char buffer_content[LW_WWWCLI_HTTP_CONTENT_SIZE];
+  char buffer_url[LW_WWWCLI_HTTP_URL_SIZE];
+  char *pos, *pos_tmp;
+  int i = 0;
+
+  log_print_str ("Getting server list from \"");
+  log_print_str (STARTUP_METASERVER);
+  log_print_str ("\" ");
+
+  memset (&buffer_url, 0, sizeof (buffer_url));
+  LW_MACRO_SPRINTF3 (buffer_url,
+		     "%s%s?protocol=%s&game=" LW_PROGRAM "&version="
+		     LW_VERSION, STARTUP_METASERVER, LW_WWWCLI_URL_LIST,
+		     LW_SERVER_METASERVER_PROTOCOL);
+
+  if (lw_httputil_get_page
+      (buffer_content, buffer_url, sizeof (buffer_content)))
+    {
+      pos = buffer_content;
+
+      while (read_eol (&pos));
+
+      while (i < (*size) && strlen (pos) > 0)
+	{
+	  pos_tmp = pos;
+	  if (read_eol_n (&pos_tmp, LW_WWWCLI_MIN_LINE_SIZE))
+	    {
+	      /*
+	       * This was just an empty or too short line...
+	       */
+	      pos = pos_tmp;
+	    }
+	  else
+	    {
+	      /*
+	       * We parse the line only if there's something on it...
+	       */
+	      if (parse_line (buffer + i, &pos))
+		{
+		  if (buffer[i].busy_players < buffer[i].max_players)
+		    {
+		      /*
+		       * we increment i only if there's some room left on the
+		       * server. If it's full of people playing on it, it's
+		       * of absolutely no use to present it as a working
+		       * server... And not incrementing i will make it be
+		       * overwritten by the next server.
+		       */
+		      ++i;
+		      log_print_str ("+");
+		    }
+		  else
+		    {
+		      log_print_str ("=");
+		    }
+		}
+	      else
+		{
+		  log_print_str ("-");
+		}
+	    }
+	}
+
+      result = 1;
+    }
+
+  if (result == 1)
+    {
+      (*size) = i;
+    }
+  else
+    {
+      (*size) = 0;
+    }
+
+  display_success (result);
+  if (!result)
+    {
+      log_print_str ("Error: ");
+      log_println_str (buffer_content);
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Parses a line returned by the meta-server
+ */
+static int
+parse_line (LW_WWWCLI_DATA * result, char **str)
+{
+  int ok = 0;
+  char temp[LW_WWWCLI_TEMP_BUFFER_SIZE];
+
+  memset (result, 0, sizeof (LW_WWWCLI_DATA));
+
+
+  if (read_string (result->ip, str, sizeof (result->ip)) &&
+      read_separator (str) &&
+      read_int (&(result->port), str) &&
+      read_separator (str) &&
+      read_string (temp, str, sizeof (temp)) &&
+      read_separator (str) &&
+      read_string (temp, str, sizeof (temp)) &&
+      read_separator (str) &&
+      read_int (&(result->uptime), str) &&
+      read_separator (str) &&
+      read_int (&(result->busy_players), str) &&
+      read_separator (str) &&
+      read_int (&(result->max_players), str) &&
+      read_separator (str) &&
+      read_int (&(result->password), str) &&
+      read_separator (str) &&
+      read_string (result->comment, str, sizeof (result->comment)))
+    {
+      LW_MACRO_SPRINTF3 (result->label,
+			 "%s (%d/%d)",
+			 result->ip,
+			 result->busy_players, result->max_players);
+
+      result->ping_delay = lw_ping_try_server (result->ip, result->port);
+
+      ok = 1;
+    }
+
+  next_line (str);
+
+  return ok;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Skip spaces, tabs and the likes.
+ */
+static void
+skip_space (char **str)
+{
+  while ((isspace (**str) || (**str) == '\r') && (**str) != '\n')
+    {
+      ++(*str);
+    }
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Reads a string between ''. Double '' are interpreted as a single '
+ * which is the standard SQL convention
+ */
+static int
+read_string (char *result, char **str, int size)
+{
+  int i = 0;
+  int done = 0;
+  char c;
+
+  skip_space (str);
+
+  c = **str;
+  if (c == '\'')
+    {
+      ++(*str);
+      while ((c = **str) != '\0' && c != '\n' && !done)
+	{
+	  ++(*str);
+	  if (c == '\'')
+	    {
+	      if ((**str) == '\'')
+		{
+		  ++(*str);
+		  if (i < size - 1)
+		    {
+		      result[i++] = '\'';
+		    }
+		}
+	      else
+		{
+		  done = 1;
+		}
+	    }
+	  else
+	    {
+	      if (i < size - 1)
+		{
+		  result[i++] = c;
+		}
+	    }
+	}
+    }
+
+  result[i++] = '\0';
+
+  skip_space (str);
+
+  return done;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Reads an integer
+ */
+static int
+read_int (int *result, char **str)
+{
+  int ok = 0;
+  char c;
+
+  (*result) = 0;
+
+  skip_space (str);
+
+  while (isdigit (c = (**str)))
+    {
+      ++(*str);
+
+      (*result) *= 10;
+      (*result) += c - '0';
+
+      ok = 1;
+    }
+
+  skip_space (str);
+
+  return ok;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Reads a field separator
+ */
+static int
+read_separator (char **str)
+{
+  int ok = 0;
+  char c;
+
+  skip_space (str);
+
+  c = **str;
+
+  if (c == ',')
+    {
+      ++(*str);
+      ok = 1;
+    }
+
+  skip_space (str);
+
+  return ok;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Reads a new-line character
+ */
+static int
+read_eol (char **str)
+{
+  int ok = 0;
+  char c;
+
+  skip_space (str);
+
+  c = **str;
+
+  if (c == '\n')
+    {
+      ++(*str);
+      ok = 1;
+    }
+
+  skip_space (str);
+
+  return ok;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Reads "less than n chars", then a "\n"
+ */
+static int
+read_eol_n (char **str, int n)
+{
+  int ok = 0;
+  char *tmp;
+
+  skip_space (str);
+
+  tmp = strchr (*str, '\n');
+  if (tmp != NULL)
+    {
+      if (tmp - (*str) < n)
+	{
+	  ok = 1;
+	  (*str) = tmp + 1;
+	  skip_space (str);
+	}
+    }
+
+  return ok;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Reads an end of line
+ */
+static void
+next_line (char **str)
+{
+  char *pos;
+  int len;
+
+  skip_space (str);
+
+  pos = strchr (*str, '\n');
+  if (pos)
+    {
+      (*str) = pos + 1;
+    }
+  else
+    {
+      /*
+       * No '\n' found, we decided to go to the
+       * very end of the string
+       */
+      len = strlen (*str);
+      (*str) += len;
+    }
+
+  skip_space (str);
+}

Added: unstable/liquidwar/branches/upstream/current/src/wwwcli.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/wwwcli.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/wwwcli.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,88 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : wwwcli.h                                         */
+/* content       : client code used to contact www.ufoot.org        */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_WWWCLI
+#define LIQUID_WAR_INCLUDE_WWWCLI
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "sockgen.h"
+#include "base.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+
+typedef struct
+{
+  char label[LW_SOCK_IP_SIZE + 1 + 33];
+  char ip[LW_SOCK_IP_SIZE];
+  int port;
+  int uptime;
+  int busy_players;
+  int max_players;
+  int password;
+  char comment[COMMENT_SIZE + 1];
+  int ping_delay;
+}
+LW_WWWCLI_DATA;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+int lw_wwwcli_get_games (LW_WWWCLI_DATA * buffer, int *size);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/src/wwwsrv.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/wwwsrv.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/wwwsrv.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,235 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : wwwsrv.c                                         */
+/* content       : server code used to contact www.ufoot.org        */
+/********************************************************************/
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include <stdio.h>
+#include <string.h>
+
+#include "wwwsrv.h"
+#include "log.h"
+#include "httputil.h"
+#include "thrdgen.h"
+#include "server.h"
+#include "macro.h"
+
+/*==================================================================*/
+/* constants                                                        */
+/*==================================================================*/
+
+#define LW_WWWSRV_HTTP_CONTENT_SIZE 1000
+#define LW_WWWSRV_HTTP_URL_SIZE (URL_SIZE + 200 + COMMENT_SIZE * 3)
+
+#define LW_WWWSRV_URL_REGISTER "register.php3"
+#define LW_WWWSRV_DELAY 5
+
+#define LW_WWWSRV_OK           "OK"
+
+/*==================================================================*/
+/* static functions                                                 */
+/*==================================================================*/
+
+static void lw_wwwsrv_callback (void *args);
+
+/*==================================================================*/
+/* global functions                                                 */
+/*==================================================================*/
+
+/*------------------------------------------------------------------*/
+/*
+ * Initializes the data structure
+ */
+void
+lw_wwwsrv_init (LW_WWWSRV_DATA * data,
+		int privacy,
+		int log,
+		char *metaserver,
+		int port,
+		int busy_players,
+		int max_players, char *password, char *comment)
+{
+  memset (data, 0, sizeof (LW_WWWSRV_DATA));
+
+  data->privacy = privacy;
+  data->log = log;
+  strncpy (data->metaserver, metaserver, URL_SIZE);
+  data->port = port;
+  data->busy_players = busy_players;
+  data->max_players = max_players;
+  strncpy (data->password, password, URL_SIZE);
+  strncpy (data->comment, comment, URL_SIZE);
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Launches a thread which will register itself on the main server
+ * Note that the return value just tells if the thread has been
+ * successfully launched, but one can not use it to know if the
+ * meta server actually registered us.
+ */
+int
+lw_wwwsrv_register (LW_WWWSRV_DATA * data)
+{
+  int result = 0;
+
+  if (data->privacy == 1)
+    {
+      /*
+       * privacy is set to 1, so we try and contact the metaserver
+       */
+      result = lw_thread_start (lw_wwwsrv_callback, (void *) data);
+    }
+  else
+    {
+      /*
+       * privacy is set to 0, we do not tell anyone about this server
+       */
+      result = 1;
+    }
+
+  return result;
+}
+
+/*------------------------------------------------------------------*/
+/*
+ * Main function of the server thread which tries to connect
+ * on the metaserver
+ */
+static void
+lw_wwwsrv_callback (void *args)
+{
+  LW_WWWSRV_DATA data;
+  char buffer_content[LW_WWWSRV_HTTP_CONTENT_SIZE];
+  char buffer_url[LW_WWWSRV_HTTP_URL_SIZE];
+  char buffer_num[33];
+  char buffer_comment[COMMENT_SIZE * 3 + 1];
+  int ok = 0;
+
+  memcpy (&data, args, sizeof (LW_WWWSRV_DATA));
+
+  if (data.log)
+    {
+      log_print_str ("Trying to register on \"");
+      log_print_str (data.metaserver);
+      log_println_str ("\"...");
+    }
+
+  memset (&buffer_url, 0, sizeof (buffer_url));
+
+  LW_MACRO_SPRINTF3 (buffer_url,
+		     "%s%s?protocol=%s&game=" LW_PROGRAM "&version="
+		     LW_VERSION, data.metaserver, LW_WWWSRV_URL_REGISTER,
+		     LW_SERVER_METASERVER_PROTOCOL);
+
+  LW_MACRO_SPRINTF1 (buffer_num, "%d", data.port);
+  LW_MACRO_STRCAT (buffer_url, "&port=");
+  LW_MACRO_STRCAT (buffer_url, buffer_num);
+
+  LW_MACRO_SPRINTF1 (buffer_num, "%d", data.busy_players);
+  LW_MACRO_STRCAT (buffer_url, "&busy_players=");
+  LW_MACRO_STRCAT (buffer_url, buffer_num);
+
+  LW_MACRO_SPRINTF1 (buffer_num, "%d", data.max_players);
+  LW_MACRO_STRCAT (buffer_url, "&max_players=");
+  LW_MACRO_STRCAT (buffer_url, buffer_num);
+
+  LW_MACRO_STRCAT (buffer_url, "&password=");
+  if (strlen (data.password) > 0)
+    {
+      LW_MACRO_STRCAT (buffer_url, "1");
+    }
+  else
+    {
+      LW_MACRO_STRCAT (buffer_url, "0");
+    }
+
+  LW_MACRO_STRCAT (buffer_url, "&comment=");
+  lw_httputil_text_to_urlparam (buffer_comment,
+				data.comment, sizeof (buffer_comment) - 1);
+  LW_MACRO_STRCAT (buffer_url, buffer_comment);
+
+  if (lw_httputil_get_page
+      (buffer_content, buffer_url, sizeof (buffer_content)))
+    {
+      if (strstr (buffer_content, LW_WWWSRV_OK))
+	{
+	  ok = 1;
+	}
+      else
+	{
+	  log_print_str ("Incorrect answer from \"");
+	  log_print_str (data.metaserver);
+	  log_println_str ("\"!");
+	}
+    }
+  else
+    {
+      log_println_str (buffer_content);
+    }
+
+  if (data.log)
+    {
+      if (ok)
+	{
+	  log_print_str ("Successfully registered on \"");
+	  log_print_str (data.metaserver);
+	  log_println_str ("\"");
+	  log_flush ();
+	}
+      else
+	{
+	  log_print_str ("Unable to register on \"");
+	  log_print_str (data.metaserver);
+	  log_println_str ("\"");
+	  log_flush ();
+	}
+    }
+}

Added: unstable/liquidwar/branches/upstream/current/src/wwwsrv.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/src/wwwsrv.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/src/wwwsrv.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,89 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* name          : wwwsrv.h                                         */
+/* content       : server code used to contact www.ufoot.org        */
+/********************************************************************/
+
+#ifndef LIQUID_WAR_INCLUDE_WWWSRV
+#define LIQUID_WAR_INCLUDE_WWWSRV
+
+/*==================================================================*/
+/* includes                                                         */
+/*==================================================================*/
+
+#include "base.h"
+
+/*==================================================================*/
+/* structs                                                          */
+/*==================================================================*/
+
+typedef struct
+{
+  int privacy;
+  int log;
+  char metaserver[URL_SIZE + 1];
+  int port;
+  int busy_players;
+  int max_players;
+  char password[PASSWORD_SIZE + 1];
+  char comment[COMMENT_SIZE + 1];
+}
+LW_WWWSRV_DATA;
+
+/*==================================================================*/
+/* fonctions globales                                               */
+/*==================================================================*/
+
+void lw_wwwsrv_init (LW_WWWSRV_DATA * data,
+		     int privacy,
+		     int log,
+		     char *metaserver,
+		     int port,
+		     int busy_players,
+		     int max_players, char *password, char *comment);
+int lw_wwwsrv_register (LW_WWWSRV_DATA * data);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/test.sh
===================================================================
--- unstable/liquidwar/branches/upstream/current/test.sh	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/test.sh	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,11 @@
+#!/bin/sh
+#
+# Script which launches Liquid War using files in the source/build tree
+# instead of system wide files, very convenient for testing.
+
+./src/liquidwar \
+	-dat ./data/liquidwar.dat \
+	-map ./custom/map \
+	-tex ./custom/texture \
+	-mid ./custom/music
+


Property changes on: unstable/liquidwar/branches/upstream/current/test.sh
___________________________________________________________________
Name: svn:executable
   + 

Added: unstable/liquidwar/branches/upstream/current/utils/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,4 @@
+Makefile
+liquidwarcol
+liquidwarmap
+liquidwartex

Added: unstable/liquidwar/branches/upstream/current/utils/Makefile.in
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/Makefile.in	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/Makefile.in	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,55 @@
+
+SNPRINTF = 	@SNPRINTF@
+ALCFLAGS = 	@ALCFLAGS@
+ALLIBS = 	@ALLIBS@
+
+ifeq ($(SNPRINTF),yes)
+	SNPRINTF_FILES =
+	SNPRINTF_OPTIONS =
+else
+	SNPRINTF_FILES = snprintf/snprintf.o
+	SNPRINTF_OPTIONS = -DSNPRINTF
+endif
+
+EXE_FILES = liquidwarcol liquidwarmap liquidwartex
+
+OBJ_NAMES = liquidwarcol liquidwarmap liquidwartex
+OBJ_FILES = $(addsuffix .o, $(OBJ_NAMES))
+
+CMD_CC = $(CC) $(CFLAGS) $(ALCFLAGS) -c -Wall -W $(SNPRINTF_OPTIONS) 
+
+all: $(EXE_FILES) $(OBJ_FILES)
+
+install:
+
+config: print_cmd_cc
+
+check:
+
+dep:
+
+clean: 
+	@rm -f *.o
+	@rm -f */*.o
+	@rm -f $(OBJ_FILES)
+	@rm -f $(EXE_FILES)
+
+distclean:
+	@rm -f snprintf/test
+	@rm -f lwmapgen/lwmapgen
+	@rm -f lwmapgen/liquidwar-mapgen
+	@rm -f Makefile
+
+liquidwar%: liquidwar%.o $(SNPRINTF_FILES)
+	@echo "Building $@"
+	@$(CC) $(LDFLAGS) -o $@ $< $(SNPRINTF_FILES) $(ALLIBS)
+
+%.o: %.c
+	@echo "Compiling" $<
+	@$(CMD_CC) $< -o $@
+
+print_cmd_cc:
+	@echo "The command line to compile .c files in this directory is:"
+	@echo $(CMD_CC)
+
+

Added: unstable/liquidwar/branches/upstream/current/utils/liquidwarcol.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/liquidwarcol.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/liquidwarcol.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,456 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : liquidwarcol.c                                   */
+/* contenu       : tools to convert files to 8 bits palettes        */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*=================================================================*/
+/* defines                                                         */
+/*=================================================================*/
+
+#define ALLEGRO_USE_CONSOLE
+
+/*=================================================================*/
+/* includes                                                        */
+/*=================================================================*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <allegro.h>
+
+/*=================================================================*/
+/* constants                                                       */
+/*=================================================================*/
+
+#define LW_TEXTURE_RANDOM_MAX_RETRIES 10000
+
+/*=================================================================*/
+/* variables globales                                              */
+/*=================================================================*/
+
+int ARGC;
+char **ARGV;
+int FLAG_BACKUP = 0;
+int FLAG_HELP = 0;
+int FLAG_SILENT = 0;
+int FIRST_COLOR;
+int NUMBER_OF_COLORS;
+char *FILENAMES[65536];
+int NUMBER_OF_FILES = 0;
+PALETTE PALETTE_SRC;
+PALETTE PALETTE_DST;
+BITMAP *BITMAP_SRC = NULL;
+BITMAP *BITMAP_DST = NULL;
+
+/*=================================================================*/
+/* fonctions                                                       */
+/*=================================================================*/
+
+/*-----------------------------------------------------------------*/
+/* affichages d'aide                                               */
+/*-----------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------*/
+void
+display_common_help (void)
+{
+  printf ("liquidwarcol by U-Foot (ufoot at ufoot.org).\n");
+  printf ("This is a 'palette reducer' for 256 colors bitmaps.\n");
+  printf ("It is free software, protected by the GPL.\n");
+  printf ("It uses Allegro by Shawn Hargreaves.\n");
+  printf ("\n");
+}
+
+/*-----------------------------------------------------------------*/
+void
+display_short_help (void)
+{
+  display_common_help ();
+  printf ("Type \"liquidwarcol -?\" for more help.\n");
+}
+
+/*-----------------------------------------------------------------*/
+void
+display_long_help (void)
+{
+  display_common_help ();
+  printf ("Syntax:\n");
+  printf ("liquidwarcol [options] first_color number_of_colors filenames\n");
+  printf ("\n");
+  printf ("Options:\n");
+  printf ("-? -h -H : displays this help.\n");
+  printf ("-s -S :    silent mode, nothing written to the console.\n");
+  printf ("\n");
+  printf ("Warning: the source file will be replaced!\n");
+}
+
+/*-----------------------------------------------------------------*/
+/* lecture des parametres de la ligne de commande                  */
+/*-----------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------*/
+int
+acknowledge_flag (char *str)
+{
+  int found = 0;
+
+  if (str[0] == '-' || str[0] == '/')
+    {
+      found = 1;
+      switch (str[1])
+	{
+	case '?':
+	case 'h':
+	case 'H':
+	  FLAG_HELP = 1;
+	  break;
+	case 'b':
+	case 'B':
+	  FLAG_BACKUP = 1;
+	  break;
+	case 's':
+	case 'S':
+	  FLAG_SILENT = 1;
+	  break;
+	default:
+	  found = 0;
+	}
+    }
+  return found;
+}
+
+/*-----------------------------------------------------------------*/
+int
+read_command_line (void)
+{
+  int i, j = 0, success = 1;
+
+  for (i = 1; i < ARGC; ++i)
+    {
+      if ((!acknowledge_flag (ARGV[i])))
+	{
+	  if (j == 0)
+	    FIRST_COLOR = atoi (ARGV[i]);
+	  if (j == 1)
+	    NUMBER_OF_COLORS = atoi (ARGV[i]);
+	  if (j >= 2)
+	    FILENAMES[j - 2] = ARGV[i];
+	  j++;
+	}
+    }
+  NUMBER_OF_FILES = j - 2;
+  if (NUMBER_OF_FILES > 0)
+    {
+      if (FIRST_COLOR < 0)
+	{
+	  success = 0;
+	  printf ("ERROR! First color number must be >= 0.\n");
+	}
+      if (FIRST_COLOR > 255)
+	{
+	  success = 0;
+	  printf ("ERROR! First color number must be < 255.\n");
+	}
+      if (NUMBER_OF_COLORS < 1)
+	{
+	  success = 0;
+	  printf ("ERROR! Number of colors must be > 1.\n");
+	}
+      if (NUMBER_OF_COLORS + FIRST_COLOR > 256)
+	{
+	  success = 0;
+	  printf ("ERROR! Last color number must be < 256.\n");
+	}
+    }
+  else
+    {
+      success = 0;
+      if (!FLAG_HELP)
+	printf ("ERROR! Two few arguments.\n");
+    }
+  return success;
+}
+
+/*-----------------------------------------------------------------*/
+/* acces disque                                                    */
+/*-----------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------*/
+int
+load_file (char *filename)
+{
+  int success;
+
+  if (!FLAG_SILENT)
+    printf ("Loading '%s'.\n", filename);
+
+  if (BITMAP_SRC != NULL)
+    destroy_bitmap (BITMAP_SRC);
+  BITMAP_SRC = load_bitmap (filename, PALETTE_SRC);
+  success = BITMAP_SRC != NULL;
+  if (!success)
+    printf ("ERROR! Unable to read '%s'.\n", filename);
+  return success;
+}
+
+/*-----------------------------------------------------------------*/
+void
+save_backup (char *filename)
+{
+  char *bak_name = "faut encore le programmer";
+
+  if (!FLAG_SILENT)
+    printf ("Saving a copy of '%s' as '%s'.\n", filename, bak_name);
+}
+
+/*-----------------------------------------------------------------*/
+void
+save_file (char *filename)
+{
+  if (!FLAG_SILENT)
+    printf ("Replacing '%s'.\n", filename);
+  if (save_bitmap (filename, BITMAP_DST, PALETTE_DST))
+    printf ("ERROR! Unable to save '%s'.\n", filename);
+}
+
+/*-----------------------------------------------------------------*/
+/* operations de conversion                                        */
+/*-----------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------*/
+int
+find_color (PALETTE pal, RGB rgb)
+{
+  int i, found = -1;
+
+  for (i = 0; i < 256 && found < 0; ++i)
+    if (pal[i].r == rgb.r && pal[i].g == rgb.g && pal[i].b == rgb.b)
+      found = i;
+
+  return found;
+}
+
+/*-----------------------------------------------------------------*/
+int
+exist_color (PALETTE pal, RGB rgb)
+{
+  return (find_color (pal, rgb) >= 0);
+}
+
+/*-----------------------------------------------------------------*/
+void
+recalculate_number_of_colors ()
+{
+  int i, x, y, n = 1;
+  RGB color;
+  PALETTE pal;
+
+  //nb_of_colors=NUMBER_OF_COLORS;
+  color = PALETTE_SRC[getpixel (BITMAP_SRC, 0, 0)];
+
+  for (i = 0; i < 256; ++i)
+    pal[i] = color;
+
+  for (y = 0; y < BITMAP_SRC->h && n < NUMBER_OF_COLORS; ++y)
+    for (x = 0; x < BITMAP_SRC->w && n < NUMBER_OF_COLORS; ++x)
+      {
+	color = PALETTE_SRC[getpixel (BITMAP_SRC, x, y)];
+	if (!exist_color (pal, color))
+	  pal[n++] = color;
+      }
+  NUMBER_OF_COLORS = n;
+}
+
+/*-----------------------------------------------------------------*/
+void
+create_new_palette (void)
+{
+  int i, x, y, index;
+  int nb_retries = 0;
+  RGB color;
+
+  x = random () % BITMAP_SRC->w;
+  y = random () % BITMAP_SRC->h;
+  color = PALETTE_SRC[getpixel (BITMAP_SRC, x, y)];
+
+  for (i = 0; i < 256; ++i)
+    PALETTE_DST[i] = color;
+
+  for (i = 1; i < NUMBER_OF_COLORS;)
+    {
+      x = random () % BITMAP_SRC->w;
+      y = random () % BITMAP_SRC->h;
+      index = getpixel (BITMAP_SRC, x, y);
+      color = PALETTE_SRC[index];
+      if ((!exist_color (PALETTE_DST, color)) ||
+	  (nb_retries > LW_TEXTURE_RANDOM_MAX_RETRIES))
+	{
+	  PALETTE_DST[FIRST_COLOR + (i++)] = color;
+	  nb_retries = 0;
+	}
+      else
+	{
+	  nb_retries++;
+	}
+    }
+}
+
+/*-----------------------------------------------------------------*/
+void
+correct_palette (void)
+{
+  int i;
+
+  for (i = 0; i < FIRST_COLOR; ++i)
+    {
+      PALETTE_DST[i].r = 0;
+      PALETTE_DST[i].g = 0;
+      PALETTE_DST[i].b = 0;
+    }
+  for (i = FIRST_COLOR + NUMBER_OF_COLORS; i < 256; ++i)
+    {
+      PALETTE_DST[i].r = 63;
+      PALETTE_DST[i].g = 63;
+      PALETTE_DST[i].b = 63;
+    }
+}
+
+/*-----------------------------------------------------------------*/
+void
+create_converted_bitmap (void)
+{
+  char corres[256];
+  int i, x, y, index;
+
+  for (i = 0; i < 256; ++i)
+    corres[i] = bestfit_color (PALETTE_DST,
+			       PALETTE_SRC[i].r,
+			       PALETTE_SRC[i].g, PALETTE_SRC[i].b);
+  BITMAP_DST = create_bitmap (BITMAP_SRC->w, BITMAP_SRC->h);
+  for (y = 0; y < BITMAP_SRC->h; ++y)
+    for (x = 0; x < BITMAP_SRC->w; ++x)
+      {
+	index = corres[getpixel (BITMAP_SRC, x, y)];
+	index = (index < FIRST_COLOR ||
+		 index >= FIRST_COLOR + NUMBER_OF_COLORS) ?
+	  FIRST_COLOR : index;
+	putpixel (BITMAP_DST, x, y, index);
+      }
+}
+
+/*-----------------------------------------------------------------*/
+void
+convert_bitmap ()
+{
+  if (BITMAP_DST != NULL)
+    destroy_bitmap (BITMAP_DST);
+
+  recalculate_number_of_colors ();
+  create_new_palette ();
+  create_converted_bitmap ();
+  correct_palette ();
+}
+
+/*=================================================================*/
+/* fonctions main                                                  */
+/*=================================================================*/
+
+/*-----------------------------------------------------------------*/
+int
+main (int argc, char **argv)
+{
+  int i;
+
+  ARGC = argc;
+  ARGV = argv;
+
+#ifdef ALLEGRO_UNIX
+  install_allegro (SYSTEM_NONE, &errno, atexit);
+#else
+  allegro_init ();
+#endif
+
+  set_color_depth (8);
+  set_color_conversion (COLORCONV_REDUCE_TO_256);
+
+  srandom (time (NULL));
+  // srandom(1);
+
+  if (read_command_line ())
+    {
+      for (i = 0; i < NUMBER_OF_FILES; ++i)
+	{
+	  if (load_file (FILENAMES[i]))
+	    {
+	      if (FLAG_BACKUP)
+		save_backup (FILENAMES[i]);
+	      convert_bitmap (FILENAMES[i]);
+	      save_file (FILENAMES[i]);
+	    }
+	}
+    }
+  else
+    {
+      if (FLAG_HELP)
+	display_long_help ();
+      else
+	display_short_help ();
+    }
+  allegro_exit ();
+
+  return 0;
+
+}
+
+#ifdef ALLEGRO_WINDOWS
+END_OF_MAIN ()
+#endif
+#ifdef ALLEGRO_UNIX
+  END_OF_MAIN ();
+#endif

Added: unstable/liquidwar/branches/upstream/current/utils/liquidwarmap.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/liquidwarmap.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/liquidwarmap.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,581 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : liquidwarmap.c                                   */
+/* contenu       : tools to generate tabs                           */
+/* date de modif : 3 mai 98                                         */
+/********************************************************************/
+
+/*=================================================================*/
+/* defines                                                         */
+/*=================================================================*/
+
+#define ALLEGRO_USE_CONSOLE
+
+/*=================================================================*/
+/* includes                                                        */
+/*=================================================================*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include <time.h>
+#include <allegro.h>
+#include <sys/stat.h>
+
+/*=================================================================*/
+/* contantes                                                       */
+/*=================================================================*/
+
+#define LIGHT_OR_DARK_TRESHOLD 315
+#define CONSIDERED_AS_DARK 0
+#define CONSIDERED_AS_LIGHT 2
+#define PLAYABLE_AREA 1
+#define MINI_SIDE_SIZE 4
+#define MINI_PLAYABLE_AREA 1024
+
+/*=================================================================*/
+/* variables globales                                              */
+/*=================================================================*/
+
+int ARGC;
+char **ARGV;
+int FLAG_HELP = 0;
+int FLAG_SILENT = 0;
+char *FILENAMES[65536];
+int NUMBER_OF_FILES = 0;
+PALETTE PALETTE_SRC;
+BITMAP *BITMAP_SRC = NULL;
+BITMAP *BITMAP_DST = NULL;
+signed char BUFFER[1048576];
+int DST_X, DST_Y, DST_W, DST_H, DST_SIZE, BG_SIZE;
+char SYSTEM_NAME[16];
+char READABLE_NAME[32];
+
+/*=================================================================*/
+/* fonctions                                                       */
+/*=================================================================*/
+
+/*-----------------------------------------------------------------*/
+/* affichages d'aide                                               */
+/*-----------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------*/
+void
+display_common_help (void)
+{
+  printf ("liquidwarmap by U-Foot (ufoot at ufoot.org).\n");
+  printf ("This program creates maps for Liquid War.\n");
+  printf ("It is free software, protected by the GPL.\n");
+  printf ("It uses Allegro by Shawn Hargreaves.\n");
+  printf ("\n");
+}
+
+/*-----------------------------------------------------------------*/
+void
+display_short_help (void)
+{
+  display_common_help ();
+  printf ("Type \"liquidwarmap -?\" for more help.\n");
+}
+
+/*-----------------------------------------------------------------*/
+void
+display_long_help (void)
+{
+  display_common_help ();
+  printf ("The source must be a 256 color bitmap.\n");
+  printf ("Walls must be in the same color - same index in fact.\n");
+  printf ("The wall index color is given by the top left pixel,\n");
+  printf ("and the map must be contained in a closed rectangle.\n");
+  printf ("\n");
+  printf ("Syntax:\n");
+  printf ("liquidwarmap [options] filenames\n");
+  printf ("\n");
+  printf ("Options:\n");
+  printf ("-? -h -H : displays this help.\n");
+  printf ("-s -S :    silent mode, nothing written to the console.\n");
+  printf ("\n");
+  printf ("Remark: the created map will have a .map extension.\n");
+  printf ("Warning: the source file will be replaced by a smaller file.\n");
+}
+
+/*-----------------------------------------------------------------*/
+/* lecture des parametres de la ligne de commande                  */
+/*-----------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------*/
+int
+acknowledge_flag (char *str)
+{
+  int found = 0;
+
+  if (str[0] == '-' || str[0] == '/')
+    {
+      found = 1;
+      switch (str[1])
+	{
+	case '?':
+	case 'h':
+	case 'H':
+	  FLAG_HELP = 1;
+	  break;
+	case 's':
+	case 'S':
+	  FLAG_SILENT = 1;
+	  break;
+	default:
+	  found = 0;
+	}
+    }
+  return found;
+}
+
+/*-----------------------------------------------------------------*/
+int
+read_command_line (void)
+{
+  int i, j = 0, success = 1;
+
+  for (i = 1; i < ARGC; ++i)
+    {
+      if ((!acknowledge_flag (ARGV[i])))
+	{
+	  FILENAMES[j] = ARGV[i];
+	  j++;
+	}
+    }
+  NUMBER_OF_FILES = j;
+  if (NUMBER_OF_FILES <= 0)
+    {
+      success = 0;
+      if (!FLAG_HELP)
+	printf ("ERROR! Two few arguments.\n");
+    }
+  return success;
+}
+
+/*-----------------------------------------------------------------*/
+/* acces disque                                                    */
+/*-----------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------*/
+int
+load_file (char *filename)
+{
+  int success;
+
+  if (!FLAG_SILENT)
+    printf ("Loading '%s'.\n", filename);
+
+  if (BITMAP_SRC != NULL)
+    destroy_bitmap (BITMAP_SRC);
+  BITMAP_SRC = load_bitmap (filename, PALETTE_SRC);
+  success = BITMAP_SRC != NULL;
+  if (!success)
+    printf ("ERROR! Unable to read '%s'.\n", filename);
+  return success;
+}
+
+/*-----------------------------------------------------------------*/
+/* lecture des parametres du tableau                               */
+/*-----------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+static void
+sort_light_and_dark (BITMAP * bmp, PALETTE pal)
+{
+  char table[256];
+  int i, x, y;
+
+  for (i = 0; i < 256; ++i)
+    {
+      if (6 * pal[i].r + 3 * pal[i].g + pal[i].b > LIGHT_OR_DARK_TRESHOLD)
+	table[i] = CONSIDERED_AS_LIGHT;
+      else
+	table[i] = CONSIDERED_AS_DARK;
+    }
+
+  for (y = 0; y < bmp->h; ++y)
+    for (x = 0; x < bmp->w; ++x)
+      putpixel (bmp, x, y, table[getpixel (bmp, x, y)]);
+}
+
+/*-----------------------------------------------------------------*/
+void
+get_range (void)
+{
+  /*
+     useless and buggy code from an old time, when maps where
+     systematically drawn on 320x200 bitmaps and "getting the
+     useable part had a sense". Not any more. Now it only
+     wrecks some maps. Definitely useless.
+
+     int min_x = BITMAP_SRC->w;
+     int min_y = BITMAP_SRC->h;
+     int max_x = -1;
+     int max_y = -1;
+     int x, y;
+
+     for (y = 0; y < BITMAP_SRC->h; ++y)
+     for (x = 0; x < BITMAP_SRC->w; ++x)
+     if (!getpixel (BITMAP_SRC, x, y))
+     {
+     if (min_x > x)
+     min_x = x;
+     if (min_y > y)
+     min_y = y;
+     if (max_x < x)
+     max_x = x;
+     if (max_y < y)
+     max_y = y;
+     }
+
+     DST_X = min_x;
+     DST_Y = min_y;
+     DST_W = max_x - min_x + 1;
+     DST_H = max_y - min_y + 1;
+   */
+
+  DST_X = 0;
+  DST_Y = 0;
+  DST_W = BITMAP_SRC->w;
+  DST_H = BITMAP_SRC->h;
+
+  if (DST_W < 1 || DST_H < 1)
+    {
+      printf ("ERROR! Map is too small.\n");
+      DST_W = DST_H = 1;
+    }
+  if (BITMAP_DST != NULL)
+    destroy_bitmap (BITMAP_DST);
+  BITMAP_DST = create_bitmap (DST_W, DST_H);
+  blit (BITMAP_SRC, BITMAP_DST, DST_X, DST_Y, 0, 0, DST_W, DST_H);
+}
+
+/*-----------------------------------------------------------------*/
+/* conversion dans le buffer                                       */
+/*-----------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------*/
+void
+convert_to_buffer (void)
+{
+  int pos_src, pos_dst, l, wh;
+  char *data;
+  int wall_color;
+
+  wh = BITMAP_DST->h * BITMAP_DST->w;
+  data = BITMAP_DST->dat;
+  pos_src = pos_dst = 0;
+  BG_SIZE = 0;
+
+  if (wh > 0)
+    {
+      wall_color = CONSIDERED_AS_DARK;
+      while (pos_src < wh)
+	{
+	  l = 0;
+	  if (data[pos_src] == wall_color)
+	    {
+	      while (pos_src < wh && (data[pos_src] == wall_color) && l < 127)
+		{
+		  l++;
+		  pos_src++;
+		}
+	      BUFFER[pos_dst++] = l;
+	    }
+	  else
+	    {
+	      while (pos_src < wh && data[pos_src] != wall_color && l < 127)
+		{
+		  l++;
+		  pos_src++;
+		}
+	      BUFFER[pos_dst++] = -l;
+	      BG_SIZE += l;
+	    }
+	}
+    }
+  BUFFER[pos_dst++] = 0;
+
+  DST_SIZE = pos_dst;
+}
+
+/*-----------------------------------------------------------------*/
+void
+change_ext_to_txt (char *str)
+{
+  char *ext;
+
+  ext = strchr (str, '.');
+  ext[1] = 't';
+  ext[2] = 'x';
+  ext[3] = 't';
+}
+
+/*-----------------------------------------------------------------*/
+void
+update_system_name (char *str)
+{
+  char *search;
+
+  memset (SYSTEM_NAME, 0, sizeof (SYSTEM_NAME));
+
+  /*
+   * No extension we just use the file name
+   */
+  strncpy (SYSTEM_NAME, str, sizeof (SYSTEM_NAME));
+  search = strchr (SYSTEM_NAME, '.');
+  if (search)
+    {
+      (*search) = '\0';
+    }
+}
+
+/*-----------------------------------------------------------------*/
+void
+update_readable_name (char *str)
+{
+  FILE *f;
+  char *search;
+
+  memset (READABLE_NAME, 0, sizeof (READABLE_NAME));
+
+  f = fopen (str, "r");
+  if (f != NULL)
+    {
+      /*
+       * If there's a corresponding .txt file, we open it and interpret
+       * it as the name of the map
+       */
+      fread (READABLE_NAME, sizeof (READABLE_NAME), 1, f);
+      fclose (f);
+      /*
+       * Now we get rid of all the lines following the first one
+       */
+      search = strchr (READABLE_NAME, 10);
+      if (search)
+	{
+	  (*search) = 0;
+	}
+      search = strchr (READABLE_NAME, 13);
+      if (search)
+	{
+	  (*search) = 0;
+	}
+    }
+  else
+    {
+      /*
+       * No .txt file we just use the file name
+       */
+      strncpy (READABLE_NAME, str, sizeof (READABLE_NAME));
+      search = strchr (READABLE_NAME, '.');
+      if (search)
+	{
+	  (*search) = '\0';
+	}
+    }
+}
+
+/*-----------------------------------------------------------------*/
+/* on ecrit sur le disque                                          */
+/*-----------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------*/
+void
+change_ext_to_map (char *str)
+{
+  char *ext;
+
+  ext = strchr (str, '.');
+  ext[1] = 'm';
+  ext[2] = 'a';
+  ext[3] = 'p';
+}
+
+/*-----------------------------------------------------------------*/
+void
+write_to_disk (char *str)
+{
+  FILE *f;
+  short w, h;
+  int size;
+  unsigned char header[8];
+
+  if (!FLAG_SILENT)
+    printf ("Writing %s to disk.\n", str);
+  delete_file (str);
+  f = fopen (str, "w");
+  if (f != NULL)
+    {
+      w = DST_W;
+      h = DST_H;
+      size = DST_SIZE;
+
+      /*
+       * Previous versions of LW used to store the size of
+       * the background here, to sort map afterwards. Now
+       * we store the size of the map.
+       */
+
+      /*
+       * Here's an ugly serialization of ints and shorts.
+       * Usefull to make the game work on Mac OS X and possible
+       * any platform that does not have PC-like endianess
+       */
+
+      header[0] = 0xFF & size;
+      header[1] = 0xFF & size >> 8;
+      header[2] = 0xFF & size >> 16;
+      header[3] = size >> 24;
+      header[4] = 0xFF & w;
+      header[5] = w >> 8;
+      header[6] = 0xFF & h;
+      header[7] = h >> 8;
+
+      /*
+         Uncomment this to invert endianess of map header.
+         Used only for testing, do not uncomment it even
+         when compiling on Mac, it would make the game
+         unusable in network mode...
+       */
+      /*
+         header[3] = 0xFF & size;
+         header[2] = 0xFF & size>>8;
+         header[1] = 0xFF & size>>16;
+         header[0] = size>>24;
+         header[5] = 0xFF & w;
+         header[4] = w>>8;
+         header[7] = 0xFF & h;
+         header[6] = h>>8;
+       */
+
+      fwrite (&(header[0]), 8, 1, f);
+      fwrite (SYSTEM_NAME, sizeof (SYSTEM_NAME), 1, f);
+      fwrite (READABLE_NAME, sizeof (READABLE_NAME), 1, f);
+      fwrite (BUFFER, size, 1, f);
+      fclose (f);
+    }
+  else
+    {
+      printf ("Unable to write %s.\n", str);
+    }
+}
+
+/*-----------------------------------------------------------------*/
+void
+write_with_new_size (char *str)
+{
+  if (!FLAG_SILENT)
+    printf ("Writing %s to disk.\n", str);
+  delete_file (str);
+
+  save_bitmap (str, BITMAP_DST, PALETTE_SRC);
+}
+
+/*=================================================================*/
+/* fonctions main                                                  */
+/*=================================================================*/
+
+/*-----------------------------------------------------------------*/
+int
+main (int argc, char **argv)
+{
+  int i;
+
+  ARGC = argc;
+  ARGV = argv;
+
+#ifdef ALLEGRO_UNIX
+  install_allegro (SYSTEM_NONE, &errno, atexit);
+#else
+  allegro_init ();
+#endif
+
+  set_color_depth (8);
+  set_color_conversion (COLORCONV_REDUCE_TO_256);
+
+  if (read_command_line ())
+    {
+      for (i = 0; i < NUMBER_OF_FILES; ++i)
+	{
+	  if (load_file (FILENAMES[i]))
+	    {
+	      sort_light_and_dark (BITMAP_SRC, PALETTE_SRC);
+	      get_range ();
+	      if (BITMAP_SRC->w != BITMAP_DST->w
+		  || BITMAP_SRC->h != BITMAP_DST->h)
+		write_with_new_size (FILENAMES[i]);
+	      convert_to_buffer ();
+	      change_ext_to_txt (FILENAMES[i]);
+	      update_system_name (FILENAMES[i]);
+	      update_readable_name (FILENAMES[i]);
+	      change_ext_to_map (FILENAMES[i]);
+	      write_to_disk (FILENAMES[i]);
+	    }
+	}
+    }
+  else
+    {
+      if (FLAG_HELP)
+	display_long_help ();
+      else
+	display_short_help ();
+    }
+  allegro_exit ();
+
+  return 0;
+
+}
+
+#ifdef ALLEGRO_WINDOWS
+END_OF_MAIN ()
+#endif
+#ifdef ALLEGRO_UNIX
+  END_OF_MAIN ();
+#endif

Added: unstable/liquidwar/branches/upstream/current/utils/liquidwartex.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/liquidwartex.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/liquidwartex.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,452 @@
+/********************************************************************/
+/*                                                                  */
+/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
+/*            L   I Q  Q U U I D D   W   W A A R R   5              */
+/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
+/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
+/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
+/*                                                                  */
+/*                             b                                    */
+/*                             bb  y y                              */
+/*                             b b yyy                              */
+/*                             bb    y                              */
+/*                                 yy                               */
+/*                                                                  */
+/*                     U U       FFF  O   O  TTT                    */
+/*                     U U       F   O O O O  T                     */
+/*                     U U TIRET FF  O O O O  T                     */
+/*                     U U       F   O O O O  T                     */
+/*                      U        F    O   O   T                     */
+/*                                                                  */
+/********************************************************************/
+
+/*****************************************************************************/
+/* Liquid War is a multiplayer wargame                                       */
+/* Copyright (C) 1998-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Liquid War homepage : http://www.ufoot.org/liquidwar                      */
+/* Contact author      : ufoot at ufoot.org                                     */
+/*****************************************************************************/
+
+/********************************************************************/
+/* nom           : liquidwartex.c                                   */
+/* contenu       : tool to generate textures                        */
+/* date de modif : March 2000                                       */
+/********************************************************************/
+
+/*=================================================================*/
+/* defines                                                         */
+/*=================================================================*/
+
+#define ALLEGRO_USE_CONSOLE
+
+/*=================================================================*/
+/* includes                                                        */
+/*=================================================================*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include <time.h>
+#include <allegro.h>
+#include <sys/stat.h>
+
+/*=================================================================*/
+/* variables globales                                              */
+/*=================================================================*/
+
+int ARGC;
+char **ARGV;
+int FLAG_HELP = 0;
+int FLAG_SILENT = 0;
+char *FILENAMES[65536];
+int NUMBER_OF_FILES = 0;
+PALETTE PALETTE_SRC;
+BITMAP *BITMAP_SRC = NULL;
+int DST_X, DST_Y, DST_W, DST_H, DST_SIZE;
+int FIRST_COLOR = 32;
+int COLOR_NUMBER = 32;
+char BUFFER[1048576];
+char SYSTEM_NAME[16];
+
+
+/*=================================================================*/
+/* fonctions                                                       */
+/*=================================================================*/
+
+/*-----------------------------------------------------------------*/
+/* affichages d'aide                                               */
+/*-----------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------*/
+void
+display_common_help (void)
+{
+  printf ("liquidwartex by U-Foot (ufoot at ufoot.org).\n");
+  printf ("This program creates textures for Liquid War.\n");
+  printf ("It is free software, protected by the GPL.\n");
+  printf ("It uses Allegro by Shawn Hargreaves.\n");
+  printf ("\n");
+}
+
+/*-----------------------------------------------------------------*/
+void
+display_short_help (void)
+{
+  display_common_help ();
+  printf ("Type \"liquidwartex -?\" for more help.\n");
+}
+
+/*-----------------------------------------------------------------*/
+void
+display_long_help (void)
+{
+  display_common_help ();
+  printf
+    ("The source must be a 256 color bitmap using color from first_color to first_color+number_of_colors-1.\n");
+  printf ("\n");
+  printf ("Syntax:\n");
+  printf ("liquidwartex [options] first_color number_of_colors filenames\n");
+  printf ("\n");
+  printf ("Options:\n");
+  printf ("-? -h -H : displays this help.\n");
+  printf ("-s -S :    silent mode, nothing written to the console.\n");
+  printf ("\n");
+  printf ("Remark: the created texture will have a .tex extension.\n");
+}
+
+/*-----------------------------------------------------------------*/
+/* lecture des parametres de la ligne de commande                  */
+/*-----------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------*/
+int
+acknowledge_flag (char *str)
+{
+  int found = 0;
+
+  if (str[0] == '-' || str[0] == '/')
+    {
+      found = 1;
+      switch (str[1])
+	{
+	case '?':
+	case 'h':
+	case 'H':
+	  FLAG_HELP = 1;
+	  break;
+	case 's':
+	case 'S':
+	  FLAG_SILENT = 1;
+	  break;
+	default:
+	  found = 0;
+	}
+    }
+  return found;
+}
+
+/*-----------------------------------------------------------------*/
+int
+read_command_line (void)
+{
+  int i, j = 0, success = 1;
+
+  if (ARGC <= 2)
+    {
+      success = 0;
+      if (!FLAG_HELP)
+	printf ("ERROR! Too few arguments.\n");
+    }
+  else
+    {
+      for (i = 1; i < ARGC; ++i)
+	{
+	  if ((!acknowledge_flag (ARGV[i])))
+	    {
+	      if (j == 0)
+		FIRST_COLOR = atoi (ARGV[i]);
+	      if (j == 1)
+		COLOR_NUMBER = atoi (ARGV[i]);
+	      if (j >= 2)
+		FILENAMES[j - 2] = ARGV[i];
+	      j++;
+	    }
+	}
+      if (COLOR_NUMBER < 8 || COLOR_NUMBER > 32)
+	{
+	  /*
+	   * COLOR_NUMBER must be <=32 for weird implementation
+	   * reasons. There's no easy way to change this easily.
+	   */
+	  success = 0;
+	  if (!FLAG_HELP)
+	    printf ("ERROR! Color number must be between 8 and 32");
+	}
+      else
+	{
+	  NUMBER_OF_FILES = j - 2;
+	  if (NUMBER_OF_FILES <= 0)
+	    {
+	      success = 0;
+	      if (!FLAG_HELP)
+		printf ("ERROR! Too few arguments.\n");
+	    }
+	}
+    }
+  return success;
+}
+
+/*-----------------------------------------------------------------*/
+/* acces disque                                                    */
+/*-----------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------*/
+int
+load_file (char *filename)
+{
+  int success;
+
+  if (!FLAG_SILENT)
+    printf ("Loading '%s'.\n", filename);
+
+  if (BITMAP_SRC != NULL)
+    destroy_bitmap (BITMAP_SRC);
+  BITMAP_SRC = load_bitmap (filename, PALETTE_SRC);
+  success = BITMAP_SRC != NULL;
+  if (!success)
+    printf ("ERROR! Unable to read '%s'.\n", filename);
+  return success;
+}
+
+/*-----------------------------------------------------------------*/
+/* lecture des parametres du tableau                               */
+/*-----------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------*/
+void
+get_range (void)
+{
+  int min_x = BITMAP_SRC->w;
+  int min_y = BITMAP_SRC->h;
+  int max_x = -1;
+  int max_y = -1;
+  int x, y;
+
+  for (y = 0; y < BITMAP_SRC->h; ++y)
+    for (x = 0; x < BITMAP_SRC->w; ++x)
+      if (getpixel (BITMAP_SRC, x, y) >= FIRST_COLOR ||
+	  getpixel (BITMAP_SRC, x, y) < FIRST_COLOR + COLOR_NUMBER)
+	{
+	  if (min_x > x)
+	    min_x = x;
+	  if (min_y > y)
+	    min_y = y;
+	  if (max_x < x)
+	    max_x = x;
+	  if (max_y < y)
+	    max_y = y;
+	}
+  DST_X = min_x;
+  DST_Y = min_y;
+  DST_W = max_x - min_x + 1;
+  DST_H = max_y - min_y + 1;
+
+  if (DST_W < 1 || DST_H < 1)
+    {
+      printf ("ERROR! Texture is too small.\n");
+      DST_W = DST_H = 1;
+    }
+  DST_SIZE = 3 * COLOR_NUMBER + ((DST_W * DST_H + 7) / 8) * 5;
+}
+
+/*-----------------------------------------------------------------*/
+void
+update_system_name (char *str)
+{
+  char *search;
+
+  memset (SYSTEM_NAME, 0, sizeof (SYSTEM_NAME));
+
+  /*
+   * No extension we just use the file name
+   */
+  strncpy (SYSTEM_NAME, str, sizeof (SYSTEM_NAME));
+  search = strchr (SYSTEM_NAME, '.');
+  if (search)
+    {
+      (*search) = '\0';
+    }
+}
+
+/*-----------------------------------------------------------------*/
+/* conversion dans le buffer                                       */
+/*-----------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------*/
+void
+convert_to_buffer (void)
+{
+  int pos = 0, pos8 = 0, x, y, i;
+  char octet[5], toadd;
+  int coul;
+
+  for (i = 0; i < COLOR_NUMBER; ++i)
+    {
+      BUFFER[pos++] = PALETTE_SRC[FIRST_COLOR + i].r;
+      BUFFER[pos++] = PALETTE_SRC[FIRST_COLOR + i].g;
+      BUFFER[pos++] = PALETTE_SRC[FIRST_COLOR + i].b;
+    }
+
+  for (i = 0; i < 5; ++i)
+    octet[i] = 0;
+
+  for (y = 0; y < DST_H; ++y)
+    for (x = 0; x < DST_W; ++x)
+      {
+	coul = getpixel (BITMAP_SRC, DST_X + x, DST_Y + y) - FIRST_COLOR;
+	toadd = 1 << pos8;
+	octet[0] |= (coul & 1) ? toadd : 0;
+	octet[1] |= (coul & 2) ? toadd : 0;
+	octet[2] |= (coul & 4) ? toadd : 0;
+	octet[3] |= (coul & 8) ? toadd : 0;
+	octet[4] |= (coul & 16) ? toadd : 0;
+
+	if (pos8 == 7 || (y == DST_H - 1 && x == DST_W - 1))
+	  {
+	    for (i = 0; i < 5; ++i)
+	      {
+		BUFFER[pos++] = octet[i];
+		octet[i] = 0;
+	      }
+	    pos8 = 0;
+	  }
+	else
+	  pos8++;
+      }
+}
+
+/*-----------------------------------------------------------------*/
+/* on ecrit sur le disque                                          */
+/*-----------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------*/
+void
+change_ext (char *str)
+{
+  char *ext;
+
+  ext = strchr (str, '.');
+  ext[1] = 't';
+  ext[2] = 'e';
+  ext[3] = 'x';
+}
+
+/*-----------------------------------------------------------------*/
+void
+write_to_disk (char *str)
+{
+  FILE *f;
+  short w, h;
+  char header[4];
+
+  if (!FLAG_SILENT)
+    printf ("Writing %s to disk.\n", str);
+  delete_file (str);
+  f = fopen (str, "w");
+  if (f != NULL)
+    {
+      w = DST_W;
+      h = DST_H;
+
+      /*
+       * This is supposed to match the endianess used in 
+       * the serial.h/serial.c files of the core source.
+       */
+      header[0] = 0xFF & w;
+      header[1] = w >> 8;
+      header[2] = 0xFF & h;
+      header[3] = h >> 8;
+
+      fwrite (header, 4, 1, f);
+
+      fwrite (SYSTEM_NAME, sizeof (SYSTEM_NAME), 1, f);
+      fwrite (BUFFER, DST_SIZE, 1, f);
+      fclose (f);
+    }
+  else
+    {
+      printf ("Unable to write %s.\n", str);
+    }
+}
+
+/*=================================================================*/
+/* fonctions main                                                  */
+/*=================================================================*/
+
+/*-----------------------------------------------------------------*/
+int
+main (int argc, char **argv)
+{
+  int i;
+
+  ARGC = argc;
+  ARGV = argv;
+
+#ifdef ALLEGRO_UNIX
+  install_allegro (SYSTEM_NONE, &errno, atexit);
+#else
+  allegro_init ();
+#endif
+
+  set_color_depth (8);
+  set_color_conversion (COLORCONV_REDUCE_TO_256);
+
+  if (read_command_line ())
+    {
+      for (i = 0; i < NUMBER_OF_FILES; ++i)
+	{
+	  if (load_file (FILENAMES[i]))
+	    {
+	      get_range ();
+	      convert_to_buffer ();
+	      update_system_name (FILENAMES[i]);
+	      change_ext (FILENAMES[i]);
+	      write_to_disk (FILENAMES[i]);
+	    }
+	}
+    }
+  else
+    {
+      if (FLAG_HELP)
+	display_long_help ();
+      else
+	display_short_help ();
+    }
+  allegro_exit ();
+
+  return 0;
+
+}
+
+#ifdef ALLEGRO_WINDOWS
+END_OF_MAIN ()
+#endif
+#ifdef ALLEGRO_UNIX
+  END_OF_MAIN ();
+#endif

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/.cvsignore
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/.cvsignore	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/.cvsignore	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,2 @@
+lwmapgen
+liquidwar-mapgen

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/CHANGES
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/CHANGES	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/CHANGES	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,3 @@
+0.0.0     Initial Release
+
+0.0.1     Updated docs, added change log.

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/CREDITS
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/CREDITS	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/CREDITS	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,8 @@
+David Redick:          I did everything except whats listed here.
+                       I also tweaked worms.c & bubbles.c.
+
+Chris Guirl:           I did worms.c, bubbles.c, tweaked cut.c, and other stuff.
+
+Christian Mauduit:     I tweaked the allegro stuff in main.c.
+
+Robert Eshleman:       I helped bug hunt, test, and laughed at David.

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/HACKING
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/HACKING	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/HACKING	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,65 @@
+Where stuff is.
+---------------
+
+map.h contains a struct for the general map info.
+Size, grid size, file name, generating function to use (how the map is made).
+
+func_list.h is just a list of generating functions availible.
+
+func.h contains a struct for the generating function info.
+Name, description, and function pointer.
+
+Nearly all *.c files are generating functions.
+
+cut.c is a "helper" function to cut random lines out of the map.
+It is used by lines and rand_poly_cut.
+
+misc.c is just useful functions.
+One to create arrays, one to create 2d matrix (grid), and a wrapper for the
+random number generator that creates a number in a given range.
+
+main.c is the shell interface for the liquidwar-mapgen.
+
+
+How it works.
+-------------
+
+Given a filename, map size, grid size, and function.
+
+Main just creates a bitmap, calls the function and then saves the bitmap.
+
+Functions are just a void-void function pointer.
+
+
+Adding a new function.
+----------------------
+
+First take a look at a simple function like big_quad.c
+
+Then just write your foo_func.c.
+
+Add "void foo_func();" in func_list.h  [Please keep in alpha-num order].
+
+Increase MAX_FUNC in func.h.
+
+Add the extra info in func.c.
+
+
+Notes about functions.
+----------------------
+
+*Be careful of magic size numbers.
+Most of the functions base the size of things off of the section size.
+This allows the function to create nice, playable maps on either 128x96 or
+640x480 map sizes.
+
+*Be careful about dividing numbers.
+Since you'll be dealing with ints. The number could be so small it will be
+rounded to 0.
+
+*Use tester.sh to test your function.
+
+*Play test your maps.
+The map may look cool but how well does it play?
+Circuit use be to be a nice small little function but after playing on
+it, I found that it sucked.  I had to add a ton of code to make it play well.

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/HEADER
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/HEADER	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/HEADER	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,4 @@
+/*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/Makefile
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/Makefile	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/Makefile	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,89 @@
+# Copyright (C) 2003, David Redick
+# Released under the GNU General Public License (v2)
+
+CC=gcc
+CFLAGS=-ggdb -O3 -Wall -W -ansi `allegro-config --cflags`
+LDFLAGS=`allegro-config --libs` -lm
+EXE=liquidwar-mapgen
+
+OBJ=big_quad.o boxes.o bubbles.o circles.o circuit.o cut.o func.o hole.o \
+	lines.o map.o map_generator.o misc.o rand_box.o rand_func.o rand_poly.o \
+	rand_poly_cut.o street.o worms.o
+
+
+all: $(EXE)
+
+$(EXE): core main.c
+	$(CC) $(CFLAGS) main.c $(OBJ) $(LDFLAGS) -o $(EXE)
+	#strip $(EXE)
+
+core: $(OBJ)
+	@echo ""
+	@echo "Done compiling core functions..."
+	@echo ""
+
+clean: cleanmap
+	rm -rf $(EXE) *~ *.o
+
+cleanmaps: cleanmap
+
+cleanmap:
+	rm -rf *.bmp ./maps/*
+
+###############################################################################
+# core files... keep func.o, map.o, map_generator.o and misc.o at top
+
+misc.o: misc.c misc.h
+	$(CC) $(CFLAGS) -c misc.c
+
+func.o: func.c func.h func_list.h
+	$(CC) $(CFLAGS) -c func.c
+
+map.o: map.c map.h func.o misc.o
+	$(CC) $(CFLAGS) -c map.c
+
+map_generator.o: map_generator.c map_generator.h map.o
+	$(CC) $(CFLAGS) -c map_generator.c
+
+
+big_quad.o: big_quad.c map.o
+	$(CC) $(CFLAGS) -c big_quad.c
+
+boxes.o: boxes.c map.o
+	$(CC) $(CFLAGS) -c boxes.c
+
+bubbles.o: bubbles.c map.o
+	$(CC) $(CFLAGS) -c bubbles.c
+
+circles.o: circles.c map.o
+	$(CC) $(CFLAGS) -c circles.c
+
+circuit.o: circuit.c map.o
+	$(CC) $(CFLAGS) -c circuit.c
+
+cut.o: cut.c cut.h map.o
+	$(CC) $(CFLAGS) -c cut.c
+
+hole.o: hole.c rand_poly.o
+	$(CC) $(CFLAGS) -c hole.c
+
+lines.o: lines.c cut.o
+	$(CC) $(CFLAGS) -c lines.c
+
+rand_box.o: rand_box.c map.o
+	$(CC) $(CFLAGS) -c rand_box.c
+
+rand_func.o: rand_func.c map.o
+	$(CC) $(CFLAGS) -c rand_func.c
+
+rand_poly.o: rand_poly.c map.o
+	$(CC) $(CFLAGS) -c rand_poly.c
+
+rand_poly_cut.o: rand_poly_cut.c rand_poly.o cut.o
+	$(CC) $(CFLAGS) -c rand_poly_cut.c
+
+street.o: street.c map.o
+	$(CC) $(CFLAGS) -c street.c
+
+worms.o: worms.c map.o
+	$(CC) $(CFLAGS) -c worms.c

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/README
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/README	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/README	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,38 @@
+A Random Map Generator for Liquid War.
+Liquid War:    http://www.ufoot.org/liquidwar/
+Generator:     http://xdavidx.sqrville.org/lwmapgen/
+
+Requires Allegro and gcc.
+
+To compile: make
+To Run: ./liquidwar-mapgen [options]
+
+For options: ./liquidwar-mapgen --help
+To list generating functions: ./liquidwar-mapgen --list
+
+For technical info see "HACKING".
+
+
+TODO:
+* strange big_quad shapes with -s 0 -g 1
+
+*On my Gentoo system, I get a segfault in/after save_bitmap with map size
+is 4 or 5.  Both in allegro-4.0.3 and 4.1.11
+
+*If an output filename is around 20 char long, I get a segfault when
+trying to create the bitmap.  It appears to be a bug in allegro-4.0.3.
+It works in allegro-4.1.11.
+
+* Once in a while I segfault in rand_boxes, and any thing that uses rand_poly.
+Whats with this?  It usually happens with 5/6 and 15/16.
+
+* more generating functions...
+esp. ones that create "closed in maps".
+Personally I would like to have a maze-like function and
+one that makes little mushrooms like centipede =].
+
+* tweak rand_poly.c to create better looking maps.
+
+
+--David
+dredick (AT) novagaming.net

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/big_quad.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/big_quad.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/big_quad.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,41 @@
+/*
+* One big, solid quad that takes up most of the map.
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#include "map.h"
+#include "misc.h"
+
+
+void big_quad()
+{
+     int vert[8];
+
+     /*
+     * NOTE: we don't want to overlap the areas or we get strange polys
+     * The 2 and the "-3" are to make sure the quad doesn't touch the
+     * edge of the map.
+     */
+
+     /* left side of map */
+     vert[0] = rand_num(2, map.sec_width);
+     vert[1] = rand_num(2, map.height-3);
+
+     /* top side of map */
+     vert[2] = rand_num(map.sec_width+1, map.width-3);
+     vert[3] = rand_num(2, map.sec_height);
+     
+     /* right side of map */
+     vert[4] = rand_num(map.width-map.sec_width , map.width-3);
+     vert[5] = rand_num(map.sec_height+1, map.height-3);
+
+     /* bottom side of map */
+     vert[6] = rand_num(map.sec_width+1, map.width-map.sec_width-1);
+     vert[7] = rand_num(map.height-map.sec_height, map.height-3);
+
+     polygon(map.map, 4, vert, 0);
+
+return;
+}

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/boxes.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/boxes.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/boxes.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,58 @@
+/*
+* A bunch of boxes of the same size.
+*
+* This works best if r/c are large and close to each other.
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#include "map.h"
+
+
+void boxes()
+{
+     int r, c;
+     int startx, starty, endx, endy;
+     int pad;
+
+     pad = 1;
+
+     for( r = 0; r < map.num_row; r++ )
+     {
+          for( c = 0; c < map.num_col; c++ )
+          {
+               /* 1 out 2 chance to draw box */
+               if( rand()%2 == 0 )
+               {
+                    /*
+                    * if box is on the edge of the map i use
+                    * the absolute pixel
+                    */
+                    if( c == 0 )
+                         startx = pad+1;
+                    else
+                         startx = map.sec_width*c+pad;
+
+                    if( r == 0 )
+                         starty = pad+1;
+                    else
+                         starty = map.sec_height*r+pad;
+
+                    if( c == map.num_col-1 )
+                         endx = map.width-pad-2;
+                    else
+                         endx = map.sec_width*(c+1)-pad;
+
+                    if( r == map.num_row-1 )
+                         endy = map.height-pad-2;
+                    else
+                         endy = map.sec_height*(r+1)-pad;
+
+                    rectfill(map.map, startx, starty, endx, endy, 0);
+               }
+          }
+     }
+
+return;
+}

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/bubbles.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/bubbles.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/bubbles.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,67 @@
+/*
+* Random bubbles.
+*
+* start with a wall-filled field - then erase a circle,
+* then fill a smaller one inside it - repeat
+*
+* Copyright (C) 2003, Chris Guirl
+* Released under the GNU General Public License (v2)
+*/
+
+#include "map.h"
+#include "misc.h"
+
+
+void bubbles()
+{
+     int r, c, b;
+     int size;
+     int centerx, centery;
+     int outradius, inradius, midradius;
+     int bubblesx, bubblesy; /* number of bubbles in a row or column */
+     int numbubbles;
+
+     clear_invert_map();
+
+     /*
+     * outer is the main bubble
+     * inner is the black dot in the bubble
+     * what's the middle??
+     */
+
+     size = (map.sec_width > map.sec_height ? map.sec_width : map.sec_height);
+     outradius = rand_num(size/3, size);
+     inradius  = rand_num(outradius/1.5, outradius*(7.0/8.0));
+     midradius = (outradius + inradius) / 2;
+
+     midradius = (midradius == 0 ? 1 : midradius);
+
+
+     bubblesx = map.sec_width  / midradius;
+     bubblesy = map.sec_height / midradius;
+     numbubbles = (bubblesx * bubblesy);
+
+     numbubbles = (numbubbles == 0 ? 1 : numbubbles);
+
+
+     for( r = 0; r < map.num_row; r++ )
+     {
+          for( c = 0; c < map.num_col; c++ )
+          {
+               for( b = 0; b < numbubbles; b++ )
+               {
+                    rand_point_section_offset(&centerx, &centery, r, c, 0);
+
+                    /*
+                    *centerx *= (centerx / bubblesx);
+                    *centery *= (centery / bubblesy);
+                    */
+
+                    circlefill(map.map, centerx, centery, outradius, 255);
+                    circlefill(map.map, centerx, centery, inradius, 0);
+               }
+          } /* for(c..) */
+     } /* for(r..) */
+
+return;
+}

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/circles.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/circles.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/circles.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,34 @@
+/*
+* Random circles.
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#include "map.h"
+
+
+void circles()
+{
+     int r, c;
+     int centerx, centery;
+     int radius;
+     int size;
+
+
+     /* whats the max radius */
+     size = (map.sec_width < map.sec_height ? map.sec_width : map.sec_height)/2.0;
+     size = (size == 0 ? 1 : size);
+
+     for( r = 0; r < map.num_row; r++ )
+     {
+          for( c = 0; c < map.num_col; c++ )
+          {
+               rand_point_section_offset(&centerx, &centery, r, c, 0);
+               radius = rand()%size+1;
+               circlefill(map.map, centerx, centery, radius, 0);
+          }
+     }
+
+return;
+}

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/circuit.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/circuit.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/circuit.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,400 @@
+/*
+* A map that looks like a circuit board.
+*
+* "Wells" are just big circles.
+* "Pipes" are just lines that connect wells.
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#include <stdio.h>
+
+#include "map.h"
+#include "misc.h"
+
+static char **grid;
+static int *count;
+static int size;
+
+/******************************************************************************/
+/*
+* flip = 0 for front well connections
+* flip = 1 for back well connections
+*
+* its just makes the map look & play better
+*/
+
+static void draw_pipe( int fromr, int fromc, int tor, int toc, int flip )
+{
+     int fromx, fromy, tox, toy;
+
+
+     if( fromc < toc )
+     {
+          /* up/down then across */
+          if( flip == 0 )
+          {
+               /* go up/down to reach target */
+               section_center(&fromx, &fromy, fromr, fromc);
+               section_center(&tox, &toy, tor, fromc);
+               rectfill(map.map, fromx-size, fromy, tox+size, toy, 255);
+
+               /* across some num of sections */
+               section_center(&fromx, &fromy, tor, fromc);
+               section_center(&tox, &toy, tor, toc);
+               rectfill(map.map, fromx, fromy-size, tox, toy+size, 255);
+          }
+          /* across then up/down */
+          else
+          {
+               /* across some num of sections */
+               section_center(&fromx, &fromy, fromr, fromc);
+               section_center(&tox, &toy, fromr, toc);
+               rectfill(map.map, fromx, fromy-size, tox, toy+size, 255);
+
+               /* go up/down to reach target */
+               section_center(&fromx, &fromy, fromr, toc);
+               section_center(&tox, &toy, tor, toc);
+               rectfill(map.map, fromx-size, fromy, tox+size, toy, 255);
+          }
+     }
+     else if( fromc > toc )
+     {
+          /* across then up/down */
+          if( flip == 0 )
+          {
+               /* across some num of sections */
+               section_center(&fromx, &fromy, fromr, fromc);
+               section_center(&tox, &toy, fromr, toc);
+               rectfill(map.map, fromx, fromy-size, tox, toy+size, 255);
+
+               /* go up/down to reach target */
+               section_center(&fromx, &fromy, fromr, toc);
+               section_center(&tox, &toy, tor, toc);
+               rectfill(map.map, fromx-size, fromy, tox+size, toy, 255);
+          }
+          /* up/down then across */
+          else
+          {
+               /* go up/down to reach target */
+               section_center(&fromx, &fromy, fromr, fromc);
+               section_center(&tox, &toy, tor, fromc);
+               rectfill(map.map, fromx-size, fromy, tox+size, toy, 255);
+
+               /* across some num of sections */
+               section_center(&fromx, &fromy, tor, fromc);
+               section_center(&tox, &toy, tor, toc);
+               rectfill(map.map, fromx, fromy-size, tox, toy+size, 255);
+          }
+     }
+     else
+     {
+          /* go up/down to reach target */
+          section_center(&fromx, &fromy, fromr, fromc);
+          section_center(&tox, &toy, tor, toc);
+          rectfill(map.map, fromx-size, fromy, tox+size, toy, 255);
+     }
+
+return;
+}
+
+/******************************************************************************/
+/* connect all wells on in row */
+
+static void connect_rows()
+{
+     int r, c;
+     int fromc, toc;
+
+     /* make gcc shutup about these being uninitialized */
+     fromc = toc = -1;
+
+
+     for( r = 0; r < map.num_row; r++ )
+     {
+          /* can't connect if there's not 2 or more... */
+          if( count[r] < 2 )
+               continue;
+
+          /* find first c... */
+          for( c = 0; c < map.num_col; c++ )
+          {
+               if( grid[r][c] == 1 )
+               {
+                    fromc = c;
+                    break;
+               }
+          }
+
+          /* find last c... */
+          for( c++ ; c < map.num_col; c++ )
+          {
+               if( grid[r][c] == 1 )
+                    toc = c;
+          }
+
+          draw_pipe(r, fromc, r, toc, 0);
+     }
+
+
+return;
+}
+
+/******************************************************************************/
+/* connect the first well on each row */
+/* TODO: I don't think this works 100% */
+
+static void connect_front()
+{
+     int r, c;
+     int fromr, fromc, tor, toc;
+
+     /* make gcc shutup about these being uninitialized */
+     fromc = tor = toc = -1;
+
+
+     for( r = 0; r < map.num_row; r++ )
+     {
+          if( count[r] == 0 )
+               continue;
+
+          fromr = r;
+          /* find first well */
+          for( c = 0; c < map.num_col; c++ )
+          {
+               if( grid[fromr][c] == 1 )
+               {
+                    fromc = c;
+                    break;
+               }
+          }
+
+
+          /* tor = -1; */
+          /* find next row with a well */
+          for( r++; r < map.num_row; r++ )
+          {
+               if( count[r] > 0 )
+               {
+                    tor = r;
+                    break;
+               }
+          }
+          /* there might be no other wells after from row */
+          if( r == map.num_row )
+               break;
+
+          /* find first well on to row */
+          for( c = 0; c < map.num_col; c++ )
+          {
+               if( grid[tor][c] == 1 )
+               {
+                    toc = c;
+                    break;
+               }
+          }
+
+          draw_pipe(fromr, fromc, tor, toc, 0);
+printf("FRONT: %d, %d ---- %d, %d\n", fromr, fromc, tor, toc);
+          r = tor-1;
+     }
+
+return;
+}
+
+/******************************************************************************/
+/* connect the last well on each row */
+/* TODO: I don't think this works 100% */
+
+static void connect_back()
+{
+     int r, c; 
+     int fromr, fromc, tor, toc;
+
+
+     /* make gcc shutup about these being uninitialized */
+     fromc = tor = toc = -1;
+
+
+     for( r = 0; r < map.num_row; r++ )
+     {
+          if( count[r] == 0 )
+               continue;
+
+          fromr = r;
+          /* find last well */ 
+          for( c = map.num_col-1; c >= 0; c-- )
+          {
+               if( grid[fromr][c] == 1 )
+               {
+                    fromc = c;
+                    break;
+               }
+          }
+
+          /* tor = -1; */
+          /* find next row with well */
+          for( r++; r < map.num_row; r++ )
+          {
+               if( count[r] > 0 )
+               {
+                    tor = r;
+                    break;
+               }
+          }
+          /* there might not be another row after from row */
+          if( r == map.num_row )
+               break;
+
+          /* find last well */ 
+          for( c = map.num_col-1; c >= 0; c-- )
+          {
+               if( grid[tor][c] == 1 )
+               {
+                    toc = c;
+                    break;
+               }
+          }
+
+          draw_pipe(fromr, fromc, tor, toc, 1);
+printf("BACK: %d, %d ---- %d, %d\n", fromr, fromc, tor, toc);
+          r = tor-1;
+     }
+
+return;
+}
+
+/******************************************************************************/
+
+void connect_mid()
+{
+     int r, c;
+     int fromr, fromc, tor, toc;
+     int mid, i;
+
+
+     /* make gcc shutup about these being uninitialized */
+     fromc = tor = toc = -1;
+
+
+     for( r = 0; r < map.num_row; r++ )
+     {
+printf("row == %d, count[%d] = %d\n", r, r, count[r]);
+          if( count[r] == 0 )
+               continue;
+
+          fromr = r;
+
+          /* find first middle well */
+          mid = count[fromr]/2;
+          i = 0;
+          for( c = 0; c < map.num_col; c++ )
+          {
+               if( grid[fromr][c] == 1 )
+               {
+                    fromc = c;
+                    if( i == mid )
+                         break;
+                    i++;
+               }
+          }
+
+
+          /* tor = -1; */
+          /* find to row */
+          for( r++; r < map.num_row; r++ )
+          {
+               if( count[r] > 0 )
+               {
+                    tor = r;
+                    break;
+               }
+          }
+          /* there might not be another row after from row */
+          if( r == map.num_row )
+               break;
+
+
+          /* find first middle well */
+          mid = count[tor]/2;
+          i = 0;
+printf("count[tor]/2 == %d/2 == %d\n", count[tor], mid);
+          for( c = 0; c < map.num_col; c++ )
+          {
+               if( grid[tor][c] == 1 )
+               {
+                    toc = c;
+                    if( i == mid )
+                         break;
+                    i++;
+               }
+          }
+
+          draw_pipe(fromr, fromc, tor, toc, 0);
+printf("pipe= %d, %d --- %d, %d\n", fromr, fromc, tor, toc);
+          r = tor - 1;
+     }
+}
+
+/******************************************************************************/
+
+void circuit()
+{
+     int r, c;
+     int do_cut;
+     int radius;
+     int centerx, centery;
+
+
+     clear_invert_map();
+
+     grid = (char **) create_grid(map.num_row, map.num_col, sizeof(char));
+     count = (int *) create_array(map.num_row, sizeof(int));
+
+     radius = (map.sec_width > map.sec_height ? map.sec_width : map.sec_height)/4.0;
+     radius = (radius == 0 ? 1 : radius );
+
+     size = (map.sec_width > map.sec_height ? map.sec_width : map.sec_height)/12.0;
+     size = (size == 0 ? 1 : size);
+
+     for( r = 0; r < map.num_row; r++ )
+     {
+          count[r] = 0;
+          for( c = 0; c < map.num_col; c++ )
+          {
+               if( (r == 0 || r == map.num_row-1)
+               && (c == 0 || c == map.num_col/2 || c == map.num_col-1) )
+                    do_cut = 1;
+               else
+                    do_cut = rand()%4;
+
+               if( do_cut != 1 )
+               {
+                    grid[r][c] = 0;
+                    continue;
+               }
+
+               section_center(&centerx, &centery, r, c);
+               circlefill(map.map, centerx, centery, radius, 255);
+
+               grid[r][c] = 1;
+               count[r]++;
+          }
+     }
+
+
+     connect_rows();
+     connect_front();
+     connect_back();
+     connect_mid();
+
+     delete_grid((void **)grid, map.num_row);
+     delete_array(count);
+
+     /* redraw outline */
+     /* TODO: once in a while if cuts off the edge.. */
+     rect(map.map, 0, 0, map.width-1, map.height-1, 0);
+
+return;
+}

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/cut.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/cut.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/cut.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,71 @@
+/*
+* Makes a bunch random lines.
+*
+* Copyright (C) 2003, David Redick, Chris Guirl
+* Released under the GNU General Public License (v2)
+*/
+
+#include "map.h"
+
+
+void cut()
+{
+     int i, size;
+     int startx, starty, endx, endy;
+     int fromr, fromc, tor, toc;
+     int vert[8];
+
+
+     size = (map.sec_width > map.sec_height ? map.sec_width : map.sec_height)/8.0;
+     size = (size == 0 ? 1 : size);
+
+     /* vertical */
+     fromr = 0;
+     tor = map.num_row-1;
+     for( i = 0; i < map.num_col; i += 2 )
+     {
+          fromc = rand()%map.num_col;
+          toc = rand()%map.num_col;
+
+          section_center(&startx, &starty, fromr, fromc);
+          section_center(&endx, &endy, tor, toc);
+
+          vert[0] = startx - size;
+          vert[1] = 1;
+          vert[2] = startx + size;
+          vert[3] = 1;
+
+          vert[4] = endx + size;
+          vert[5] = map.height - 1;
+          vert[6] = endx - size;
+          vert[7] = map.height - 1;
+
+          polygon(map.map, 4, vert, 255);
+     }
+
+     /* horizontial */
+     fromc = 0;
+     toc = map.num_col-1;
+     for( i = 0; i < map.num_row; i += 2 )
+     {
+          fromr = rand()%map.num_row;
+          tor = rand()%map.num_row;
+
+          section_center(&startx, &starty, fromr, fromc);
+          section_center(&endx, &endy, tor, toc);
+
+          vert[0] = 1;
+          vert[1] = starty + size;
+          vert[2] = 1;
+          vert[3] = starty - size;
+
+          vert[4] = map.width - 2;
+          vert[5] = endy - size;
+          vert[6] = map.width - 2;
+          vert[7] = endy + size;
+
+          polygon(map.map, 4, vert, 255);
+     }
+
+return;
+}

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/cut.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/cut.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/cut.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,11 @@
+/*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#ifndef LWMAPGEN_CUT_H
+#define LWMAPGEN_CUT_H
+
+void cut();
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/func.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/func.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/func.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,29 @@
+/*
+* REMEMBER TO UPDATE MAX_FUNC IN FUNC.H
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#include "func.h"
+#include "func_list.h"
+
+
+func_t func[MAX_FUNC] =
+{
+     /* keep this first! */
+     { "rand_func", "Picks a random function.", rand_func },
+
+     { "big_quad", "One big, solid quad that takes up most of the map.", big_quad },
+     { "boxes", "A bunch of boxes of the same size.", boxes },
+     { "bubbles", "Random bubbles.", bubbles },
+     { "circles", "Random circles.", circles },
+     { "circuit", "A map that looks like a circuit board.", circuit },
+     { "hole", "Randomly shaped hole.", hole },
+     { "lines", "A grid of random lines.", lines },
+     { "rand_box", "Random boxes.", rand_box },
+     { "rand_poly", "One big, solid, random polygon that takes up most of the map.", rand_poly },
+     { "rand_poly_cut", "Do rand_poly then cut lines across it.", rand_poly_cut },
+     { "street", "A map that looks like a bunch of streets.", street },
+     { "worms", "Random little worms.", worms }
+};

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/func.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/func.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/func.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,26 @@
+/*
+* Info on the functions to generate the map.
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#ifndef LWMAPGEN_FUNC_H
+#define LWMAPGEN_FUNC_H
+
+
+#define MIN_FUNC      0
+#define MAX_FUNC     13
+
+
+typedef struct
+{
+     char *name;
+     char *desc;
+     void (*func)();
+} func_t;
+
+extern func_t func[MAX_FUNC];
+
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/func_list.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/func_list.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/func_list.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,36 @@
+/*
+* This is the master of list of functions.
+* All functions must be: "void foo();".
+* And be defined in "foo.c".
+*
+* Please keep in alpha-num order.
+*
+* These functions may be wrappers for more complex functions.
+*
+*  IF YOU ADD A FUNCTION HERE THEN ADD IT TO FUNC.C
+*  AND UPDATE MAX_FUNC IN FUNC.H
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#ifndef LWMAPGEN_FUNC_LIST_H
+#define LWMAPGEN_FUNC_LIST_H
+
+
+void big_quad();
+void boxes();
+void bubbles();
+void circles();
+void circuit();
+void hole();
+void lines();
+void rand_box();
+void rand_func();
+void rand_poly();
+void rand_poly_cut();
+void street();
+void worms();
+
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/hole.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/hole.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/hole.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,19 @@
+/*
+* Randomly shaped hole.
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#include "map.h"
+#include "func_list.h"
+
+
+void hole()
+{
+     map.color = 255;
+     clear_invert_map();
+     rand_poly();
+
+return;
+}

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/lines.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/lines.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/lines.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,17 @@
+/*
+* A grid of random lines.
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#include "map.h"
+#include "cut.h"
+
+
+void lines()
+{
+     clear_invert_map();
+     cut();
+return;
+}

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/main.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/main.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/main.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,242 @@
+/*
+* A Random map generator for Liquid War.
+*
+* Copyright (C) 2003, David Redick, Christian Mauduit
+* Released under the GNU General Public License (v2)
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include "map.h"
+#include "func.h"
+#include "map_generator.h"
+
+
+static char *filename = NULL;
+static int size = DEFAULT_MAP_SIZE;
+static int grid_size = RANDOM_MAP_GRID_SIZE;
+static int func_id = MIN_FUNC;
+
+
+void do_args(int argc, char **argv);
+void print_help();
+void print_version();
+
+#ifdef DOS
+/*
+ * These macros reduce the size of the DOS executable
+ */
+BEGIN_GFX_DRIVER_LIST
+END_GFX_DRIVER_LIST
+
+BEGIN_COLOR_DEPTH_LIST
+COLOR_DEPTH_8
+END_COLOR_DEPTH_LIST
+
+BEGIN_DIGI_DRIVER_LIST
+END_DIGI_DRIVER_LIST
+
+BEGIN_MIDI_DRIVER_LIST
+END_MIDI_DRIVER_LIST
+
+BEGIN_JOYSTICK_DRIVER_LIST
+END_JOYSTICK_DRIVER_LIST
+#endif
+
+#ifdef WIN32
+/*
+ * Under Win32 we want a console executable so we don't use
+ * the "END_OF_MAIN" stuff, and this implies to undef "main".
+ */
+#undef main
+#endif
+
+int main( int argc, char **argv )
+{
+     PALETTE pal;
+     int i;
+
+
+     /* init allegro and init palette */
+     install_allegro(SYSTEM_NONE, &errno, atexit);
+     set_color_depth(8);
+     set_color_conversion(COLORCONV_REDUCE_TO_256);
+     for( i = 0; i < 256; i++ )
+     {
+          /* divided by 4 because the colour value ranges from 0-63 */
+          pal[i].r = pal[i].g = pal[i].b = i/4;
+     }
+
+
+     srand(time(NULL));
+
+     do_args(argc, argv);
+
+printf("filename = %s\n", filename);
+
+     map_generator(filename, size, grid_size, func_id);
+
+printf("map-- %s\n", map.filename);
+     save_bitmap(map.filename, map.map, pal);
+printf("map-- %s\n", map.filename);
+
+return EXIT_SUCCESS;
+}
+
+#ifndef WIN32
+END_OF_MAIN();
+#endif
+
+/*****************************************************************************/
+
+void do_args( int argc, char **argv )
+{
+     int i;
+
+     for( i = 1; i < argc; i++ )
+     {
+          if( strcmp(argv[i], "-o") == 0 || strcmp(argv[i], "--out") == 0 )
+          {
+               int len = strlen(argv[++i]);
+               filename = malloc( sizeof(char)*len );
+               if( filename == NULL )
+               {
+                    fprintf(stderr, "fatal error: can't malloc space for map name.\n");
+                    exit(EXIT_FAILURE);
+               }
+               strcpy(filename, argv[i]);
+          }
+          else if( strcmp(argv[i], "-s") == 0 || strcmp(argv[i], "--size") == 0 )
+          {
+               size = atoi(argv[++i]);
+               if( size < MIN_MAP_SIZE )
+               {
+                    fprintf(stderr, "map size too small using: %d\n", MIN_MAP_SIZE);
+                    size = MIN_MAP_SIZE;
+               }
+               else if( size >= MAX_MAP_SIZE )
+               {
+                    fprintf(stderr, "map size too large using: %d\n", MAX_MAP_SIZE-1);
+                    size = MAX_MAP_SIZE-1;
+               }
+          }
+          else if( strcmp(argv[i], "-g") == 0 || strcmp(argv[i], "--grid") == 0 )
+          {
+               grid_size = atoi(argv[++i]);
+               if( grid_size == RANDOM_MAP_GRID_SIZE )
+               {
+                    /* ok.. don't do anything */
+               }
+               else if( grid_size < MIN_MAP_GRID_SIZE )
+               {
+                    fprintf(stderr, "map grid too small using: %d\n", MIN_MAP_GRID_SIZE);
+                    grid_size = MIN_MAP_GRID_SIZE;
+               }
+               else if( grid_size >= MAX_MAP_GRID_SIZE )
+               {
+                    fprintf(stderr, "map grid too large using: %d\n", MAX_MAP_GRID_SIZE-1);
+                    grid_size = MAX_MAP_GRID_SIZE-1;
+               }
+          }
+          else if( strcmp(argv[i], "-f") == 0 || strcmp(argv[i], "--function") == 0 )
+          {
+               int f;
+               i++;
+               for( f = 0; f < MAX_FUNC; f++ )
+               {
+                    if( strcmp(argv[i], func[f].name) == 0 )
+                         break;
+               }
+               if( f >= MAX_FUNC )
+               {
+                    fprintf(stderr, "fatal error: can't find function: %s\n", argv[i]);
+                    exit(EXIT_FAILURE);
+               }
+               else
+                    func_id = f;
+          }
+          else if( strcmp(argv[i], "-l") == 0 || strcmp(argv[i], "--list") == 0 )
+          {
+               int f;
+               printf("Random map generating functions:\n");
+               for( f = 0; f < MAX_FUNC; f++ )
+                    printf("%2d)  %s\t%s\n", f, func[f].name, func[f].desc);
+
+               exit(EXIT_SUCCESS);
+          }
+          else if( strcmp(argv[i], "--help") == 0 )
+          {
+               print_version();
+               print_help();
+               exit(EXIT_SUCCESS);
+          }
+          else if( strcmp(argv[i], "--version") == 0 )
+          {
+               print_version();
+               exit(EXIT_SUCCESS);
+          }
+          else
+          {
+               fprintf(stderr, "error: unknown arg: %s\n", argv[i]);
+               fprintf(stderr, "ignoring...\n");
+          }
+     }
+
+return;
+}
+
+/*****************************************************************************/
+
+void print_help()
+{
+     int i;
+
+     printf("\n");
+     printf("-o    --out       <filename>        Save bitmap to <filename>.    [%s]\n",
+          default_filename);
+     printf("-s    --size      <%d-%d>             Bitmap size.                  [%d]\n",
+          0, MAX_MAP_SIZE-1, DEFAULT_MAP_SIZE);
+     printf("-g    --grid      <%d-%d>             Map Grid Size                 [0]\n",
+          0, MAX_MAP_GRID_SIZE-1);
+     printf("\n");
+     printf("-f    --function  <function_name>   Which function to use.        [rand_func]\n");
+     printf("-l    --list                        List all functions.\n");
+     printf("\n");
+     printf("      --help                        Print this help.\n");
+     printf("      --version                     Print Version.\n");
+
+     printf("\nMap Sizes (WxH):\n");
+     for( i = MIN_MAP_SIZE; i < MAX_MAP_SIZE; i++ )
+          printf("(%d)%dx%d  ", i,  map_size[i][0], map_size[i][1]);
+     printf("\n");
+
+     printf("\nGrid Sizes (RxC):\n");
+     printf("(0) Random  ");
+     for( i = MIN_MAP_GRID_SIZE; i < MAX_MAP_GRID_SIZE; i++ )
+     {
+          if( i > 0 && i%8 == 0 )
+               printf("\n");
+          printf("(%d)%dx%d  ", i, map_grid_size[i][0], map_grid_size[i][1]);
+     }
+     printf("\n");
+
+return;
+}
+
+/*****************************************************************************/
+
+void print_version()
+{
+     printf(
+     "Liquid War Random Map Generator Version 0.0.1\n"
+     "Copyright (C) 2003, David Redick, Chris Guirl, Christian Mauduit.\n"
+     "Released under the GNU General Public License (v2).\n"
+     );
+
+return;
+}
+
+/*****************************************************************************/

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/map.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/map.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/map.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,138 @@
+/*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "map.h"
+
+
+char default_filename[10] = "lwmap.bmp";
+
+
+/* [2] for w == 0, h == 1 */
+int map_size[MAX_MAP_SIZE][2] =
+{
+     { 128, 95 },     /* 0 */
+     { 160, 120 },    /* 1 */
+     { 256, 190 },    /* 2 */
+     { 320, 240 },    /* 3 */
+     { 512, 380 },    /* 4 */
+     { 640, 480 }     /* 5 */
+};
+
+
+/* [2] for r == 0, c == 1 */
+/* the maps just look better if the ratio is the same */
+int map_grid_size[MAX_MAP_GRID_SIZE][2] =
+{
+     /* this is random. keep at top */
+     { 0, 0 },     /* 0 */
+
+     { 2, 3 },     /* 1 */
+     { 4, 6 },     /* 2 */
+     { 6, 9 },     /* 3 */
+     { 8, 12 },    /* 4 */
+     { 10, 15 },   /* 5 */
+     { 12, 18 },   /* 6 */
+     { 14, 21 },   /* 7 */
+     { 16, 24 },   /* 8 */
+     { 18, 26 }    /* 9 */
+};
+
+
+map_t map;
+
+/*****************************************************************************/
+
+void clear_map()
+{
+     clear_to_color(map.map, 255);
+     /* draw outline */
+     rect(map.map, 0, 0, map.width-1, map.height-1, 0);
+}
+
+/*****************************************************************************/
+
+void clear_invert_map()
+{
+     clear_to_color(map.map, 0);
+}
+
+/*****************************************************************************/
+/* print map info to stdout */
+/* really for debugging */
+
+void print_map()
+{
+     printf("Name:     %s\n",      map.filename);
+     printf("Size:     %dx%d\n",   map.width, map.height);
+     printf("Row/Col:  %d/%d\n",   map.num_row, map.num_col);
+     printf("Section:  %fx%f\n",   map.sec_width, map.sec_height);
+     printf("Function: (%d) %s\t%s\n", map.func_id,
+          func[map.func_id].name, func[map.func_id].desc);
+}
+
+/*****************************************************************************/
+/* get r, c from i */
+void section_rc( int *r, int *c, int i )
+{
+     *r = i / map.num_col;
+     *c = i % map.num_col;
+
+return;
+}
+
+/*****************************************************************************/
+
+void offset( int *xoffset, int *yoffset, int r, int c)
+{
+     *xoffset = c * map.sec_width;
+     *yoffset = r * map.sec_height;
+
+return;
+}
+
+/*****************************************************************************/
+/* TODO: does this cause rounding errors? */
+
+void rand_point_section( int *x, int *y, int pad )
+{
+     *x = rand_num(pad, map.sec_width-pad);
+     *y = rand_num(pad, map.sec_height-pad);
+
+return;
+}
+
+/*****************************************************************************/
+/* TODO: does this cause rounding errors? */
+
+void rand_point_section_offset( int *x, int *y, int r, int c, int pad )
+{
+     int xoffset, yoffset;
+
+     offset(&xoffset, &yoffset, r, c);
+
+     *x = rand_num(pad, map.sec_width-pad) + xoffset;
+     *y = rand_num(pad, map.sec_height-pad) + yoffset;
+
+return;
+}
+
+/*****************************************************************************/
+
+void section_center( int *x, int *y, int r, int c )
+{
+     int xoffset, yoffset;
+
+     offset(&xoffset, &yoffset, r, c);
+
+     *x = (map.sec_width/2.0)+xoffset;
+     *y = (map.sec_height/2.0)+yoffset;
+
+return;
+}
+
+/*****************************************************************************/

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/map.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/map.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/map.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,97 @@
+/*
+* Map info, misc map functions.
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#ifndef LWMAPGEN_MAP_H
+#define LWMAPGEN_MAP_H
+
+
+#include <allegro.h>
+#include "func.h"
+#include "misc.h"
+
+#define ALLEGRO_USE_CONSOLE
+
+extern char default_filename[10];
+
+
+#define MIN_MAP_SIZE     0
+#define MAX_MAP_SIZE     6
+#define DEFAULT_MAP_SIZE     3
+
+extern int map_size[MAX_MAP_SIZE][2];
+
+
+#define RANDOM_MAP_GRID_SIZE  0
+#define MIN_MAP_GRID_SIZE     1
+#define MAX_MAP_GRID_SIZE     10
+extern int map_grid_size[MAX_MAP_GRID_SIZE][2];
+
+
+typedef struct
+{
+     char *filename;        /* should not be changed */
+
+     int width, height;     /* should not be changed */
+     BITMAP *map;
+
+     /* grid size */
+     int num_row, num_col;
+
+     /* section size */
+     float sec_width, sec_height;     /* should not be changed */
+
+     /* the color to draw with */
+     int color;     /* 0 == normal, 255 == inverted */
+
+     int func_id;
+     void (*func)();
+} map_t;
+
+extern map_t map;
+
+
+/* sets up the map for drawing */
+void clear_map();
+void clear_invert_map();
+
+/* print all the map info to stdout */
+/* really for debugging */
+void print_map();
+
+
+/*****************************************************************************/
+/* Misc functions */
+
+/*
+* The default sections looks like this:
+*     c 0   1   2
+*  r  +---+---+---+
+*  0  | 0 | 1 | 2 | <-+
+*     +---+---+---+   |
+*  1  | 3 | 4 | 5 | <-+- i
+*     +---+---+---+
+*/
+
+/* get i from r, c */
+#define section(r,c)     ( (r*map.num_col)+c )
+
+/* get r, c from i */
+void section_rc( int *row, int *col, int i );
+
+
+void offset( int *xoffset, int *yoffset, int r, int c );
+
+void rand_point_section( int *x, int *y, int pad );
+
+void rand_point_section_offset( int *x, int *y, int r, int c, int pad );
+
+void section_center( int *x, int *y, int r, int c );
+
+/*****************************************************************************/
+
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/map_generator.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/map_generator.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/map_generator.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,79 @@
+/*
+* The main interface to the map generator.
+* 
+* This is mainly for the game liquidwar to interface with the generator.
+* For the shell interface see main.c
+*
+* Note: I assume that all args are valid.
+*
+* If filename is NULL then default filename is used.
+*
+* size must be MIN_MAP_SIZE to MAX_MAP_SIZE-1 inclusive.
+*
+* grid_size must be MIN_MAP_GRID_SIZE to MAX_MAP_GRID_SIZE-1 inclusive
+* or RANDOM_MAP_GRID_SIZE
+*
+* func_id must be MIN_FUNC to MAX_FUNC-1 inclusive
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "map.h"
+
+
+void map_generator( char *filename, int size, int grid_size, int func_id )
+{
+     char *fname;
+
+     if( filename == NULL )
+          fname = default_filename;
+     else
+          fname = filename;
+
+     map.filename = malloc( sizeof(char)*strlen(fname) );
+     if( map.filename == NULL )
+     {
+          fprintf(stderr, "fatal error: can't malloc space for map filename.\n");
+          exit(EXIT_FAILURE);
+     }
+     strcpy(map.filename, fname);
+
+printf("map.filename = %s\n", map.filename);
+
+     map.width  = map_size[size][0];
+     map.height = map_size[size][1];
+
+     map.map = create_bitmap_ex(8, map.width, map.height);
+
+     if( grid_size == RANDOM_MAP_GRID_SIZE )
+          grid_size = rand_num(MIN_MAP_GRID_SIZE, MAX_MAP_GRID_SIZE-1);
+     map.num_row = map_grid_size[grid_size][0];
+     map.num_col = map_grid_size[grid_size][1];
+
+     map.sec_width  = (float)map.width  / (float)map.num_col;
+     map.sec_height = (float)map.height / (float)map.num_row;
+
+     map.color = 0;
+
+     map.func_id = func_id;
+     map.func = func[func_id].func;
+
+
+     clear_map();
+
+     printf("Generating random map using:\n\t%2d)  %s\t%s\n",
+          func_id, func[func_id].name, func[func_id].desc);
+
+print_map();
+
+     (*map.func)();
+
+print_map();
+
+return;
+}

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/map_generator.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/map_generator.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/map_generator.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,30 @@
+/*
+* The main interface to the map generator.
+* 
+* This is mainly for the game liquidwar to interface with the generator.
+* For the shell interface see main.c
+*
+* Note: I assume that all args are valid.
+*
+* If filename is NULL then default filename is used.
+*
+* size must be MIN_MAP_SIZE to MAX_MAP_SIZE-1 inclusive.
+*
+* grid_size must be MIN_MAP_GRID_SIZE to MAX_MAP_GRID_SIZE-1 inclusive
+* or RANDOM_MAP_GRID_SIZE
+*
+* func_id must be MIN_FUNC to MAX_FUNC-1 inclusive
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+/* damn thats a long name... =] */
+#ifndef LWMAPGEN_MAP_GENERATOR_H
+#define LWMAPGEN_MAP_GENERATOR_H
+
+
+void map_generator( char *filename, int size, int grid_size, int func_id );
+
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/misc.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/misc.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/misc.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,89 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "misc.h"
+
+/*****************************************************************************/
+/* generate a random num from min to max inclusive on both ends */
+
+int rand_num( int min, int max )
+{
+     /* prevent /0 errors and strange numbers */
+     if( min > max )
+     {
+          fprintf(stderr, "for rand_num(%d, %d), max must be > min.\n", min, max);
+          return max;
+     }
+     else if( min == max )
+          return max;
+
+return rand()%(max-min+1)+min;
+}
+
+/*****************************************************************************/
+
+void * create_array( int length, int size )
+{
+     void *array;
+
+     if( length == 0 || size == 0 )
+     {
+          fprintf(stderr, "can't create an array of 0 length. [%d](%d)\n", length, size);
+          return NULL;
+     }
+
+     array = malloc(length*size);
+     if( array == NULL )
+     {
+          fprintf(stderr, "fatal error: can't malloc space for array.\n");
+          exit(EXIT_FAILURE);
+     }
+
+return array;
+}
+
+void delete_array( void *array )
+{
+     free(array);
+return;
+}
+
+/*****************************************************************************/
+
+void ** create_grid( int r, int c, int size )
+{
+     void **grid;
+     int i;
+
+     if( r == 0 || c == 0 || size == 0 )
+     {
+          fprintf(stderr, "can't create grid with 0 dimenson/size [%d][%d](%d).\n", r, c, size);
+          return NULL;
+     }
+
+     grid = (void **) malloc( r * sizeof(void*) );
+     if( grid == NULL )
+     {
+          fprintf(stderr, "fatal error: can't malloc space for grid rows.\n");
+          exit(EXIT_FAILURE);
+     }
+
+     for( i = 0; i < r; i++ )
+          grid[i] = (void *) create_array(c,size);
+
+return grid;
+}
+
+void delete_grid( void **grid, int r )
+{
+     int i;
+
+     if( r == 0 )
+          fprintf(stderr, "can't free grid with 0 rows.\n");
+
+     for( i = 0; i < r; i++ )
+          delete_array(grid[i]);
+
+     free(grid);
+return;
+}

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/misc.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/misc.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/misc.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,25 @@
+/*
+* Just misc. functions...
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#ifndef LWMAPGEN_MISC_H
+#define LWMAPGEN_MISC_H
+
+
+/* a random number from min to max inclusive on both ends */
+int rand_num( int min, int max);
+
+
+/* size == the size of the elements in the array/grid */
+
+void * create_array( int length, int size );
+void delete_array( void *array );
+
+void ** create_grid( int r, int c, int size );
+void delete_grid( void **grid, int r );
+
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/old/invert_rand_poly.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/old/invert_rand_poly.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/old/invert_rand_poly.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,19 @@
+/*
+* Cuts out one big polygon, that takes up most of the map.
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#include "map.h"
+#include "func_list.h"
+
+
+void invert_rand_poly()
+{
+     map.color = 255;
+     clear_invert_map();
+     rand_poly();
+
+return;
+}

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/old/rand_poly_cut.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/old/rand_poly_cut.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/old/rand_poly_cut.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,70 @@
+/*
+* This creates one big polygon and cuts slices out of it.
+* Cuts can be vertical, horizontial or both.
+*
+* Added a 1/3 chance of cutting.
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#include <stdio.h>
+
+#include "map.h"
+#include "func_list.h"
+
+
+void rand_poly_cut()
+{
+     int section_width, section_height;
+     int xoffset, yoffset;
+     int r, c;
+     int way, start;
+     int cutx, cuty;
+     int cutsize;
+
+
+     section_size(&section_width, &section_height);
+
+
+     rand_poly();
+
+
+     way = rand()%3;
+
+     /* cut along rows, horziontial cuts */
+     if( way == 0 || way == 2 )
+     {
+          start = rand()%2;
+          for( r = start; r < map.num_row; r += 2 )
+          {
+               if( rand()%3 != 0 )
+                    continue;
+
+               offset(&xoffset, &yoffset, r, 0);
+
+               cutsize = rand()%(section_height/2-map.max_pad)+1;
+               cuty = section_height/2 + yoffset;
+               rectfill(map.map, 1, cuty-cutsize, map.width-2, cuty+cutsize, 255);
+          }
+     }
+
+     /* cut along cols, vertical cuts */
+     if( way == 1 || way == 2 )
+     {
+          start = rand()%2;
+          for( c = start; c < map.num_col; c += 2 )
+          {
+               if( rand()%3 != 0 )
+                    continue;
+
+               offset(&xoffset, &yoffset, 0, c);
+
+               cutsize = rand()%(section_width/2-map.max_pad)+1;
+               cutx = section_width/2 + xoffset;
+               rectfill(map.map, cutx-cutsize, 1, cutx+cutsize, map.height-2, 255);
+          }
+     }
+     
+return;
+}

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/old/rand_poly_diag_cut.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/old/rand_poly_diag_cut.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/old/rand_poly_diag_cut.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,119 @@
+/*
+* Creates one big random polygon, that takes up most of the map
+* and cuts slices out of it.  Slices can are cut diagonal.
+*
+* Copyright (C) 2003, David Redick, Chris Guirl
+* Released under the GNU General Public License (v2)
+*/
+
+#include <stdio.h>
+
+#include "map.h"
+#include "func_list.h"
+
+
+void rand_poly_diag_cut()
+{
+     int section_width, section_height;
+     int xoffset, yoffset;
+     int r, c;
+     int way, start;
+     /* int cutx, cuty; */
+     int cutsize;
+     int *vert;
+     
+
+     vert = malloc( sizeof(int) * 4 * 2);
+     if( vert == NULL )
+     {
+          fprintf(stderr, "fatal error: can't malloc space for verts.\n");
+          exit(EXIT_FAILURE);
+     }
+
+
+     section_size(&section_width, &section_height);
+
+     rand_poly();
+
+/*     int i;
+     for ( i = 0; i < rand()%10; i++ )
+     {
+*/
+         /* was %2... fixed so that both slanted
+          * rows & cols could happen -- david
+          */
+          way = rand()%3;
+          
+          /* cut slanted rows */
+          if( way == 0 || way == 2 )
+          {
+               start = rand()%2;
+               for( r = start; r < map.num_row; r += 2 )
+               {
+		   
+                    offset(&xoffset, &yoffset, r, 0);
+
+                    cutsize = rand()%(section_height/2-map.max_pad)+1;
+
+                    /* following 2 lines removed by c. guirl 2003/11/09
+                    cuty = section_height/2 + yoffset;
+                    rectfill(map.map, 1, cuty-cutsize, map.width-2, cuty+cutsize, 255);
+                    */
+
+                    int topdist_left = rand()%(section_width-cutsize);
+                    int topdist_right = rand()%(section_width-cutsize);
+
+                    vert[0] = 1;
+                    vert[1] = yoffset + topdist_left;
+
+                    vert[2] = map.width-2;
+                    vert[3] = yoffset + topdist_right;
+
+                    vert[4] = map.width-2;
+                    vert[5] = yoffset + topdist_right + cutsize;
+
+                    vert[6] = 1;
+                    vert[7] = yoffset + topdist_left + cutsize;
+
+                    polygon (map.map, 4, vert, 255);
+ 	          }
+          }
+
+          /* cut slanted cols */
+          if( way == 1 || way == 2 )
+          {
+               start = rand()%2;
+               for( c = start; c < map.num_col; c += 2 )
+               {
+                    offset(&xoffset, &yoffset, 0, c);
+
+                    cutsize = rand()%(section_width/2-map.max_pad)+1;
+
+                    /* following 2 lines removed by c. guirl 2003/11/09
+                    cutx = section_width/2 + xoffset;
+                    rectfill(map.map, cutx-cutsize, 1, cutx+cutsize, map.height-2, 255);
+                    */
+
+
+                    int leftdist_top = rand()%(section_width-cutsize);
+                    int leftdist_bottom = rand()%(section_width-cutsize);
+
+                    vert[0] = xoffset + leftdist_top;
+                    vert[1] = 1;
+
+                    vert[2] = xoffset + leftdist_bottom;
+                    vert[3] = map.height-2;
+
+                    vert[4] = xoffset + leftdist_bottom + cutsize;
+                    vert[5] = map.height-2;
+
+                    vert[6] = xoffset + leftdist_top + cutsize;
+                    vert[7] = 1;
+
+                    polygon (map.map, 4, vert, 255);
+               }
+          }
+/*     } */
+
+return;
+}

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/rand_box.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/rand_box.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/rand_box.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,50 @@
+/*
+* Random boxes.
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#include "map.h"
+
+
+void rand_box()
+{
+     int r, c;
+     int xoffset, yoffset;
+
+     /* the start is the upper left */
+     int starty, startx;
+     int bwidth, bheight;
+
+
+     for( r = 0; r < map.num_row; r++ )
+     {
+          for( c = 0; c < map.num_col; c++ )
+          {
+               offset(&xoffset, &yoffset, r, c);
+
+               rand_point_section( &startx, &starty, 1);
+
+               /* +1 because we don't want 0 dimensions =] */
+               bwidth  = rand() % (int)map.sec_width + 1;
+               bheight = rand() % (int)map.sec_height + 1;
+
+               /*
+               * if the box goes outside the section
+               * then just make the box smaller
+               * NOTE: -1 is for the padding
+               */
+               if( startx + bwidth > map.sec_width - 1 )
+                    bwidth -= (startx + bwidth) - (map.sec_width - 1);
+
+               if( starty + bheight > map.sec_height - 1 )
+                    bheight -= (starty + bheight) - (map.sec_height - 1);
+
+               rectfill(map.map, startx+xoffset, starty+yoffset,
+                    startx+bwidth+xoffset, starty+bheight+yoffset, 0);
+          }
+     }
+
+return;
+}

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/rand_func.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/rand_func.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/rand_func.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,35 @@
+/*
+* Picks a random fuction.
+*
+* This is really just a nice way to wrap up some code.
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "func.h"
+#include "misc.h"
+
+
+void rand_func()
+{
+     int i;
+     void (*rfunc)();
+
+     /*
+     * NOTE: I'm assuming that rand_func is the
+     * first function listed in func.c
+     * that way I can just pick from 1 to MAX_FUNC-1
+     * and the code will be simple.
+     */
+     i = rand_num(1, MAX_FUNC-1);
+     rfunc = func[i].func;
+
+     printf("Random Function:  %2d) %s\t%s\n", i, func[i].name, func[i].desc);
+     (*rfunc)();
+
+return;
+}

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/rand_poly.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/rand_poly.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/rand_poly.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,69 @@
+/*
+* One big, solid, random polygon that takes up most of the map.
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#include "map.h"
+#include "misc.h"
+
+#define PAD     5
+
+void rand_poly()
+{
+     int r, c;
+     int num_vert;
+     int *vert;
+     int v;
+
+    
+     /* -4 is for the corners */
+     num_vert = (2*map.num_col) + (2*map.num_row) - 4;
+     vert = create_array(num_vert*2, sizeof(int));
+
+     v = 0;
+
+     /* top */
+     r = 0;
+     for( c = 0; c < map.num_col; c++ )
+     {
+          rand_point_section_offset(&vert[v], &vert[v+1], r, c, PAD);
+          v += 2;
+     }
+
+
+     /* right side */
+     c = map.num_col-1;
+     for( r = 1; r < map.num_row; r++ )
+     {
+          rand_point_section_offset(&vert[v], &vert[v+1], r, c, PAD);
+          v += 2;
+     }
+
+
+     /* bottom */
+     r = map.num_row-1;
+     for( c = map.num_col-2; c >= 0; c-- )
+     {
+          rand_point_section_offset(&vert[v], &vert[v+1], r, c, PAD);
+          v += 2;
+     }
+
+
+     /* left side */
+     c = 0;
+     for( r = map.num_row-2; r >= 1; r-- )
+     {
+          rand_point_section_offset(&vert[v], &vert[v+1], r, c, PAD);
+          v += 2;
+     }
+
+
+     /* draw poly */
+     polygon(map.map, num_vert, vert, map.color);
+
+     delete_array(vert);
+     
+return;
+}

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/rand_poly_cut.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/rand_poly_cut.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/rand_poly_cut.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,18 @@
+/*
+* Do rand_poly then cut lines across it.
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#include "map.h"
+#include "func_list.h"
+#include "cut.h"
+
+
+void rand_poly_cut()
+{
+     rand_poly();
+     cut();
+return;
+}

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/street.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/street.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/street.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,131 @@
+/*
+* A map that looks like a bunch of streets.
+*
+* This works best if r & c are rather large (but not too large).
+*
+* Copyright (C) 2003, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+
+#include <stdlib.h>
+
+#include "map.h"
+#include "misc.h"
+
+
+#define MAX_MAIN_ROW     3
+#define MAX_MAIN_COL     3
+
+void street()
+{
+     int main_row[MAX_MAIN_ROW];
+     int main_col[MAX_MAIN_COL];
+     int startx, starty, endx, endy;
+     int r, c, tor, toc;
+     int size;
+     int start, way;
+     int i;
+
+
+     clear_invert_map();
+
+     /*
+     * TODO: its possible only have 1 main and thats bad...
+     * 2x3 is best... tho' it may not matter much.
+     * What about basing the numbers off map.num_row/col??
+     * yeah I like that better than macros.
+     * maybe MMR = #rows % 4 + 1..
+     */
+
+     /* pick the main rows/cols to branch from */
+     for( i = 0; i < MAX_MAIN_ROW; i++ )
+          main_row[i] = rand()%map.num_row;
+     for( i = 0; i < MAX_MAIN_COL; i++ )
+          main_col[i] = rand()%map.num_col;
+
+
+     size = (map.sec_width > map.sec_height ? map.sec_width : map.sec_height)/8;
+     size = (size == 0 ? 1 : size);
+
+
+     /* branch off rows */
+     for( i = 0; i < MAX_MAIN_ROW; i++ )
+     {
+          r = main_row[i];
+
+          /* draw main row */
+          section_center(&startx, &starty, r, 0);
+          section_center(&endx, &endy, r, map.num_col-1);
+          rectfill(map.map, startx, starty-size, endx, endy+size, 255);
+
+
+          /* do the branches */
+          start = rand()%2;
+          for( c = start; c < map.num_col; c += 2 )
+          {
+               section_center(&startx, &starty, r, c);
+
+               way = rand()%3;
+
+               /* draw up */
+               if( r != 0 && (way == 0 || way == 2) )
+               {
+                    tor = rand()%r;
+                    section_center(&endx, &endy, tor, c);
+                    rectfill(map.map, startx-size, starty, endx+size, endy, 255);
+               }
+
+               /* draw down */
+               if( r != map.num_row-1 && (way == 1 || way == 2) )
+               {
+
+                    tor = rand_num(r, map.num_row-r);
+                    /* tor = rand()%(map.num_row-r-1)+r+1; */
+                    section_center(&endx, &endy, tor, c);
+                    rectfill(map.map, startx-size, starty, endx+size, endy, 255);
+               }               
+          }
+     }
+
+
+     /* branch off cols */
+     for( i = 0; i < MAX_MAIN_COL; i++ )
+     {
+          c = main_col[i];
+
+          /* draw main col */
+          section_center(&startx, &starty, 0, c);
+          section_center(&endx, &endy, map.num_row-1, c);
+          rectfill(map.map, startx-size, starty, endx+size, endy, 255);
+
+
+          /* do the branches */
+          start = rand()%2;
+          for( r = start; r < map.num_row; r += 2 )
+          {
+               section_center(&startx, &starty, r, c);
+
+               way = rand()%3;
+
+               /* draw left */
+               if( c != 0 && (way == 0 || way == 2) )
+               {
+                    toc = rand()%c;
+                    section_center(&endx, &endy, r, toc);
+                    rectfill(map.map, startx, starty-size, endx, endy+size, 255);
+               }
+
+               /* draw right */
+               if( c != map.num_col-1 && (way == 1 || way == 2) )
+               {
+                    toc = rand_num(c, map.num_col-c);
+                    /* toc = rand()%(map.num_col-c-1)+c+1; */
+                    section_center(&endx, &endy, r, toc);
+                    rectfill(map.map, startx-size, starty-size, endx, endy+size, 255);
+               }               
+          }
+     }
+
+return;
+}

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/tester.sh
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/tester.sh	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/tester.sh	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+mapsize="0 1 2 3 4 5"
+gridsize="0 1 2 3 4 5 6 7 8 9"
+
+
+testfunc="rand_func big_quad boxes bubbles circles circuit hole lines \
+rand_box rand_poly rand_poly_cut street worms"
+
+#testfunc=big_quad
+
+
+make cleanmaps
+if [ ! -x ./liquidwar-mapgen ]; then
+     make
+fi
+
+
+for func in $testfunc; do
+     for s in $mapsize; do
+          for g in $gridsize; do
+               echo "******* testing: $func / $i *******"
+               ./liquidwar-mapgen -f $func -s $s -g $g -o ./$func.$s.$g.bmp
+               sleep 2
+          done
+     done
+done
+
+
+###############################
+# arrange the maps...
+
+if [ ! -d ./maps ]; then
+     mkdir ./maps
+fi
+
+mv -f *.bmp ./maps
+cd ./maps
+
+
+###############################
+# view the maps...
+
+viewer=`which ee xv 2> /dev/null`
+if [ -z "$viewer" ]; then
+     echo "Can't find image viewer."
+     exit 0
+fi
+
+if [ -z "$DISPLAY" ]; then
+     echo "\$DISPLAY is not set."
+     exit 0
+fi
+
+for file in *.bmp; do
+     $viewer $file
+done


Property changes on: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/tester.sh
___________________________________________________________________
Name: svn:executable
   + 

Added: unstable/liquidwar/branches/upstream/current/utils/lwmapgen/worms.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/lwmapgen/worms.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/lwmapgen/worms.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,94 @@
+/*
+* Random little worms.
+*
+* Copyright (C) 2003, Chris Guirl, David Redick
+* Released under the GNU General Public License (v2)
+*/
+
+#include <math.h>
+#include <stdio.h>
+
+#include "map.h"
+
+
+/* math.h files do not define M_PI in ansi C  */
+#ifndef M_PI
+#define M_PI     3.14159265358979323846264338327950288
+#endif
+
+
+int filled( int centerx, int centery, int rad, int startdeg, int col, int seg )
+{
+     int deg;
+     int result = 0;
+     int check_degrees;
+
+     /*
+     * int seg is the current segment - if this is the first segment of a
+     * worm (seg = 0) check 360 degrees around it instead of just 180
+     */
+
+     if( 0 == seg )
+          check_degrees = 180;
+     else
+          check_degrees = 90;
+
+
+     for( deg = startdeg-check_degrees; deg < startdeg+check_degrees; deg += 5 )
+     {
+
+          if( getpixel(map.map, centerx+(rad*cos(M_PI*deg/180)), centery+(rad*sin(M_PI*deg/180))) == col )
+          {
+               result = 1;
+               break;
+          }
+     }
+
+return result;
+}
+
+
+void worms()
+{
+     int r, c, segs;
+     int centerx, centery;
+     int radius, segments;
+     int degree, change;
+
+
+     /* 5-15 */
+     radius = rand()%10+5;
+     segments = rand()%10+5;
+
+
+     for( r = 0; r < map.num_row; r++ )
+     {
+          for( c = 0; c < map.num_col; c++ )
+          {
+               rand_point_section_offset(&centerx, &centery, r, c, 0);
+               degree = rand()%360;
+
+               for( segs = 0; segs < segments; segs++ )
+               {
+                    /* -15 to 14 */
+                    change = rand()%30-15;
+                    degree += change;
+
+                    centerx += radius*cos(M_PI*degree/180);
+                    centery += radius*sin(M_PI*degree/180);
+
+                    if( filled(centerx, centery, radius+1, degree, 0, segs) == 0 )
+                    {
+                         circlefill(map.map, centerx, centery, radius, 0);
+                    }
+                    else
+                    {
+                         /* encountered another worm, stopping... */
+                         break;
+                    }
+               }
+          } /* for(c..) */
+     } /* for(r..) */
+
+return;
+}

Added: unstable/liquidwar/branches/upstream/current/utils/snprintf/COPYING
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/snprintf/COPYING	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/snprintf/COPYING	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.

Added: unstable/liquidwar/branches/upstream/current/utils/snprintf/INSTALL
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/snprintf/INSTALL	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/snprintf/INSTALL	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,24 @@
+HOW TO INSTALL - manually:
+
+  1. Read the description of macros that control the bahaviour
+     of the program at the beginning of the file snprintf.c,
+     change the definitions in snprintf.c or in Makefile if necessary.
+
+  2. make
+
+  3. move the file snprintf.o where your programs will find it
+
+
+
+HOW TO INSTALL - with autoconf:
+
+Contributed by Caolan McNamara <Caolan.McNamara at ul.ie>:
+
+  Though it might be overkill for snprintf I also have
+  an autoconf and automaked version which works out the need
+  for long long support and makes snprintf optionally into
+  a dynamic library on libtool supported platforms.
+
+  1. cd with_autoconf
+
+  2. follow instructions in the file INSTALL there.

Added: unstable/liquidwar/branches/upstream/current/utils/snprintf/LICENSE.txt
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/snprintf/LICENSE.txt	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/snprintf/LICENSE.txt	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,121 @@
+The Frontier Artistic License Version 1.0
+Derived from the Artistic License at OpenSource.org.
+Submitted to OpenSource.org for Open Source Initiative certification.
+   
+Preamble
+
+The intent of this document is to state the conditions under which a
+Package may be copied, such that the Copyright Holder maintains some
+semblance of artistic control over the development of the package,
+while giving the users of the package the right to use and distribute
+the Package in a more-or-less customary fashion, plus the right to
+make reasonable modifications.
+   
+Definitions
+
+  "Package" refers to the script, suite, file, or collection of
+  scripts, suites, and/or files distributed by the Copyright Holder,
+  and to derivatives of that Package created through textual modification.
+
+  "Standard Version" refers to such a Package if it has not been
+  modified, or has been modified in accordance with the wishes of
+  the Copyright Holder.
+
+  "Copyright Holder" is whoever is named in the copyright statement
+  or statements for the package.
+
+  "You" is you, if you're thinking about copying or distributing
+  this Package.
+
+  "Reasonable copying fee" is whatever you can justify on the basis
+  of media cost, duplication charges, time of people involved, and
+  so on. (You will not be required to justify it to the Copyright
+  Holder, but only to the computing community at large as a market
+  that must bear the fee.)
+
+  "Freely Available" means that no fee is charged for the item
+  itself, though there may be fees involved in handling the item.
+  It also means that recipients of the item may redistribute it under
+  the same conditions they received it.
+       
+
+Terms
+
+1. You may make and give away verbatim copies of the source form of
+the Standard Version of this Package without restriction, provided
+that you duplicate all of the original copyright notices and
+associated disclaimers.
+   
+2. You may apply bug fixes, portability fixes, and other modifications
+derived from the Public Domain or from the Copyright Holder. A Package
+modified in such a way shall still be considered the Standard Version.
+   
+3. You may otherwise modify your copy of this Package in any way,
+provided that you insert a prominent notice in each changed script,
+suite, or file stating how and when you changed that script, suite,
+or file, and provided that you do at least ONE of the following:
+   
+  a) Use the modified Package only within your corporation or
+  organization, or retain the modified Package solely for personal use.
+     
+  b) Place your modifications in the Public Domain or otherwise make
+  them Freely Available, such as by posting said modifications to Usenet
+  or an equivalent medium, or placing the modifications on a major archive
+  site such as ftp.uu.net, or by allowing the Copyright Holder to include
+  your modifications in the Standard Version of the Package.
+     
+  c) Rename any non-standard executables so the names do not conflict
+  with standard executables, which must also be provided, and provide
+  a separate manual page (or equivalent) for each non-standard executable
+  that clearly documents how it differs from the Standard Version.
+     
+  d) Make other distribution arrangements with the Copyright Holder.
+     
+4. You may distribute the programs of this Package in object code or
+executable form, provided that you do at least ONE of the following:
+   
+  a) Distribute a Standard Version of the executables and library
+  files, together with instructions (in the manual page or
+  equivalent) on where to get the Standard Version.
+     
+  b) Accompany the distribution with the machine-readable source of
+  the Package with your modifications.
+     
+  c) Accompany any non-standard executables with their corresponding
+  Standard Version executables, give the non-standard executables
+  non-standard names, and clearly document the differences in manual
+  pages (or equivalent), together with instructions on where to get
+  the Standard Version.
+     
+  d) Make other distribution arrangements with the Copyright Holder.
+     
+5. You may charge a reasonable copying fee for any distribution of
+this Package. You may charge any fee you choose for support of this
+Package. You may not charge a fee for this Package itself. However,
+you may distribute this Package in aggregate with other (possibly
+commercial) programs as part of a larger (possibly commercial)
+software distribution provided that you do not advertise this Package
+as a product of your own.
+   
+6. The scripts and library files supplied as input to or produced as
+output from the programs of this Package do not automatically fall
+under the copyright of this Package, but belong to whomever generated
+them, and may be sold commercially, and may be aggregated with this
+Package.
+   
+7. Scripts, suites, or programs supplied by you that depend on or
+otherwise make use of this Package shall not be considered part of
+this Package.
+   
+8. The name of the Copyright Holder may not be used to endorse or
+promote products derived from this software without specific prior
+written permission.
+   
+9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+   
+                        The End
+
+
+http://www.spinwardstars.com/frontier/fal.html

Added: unstable/liquidwar/branches/upstream/current/utils/snprintf/Makefile
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/snprintf/Makefile	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/snprintf/Makefile	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,43 @@
+# Make sure you include -DHAVE_SNPRINTF in CFLAGS if your system
+# does have snprintf!
+
+# If you need (long long int) support and you sprintf supports it,
+# define -DSNPRINTF_LONGLONG_SUPPORT
+
+CC      = gcc
+
+CFLAGS  = -DPREFER_PORTABLE_SNPRINTF -O3 \
+	  -Wall -Wpointer-arith -Wwrite-strings \
+	  -Wcast-qual -Wcast-align -Waggregate-return \
+	  -Wmissing-prototypes -Wmissing-declarations \
+	  -Wshadow -Wstrict-prototypes
+
+#	  -DNEED_ASPRINTF -DNEED_ASNPRINTF -DNEED_VASPRINTF -DNEED_VASNPRINTF
+#	  -DNEED_SNPRINTF_ONLY
+
+# Digital Unix: native compiler usually produces better code than gcc
+#CC     = cc
+#CFLAGS = -DPREFER_PORTABLE_SNPRINTF -O4 -std1 -arch host
+
+# Recommend to leave COMPATIBILITY empty for normal use.
+# Should be set for bug compatibility when running tests
+# too keep them less chatty.
+COMPATIBILITY =
+
+#COMPATIBILITY = -DSOLARIS_BUG_COMPATIBLE
+#COMPATIBILITY = -DHPUX_BUG_COMPATIBLE
+#COMPATIBILITY = -DDIGITAL_UNIX_BUG_COMPATIBLE
+#COMPATIBILITY = -DPERL_BUG_COMPATIBLE
+#COMPATIBILITY = -DLINUX_COMPATIBLE
+
+.c.o:
+	rm -f $@
+	$(CC) $(CFLAGS) $(COMPATIBILITY) -c $*.c
+
+all:snprintf.o Makefile
+
+test::snprintf.o test.c Makefile
+	$(CC) $(CFLAGS) $(COMPATIBILITY) snprintf.o -o $@ test.c
+
+clean:
+	/usr/bin/rm -f *.o test core

Added: unstable/liquidwar/branches/upstream/current/utils/snprintf/README.html
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/snprintf/README.html	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/snprintf/README.html	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,447 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head>
+<link rev="made" href="mailto:mark.martinec at ijs.si"><title>snprintf.c - a portable implementation of snprintf (including vsnprintf.c, asnprintf, vasnprintf, asprintf, vasprintf)</title>
+
+<meta http-equiv="Content-Language" content="en">
+<meta name="author" content="Mark Martinec">
+<meta name="copyright" content="Copyright 2000 Mark Martinec, All Rights Reserved">
+<meta name="date" content="2002-02-11">
+<meta name="keywords" lang="en" content="snprintf,portable,vsnprintf,asnprintf,vasnprintf,asprintf,vasprintf
+          ISO/IEC 9899:1999,ISO C99,ISO C9x,POSIX">
+<style type="text/css">
+<!--
+  body { background: white; color: black }
+ -->
+</style></head>
+
+<body>
+<h1><b>snprintf.c</b>
+<br> - a portable implementation of snprintf,
+<br><font size="+1">including
+vsnprintf.c, asnprintf, vasnprintf, asprintf, vasprintf</font>
+</h1>
+
+<p><b>snprintf</b> is a routine to convert numeric and string arguments
+to formatted strings. It is similar to sprintf(3) provided in a
+system's C library, yet it requires an additional argument - the buffer
+size - and it guarantees never to store anything beyond the given buffer,
+regardless of the format or arguments to be formatted. Some newer
+operating systems do provide <b>snprintf</b> in their C library,
+but many do not or do provide an inadequate (slow or idiosyncratic)
+version, which calls for a portable implementation of this routine.
+
+</p><h2>Author</h2>
+
+<p><a href="http://www.ijs.si/people/mark/">Mark Martinec</a>
+&lt;<a href="mailto:mark.martinec at ijs.si">mark.martinec at ijs.si</a>&gt;,
+April 1999, June 2000
+<br>Copyright © 1999,2000,2001,2002 Mark Martinec. All rights reserved.
+
+</p><h2>Terms and conditions ...</h2>
+
+<p>This program is free software; it is dual licensed, the terms of the
+"Frontier Artistic License" or the "GNU General Public License"
+can be chosen at your discretion. The chosen license then applies
+solely and in its entirety. Both licenses come with this Kit.
+
+</p><h2>Features</h2>
+
+<ul>
+<li>careful adherence to specs regarding flags, field width and precision;
+</li><li>good performance for large string handling (large format, large argument
+or large paddings). Performance is similar to system's <b>sprintf</b>
+and in several cases significantly better (make sure you compile with
+optimizations turned on, tell the compiler the code is strict ANSI
+if necessary to give it more freedom for optimizations);
+</li><li>return value semantics per ISO/IEC 9899:1999 ("ISO C99");
+</li><li>written in standard ISO/ANSI C - requires an ANSI C compiler.
+</li></ul>
+
+<h2>Supported conversion specifiers and data types</h2>
+
+<p>This <b>snprintf</b> only supports the following conversion specifiers:
+s, c, d, o, u, x, X, p  (and synonyms: i, D, U, O - see below)
+with flags: '-', '+', ' ', '0' and '#'.
+An asterisk is supported for field width as well as precision.
+
+</p><p>Length modifiers 'h' (<i>short int</i>), 'l' (<i>long int</i>),
+and 'll' (<i>long long int</i>) are supported.
+
+</p><p>NOTE:
+</p><blockquote>
+If macro SNPRINTF_LONGLONG_SUPPORT is not defined (default)
+the length modifier 'll' is recognized but treated the same as 'l',
+which may cause argument value truncation!
+Defining SNPRINTF_LONGLONG_SUPPORT requires that your system's
+<b>sprintf</b> also handles length modifier 'll'.
+<i>long long int</i> is a language extension which may not be portable.
+</blockquote>
+
+<p>Conversion of numeric data (conversion specifiers d, o, u, x, X, p)
+with length modifiers (none or h, l, ll) is left to the system
+routine <b>sprintf</b>, but all handling of flags, field width and precision
+as well as c and s conversions is done very carefully by this portable routine.
+If a string precision (truncation) is specified (e.g. %.8s) it is
+guaranteed the string beyond the specified precision will not be referenced.
+
+</p><p>Length modifiers h, l and ll are ignored for c and s conversions
+(data types <i>wint_t</i> and <i>wchar_t</i> are not supported).
+
+</p><p>The following common synonyms for conversion characters are supported:
+</p><ul>
+<li>i is a synonym for d
+</li><li>D is a synonym for ld, explicit length modifiers are ignored
+</li><li>U is a synonym for lu, explicit length modifiers are ignored
+</li><li>O is a synonym for lo, explicit length modifiers are ignored
+</li></ul>
+The D, O and U conversion characters are nonstandard, they are supported
+for backward compatibility only, and should not be used for new code.
+
+<p>The following is specifically <b>not</b> supported:
+</p><ul>
+<li>flag ' (thousands' grouping character) is recognized but ignored
+</li><li>numeric conversion specifiers: f, e, E, g, G and synonym F,
+as well as the new a and A conversion specifiers
+</li><li>length modifier 'L' (<i>long double</i>)
+and 'q' (<i>quad</i> - use 'll' instead)
+</li><li>wide character/string conversions: lc, ls, and nonstandard
+synonyms C and S
+</li><li>writeback of converted string length: conversion character n
+</li><li>the n$ specification for direct reference to n-th argument
+</li><li>locales
+</li></ul>
+
+<p>It is permitted for str_m to be zero, and it is permitted to specify NULL
+pointer for resulting string argument if str_m is zero (as per ISO C99).
+
+</p><p>The return value is the number of characters which would be generated
+for the given input, <i>excluding</i> the trailing null. If this value
+is greater or equal to str_m, not all characters from the result
+have been stored in str, output bytes beyond the (str_m-1) -th character
+are discarded. If str_m is greater than zero it is guaranteed
+the resulting string will be null-terminated.
+
+</p><p>NOTE that this matches the ISO C99, OpenBSD, and GNU C library 2.1,
+but is different from some older and vendor implementations,
+and is also different from XPG, XSH5, SUSv2 specifications.
+For historical discussion on changes in the semantics and standards
+of snprintf see printf(3) man page in the Linux programmers manual.
+
+</p><p>Routines asprintf and vasprintf return a pointer (in the ptr argument)
+to a buffer sufficiently large to hold the resulting string. This pointer
+should be passed to free(3) to release the allocated storage when it is
+no longer needed. If sufficient space cannot be allocated, these functions
+will return -1 and set ptr to be a NULL pointer. These two routines are a
+GNU C library extensions (glibc).
+
+</p><p>Routines asnprintf and vasnprintf are similar to asprintf and vasprintf,
+yet, like snprintf and vsnprintf counterparts, will write at most str_m-1
+characters into the allocated output string, the last character in the
+allocated buffer then gets the terminating null. If the formatted string
+length (the return value) is greater than or equal to the str_m argument,
+the resulting string was truncated and some of the formatted characters
+were discarded. These routines present a handy way to limit the amount
+of allocated memory to some sane value.
+
+</p><h2>Availability</h2>
+
+<p><a href="http://www.ijs.si/software/snprintf/">http://www.ijs.si/software/snprintf/</a>
+
+</p><ul>
+<li>
+<a href="http://www.ijs.si/software/snprintf/snprintf_1.3.tar.gz">snprintf_1.3.tar.gz</a> (1999-06-30),
+md5 sum: <a href="http://www.ijs.si/software/snprintf/snprintf_1.3.tar.gz.md5">snprintf_1.3.tar.gz.md5</a> (old)
+
+</li><li>
+<a href="http://www.ijs.si/software/snprintf/snprintf_2.1.tar.gz">snprintf_2.1.tar.gz</a> (2000-07-14),
+md5 sum: <a href="http://www.ijs.si/software/snprintf/snprintf_2.1.tar.gz.md5">snprintf_2.1.tar.gz.md5</a> (old)
+
+</li><li>
+<a href="http://www.ijs.si/software/snprintf/snprintf_2.2.tar.gz">snprintf_2.2.tar.gz</a> (2000-10-18),
+md5 sum: <a href="http://www.ijs.si/software/snprintf/snprintf_2.2.tar.gz.md5">snprintf_2.2.tar.gz.md5</a> (current)
+</li></ul>
+
+
+<h2>Mailing list</h2>
+
+<p>There is a very low-traffic mailing list <i>snprintf-announce at ijs.si</i>
+where announcements about new versions will be posted
+as well as warnings about threatening bugs if discovered.
+The posting is restricted to snprintf developer(s).
+
+</p><p>To subscribe to (or unsubscribe from) the mailing list
+please visit the list server's web page
+<a href="http://mailman.ijs.si/listinfo/snprintf-announce">http://mailman.ijs.si/listinfo/snprintf-announce</a>
+
+</p><p>You can also subscribe to the list by mailing
+the command SUBSCRIBE either in the subject or in the message body
+to the address <a href="mailto:snprintf-announce-request at ijs.si">snprintf-announce-request at ijs.si</a> . You will be asked for
+confirmation before subscription will be effective.
+
+</p><p>The list of members is only accessible to the list administrator,
+so there is no need for concern about automatic e-mail address gatherers.
+
+</p><p>Questions about the mailing list and concerns for the attention
+of a person should be sent to <a href="mailto:snprintf-announce-admin at ijs.si">snprintf-announce-admin at ijs.si</a>
+
+</p><p>There is no <i>general</i> discussion list about portable snprintf
+at the moment. Please send comments and suggestion to the author.
+
+
+</p><h2>Known problems with the latest version 2.2</h2>
+
+Please add the following two <tt>#include</tt> directives
+to file <i>snprintf.h</i> if your compiler complains:
+<blockquote>
+#include &lt;stddef.h&gt;<br>
+#include &lt;stdarg.h&gt;
+</blockquote>
+
+Only if using <i>test.c</i>, please replace the line 266:
+<blockquote>
+    assert(str_full[sizeof(str_full)-1] == '\0');
+</blockquote>
+in file <i>test.c</i>, with:
+<blockquote>
+    assert(str_full[len1f] == '\0');
+</blockquote>
+
+<p>(Thanks to <a href="http://www.cs.helsinki.fi/u/tuturune/">Tuomo
+A Turunen</a> for reporting the later problem.)
+
+</p><p>This will be fixed in the next version.
+
+
+</p><h2>Revision history</h2>
+
+<p><b>Version 1.3 fixes a runaway loop problem from 1.2. Please upgrade.</b>
+<br><b>Version 2.2 fixes a potential %c conversion problem
+present in all previous versions.</b>
+
+</p><dl><dt>1999-06-30	V1.3  Mark Martinec &lt;mark.martinec at ijs.si&gt;
+</dt><dd><ul>
+<li>fixed runaway loop (eventually crashing when str_l wraps
+  beyond 2^31) while copying format string without
+  conversion specifiers to a buffer that is too short
+  (thanks to Edwin Young &lt;edwiny at autonomy.com&gt; for spotting the problem);
+</li><li>added macros PORTABLE_SNPRINTF_VERSION_(MAJOR|MINOR) to snprintf.h
+</li></ul>
+
+</dd><dt>2000-02-14	V2.0 (never released) Mark Martinec &lt;mark.martinec at ijs.si&gt;
+</dt><dd><ul>
+<li>relaxed license terms:
+  <a href="http://www.ijs.si/software/snprintf/LICENSE.txt">The Artistic License</a> now applies.
+  You may still apply the GNU GENERAL PUBLIC LICENSE
+  as was distributed with previous versions, if you prefer;
+</li><li>changed REVISION HISTORY dates to use
+  <a href="http://www.cl.cam.ac.uk/%7Emgk25/iso-time.html">ISO 8601
+  date format</a>;
+</li><li>added vsnprintf (patch also independently proposed by
+  Caolán McNamara 2000-05-04, and Keith M Willenson 2000-06-01)
+</li></ul>
+
+</dd><dt>2000-06-27	V2.1  Mark Martinec &lt;mark.martinec at ijs.si&gt;
+</dt><dd><ul>
+<li>removed POSIX check for str_m &lt; 1; value 0 for str_m is
+  allowed by ISO C99 (and GNU C library 2.1) (pointed out
+  on 2000-05-04 by Caolán McNamara, caolan@ csn dot ul dot ie).
+  Besides relaxed license this change in standards adherence
+  is the main reason to bump up the major version number;
+</li><li>added nonstandard routines asnprintf, vasnprintf, asprintf,
+  vasprintf that dynamically allocate storage for the
+  resulting string; these routines are not compiled by default,
+  see comments where NEED_V?ASN?PRINTF macros are defined;
+</li><li>autoconf contributed by Caolán McNamara
+</li></ul>
+
+</dd><dt>2000-10-06	V2.2  Mark Martinec &lt;mark.martinec at ijs.si&gt;
+</dt><dd><ul>
+<li><b>BUG FIX</b>: the %c conversion used a temporary variable
+  that was no longer in scope when referenced,
+  possibly causing incorrect resulting character;
+</li><li>BUG FIX: make precision and minimal field width unsigned
+  to handle huge values (2^31 &lt;= n &lt; 2^32) correctly;
+  also be more careful in the use of signed/unsigned/size_t
+  internal variables -- probably more careful than many
+  vendor implementations, but there may still be a case
+  where huge values of str_m, precision or minimal field
+  could cause incorrect behaviour;
+</li><li>use separate variables for signed/unsigned arguments,
+  and for short/int, long, and long long argument lengths
+  to avoid possible incompatibilities on certain
+  computer architectures. Also use separate variable
+  arg_sign to hold sign of a numeric argument,
+  to make code more transparent;
+</li><li>some fiddling with zero padding and "0x" to make it
+  Linux compatible;
+</li><li>systematically use macros fast_memcpy and fast_memset
+  instead of case-by-case hand optimization; determine some
+  breakeven string lengths for different architectures;
+</li><li>terminology change: <i>format</i> -&gt; <i>conversion specifier</i>,
+  <i>C9x</i> -&gt; <i>ISO/IEC 9899:1999 ("ISO C99")</i>,
+  <i>alternative form</i> -&gt; <i>alternate form</i>,
+  <i>data type modifier</i> -&gt; <i>length modifier</i>;
+</li><li>several comments rephrased and new ones added;
+</li><li>make compiler not complain about 'credits' defined but
+  not used;
+</li></ul>
+</dd></dl>
+
+<h2>Other implementations of snprintf</h2>
+
+<p>I am aware of some other (more or less) portable implementations
+of <b>snprintf</b>. I do not claim they are free software - please refer
+to their respective copyright and licensing terms.
+If you know of other versions please let
+<a href="http://www.ijs.si/people/mark/">me</a> know.
+
+</p><ul>
+<li><a href="http://www.contactor.se/%7Edast/trio/">Trio</a> is a fully
+matured and stable, platform-independent and extendable implementation
+of the stdio printf and scanf functions and the string library functions,
+written by Bjorn Reese
+&lt;<a href="mailto:breese at mail1.stofanet.dk">breese at mail1.stofanet.dk</a>&gt;
+and Daniel Stenberg &lt;daniel at haxx.se&gt;. Trio fully implements
+the C99 (ISO/IEC 9899:1999) and UNIX98 (the Single Unix Specification,
+Version 2) standards, as well as many features from other implemenations,
+e.g. the GNU libc and BSD4. See <a href="http://www.contactor.se/%7Edast/trio/">http://www.contactor.se/~dast/trio/</a>
+and <a href="http://sourceforge.net/projects/ctrio/">http://sourceforge.net/projects/ctrio/</a>
+
+</li><li>a very thorough implementation (src/util_snprintf.c)
+by the Apache Group distributed with the
+<a href="http://www.apache.org/">Apache web server
+- http://www.apache.org/</a> .
+Does its own floating point conversions using routines
+ecvt(3), fcvt(3) and gcvt(3) from the standard C library
+or from the GNU libc.
+
+<br>This is from the code:
+<blockquote>
+This software [...] was originally based
+on public domain software written at the
+<a href="http://www.ncsa.uiuc.edu/ncsa.html">National Center
+for Supercomputing Applications</a>, University of Illinois,
+Urbana-Champaign.<br>
+[...] This code is based on, and used with the permission of,
+the SIO stdio-replacement strx_* functions by Panos Tsirigotis
+&lt;<a href="mailto:panos at alumni.cs.colorado.edu">panos at alumni.cs.colorado.edu</a>&gt; for xinetd.
+</blockquote>
+
+</li><li><a href="http://www.qlue.com/downloads/c_utils_README.html">QCI
+Utilities</a> use a modified version of snprintf from the Apache group.
+
+</li><li>implementations as distributed with
+<a href="http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/">OpenBSD</a>,
+<a href="http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/stdio/">FreeBSD</a>, and
+<a href="http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/basesrc/lib/libc/stdio/">NetBSD</a>
+are all wrappers to vfprintf.c, which is derived from software
+contributed to Berkeley by Chris Torek.
+
+</li><li>implementation from Prof. Patrick Powell
+&lt;<a href="mailto:papowell at sdsu.edu">papowell at sdsu.edu</a>&gt;,
+Dept. Electrical and Computer Engineering, San Diego State University,
+San Diego, CA 92182-1309, published in
+<a href="http://www.geek-girl.com/bugtraq/1995_3/0217.html">Bugtraq
+archives for 3rd quarter (Jul-Aug) 1995</a>.
+No floating point conversions.
+
+</li><li>Brandon Long's
+&lt;<a href="mailto:blong at fiction.net">blong at fiction.net</a>&gt;
+<a href="http://www.fiction.net/blong/programs/">modified version</a>
+of Prof. Patrick Powell's snprintf with contributions from others.
+With minimal floating point support.
+
+</li><li><a href="http://samba.org/">Samba</a> comes with snprintf
+(see <a href="http://samba.org/cgi-bin/cvsweb/samba/source/lib/snprintf.c">source</a> from the CVS repository). It is based on Patrick Powell's code
+with Brandon Long's modifications, plus some newer fixes.
+
+</li><li>implementation (src/snprintf.c) as distributed with
+<a href="http://www.sendmail.org/">sendmail - http://www.sendmail.org/</a>
+is a cleaned up Prof. Patrick Powell's version
+to compile properly and to support .precision and %lx.
+
+</li><li>implementation from <a href="http://www.csn.ul.ie/%7Ecaolan/">Caolán McNamara</a> available at
+<a href="http://www.csn.ul.ie/%7Ecaolan/publink/snprintf-1.1.tar.gz">http://www.csn.ul.ie/~caolan/publink/snprintf-1.1.tar.gz</a>,
+handles floating point.
+
+</li><li>implementation used by
+<a href="ftp://ftp.soscorp.com/pub/sos/lib">newlog</a>
+(a replacement for syslog(3)) made available by
+the <a href="http://www.soscorp.com/">SOS Corporation</a>.
+Enabling floating point support is a compile-time option.
+
+</li><li>implementation by Michael Richardson
+&lt;<a href="mailto:mcr at metis.milkyway.com">mcr at metis.milkyway.com</a>&gt;
+is available at
+<a href="http://sandelman.ottawa.on.ca/SSW/snp/snp.html">http://sandelman.ottawa.on.ca/SSW/snp/snp.html</a>.
+It is based on BSD44-lite's vfprintf() call, modified to function
+on SunOS. Needs internal routines from the 4.4 strtod (included),
+requires GCC to compile the long long (aka quad_t) portions. 
+
+</li><li>implementation from Tomi Salo
+&lt;<a href="mailto:ttsalo at ssh.fi">ttsalo at ssh.fi</a>&gt;
+distributed with
+<a href="http://www.europe.datafellows.com/f-secure/ssh/">SSH 2.0
+Unix Server</a>. Not in public domain.
+Floating point conversions done by system's sprintf.
+
+</li><li>and for completeness: <a href="http://www.ijs.si/people/mark/">my</a>
+portable version described in this very document available at
+<a href="http://www.ijs.si/software/snprintf/">http://www.ijs.si/software/snprintf/</a> .
+</li></ul>
+
+<h2>Related work</h2>
+
+<ul>
+<li><a href="http://www.engelschall.com/sw/str/">Str</a> library
+by <a href="http://www.engelschall.com/">Ralf S. Engelschall</a>
+&lt;<a href="mailto:rse at engelschall.com">rse at engelschall.com</a>&gt;
+provides a str_format(3) function. Its implementation is based
+on Panos Tsirigotis' sprintf(3) code as adjusted by the Apache
+Software Foundation 1998.
+
+</li><li><a href="http://www.research.att.com/sw/tools/sfio/">Sfio:
+A Safe/Fast I/O Library</a> by Glenn Fowler, David Korn, and Kiem-Phong Vo,
+includes sfprintf/sfscanf and is thread-safe.
+
+</li><li><a href="http://www.oranda.demon.co.uk/dist/">snprintfv</a>
+(libsnprintfv) by <a href="http://www.oranda.demon.co.uk/">Gary
+V. Vaughan</a> &lt;<a href="mailto:gvv at techie.com">gvv at techie.com</a>&gt;
+provides all the features present in a POSIX format printing implementation.
+It is a rewrite of the printf string formatting API which also accepts
+argv style argument vectors.
+
+</li><li><a href="http://www.opengroup.org/platform/resolutions/bwg98-006.html">The Approved Base Working Group Resolution for XSH5,
+Ref: bwg98-006, Topic: snprintf</a>.
+</li></ul>
+
+<h2>Some notable references</h2>
+
+<p>Some references to my portable snprintf as I happened to come across:
+
+</p><ul>
+<li><a href="http://hpux.connect.org.uk/">Software Porting
+And Archive Centre for HP-UX</a>:
+<a href="http://hpux.connect.org.uk/hppd/hpux/Development/Libraries/snprintf-2.2/">http://hpux.connect.org.uk/hppd/hpux/Development/Libraries/snprintf-2.2/</a>
+
+</li><li><a href="http://www.wwnet.net/%7Ejanc/incnote/stdio.html">Unix
+Incompatibility Notes: I/O Functions</a>, by Jan Wolter
+</li></ul>
+
+<p>Information about applications and packages using my snprintf
+is appreciated.
+
+</p><hr>
+<p>In retrospect, it appears that a lot of effort was wasted by many
+people for not being aware of what others are doing. Sigh.
+
+</p><p></p><hr> 
+<i><a href="http://www.ijs.si/people/mark/">mm</a></i>
+<br>Last updated: 2002-02-11
+<br>(<i>promoting
+<a href="http://www.cl.cam.ac.uk/%7Emgk25/iso-time.html">ISO 8601</a>
+/ <a href="http://www.qsl.net/g1smd/isoimp.htm">EN 28601</a> standard
+for specifying date and time!</i>)
+
+<p><a href="http://validator.w3.org/check/referer"><img src="valid-html40.gif" alt="Valid HTML 4.0!" border="0" width="88" height="31"></a>
+
+</p></body></html>

Added: unstable/liquidwar/branches/upstream/current/utils/snprintf/snprintf.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/snprintf/snprintf.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/snprintf/snprintf.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,1025 @@
+/*
+ * snprintf.c - a portable implementation of snprintf
+ *
+ * AUTHOR
+ *   Mark Martinec <mark.martinec at ijs.si>, April 1999.
+ *
+ *   Copyright 1999, Mark Martinec. All rights reserved.
+ *
+ * TERMS AND CONDITIONS
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the "Frontier Artistic License" which comes
+ *   with this Kit.
+ *
+ *   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 Frontier Artistic License for more details.
+ *
+ *   You should have received a copy of the Frontier Artistic License
+ *   with this Kit in the file named LICENSE.txt .
+ *   If not, I'll be glad to provide one.
+ *
+ * FEATURES
+ * - careful adherence to specs regarding flags, field width and precision;
+ * - good performance for large string handling (large format, large
+ *   argument or large paddings). Performance is similar to system's sprintf
+ *   and in several cases significantly better (make sure you compile with
+ *   optimizations turned on, tell the compiler the code is strict ANSI
+ *   if necessary to give it more freedom for optimizations);
+ * - return value semantics per ISO/IEC 9899:1999 ("ISO C99");
+ * - written in standard ISO/ANSI C - requires an ANSI C compiler.
+ *
+ * SUPPORTED CONVERSION SPECIFIERS AND DATA TYPES
+ *
+ * This snprintf only supports the following conversion specifiers:
+ * s, c, d, u, o, x, X, p  (and synonyms: i, D, U, O - see below)
+ * with flags: '-', '+', ' ', '0' and '#'.
+ * An asterisk is supported for field width as well as precision.
+ *
+ * Length modifiers 'h' (short int), 'l' (long int),
+ * and 'll' (long long int) are supported.
+ * NOTE:
+ *   If macro SNPRINTF_LONGLONG_SUPPORT is not defined (default) the
+ *   length modifier 'll' is recognized but treated the same as 'l',
+ *   which may cause argument value truncation! Defining
+ *   SNPRINTF_LONGLONG_SUPPORT requires that your system's sprintf also
+ *   handles length modifier 'll'.  long long int is a language extension
+ *   which may not be portable.
+ *
+ * Conversion of numeric data (conversion specifiers d, u, o, x, X, p)
+ * with length modifiers (none or h, l, ll) is left to the system routine
+ * sprintf, but all handling of flags, field width and precision as well as
+ * c and s conversions is done very carefully by this portable routine.
+ * If a string precision (truncation) is specified (e.g. %.8s) it is
+ * guaranteed the string beyond the specified precision will not be referenced.
+ *
+ * Length modifiers h, l and ll are ignored for c and s conversions (data
+ * types wint_t and wchar_t are not supported).
+ *
+ * The following common synonyms for conversion characters are supported:
+ *   - i is a synonym for d
+ *   - D is a synonym for ld, explicit length modifiers are ignored
+ *   - U is a synonym for lu, explicit length modifiers are ignored
+ *   - O is a synonym for lo, explicit length modifiers are ignored
+ * The D, O and U conversion characters are nonstandard, they are supported
+ * for backward compatibility only, and should not be used for new code.
+ *
+ * The following is specifically NOT supported:
+ *   - flag ' (thousands' grouping character) is recognized but ignored
+ *   - numeric conversion specifiers: f, e, E, g, G and synonym F,
+ *     as well as the new a and A conversion specifiers
+ *   - length modifier 'L' (long double) and 'q' (quad - use 'll' instead)
+ *   - wide character/string conversions: lc, ls, and nonstandard
+ *     synonyms C and S
+ *   - writeback of converted string length: conversion character n
+ *   - the n$ specification for direct reference to n-th argument
+ *   - locales
+ *
+ * It is permitted for str_m to be zero, and it is permitted to specify NULL
+ * pointer for resulting string argument if str_m is zero (as per ISO C99).
+ *
+ * The return value is the number of characters which would be generated
+ * for the given input, excluding the trailing null. If this value
+ * is greater or equal to str_m, not all characters from the result
+ * have been stored in str, output bytes beyond the (str_m-1) -th character
+ * are discarded. If str_m is greater than zero it is guaranteed
+ * the resulting string will be null-terminated.
+ *
+ * NOTE that this matches the ISO C99, OpenBSD, and GNU C library 2.1,
+ * but is different from some older and vendor implementations,
+ * and is also different from XPG, XSH5, SUSv2 specifications.
+ * For historical discussion on changes in the semantics and standards
+ * of snprintf see printf(3) man page in the Linux programmers manual.
+ *
+ * Routines asprintf and vasprintf return a pointer (in the ptr argument)
+ * to a buffer sufficiently large to hold the resulting string. This pointer
+ * should be passed to free(3) to release the allocated storage when it is
+ * no longer needed. If sufficient space cannot be allocated, these functions
+ * will return -1 and set ptr to be a NULL pointer. These two routines are a
+ * GNU C library extensions (glibc).
+ *
+ * Routines asnprintf and vasnprintf are similar to asprintf and vasprintf,
+ * yet, like snprintf and vsnprintf counterparts, will write at most str_m-1
+ * characters into the allocated output string, the last character in the
+ * allocated buffer then gets the terminating null. If the formatted string
+ * length (the return value) is greater than or equal to the str_m argument,
+ * the resulting string was truncated and some of the formatted characters
+ * were discarded. These routines present a handy way to limit the amount
+ * of allocated memory to some sane value.
+ *
+ * AVAILABILITY
+ *   http://www.ijs.si/software/snprintf/
+ *
+ * REVISION HISTORY
+ * 1999-04	V0.9  Mark Martinec
+ *		- initial version, some modifications after comparing printf
+ *		  man pages for Digital Unix 4.0, Solaris 2.6 and HPUX 10,
+ *		  and checking how Perl handles sprintf (differently!);
+ * 1999-04-09	V1.0  Mark Martinec <mark.martinec at ijs.si>
+ *		- added main test program, fixed remaining inconsistencies,
+ *		  added optional (long long int) support;
+ * 1999-04-12	V1.1  Mark Martinec <mark.martinec at ijs.si>
+ *		- support the 'p' conversion (pointer to void);
+ *		- if a string precision is specified
+ *		  make sure the string beyond the specified precision
+ *		  will not be referenced (e.g. by strlen);
+ * 1999-04-13	V1.2  Mark Martinec <mark.martinec at ijs.si>
+ *		- support synonyms %D=%ld, %U=%lu, %O=%lo;
+ *		- speed up the case of long format string with few conversions;
+ * 1999-06-30	V1.3  Mark Martinec <mark.martinec at ijs.si>
+ *		- fixed runaway loop (eventually crashing when str_l wraps
+ *		  beyond 2^31) while copying format string without
+ *		  conversion specifiers to a buffer that is too short
+ *		  (thanks to Edwin Young <edwiny at autonomy.com> for
+ *		  spotting the problem);
+ *		- added macros PORTABLE_SNPRINTF_VERSION_(MAJOR|MINOR)
+ *		  to snprintf.h
+ * 2000-02-14	V2.0 (never released) Mark Martinec <mark.martinec at ijs.si>
+ *		- relaxed license terms: The Artistic License now applies.
+ *		  You may still apply the GNU GENERAL PUBLIC LICENSE
+ *		  as was distributed with previous versions, if you prefer;
+ *		- changed REVISION HISTORY dates to use ISO 8601 date format;
+ *		- added vsnprintf (patch also independently proposed by
+ *		  Caolan McNamara 2000-05-04, and Keith M Willenson 2000-06-01)
+ * 2000-06-27	V2.1  Mark Martinec <mark.martinec at ijs.si>
+ *		- removed POSIX check for str_m<1; value 0 for str_m is
+ *		  allowed by ISO C99 (and GNU C library 2.1) - (pointed out
+ *		  on 2000-05-04 by Caolan McNamara, caolan@ csn dot ul dot ie).
+ *		  Besides relaxed license this change in standards adherence
+ *		  is the main reason to bump up the major version number;
+ *		- added nonstandard routines asnprintf, vasnprintf, asprintf,
+ *		  vasprintf that dynamically allocate storage for the
+ *		  resulting string; these routines are not compiled by default,
+ *		  see comments where NEED_V?ASN?PRINTF macros are defined;
+ *		- autoconf contributed by Caolan McNamara
+ * 2000-10-06	V2.2  Mark Martinec <mark.martinec at ijs.si>
+ *		- BUG FIX: the %c conversion used a temporary variable
+ *		  that was no longer in scope when referenced,
+ *		  possibly causing incorrect resulting character;
+ *		- BUG FIX: make precision and minimal field width unsigned
+ *		  to handle huge values (2^31 <= n < 2^32) correctly;
+ *		  also be more careful in the use of signed/unsigned/size_t
+ *		  internal variables - probably more careful than many
+ *		  vendor implementations, but there may still be a case
+ *		  where huge values of str_m, precision or minimal field
+ *		  could cause incorrect behaviour;
+ *		- use separate variables for signed/unsigned arguments,
+ *		  and for short/int, long, and long long argument lengths
+ *		  to avoid possible incompatibilities on certain
+ *		  computer architectures. Also use separate variable
+ *		  arg_sign to hold sign of a numeric argument,
+ *		  to make code more transparent;
+ *		- some fiddling with zero padding and "0x" to make it
+ *		  Linux compatible;
+ *		- systematically use macros fast_memcpy and fast_memset
+ *		  instead of case-by-case hand optimization; determine some
+ *		  breakeven string lengths for different architectures;
+ *		- terminology change: 'format' -> 'conversion specifier',
+ *		  'C9x' -> 'ISO/IEC 9899:1999 ("ISO C99")',
+ *		  'alternative form' -> 'alternate form',
+ *		  'data type modifier' -> 'length modifier';
+ *		- several comments rephrased and new ones added;
+ *		- make compiler not complain about 'credits' defined but
+ *		  not used;
+ */
+
+
+/* Define HAVE_SNPRINTF if your system already has snprintf and vsnprintf.
+ *
+ * If HAVE_SNPRINTF is defined this module will not produce code for
+ * snprintf and vsnprintf, unless PREFER_PORTABLE_SNPRINTF is defined as well,
+ * causing this portable version of snprintf to be called portable_snprintf
+ * (and portable_vsnprintf).
+ */
+/* #define HAVE_SNPRINTF */
+
+/* Define PREFER_PORTABLE_SNPRINTF if your system does have snprintf and
+ * vsnprintf but you would prefer to use the portable routine(s) instead.
+ * In this case the portable routine is declared as portable_snprintf
+ * (and portable_vsnprintf) and a macro 'snprintf' (and 'vsnprintf')
+ * is defined to expand to 'portable_v?snprintf' - see file snprintf.h .
+ * Defining this macro is only useful if HAVE_SNPRINTF is also defined,
+ * but does does no harm if defined nevertheless.
+ */
+/* #define PREFER_PORTABLE_SNPRINTF */
+
+/* Define SNPRINTF_LONGLONG_SUPPORT if you want to support
+ * data type (long long int) and length modifier 'll' (e.g. %lld).
+ * If undefined, 'll' is recognized but treated as a single 'l'.
+ *
+ * If the system's sprintf does not handle 'll'
+ * the SNPRINTF_LONGLONG_SUPPORT must not be defined!
+ *
+ * This is off by default as (long long int) is a language extension.
+ */
+/* #define SNPRINTF_LONGLONG_SUPPORT */
+
+/* Define NEED_SNPRINTF_ONLY if you only need snprintf, and not vsnprintf.
+ * If NEED_SNPRINTF_ONLY is defined, the snprintf will be defined directly,
+ * otherwise both snprintf and vsnprintf routines will be defined
+ * and snprintf will be a simple wrapper around vsnprintf, at the expense
+ * of an extra procedure call.
+ */
+/* #define NEED_SNPRINTF_ONLY */
+
+/* Define NEED_V?ASN?PRINTF macros if you need library extension
+ * routines asprintf, vasprintf, asnprintf, vasnprintf respectively,
+ * and your system library does not provide them. They are all small
+ * wrapper routines around portable_vsnprintf. Defining any of the four
+ * NEED_V?ASN?PRINTF macros automatically turns off NEED_SNPRINTF_ONLY
+ * and turns on PREFER_PORTABLE_SNPRINTF.
+ *
+ * Watch for name conflicts with the system library if these routines
+ * are already present there.
+ *
+ * NOTE: vasprintf and vasnprintf routines need va_copy() from stdarg.h, as
+ * specified by C99, to be able to traverse the same list of arguments twice.
+ * I don't know of any other standard and portable way of achieving the same.
+ * With some versions of gcc you may use __va_copy(). You might even get away
+ * with "ap2 = ap", in this case you must not call va_end(ap2) !
+ *   #define va_copy(ap2,ap) ap2 = ap
+ */
+/* #define NEED_ASPRINTF   */
+/* #define NEED_ASNPRINTF  */
+/* #define NEED_VASPRINTF  */
+/* #define NEED_VASNPRINTF */
+
+
+/* Define the following macros if desired:
+ *   SOLARIS_COMPATIBLE, SOLARIS_BUG_COMPATIBLE,
+ *   HPUX_COMPATIBLE, HPUX_BUG_COMPATIBLE, LINUX_COMPATIBLE,
+ *   DIGITAL_UNIX_COMPATIBLE, DIGITAL_UNIX_BUG_COMPATIBLE,
+ *   PERL_COMPATIBLE, PERL_BUG_COMPATIBLE,
+ *
+ * - For portable applications it is best not to rely on peculiarities
+ *   of a given implementation so it may be best not to define any
+ *   of the macros that select compatibility and to avoid features
+ *   that vary among the systems.
+ *
+ * - Selecting compatibility with more than one operating system
+ *   is not strictly forbidden but is not recommended.
+ *
+ * - 'x'_BUG_COMPATIBLE implies 'x'_COMPATIBLE .
+ *
+ * - 'x'_COMPATIBLE refers to (and enables) a behaviour that is
+ *   documented in a sprintf man page on a given operating system
+ *   and actually adhered to by the system's sprintf (but not on
+ *   most other operating systems). It may also refer to and enable
+ *   a behaviour that is declared 'undefined' or 'implementation specific'
+ *   in the man page but a given implementation behaves predictably
+ *   in a certain way.
+ *
+ * - 'x'_BUG_COMPATIBLE refers to (and enables) a behaviour of system's sprintf
+ *   that contradicts the sprintf man page on the same operating system.
+ *
+ * - I do not claim that the 'x'_COMPATIBLE and 'x'_BUG_COMPATIBLE
+ *   conditionals take into account all idiosyncrasies of a particular
+ *   implementation, there may be other incompatibilities.
+ */
+
+
+
+/* ============================================= */
+/* NO USER SERVICABLE PARTS FOLLOWING THIS POINT */
+/* ============================================= */
+
+#define PORTABLE_SNPRINTF_VERSION_MAJOR 2
+#define PORTABLE_SNPRINTF_VERSION_MINOR 2
+
+#if defined(NEED_ASPRINTF) || defined(NEED_ASNPRINTF) || defined(NEED_VASPRINTF) || defined(NEED_VASNPRINTF)
+# if defined(NEED_SNPRINTF_ONLY)
+# undef NEED_SNPRINTF_ONLY
+# endif
+# if !defined(PREFER_PORTABLE_SNPRINTF)
+# define PREFER_PORTABLE_SNPRINTF
+# endif
+#endif
+
+#if defined(SOLARIS_BUG_COMPATIBLE) && !defined(SOLARIS_COMPATIBLE)
+#define SOLARIS_COMPATIBLE
+#endif
+
+#if defined(HPUX_BUG_COMPATIBLE) && !defined(HPUX_COMPATIBLE)
+#define HPUX_COMPATIBLE
+#endif
+
+#if defined(DIGITAL_UNIX_BUG_COMPATIBLE) && !defined(DIGITAL_UNIX_COMPATIBLE)
+#define DIGITAL_UNIX_COMPATIBLE
+#endif
+
+#if defined(PERL_BUG_COMPATIBLE) && !defined(PERL_COMPATIBLE)
+#define PERL_COMPATIBLE
+#endif
+
+#if defined(LINUX_BUG_COMPATIBLE) && !defined(LINUX_COMPATIBLE)
+#define LINUX_COMPATIBLE
+#endif
+
+#include <sys/types.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <errno.h>
+
+#ifdef isdigit
+#undef isdigit
+#endif
+#define isdigit(c) ((c) >= '0' && (c) <= '9')
+
+/* For copying strings longer or equal to 'breakeven_point'
+ * it is more efficient to call memcpy() than to do it inline.
+ * The value depends mostly on the processor architecture,
+ * but also on the compiler and its optimization capabilities.
+ * The value is not critical, some small value greater than zero
+ * will be just fine if you don't care to squeeze every drop
+ * of performance out of the code.
+ *
+ * Small values favor memcpy, large values favor inline code.
+ */
+#if defined(__alpha__) || defined(__alpha)
+#  define breakeven_point   2	/* AXP (DEC Alpha)     - gcc or cc or egcs */
+#endif
+#if defined(__i386__)  || defined(__i386)
+#  define breakeven_point  12	/* Intel Pentium/Linux - gcc 2.96 */
+#endif
+#if defined(__hppa)
+#  define breakeven_point  10	/* HP-PA               - gcc */
+#endif
+#if defined(__sparc__) || defined(__sparc)
+#  define breakeven_point  33	/* Sun Sparc 5         - gcc 2.8.1 */
+#endif
+
+/* some other values of possible interest: */
+/* #define breakeven_point  8 */  /* VAX 4000          - vaxc */
+/* #define breakeven_point 19 */  /* VAX 4000          - gcc 2.7.0 */
+
+#ifndef breakeven_point
+#  define breakeven_point   6	/* some reasonable one-size-fits-all value */
+#endif
+
+#define fast_memcpy(d,s,n) \
+  { register size_t nn = (size_t)(n); \
+    if (nn >= breakeven_point) memcpy((d), (s), nn); \
+    else if (nn > 0) { /* proc call overhead is worth only for large strings*/\
+      register char *dd; register const char *ss; \
+      for (ss=(s), dd=(d); nn>0; nn--) *dd++ = *ss++; } }
+
+#define fast_memset(d,c,n) \
+  { register size_t nn = (size_t)(n); \
+    if (nn >= breakeven_point) memset((d), (int)(c), nn); \
+    else if (nn > 0) { /* proc call overhead is worth only for large strings*/\
+      register char *dd; register const int cc=(int)(c); \
+      for (dd=(d); nn>0; nn--) *dd++ = cc; } }
+
+/* prototypes */
+
+#if defined(NEED_ASPRINTF)
+int asprintf   (char **ptr, const char *fmt, /*args*/ ...);
+#endif
+#if defined(NEED_VASPRINTF)
+int vasprintf  (char **ptr, const char *fmt, va_list ap);
+#endif
+#if defined(NEED_ASNPRINTF)
+int asnprintf  (char **ptr, size_t str_m, const char *fmt, /*args*/ ...);
+#endif
+#if defined(NEED_VASNPRINTF)
+int vasnprintf (char **ptr, size_t str_m, const char *fmt, va_list ap);
+#endif
+
+#if defined(HAVE_SNPRINTF)
+/* declare our portable snprintf  routine under name portable_snprintf  */
+/* declare our portable vsnprintf routine under name portable_vsnprintf */
+#else
+/* declare our portable routines under names snprintf and vsnprintf */
+#define portable_snprintf snprintf
+#if !defined(NEED_SNPRINTF_ONLY)
+#define portable_vsnprintf vsnprintf
+#endif
+#endif
+
+#if !defined(HAVE_SNPRINTF) || defined(PREFER_PORTABLE_SNPRINTF)
+int portable_snprintf(char *str, size_t str_m, const char *fmt, /*args*/ ...);
+#if !defined(NEED_SNPRINTF_ONLY)
+int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap);
+#endif
+#endif
+
+/* declarations */
+
+static char credits[] = "\n\
+@(#)snprintf.c, v2.2: Mark Martinec, <mark.martinec at ijs.si>\n\
+@(#)snprintf.c, v2.2: Copyright 1999, Mark Martinec. Frontier Artistic License applies.\n\
+@(#)snprintf.c, v2.2: http://www.ijs.si/software/snprintf/\n";
+
+#if defined(NEED_ASPRINTF)
+int asprintf(char **ptr, const char *fmt, /*args*/ ...) {
+  va_list ap;
+  size_t str_m;
+  int str_l;
+
+  *ptr = NULL;
+  va_start(ap, fmt);                            /* measure the required size */
+  str_l = portable_vsnprintf(NULL, (size_t)0, fmt, ap);
+  va_end(ap);
+  assert(str_l >= 0);        /* possible integer overflow if str_m > INT_MAX */
+  *ptr = (char *) malloc(str_m = (size_t)str_l + 1);
+  if (*ptr == NULL) { errno = ENOMEM; str_l = -1; }
+  else {
+    int str_l2;
+    va_start(ap, fmt);
+    str_l2 = portable_vsnprintf(*ptr, str_m, fmt, ap);
+    va_end(ap);
+    assert(str_l2 == str_l);
+  }
+  return str_l;
+}
+#endif
+
+#if defined(NEED_VASPRINTF)
+int vasprintf(char **ptr, const char *fmt, va_list ap) {
+  size_t str_m;
+  int str_l;
+
+  *ptr = NULL;
+  { va_list ap2;
+    va_copy(ap2, ap);  /* don't consume the original ap, we'll need it again */
+    str_l = portable_vsnprintf(NULL, (size_t)0, fmt, ap2);/*get required size*/
+    va_end(ap2);
+  }
+  assert(str_l >= 0);        /* possible integer overflow if str_m > INT_MAX */
+  *ptr = (char *) malloc(str_m = (size_t)str_l + 1);
+  if (*ptr == NULL) { errno = ENOMEM; str_l = -1; }
+  else {
+    int str_l2 = portable_vsnprintf(*ptr, str_m, fmt, ap);
+    assert(str_l2 == str_l);
+  }
+  return str_l;
+}
+#endif
+
+#if defined(NEED_ASNPRINTF)
+int asnprintf (char **ptr, size_t str_m, const char *fmt, /*args*/ ...) {
+  va_list ap;
+  int str_l;
+
+  *ptr = NULL;
+  va_start(ap, fmt);                            /* measure the required size */
+  str_l = portable_vsnprintf(NULL, (size_t)0, fmt, ap);
+  va_end(ap);
+  assert(str_l >= 0);        /* possible integer overflow if str_m > INT_MAX */
+  if ((size_t)str_l + 1 < str_m) str_m = (size_t)str_l + 1;      /* truncate */
+  /* if str_m is 0, no buffer is allocated, just set *ptr to NULL */
+  if (str_m == 0) {  /* not interested in resulting string, just return size */
+  } else {
+    *ptr = (char *) malloc(str_m);
+    if (*ptr == NULL) { errno = ENOMEM; str_l = -1; }
+    else {
+      int str_l2;
+      va_start(ap, fmt);
+      str_l2 = portable_vsnprintf(*ptr, str_m, fmt, ap);
+      va_end(ap);
+      assert(str_l2 == str_l);
+    }
+  }
+  return str_l;
+}
+#endif
+
+#if defined(NEED_VASNPRINTF)
+int vasnprintf (char **ptr, size_t str_m, const char *fmt, va_list ap) {
+  int str_l;
+
+  *ptr = NULL;
+  { va_list ap2;
+    va_copy(ap2, ap);  /* don't consume the original ap, we'll need it again */
+    str_l = portable_vsnprintf(NULL, (size_t)0, fmt, ap2);/*get required size*/
+    va_end(ap2);
+  }
+  assert(str_l >= 0);        /* possible integer overflow if str_m > INT_MAX */
+  if ((size_t)str_l + 1 < str_m) str_m = (size_t)str_l + 1;      /* truncate */
+  /* if str_m is 0, no buffer is allocated, just set *ptr to NULL */
+  if (str_m == 0) {  /* not interested in resulting string, just return size */
+  } else {
+    *ptr = (char *) malloc(str_m);
+    if (*ptr == NULL) { errno = ENOMEM; str_l = -1; }
+    else {
+      int str_l2 = portable_vsnprintf(*ptr, str_m, fmt, ap);
+      assert(str_l2 == str_l);
+    }
+  }
+  return str_l;
+}
+#endif
+
+/*
+ * If the system does have snprintf and the portable routine is not
+ * specifically required, this module produces no code for snprintf/vsnprintf.
+ */
+#if !defined(HAVE_SNPRINTF) || defined(PREFER_PORTABLE_SNPRINTF)
+
+#if !defined(NEED_SNPRINTF_ONLY)
+int portable_snprintf(char *str, size_t str_m, const char *fmt, /*args*/ ...) {
+  va_list ap;
+  int str_l;
+
+  va_start(ap, fmt);
+  str_l = portable_vsnprintf(str, str_m, fmt, ap);
+  va_end(ap);
+  return str_l;
+}
+#endif
+
+#if defined(NEED_SNPRINTF_ONLY)
+int portable_snprintf(char *str, size_t str_m, const char *fmt, /*args*/ ...) {
+#else
+int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) {
+#endif
+
+#if defined(NEED_SNPRINTF_ONLY)
+  va_list ap;
+#endif
+  size_t str_l = 0;
+  const char *p = fmt;
+
+/* In contrast with POSIX, the ISO C99 now says
+ * that str can be NULL and str_m can be 0.
+ * This is more useful than the old:  if (str_m < 1) return -1; */
+
+#if defined(NEED_SNPRINTF_ONLY)
+  va_start(ap, fmt);
+#endif
+  if (!p) p = "";
+  while (*p) {
+    if (*p != '%') {
+   /* if (str_l < str_m) str[str_l++] = *p++;    -- this would be sufficient */
+   /* but the following code achieves better performance for cases
+    * where format string is long and contains few conversions */
+      const char *q = strchr(p+1,'%');
+      size_t n = !q ? strlen(p) : (q-p);
+      if (str_l < str_m) {
+        size_t avail = str_m-str_l;
+        fast_memcpy(str+str_l, p, (n>avail?avail:n));
+      }
+      p += n; str_l += n;
+    } else {
+      const char *starting_p;
+      size_t min_field_width = 0, precision = 0;
+      int zero_padding = 0, precision_specified = 0, justify_left = 0;
+      int alternate_form = 0, force_sign = 0;
+      int space_for_positive = 1; /* If both the ' ' and '+' flags appear,
+                                     the ' ' flag should be ignored. */
+      char length_modifier = '\0';            /* allowed values: \0, h, l, L */
+      char tmp[32];/* temporary buffer for simple numeric->string conversion */
+
+      const char *str_arg;      /* string address in case of string argument */
+      size_t str_arg_l;         /* natural field width of arg without padding
+                                   and sign */
+      unsigned char uchar_arg;
+        /* unsigned char argument value - only defined for c conversion.
+           N.B. standard explicitly states the char argument for
+           the c conversion is unsigned */
+
+      size_t number_of_zeros_to_pad = 0;
+        /* number of zeros to be inserted for numeric conversions
+           as required by the precision or minimal field width */
+
+      size_t zero_padding_insertion_ind = 0;
+        /* index into tmp where zero padding is to be inserted */
+
+      char fmt_spec = '\0';
+        /* current conversion specifier character */
+
+      str_arg = credits;/* just to make compiler happy (defined but not used)*/
+      str_arg = NULL;
+      starting_p = p; p++;  /* skip '%' */
+   /* parse flags */
+      while (*p == '0' || *p == '-' || *p == '+' ||
+             *p == ' ' || *p == '#' || *p == '\'') {
+        switch (*p) {
+        case '0': zero_padding = 1; break;
+        case '-': justify_left = 1; break;
+        case '+': force_sign = 1; space_for_positive = 0; break;
+        case ' ': force_sign = 1;
+     /* If both the ' ' and '+' flags appear, the ' ' flag should be ignored */
+#ifdef PERL_COMPATIBLE
+     /* ... but in Perl the last of ' ' and '+' applies */
+                  space_for_positive = 1;
+#endif
+                  break;
+        case '#': alternate_form = 1; break;
+        case '\'': break;
+        }
+        p++;
+      }
+   /* If the '0' and '-' flags both appear, the '0' flag should be ignored. */
+
+   /* parse field width */
+      if (*p == '*') {
+        int j;
+        p++; j = va_arg(ap, int);
+        if (j >= 0) min_field_width = j;
+        else { min_field_width = -j; justify_left = 1; }
+      } else if (isdigit((int)(*p))) {
+        /* size_t could be wider than unsigned int;
+           make sure we treat argument like common implementations do */
+        unsigned int uj = *p++ - '0';
+        while (isdigit((int)(*p))) uj = 10*uj + (unsigned int)(*p++ - '0');
+        min_field_width = uj;
+      }
+   /* parse precision */
+      if (*p == '.') {
+        p++; precision_specified = 1;
+        if (*p == '*') {
+          int j = va_arg(ap, int);
+          p++;
+          if (j >= 0) precision = j;
+          else {
+            precision_specified = 0; precision = 0;
+         /* NOTE:
+          *   Solaris 2.6 man page claims that in this case the precision
+          *   should be set to 0.  Digital Unix 4.0, HPUX 10 and BSD man page
+          *   claim that this case should be treated as unspecified precision,
+          *   which is what we do here.
+          */
+          }
+        } else if (isdigit((int)(*p))) {
+          /* size_t could be wider than unsigned int;
+             make sure we treat argument like common implementations do */
+          unsigned int uj = *p++ - '0';
+          while (isdigit((int)(*p))) uj = 10*uj + (unsigned int)(*p++ - '0');
+          precision = uj;
+        }
+      }
+   /* parse 'h', 'l' and 'll' length modifiers */
+      if (*p == 'h' || *p == 'l') {
+        length_modifier = *p; p++;
+        if (length_modifier == 'l' && *p == 'l') {   /* double l = long long */
+#ifdef SNPRINTF_LONGLONG_SUPPORT
+          length_modifier = '2';                  /* double l encoded as '2' */
+#else
+          length_modifier = 'l';                 /* treat it as a single 'l' */
+#endif
+          p++;
+        }
+      }
+      fmt_spec = *p;
+   /* common synonyms: */
+      switch (fmt_spec) {
+      case 'i': fmt_spec = 'd'; break;
+      case 'D': fmt_spec = 'd'; length_modifier = 'l'; break;
+      case 'U': fmt_spec = 'u'; length_modifier = 'l'; break;
+      case 'O': fmt_spec = 'o'; length_modifier = 'l'; break;
+      default: break;
+      }
+   /* get parameter value, do initial processing */
+      switch (fmt_spec) {
+      case '%': /* % behaves similar to 's' regarding flags and field widths */
+      case 'c': /* c behaves similar to 's' regarding flags and field widths */
+      case 's':
+        length_modifier = '\0';          /* wint_t and wchar_t not supported */
+     /* the result of zero padding flag with non-numeric conversion specifier*/
+     /* is undefined. Solaris and HPUX 10 does zero padding in this case,    */
+     /* Digital Unix and Linux does not. */
+#if !defined(SOLARIS_COMPATIBLE) && !defined(HPUX_COMPATIBLE)
+        zero_padding = 0;    /* turn zero padding off for string conversions */
+#endif
+        str_arg_l = 1;
+        switch (fmt_spec) {
+        case '%':
+          str_arg = p; break;
+        case 'c': {
+          int j = va_arg(ap, int);
+          uchar_arg = (unsigned char) j;   /* standard demands unsigned char */
+          str_arg = (const char *) &uchar_arg;
+          break;
+        }
+        case 's':
+          str_arg = va_arg(ap, const char *);
+          if (!str_arg) str_arg_l = 0;
+       /* make sure not to address string beyond the specified precision !!! */
+          else if (!precision_specified) str_arg_l = strlen(str_arg);
+       /* truncate string if necessary as requested by precision */
+          else if (precision == 0) str_arg_l = 0;
+          else {
+       /* memchr on HP does not like n > 2^31  !!! */
+            const char *q = memchr(str_arg, '\0',
+                             precision <= 0x7fffffff ? precision : 0x7fffffff);
+            str_arg_l = !q ? precision : (q-str_arg);
+          }
+          break;
+        default: break;
+        }
+        break;
+      case 'd': case 'u': case 'o': case 'x': case 'X': case 'p': {
+        /* NOTE: the u, o, x, X and p conversion specifiers imply
+                 the value is unsigned;  d implies a signed value */
+
+        int arg_sign = 0;
+          /* 0 if numeric argument is zero (or if pointer is NULL for 'p'),
+            +1 if greater than zero (or nonzero for unsigned arguments),
+            -1 if negative (unsigned argument is never negative) */
+
+        int int_arg = 0;  unsigned int uint_arg = 0;
+          /* only defined for length modifier h, or for no length modifiers */
+
+        long int long_arg = 0;  unsigned long int ulong_arg = 0;
+          /* only defined for length modifier l */
+
+        void *ptr_arg = NULL;
+          /* pointer argument value -only defined for p conversion */
+
+#ifdef SNPRINTF_LONGLONG_SUPPORT
+        long long int long_long_arg = 0;
+        unsigned long long int ulong_long_arg = 0;
+          /* only defined for length modifier ll */
+#endif
+        if (fmt_spec == 'p') {
+        /* HPUX 10: An l, h, ll or L before any other conversion character
+         *   (other than d, i, u, o, x, or X) is ignored.
+         * Digital Unix:
+         *   not specified, but seems to behave as HPUX does.
+         * Solaris: If an h, l, or L appears before any other conversion
+         *   specifier (other than d, i, u, o, x, or X), the behavior
+         *   is undefined. (Actually %hp converts only 16-bits of address
+         *   and %llp treats address as 64-bit data which is incompatible
+         *   with (void *) argument on a 32-bit system).
+         */
+#ifdef SOLARIS_COMPATIBLE
+#  ifdef SOLARIS_BUG_COMPATIBLE
+          /* keep length modifiers even if it represents 'll' */
+#  else
+          if (length_modifier == '2') length_modifier = '\0';
+#  endif
+#else
+          length_modifier = '\0';
+#endif
+          ptr_arg = va_arg(ap, void *);
+          if (ptr_arg != NULL) arg_sign = 1;
+        } else if (fmt_spec == 'd') {  /* signed */
+          switch (length_modifier) {
+          case '\0':
+          case 'h':
+         /* It is non-portable to specify a second argument of char or short
+          * to va_arg, because arguments seen by the called function
+          * are not char or short.  C converts char and short arguments
+          * to int before passing them to a function.
+          */
+            int_arg = va_arg(ap, int);
+            if      (int_arg > 0) arg_sign =  1;
+            else if (int_arg < 0) arg_sign = -1;
+            break;
+          case 'l':
+            long_arg = va_arg(ap, long int);
+            if      (long_arg > 0) arg_sign =  1;
+            else if (long_arg < 0) arg_sign = -1;
+            break;
+#ifdef SNPRINTF_LONGLONG_SUPPORT
+          case '2':
+            long_long_arg = va_arg(ap, long long int);
+            if      (long_long_arg > 0) arg_sign =  1;
+            else if (long_long_arg < 0) arg_sign = -1;
+            break;
+#endif
+          }
+        } else {  /* unsigned */
+          switch (length_modifier) {
+          case '\0':
+          case 'h':
+            uint_arg = va_arg(ap, unsigned int);
+            if (uint_arg) arg_sign = 1;
+            break;
+          case 'l':
+            ulong_arg = va_arg(ap, unsigned long int);
+            if (ulong_arg) arg_sign = 1;
+            break;
+#ifdef SNPRINTF_LONGLONG_SUPPORT
+          case '2':
+            ulong_long_arg = va_arg(ap, unsigned long long int);
+            if (ulong_long_arg) arg_sign = 1;
+            break;
+#endif
+          }
+        }
+        str_arg = tmp; str_arg_l = 0;
+     /* NOTE:
+      *   For d, i, u, o, x, and X conversions, if precision is specified,
+      *   the '0' flag should be ignored. This is so with Solaris 2.6,
+      *   Digital UNIX 4.0, HPUX 10, Linux, FreeBSD, NetBSD; but not with Perl.
+      */
+#ifndef PERL_COMPATIBLE
+        if (precision_specified) zero_padding = 0;
+#endif
+        if (fmt_spec == 'd') {
+          if (force_sign && arg_sign >= 0)
+            tmp[str_arg_l++] = space_for_positive ? ' ' : '+';
+         /* leave negative numbers for sprintf to handle,
+            to avoid handling tricky cases like (short int)(-32768) */
+#ifdef LINUX_COMPATIBLE
+        } else if (fmt_spec == 'p' && force_sign && arg_sign > 0) {
+          tmp[str_arg_l++] = space_for_positive ? ' ' : '+';
+#endif
+        } else if (alternate_form) {
+          if (arg_sign != 0 && (fmt_spec == 'x' || fmt_spec == 'X') )
+            { tmp[str_arg_l++] = '0'; tmp[str_arg_l++] = fmt_spec; }
+         /* alternate form should have no effect for p conversion, but ... */
+#ifdef HPUX_COMPATIBLE
+          else if (fmt_spec == 'p'
+         /* HPUX 10: for an alternate form of p conversion,
+          *          a nonzero result is prefixed by 0x. */
+#ifndef HPUX_BUG_COMPATIBLE
+         /* Actually it uses 0x prefix even for a zero value. */
+                   && arg_sign != 0
+#endif
+                  ) { tmp[str_arg_l++] = '0'; tmp[str_arg_l++] = 'x'; }
+#endif
+        }
+        zero_padding_insertion_ind = str_arg_l;
+        if (!precision_specified) precision = 1;   /* default precision is 1 */
+        if (precision == 0 && arg_sign == 0
+#if defined(HPUX_BUG_COMPATIBLE) || defined(LINUX_COMPATIBLE)
+            && fmt_spec != 'p'
+         /* HPUX 10 man page claims: With conversion character p the result of
+          * converting a zero value with a precision of zero is a null string.
+          * Actually HP returns all zeroes, and Linux returns "(nil)". */
+#endif
+        ) {
+         /* converted to null string */
+         /* When zero value is formatted with an explicit precision 0,
+            the resulting formatted string is empty (d, i, u, o, x, X, p).   */
+        } else {
+          char f[5]; int f_l = 0;
+          f[f_l++] = '%';    /* construct a simple format string for sprintf */
+          if (!length_modifier) { }
+          else if (length_modifier=='2') { f[f_l++] = 'l'; f[f_l++] = 'l'; }
+          else f[f_l++] = length_modifier;
+          f[f_l++] = fmt_spec; f[f_l++] = '\0';
+          if (fmt_spec == 'p') str_arg_l += sprintf(tmp+str_arg_l, f, ptr_arg);
+          else if (fmt_spec == 'd') {  /* signed */
+            switch (length_modifier) {
+            case '\0':
+            case 'h': str_arg_l+=sprintf(tmp+str_arg_l, f, int_arg);  break;
+            case 'l': str_arg_l+=sprintf(tmp+str_arg_l, f, long_arg); break;
+#ifdef SNPRINTF_LONGLONG_SUPPORT
+            case '2': str_arg_l+=sprintf(tmp+str_arg_l,f,long_long_arg); break;
+#endif
+            }
+          } else {  /* unsigned */
+            switch (length_modifier) {
+            case '\0':
+            case 'h': str_arg_l+=sprintf(tmp+str_arg_l, f, uint_arg);  break;
+            case 'l': str_arg_l+=sprintf(tmp+str_arg_l, f, ulong_arg); break;
+#ifdef SNPRINTF_LONGLONG_SUPPORT
+            case '2': str_arg_l+=sprintf(tmp+str_arg_l,f,ulong_long_arg);break;
+#endif
+            }
+          }
+         /* include the optional minus sign and possible "0x"
+            in the region before the zero padding insertion point */
+          if (zero_padding_insertion_ind < str_arg_l &&
+              tmp[zero_padding_insertion_ind] == '-') {
+            zero_padding_insertion_ind++;
+          }
+          if (zero_padding_insertion_ind+1 < str_arg_l &&
+              tmp[zero_padding_insertion_ind]   == '0' &&
+             (tmp[zero_padding_insertion_ind+1] == 'x' ||
+              tmp[zero_padding_insertion_ind+1] == 'X') ) {
+            zero_padding_insertion_ind += 2;
+          }
+        }
+        { size_t num_of_digits = str_arg_l - zero_padding_insertion_ind;
+          if (alternate_form && fmt_spec == 'o'
+#ifdef HPUX_COMPATIBLE                                  /* ("%#.o",0) -> ""  */
+              && (str_arg_l > 0)
+#endif
+#ifdef DIGITAL_UNIX_BUG_COMPATIBLE                      /* ("%#o",0) -> "00" */
+#else
+              /* unless zero is already the first character */
+              && !(zero_padding_insertion_ind < str_arg_l
+                   && tmp[zero_padding_insertion_ind] == '0')
+#endif
+          ) {        /* assure leading zero for alternate-form octal numbers */
+            if (!precision_specified || precision < num_of_digits+1) {
+             /* precision is increased to force the first character to be zero,
+                except if a zero value is formatted with an explicit precision
+                of zero */
+              precision = num_of_digits+1; precision_specified = 1;
+            }
+          }
+       /* zero padding to specified precision? */
+          if (num_of_digits < precision) 
+            number_of_zeros_to_pad = precision - num_of_digits;
+        }
+     /* zero padding to specified minimal field width? */
+        if (!justify_left && zero_padding) {
+          int n = min_field_width - (str_arg_l+number_of_zeros_to_pad);
+          if (n > 0) number_of_zeros_to_pad += n;
+        }
+        break;
+      }
+      default: /* unrecognized conversion specifier, keep format string as-is*/
+        zero_padding = 0;  /* turn zero padding off for non-numeric convers. */
+#ifndef DIGITAL_UNIX_COMPATIBLE
+        justify_left = 1; min_field_width = 0;                /* reset flags */
+#endif
+#if defined(PERL_COMPATIBLE) || defined(LINUX_COMPATIBLE)
+     /* keep the entire format string unchanged */
+        str_arg = starting_p; str_arg_l = p - starting_p;
+     /* well, not exactly so for Linux, which does something inbetween,
+      * and I don't feel an urge to imitate it: "%+++++hy" -> "%+y"  */
+#else
+     /* discard the unrecognized conversion, just keep *
+      * the unrecognized conversion character          */
+        str_arg = p; str_arg_l = 0;
+#endif
+        if (*p) str_arg_l++;  /* include invalid conversion specifier unchanged
+                                 if not at end-of-string */
+        break;
+      }
+      if (*p) p++;      /* step over the just processed conversion specifier */
+   /* insert padding to the left as requested by min_field_width;
+      this does not include the zero padding in case of numerical conversions*/
+      if (!justify_left) {                /* left padding with blank or zero */
+        int n = min_field_width - (str_arg_l+number_of_zeros_to_pad);
+        if (n > 0) {
+          if (str_l < str_m) {
+            size_t avail = str_m-str_l;
+            fast_memset(str+str_l, (zero_padding?'0':' '), (n>avail?avail:n));
+          }
+          str_l += n;
+        }
+      }
+   /* zero padding as requested by the precision or by the minimal field width
+    * for numeric conversions required? */
+      if (number_of_zeros_to_pad <= 0) {
+     /* will not copy first part of numeric right now, *
+      * force it to be copied later in its entirety    */
+        zero_padding_insertion_ind = 0;
+      } else {
+     /* insert first part of numerics (sign or '0x') before zero padding */
+        int n = zero_padding_insertion_ind;
+        if (n > 0) {
+          if (str_l < str_m) {
+            size_t avail = str_m-str_l;
+            fast_memcpy(str+str_l, str_arg, (n>avail?avail:n));
+          }
+          str_l += n;
+        }
+     /* insert zero padding as requested by the precision or min field width */
+        n = number_of_zeros_to_pad;
+        if (n > 0) {
+          if (str_l < str_m) {
+            size_t avail = str_m-str_l;
+            fast_memset(str+str_l, '0', (n>avail?avail:n));
+          }
+          str_l += n;
+        }
+      }
+   /* insert formatted string
+    * (or as-is conversion specifier for unknown conversions) */
+      { int n = str_arg_l - zero_padding_insertion_ind;
+        if (n > 0) {
+          if (str_l < str_m) {
+            size_t avail = str_m-str_l;
+            fast_memcpy(str+str_l, str_arg+zero_padding_insertion_ind,
+                        (n>avail?avail:n));
+          }
+          str_l += n;
+        }
+      }
+   /* insert right padding */
+      if (justify_left) {          /* right blank padding to the field width */
+        int n = min_field_width - (str_arg_l+number_of_zeros_to_pad);
+        if (n > 0) {
+          if (str_l < str_m) {
+            size_t avail = str_m-str_l;
+            fast_memset(str+str_l, ' ', (n>avail?avail:n));
+          }
+          str_l += n;
+        }
+      }
+    }
+  }
+#if defined(NEED_SNPRINTF_ONLY)
+  va_end(ap);
+#endif
+  if (str_m > 0) { /* make sure the string is null-terminated
+                      even at the expense of overwriting the last character
+                      (shouldn't happen, but just in case) */
+    str[str_l <= str_m-1 ? str_l : str_m-1] = '\0';
+  }
+  /* Return the number of characters formatted (excluding trailing null
+   * character), that is, the number of characters that would have been
+   * written to the buffer if it were large enough.
+   *
+   * The value of str_l should be returned, but str_l is of unsigned type
+   * size_t, and snprintf is int, possibly leading to an undetected
+   * integer overflow, resulting in a negative return value, which is illegal.
+   * Both XSH5 and ISO C99 (at least the draft) are silent on this issue.
+   * Should errno be set to EOVERFLOW and EOF returned in this case???
+   */
+  return (int) str_l;
+}
+#endif

Added: unstable/liquidwar/branches/upstream/current/utils/snprintf/snprintf.h
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/snprintf/snprintf.h	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/snprintf/snprintf.h	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,26 @@
+#ifndef _PORTABLE_SNPRINTF_H_
+#define _PORTABLE_SNPRINTF_H_
+
+#define PORTABLE_SNPRINTF_VERSION_MAJOR 2
+#define PORTABLE_SNPRINTF_VERSION_MINOR 2
+
+#ifdef HAVE_SNPRINTF
+#include <stdio.h>
+#else
+extern int snprintf(char *, size_t, const char *, /*args*/ ...);
+extern int vsnprintf(char *, size_t, const char *, va_list);
+#endif
+
+#if defined(HAVE_SNPRINTF) && defined(PREFER_PORTABLE_SNPRINTF)
+extern int portable_snprintf(char *str, size_t str_m, const char *fmt, /*args*/ ...);
+extern int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap);
+#define snprintf  portable_snprintf
+#define vsnprintf portable_vsnprintf
+#endif
+
+extern int asprintf  (char **ptr, const char *fmt, /*args*/ ...);
+extern int vasprintf (char **ptr, const char *fmt, va_list ap);
+extern int asnprintf (char **ptr, size_t str_m, const char *fmt, /*args*/ ...);
+extern int vasnprintf(char **ptr, size_t str_m, const char *fmt, va_list ap);
+
+#endif

Added: unstable/liquidwar/branches/upstream/current/utils/snprintf/test.c
===================================================================
--- unstable/liquidwar/branches/upstream/current/utils/snprintf/test.c	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/utils/snprintf/test.c	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,689 @@
+/*
+ * test.c - test a portable implementation of snprintf
+ *
+ * AUTHOR
+ *   Mark Martinec <mark.martinec at ijs.si>, April 1999.
+ *
+ *   Copyright 1999, Mark Martinec. All rights reserved.
+ *
+ * TERMS AND CONDITIONS
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the "Frontier Artistic License" which comes
+ *   with this Kit.
+ *
+ *   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 Frontier Artistic License for more details.
+ *
+ *   You should have received a copy of the Frontier Artistic License
+ *   with this Kit in the file named LICENSE.txt .
+ *   If not, I'll be glad to provide one.
+ *
+ * NOTE:  This test program is a QUICK and DIRTY tool
+ * =====  used while testing and benchmarking my portable snprintf.
+ *        Certain data types are not fully supported, certain test
+ *        cases were fabricated during testing by modifying the code
+ *        or running it by specifying test parameters in the command line.
+ *
+ *        You are on your own if you want to use this test program!
+ */
+
+/* If no command arguments are specified do the exhaustive test.
+ * This takes a long time. You may want to reduce the fw and fp
+ * upper limits in the for loops.
+ * You may also reduce the number of test elements in the array iargs.
+ */
+
+#include <sys/types.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+#include <assert.h>
+#include <time.h>
+
+#if defined(NEED_ASPRINTF) || defined(NEED_ASNPRINTF) || defined(NEED_VASPRINTF) || defined(NEED_VASNPRINTF)
+# if defined(NEED_SNPRINTF_ONLY)
+# undef NEED_SNPRINTF_ONLY
+# endif
+# if !defined(PREFER_PORTABLE_SNPRINTF)
+# define PREFER_PORTABLE_SNPRINTF
+# endif
+#endif
+
+#ifdef HAVE_SNPRINTF
+extern int portable_snprintf(char *str, size_t str_m, const char *fmt, /*args*/ ...);
+#else
+extern int snprintf(char *, size_t, const char *, /*args*/ ...);
+extern int vsnprintf(char *, size_t, const char *, va_list);
+#endif
+
+#ifndef HAVE_SNPRINTF
+#define portable_snprintf  snprintf
+#define portable_vsnprintf vsnprintf
+#endif
+
+#ifndef CLOCKS_PER_SEC
+#define CLOCKS_PER_SEC 100
+#endif
+
+#define min(a,b) ((a)<(b) ? (a) : (b))
+#define max(a,b) ((a)>(b) ? (a) : (b))
+
+extern int asprintf  (char **ptr, const char *fmt, /*args*/ ...);
+extern int vasprintf (char **ptr, const char *fmt, va_list ap);
+extern int asnprintf (char **ptr, size_t str_m, const char *fmt, /*args*/ ...);
+extern int vasnprintf(char **ptr, size_t str_m, const char *fmt, va_list ap);
+
+#ifndef NEED_SNPRINTF_ONLY
+int wrap_vsnprintf(char *str, size_t str_m, const char *fmt, /*args*/ ...);
+int wrap_vsnprintf(char *str, size_t str_m, const char *fmt, ...) {
+  va_list ap;
+  int str_l;
+
+  va_start(ap, fmt);
+  str_l = vsnprintf(str, str_m, fmt, ap);
+  va_end(ap);
+  return str_l;
+}
+#endif
+
+#ifdef NEED_VASPRINTF
+int wrap_vasprintf(char **ptr, const char *fmt, /*args*/ ...);
+int wrap_vasprintf(char **ptr, const char *fmt, ...) {
+  va_list ap;
+  int str_l;
+
+  va_start(ap, fmt);
+  str_l = vasprintf(ptr, fmt, ap);
+  va_end(ap);
+  return str_l;
+}
+#endif
+
+#ifdef NEED_VASNPRINTF
+int wrap_vasnprintf(char **ptr, size_t str_m, const char *fmt, /*args*/ ...);
+int wrap_vasnprintf(char **ptr, size_t str_m, const char *fmt, ...) {
+  va_list ap;
+  int str_l;
+
+  va_start(ap, fmt);
+  str_l = vasnprintf(ptr, str_m, fmt, ap);
+  va_end(ap);
+  return str_l;
+}
+#endif
+
+int main(int argc, char *argv[]) {
+  char str1[256], str2[256];
+#ifdef HAVE_SNPRINTF
+  char str3[256];
+#endif
+  int len1, len2, len3;
+  int bad = 0;
+  size_t str_m = 20; /* declared str size */
+
+  if (0) {
+ /* benchmarking */
+    const int cnt = 100000;
+    size_t size;
+    char str[40000];
+    time_t t0,t;
+    int j,len,l1,l2;
+    char *p;
+    int breakpoint;
+
+    size = 18000;
+
+    printf("\n\nsize = %d\n", (int)size);
+    p = malloc(size); assert(p);
+    memset(p,'h',size); p[size-1] = '\0';
+    t0 = clock();
+
+    printf("\ndetermine breakeven point to see when it is worth\n");
+    printf("calling memcpy and when to do inline string copy\n");
+    printf("str_l, memcpy, inline\n");
+    for (breakpoint=0; breakpoint<=35; breakpoint++) {
+      register size_t nnn = (size_t)breakpoint;
+      printf("%5ld", nnn);
+      for (j=10*cnt; j>0; j--) memcpy(str, p, nnn);
+      t = clock(); printf(" %1.3f", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+      for (j=10*cnt; j>0; j--) {
+        register size_t nn = (size_t)breakpoint;
+        if (nn > 0) {
+          register char *dd; register const char *ss;
+          for (ss=p, dd=str; nn>0; nn--) *dd++ = *ss++;
+        }
+      }
+      t = clock(); printf(" %1.3f\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+    }
+
+    printf("\nmeasuring time to SKIP a long format with no conversions\n");
+    p[0] = '%'; p[1] = 's';
+    for (j=cnt; j>0; j--) l1=portable_snprintf(NULL,(size_t)0,p,"1234567890");
+    t = clock(); printf("t_port_nul = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+    for (j=cnt; j>0; j--) l2=portable_snprintf(str,(size_t)8,p,"1234567890");
+    t = clock(); printf("t_port     = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+    assert(l1==l2);
+    p[0] = p[1] = 'h';
+
+    printf("\nmeasuring time to copy a long format with no conversions\n");
+    for (j=cnt; j>0; j--) l1=portable_snprintf(NULL,(size_t)0,p);
+    t = clock(); printf("t_port_nul = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+    for (j=cnt; j>0; j--) l2=portable_snprintf(str,sizeof(str),p);
+    t = clock(); printf("t_port     = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+    assert(l1==l2);
+    for (j=cnt; j>0; j--) sprintf(str,p);
+    t = clock(); printf("t_sys      = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+
+    printf("\nmeasuring time to copy a long format with one conversion\n");
+    p[size-10] = '%';
+    for (j=cnt; j>0; j--) l1=portable_snprintf(NULL,(size_t)0,p);
+    t = clock(); printf("t_port_nul = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+    for (j=cnt; j>0; j--) l2=portable_snprintf(str,sizeof(str),p);
+    t = clock(); printf("t_port     = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+    assert(l1==l2);
+    for (j=cnt; j>0; j--) sprintf(str,p);
+    t = clock(); printf("t_sys      = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+
+    printf("\nmeasuring string argument copy speed\n");
+    for (j=cnt; j>0; j--) l1=portable_snprintf(NULL,(size_t)0,"%.18000s",p);
+    t = clock(); printf("t_port_nul = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+    for (j=cnt; j>0; j--) l2=portable_snprintf(str,sizeof(str),"%.18000s",p);
+    t = clock(); printf("t_port     = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+    assert(l1==l2);
+    for (j=cnt; j>0; j--) sprintf(str,"%.18000s",p);
+    t = clock(); printf("t_sys      = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+
+    printf("\nmeasuring left padding speed\n");
+    p[0] = '\0';
+    for (j=cnt; j>0; j--) l1=portable_snprintf(NULL,(size_t)0,"%-18000s",p);
+    t = clock(); printf("t_port_nul = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+    for (j=cnt; j>0; j--) l2=portable_snprintf(str,sizeof(str),"%-18000s",p);
+    t = clock(); printf("t_port     = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+    assert(l1==l2);
+    for (j=cnt; j>0; j--) sprintf(str,"%-18000s",p);
+    t = clock(); printf("t_sys      = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+
+    printf("\nmeasuring right padding speed\n");
+    p[0] = '\0';
+    for (j=cnt; j>0; j--) l1=portable_snprintf(NULL,(size_t)0,"%18000s",p);
+    t = clock(); printf("t_port_nul = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+    for (j=cnt; j>0; j--) l2=portable_snprintf(str,sizeof(str),"%18000s",p);
+    t = clock(); printf("t_port     = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+    assert(l1==l2);
+    for (j=cnt; j>0; j--) sprintf(str,"%18000s",p);
+    t = clock(); printf("t_sys      = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+
+    printf("\nmeasuring zero padding speed\n");
+    for (j=cnt; j>0; j--) l1=portable_snprintf(NULL,(size_t)0,"%018000d",1);
+    t = clock(); printf("t_port_nul = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+    for (j=cnt; j>0; j--) l2=portable_snprintf(str,sizeof(str),"%018000d",1);
+    t = clock(); printf("t_port     = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+    assert(l1==l2);
+    for (j=cnt; j>0; j--) sprintf(str,"%018000d",1);
+    t = clock(); printf("t_sys      = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+
+    printf("\nmeasuring system's sprintf to efficiently handle truncated strings\n");
+    memset(p,'h',size); p[size-1] = '\0';
+    t0 = clock();
+    for (j=cnt; j>0; j--) len = strlen(p);
+    printf("len = %d\n", len);
+    t = clock(); printf("t_strlen = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+/* test if the system sprintf scans the whole string (e.g. by strlen)
+ * before recognizing this was a bad idea since the format specified
+ * a truncated string precision, e.g. "%.8s" .
+ */
+    for (j=cnt; j>0; j--) sprintf(str,"%.2s",p);
+    t = clock(); printf("t_sys    = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+#ifdef HAVE_SNPRINTF
+    for (j=cnt; j>0; j--) snprintf(str,sizeof(str),"%.2s",p);
+    t = clock(); printf("t_sys    = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+#endif
+    for (j=cnt; j>0; j--) portable_snprintf(str,sizeof(str),"%.2s",p);
+    t = clock(); printf("t_port   = %1.3f s\n", (float)(t-t0)/CLOCKS_PER_SEC); t0 = t;
+
+    free(p);
+    return 0;
+  }
+
+
+/* preliminary halfhearted test */
+{
+    const char fmt[] = "Bla%.4s%05iHE%%%-50sTail";
+    char *ptr4=0, *ptr5=0, *ptr6=0, *ptr7=0;
+    int len1f;
+    char str_full[256];
+
+    printf("\npreliminary test: snprintf\n");
+    len1  = snprintf(str1, str_m, fmt, "abcdef",-12,"str");
+    len1f = snprintf(str_full, sizeof(str_full), fmt, "abcdef",-12,"str");
+    assert(len1f==len1);
+    assert(memcmp(str1,str_full,min(len1,str_m-1)) == 0);
+    assert(str1[str_m-1] == '\0');
+    assert(str_full[sizeof(str_full)-1] == '\0');
+
+#ifndef NEED_SNPRINTF_ONLY
+    printf("preliminary test: vsnprintf\n");
+    len2 = wrap_vsnprintf(str2, str_m, fmt, "abcdef",-12,"str");
+    assert(len2==len1);
+    assert(memcmp(str1,str2,min(len1+1,str_m)) == 0);
+    assert(str2[str_m-1] == '\0');
+#endif
+
+#ifdef NEED_ASPRINTF
+    printf("preliminary test: asprintf\n");
+    len4 = asprintf(&ptr4, fmt, "abcdef",-12,"str");
+    assert(ptr4);
+    assert(len4==len1);
+    assert(memcmp(str_full,ptr4,min(len4+1,sizeof(str_full))) == 0);
+    assert(ptr4[len4] == '\0');
+#endif
+
+#ifdef NEED_ASNPRINTF
+    printf("preliminary test: asnprintf\n");
+    len5 = asnprintf(&ptr5, str_m, fmt, "abcdef",-12,"str");
+    assert(ptr5);
+    assert(len5==len1);
+    assert(memcmp(str1,ptr5,min(len5+1,str_m)) == 0);
+    assert(ptr5[len5] == '\0');
+#endif
+
+#ifdef NEED_VASPRINTF
+    printf("preliminary test: vasprintf\n");
+    len6 = wrap_vasprintf(&ptr6, fmt, "abcdef",-12,"str");
+    assert(ptr6);
+    assert(len6==len1);
+    assert(memcmp(str_full,ptr6,min(len6+1,sizeof(str_full))) == 0);
+    assert(ptr6[len6] == '\0');
+#endif
+
+#ifdef NEED_VASNPRINTF
+    printf("preliminary test: vasnprintf\n");
+    len7 = wrap_vasnprintf(&ptr7, str_m, fmt, "abcdef",-12,"str");
+    assert(ptr7);
+    assert(len7==len1);
+    assert(memcmp(str1,ptr7,min(len7+1,str_m)) == 0);
+    assert(ptr7[len7] == '\0');
+#endif
+
+    if (ptr4) free(ptr4);
+    if (ptr5) free(ptr5);
+    if (ptr6) free(ptr6);
+    if (ptr7) free(ptr7);
+}
+
+/* second preliminary halfhearted test */
+{
+    printf("\nsecond preliminary test:\n");
+
+    printf("test 0a\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "");
+    len2 = sprintf (str2,               "");
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+    printf("test 0b\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "YK");
+    len2 = sprintf (str2,               "YK");
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+    printf("test 1\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "%+d",0);
+    len2 = sprintf (str2,               "%+d",0);
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+    printf("test 2\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "%.2147483647s", "13");
+    len2 = sprintf (str2,               "%.2147483647s", "13");
+    printf("len1=%d, len2=%d\n", len1,len2);
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+    printf("test 3a\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "%.2147483648s", "13");
+    len2 = sprintf (str2,               "%.2147483648s", "13");
+    printf("len1=%d, len2=%d\n", len1,len2);
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+    printf("test 3b\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "%.2147483649s", "13");
+    len2 = sprintf (str2,               "%.2147483649s", "13");
+    printf("len1=%d, len2=%d\n", len1,len2);
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+    printf("test 4\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "%-.2147483647s", "13");
+    len2 = sprintf (str2,               "%-.2147483647s", "13");
+    printf("len1=%d, len2=%d\n", len1,len2);
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+    printf("test 5\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "%-.2147483648s", "13");
+    len2 = sprintf (str2,               "%-.2147483648s", "13");
+    printf("len1=%d, len2=%d\n", len1,len2);
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+    printf("test 6\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "%.4294967295s", "13");
+    len2 = sprintf (str2,               "%.4294967295s", "13");
+    printf("len1=%d, len2=%d\n", len1,len2);
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+    printf("test 7\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "%.4294967296s", "13");
+    len2 = sprintf (str2,               "%.4294967296s", "13");
+    printf("len1=%d, len2=%d\n", len1,len2);
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+
+    printf("test 12\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "%.*s", 2147483647,"13");
+    len2 = sprintf (str2,               "%.*s", 2147483647,"13");
+    printf("len1=%d, len2=%d\n", len1,len2);
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+    printf("test 13\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "%.*s", 2147483648U,"13");
+    len2 = sprintf (str2,               "%.*s", 2147483648U,"13");
+    printf("len1=%d, len2=%d\n", len1,len2);
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+    printf("test 14\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "%-.*s", 2147483647,"13");
+    len2 = sprintf (str2,               "%-.*s", 2147483647,"13");
+    printf("len1=%d, len2=%d\n", len1,len2);
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+    printf("test 15\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "%-.*s", 2147483648U,"13");
+    len2 = sprintf (str2,               "%-.*s", 2147483648U,"13");
+    printf("len1=%d, len2=%d\n", len1,len2);
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+    printf("test 16\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "%.*s", 4294967295U,"13");
+    len2 = sprintf (str2,               "%.*s", 4294967295U,"13");
+    printf("len1=%d, len2=%d\n", len1,len2);
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+    printf("test 17\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "%.*s", 4294967296U,"13");
+/*  len2 = sprintf (str2,               "%.*s", 4294967296U,"13"); */ /* core dumps on HPUX */
+/*  assert(len1==len2);
+ *  assert(memcmp(str1,str2,(size_t)len1) == 0);
+ */
+
+
+    printf("test 95\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "%c",'A');
+    len2 = sprintf (str2,               "%c",'A');
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+    printf("test 96\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "%10c",'A');
+    len2 = sprintf (str2,               "%10c",'A');
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+    printf("test 97\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "%-10c",'A');
+    len2 = sprintf (str2,               "%-10c",'A');
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+    printf("test 98\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "%.10c",'A');
+    len2 = sprintf (str2,               "%.10c",'A');
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+    printf("test 99\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, sizeof(str1), "%-.10c",'A');
+    len2 = sprintf (str2,               "%-.10c",'A');
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)len1) == 0);
+
+
+    printf("test 100\n");
+    memset(str1,'x',sizeof(str1));  memset(str2,'x',sizeof(str2));
+    len1 = snprintf(str1, (size_t)8, "blaBhb%shehe%cX","ABCD",'1');
+    len2 = sprintf (str2,            "blaBhb%shehe%cX","ABCD",'1');
+    assert(len1==len2);
+    assert(memcmp(str1,str2,(size_t)7) == 0);
+    assert(str1[7] == '\0');
+    assert(memcmp(str1+14,str2+16,(size_t)(len1-16)) == 0);
+
+}
+
+ /* testing for correctness and compatibility */
+  if (argc >= 3) {
+    char *c; int alldigits = 1;
+    for (c=argv[2]; *c; c++)
+      if (! (*c == '-' || (*c >= '0' && *c <= '9'))) alldigits = 0;
+    if (alldigits) {
+      int j = atoi(argv[2]);
+      len1 = portable_snprintf(str1, str_m, argv[1], j, 3);
+      len2 = sprintf(str2,                  argv[1], j, 3);
+#ifdef HAVE_SNPRINTF
+      len3 = snprintf(str3, str_m,          argv[1], j, 3);
+#endif
+    } else {
+      len1 = portable_snprintf(str1, str_m, argv[1], argv[2], 3);
+      len2 = sprintf(str2,                  argv[1], argv[2], 3);
+#ifdef HAVE_SNPRINTF
+      len3 = snprintf(str3, str_m,          argv[1], argv[2], 3);
+#endif
+    }
+    printf("portable:     |%s|  len = %d\n", str1, len1);
+    printf("sys sprintf:  |%s|  len = %d\n", str2, len2);
+#ifdef HAVE_SNPRINTF
+    printf("sys snprintf: |%s|  len = %d\n", str3, len3);
+#endif
+  } else {  /* exhaustive testing */
+
+    const char flags[] = "+- 0#";     /* set of test flags   (including '\0')*/
+    int flags_l = strlen(flags);
+
+    const char fspec[] = "scdpoxXuiy"; /* set of test formats (including '\0') */
+    int fspec_l = strlen(fspec);
+
+#ifdef SNPRINTF_LONGLONG_SUPPORT
+    const char datatype[] = " hl2"; /* set of datatypes */
+#else
+    const char datatype[] = " hl";  /* set of datatypes */
+#endif
+    int datatype_l = strlen(datatype);
+
+    const long int iargs[] =                /* set of numeric test arguments */
+      { 0,1,9,10,28,99,100,127,128,129,998,1000,32767,32768,32769,
+        -1,-9,-10,-28,-99,-100,-127,-128,-129,
+        -998,-1000,-32767,-32768,-32769 };
+    int iargs_l = sizeof(iargs)/sizeof(iargs[0]);
+    const char *sargs[] =             /* set of string test arguments */
+      { "", "a", "0", "-ab", "abcde", "abcdefghijk mnopqrstuv" };
+    int sargs_l = sizeof(sargs)/sizeof(sargs[0]);
+
+    char fmt[256];
+    int fmt_l;
+    int a, fs, fl1, fl2, fl3, fl4, fl5, fw, fp, dt;
+
+    for (fs=0; fs<=fspec_l; fs++) {  /* format specifier */
+      int strtype = (fspec[fs] == 's' || fspec[fs] == '%');
+      int args_l = (strtype ? sargs_l : iargs_l);
+
+      for (fw= -1; fw<=3; fw++) {  /* minimal field width */
+
+        printf("Trying format  %%");
+        if (fw >= 0) printf("%d", fw);
+        if (fspec[fs]) putchar(fspec[fs]);
+        putchar('\n');
+
+        for (fp= -2; fp<=3; fp++) {   /* format field precision */
+
+          /* data type modifiers */
+          for (dt=0; dt < ((strtype||fspec[fs]=='c') ? 1 : datatype_l); dt++) {
+
+            int dataty = datatype[dt];
+
+            if (fspec[fs] == 'D' || fspec[fs] == 'U' || fspec[fs] == 'O')
+              dataty = 'l';
+
+            if (fspec[fs] == 'p' && dataty == '2') continue;
+
+            for (fl1=0; fl1<=flags_l; fl1++) {  /* flags */
+             for (fl2=0; fl2<=flags_l; fl2++) {
+              for (fl3=0; fl3<=flags_l; fl3++) {
+               for (fl4=0; fl4<=flags_l; fl4++) {
+                for (fl5=0; fl5<=flags_l; fl5++) {
+
+                   for (a=0; a<args_l; a++) {  /* test arguments */
+
+                     fmt_l = 0; fmt[fmt_l++] = '%';
+                     if (flags[fl1]) fmt[fmt_l++] = flags[fl1];
+                     if (flags[fl2]) fmt[fmt_l++] = flags[fl2];
+                     if (flags[fl3]) fmt[fmt_l++] = flags[fl3];
+                     if (flags[fl4]) fmt[fmt_l++] = flags[fl4];
+                     if (flags[fl5]) fmt[fmt_l++] = flags[fl5];
+                     if (fw >= 0) fmt_l += sprintf(fmt+fmt_l, "%d", fw);
+                     if (fp >= -1) {
+                       fmt[fmt_l++] = '.';
+                       if (fp >= 0) fmt_l += sprintf(fmt+fmt_l, "%d", fp);
+                     }
+                     if (dataty == '2')
+                       { fmt[fmt_l++] = 'l'; fmt[fmt_l++] = 'l'; }
+                     else if (dataty != ' ')
+                       { fmt[fmt_l++] = dataty; }
+
+                     if (fspec[fs]) fmt[fmt_l++] = fspec[fs];
+                     fmt[fmt_l++] = '\0';
+
+                     if (a==0 && fl1==flags_l && fl2==flags_l && fl3==flags_l
+                         && fl4==flags_l && fl5==flags_l) printf("%s\n", fmt);
+
+#ifdef HAVE_SNPRINTF
+                     memset(str1,'G',sizeof(str1));
+                     memset(str2,'G',sizeof(str2));
+                     memset(str3,'G',sizeof(str3));
+#endif
+                     len1 = len2 = len3 = 0;
+                     if (strtype) {
+                       len1 = portable_snprintf(str1, str_m, fmt, sargs[a]);
+                       len2 = sprintf(str2,                  fmt, sargs[a]);
+#ifdef HAVE_SNPRINTF
+                       len3 = snprintf(str3, str_m,          fmt, sargs[a]);
+#endif
+                     } else if (fspec[fs] == 'p') {
+                       len1 = portable_snprintf(str1, str_m, fmt, (void *)iargs[a]);
+                       len2 = sprintf(str2,                  fmt, (void *)iargs[a]);
+#ifdef HAVE_SNPRINTF
+                       len3 = snprintf(str3, str_m,          fmt, (void *)iargs[a]);
+#endif
+                     } else {
+                       switch (dataty) {
+                       case '\0':
+                         len1 = portable_snprintf(str1, str_m, fmt, (int) iargs[a]);
+                         len2 = sprintf(str2,                  fmt, (int) iargs[a]);
+#ifdef HAVE_SNPRINTF
+                         len3 = snprintf(str3, str_m,          fmt, (int) iargs[a]);
+#endif
+                         break;
+                       case 'h':
+                         len1 = portable_snprintf(str1, str_m, fmt, (short int)iargs[a]);
+                         len2 = sprintf(str2,                  fmt, (short int)iargs[a]);
+#ifdef HAVE_SNPRINTF
+                         len3 = snprintf(str3, str_m,          fmt, (short int)iargs[a]);
+#endif
+                         break;
+                       case 'l':
+                         len1 = portable_snprintf(str1, str_m, fmt, (long int)iargs[a]);
+                         len2 = sprintf(str2,                  fmt, (long int)iargs[a]);
+#ifdef HAVE_SNPRINTF
+                         len3 = snprintf(str3, str_m,          fmt, (long int)iargs[a]);
+#endif
+                         break;
+#ifdef SNPRINTF_LONGLONG_SUPPORT
+                       case '2':
+                         len1 = portable_snprintf(str1, str_m, fmt, (long long int)iargs[a]);
+                         len2 = sprintf(str2,                  fmt, (long long int)iargs[a]);
+#ifdef HAVE_SNPRINTF
+                         len3 = snprintf(str3, str_m,          fmt, (long long int)iargs[a]);
+#endif
+                         break;
+#endif
+                       }
+                     }
+
+                     if (0) {
+#ifdef HAVE_SNPRINTF
+                     } else if (len1 != len3 ||
+                         memcmp(str1,str3,min(len1+20,sizeof(str1))) != 0) {
+                       bad = 1;
+                       if (strtype) printf("\n2: %s, <%s>\n", fmt, sargs[a]);
+                       else         printf("\n2: %s, %ld\n",   fmt, iargs[a]);
+                       printf("portable:     |%s|  len = %d\n", str1, len1);
+                       printf("sys sprintf:  |%s|  len = %d\n", str2, len2);
+                       printf("sys snprintf: |%s|  len = %d\n", str3, len3);
+#else
+                     } else if (len1 != len2 ||
+                         (len1>0 && memcmp(str1,str2,min(len1,str_m)-1) != 0)) {
+                       bad = 1;
+                       if (strtype) printf("\n1: %s, <%s>\n", fmt, sargs[a]);
+                       else         printf("\n1: %s, %ld\n",   fmt, iargs[a]);
+                       printf("portable:     |%s|  len = %d\n", str1, len1);
+                       printf("sys sprintf:  |%s|  len = %d\n", str2, len2);
+#endif
+                     }
+                     if (bad) return(1);
+                   }
+
+                }
+               }
+              }
+             }
+
+            }
+          }
+        }
+      }
+    }
+  }
+  return (bad?1:0);
+}

Added: unstable/liquidwar/branches/upstream/current/utils/snprintf/valid-html40.gif
===================================================================
(Binary files differ)


Property changes on: unstable/liquidwar/branches/upstream/current/utils/snprintf/valid-html40.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: unstable/liquidwar/branches/upstream/current/www/README
===================================================================
--- unstable/liquidwar/branches/upstream/current/www/README	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/www/README	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,31 @@
+This directory contains the files required to set up a meta-server.
+
+I call meta-server the software which I run on my web site to allow the
+Liquid War servers to register themselves so that clients can automatically
+find out which servers are running in the world.
+
+You might be interested in setting up such a server for yourself, if you
+think for instance that the "official" is too slow, not enough reliable etc...
+You could also want to have a meta-server running on your LAN, to keep
+track of existing servers without informing the whole world about it.
+You do not need to do it, since there's a permanent meta-server running
+on http://www.ufoot.org. Anyway, I see no reasons not to share this code.
+
+To set up the meta-server, you'll need:
+- a working PHP3 capable system. Wether you run it on UNIX or Windows, as an
+  Apache module or as a CGI has absolutely no importance. You simply need
+  PHP3 pages to work, and must load the MySQL PHP module. I have no idea 
+  wether this meta-server would work or not with a PHP4 engine.
+- a MySQL server. I believe almost any version of MySQL would fit, since I
+  use very basic SQL queries. I would have prefered to run the meta-server on
+  PostGreSQL, but my provider only has MySQL installed. So I used it. But
+  honestly, I believe any decent SGBD could fit.
+
+Note that the meta-server is not installed when you type "make install" in
+the root source directory. If you want to install a meta-server, you'll
+need to set up the MySQL database and copy the PHP3 pages yourself.
+You'll also probably need to edit the "db.php3" file since it contains the
+user and password required to connect to MySQL the server. When you set up 
+the php3 server, it is a good idea to make it fetch "/index.php3" when HTTP
+clients request "/". This is the default on many PHP3 installs anyway.
+

Added: unstable/liquidwar/branches/upstream/current/www/mysql/tables.sql
===================================================================
--- unstable/liquidwar/branches/upstream/current/www/mysql/tables.sql	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/www/mysql/tables.sql	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,27 @@
+
+-- DROP TABLE metaserver_list;
+CREATE TABLE metaserver_list(
+    address VARCHAR(15) NOT NULL,
+    port INT NOT NULL,
+    game VARCHAR(25) NOT NULL,
+    version VARCHAR(25) NOT NULL,
+    first_ping INT NOT NULL,
+    last_ping INT NOT NULL,
+    busy_players INT,
+    max_players INT,
+    password INT,
+    comment VARCHAR(100),
+    PRIMARY KEY (address,port)
+);
+
+-- DROP TABLE metaserver_chat;
+CREATE TABLE metaserver_chat(
+    address VARCHAR(15) NOT NULL,
+    post_date INT NOT NULL,
+    game VARCHAR(25) NOT NULL,
+    message TEXT,
+    PRIMARY KEY (address,post_date),
+    INDEX (post_date),
+    INDEX (address)
+);
+

Added: unstable/liquidwar/branches/upstream/current/www/php3/cleanup.php3
===================================================================
--- unstable/liquidwar/branches/upstream/current/www/php3/cleanup.php3	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/www/php3/cleanup.php3	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,43 @@
+<?
+/*****************************************************************************/
+/* Meta-server which registers game servers                                  */
+/* Copyright (C) 2002-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Homepage       : http://www.ufoot.org                                     */
+/* Contact author : ufoot at ufoot.org                                          */
+/*****************************************************************************/
+
+// system page called to remove old servers from the database
+
+require 'db.php3';
+require 'html.php3';
+require 'metaserver.php3';
+
+header("Content-Type: text/plain");
+
+$result=metaserver_cleanup();
+
+if ($result) 
+{
+  echo "OK\n";
+}
+else
+{
+  echo "error\n";
+}
+
+?>

Added: unstable/liquidwar/branches/upstream/current/www/php3/db.php3
===================================================================
--- unstable/liquidwar/branches/upstream/current/www/php3/db.php3	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/www/php3/db.php3	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,178 @@
+<?
+/*****************************************************************************/
+/* Meta-server which registers game servers                                  */
+/* Copyright (C) 2002-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Homepage       : http://www.ufoot.org                                     */
+/* Contact author : ufoot at ufoot.org                                          */
+/*****************************************************************************/
+
+define("METASERVER_DB_HOST","localhost");
+define("METASERVER_DB_USER","ufoot");
+define("METASERVER_DB_PASSWORD","");
+define("METASERVER_DB_BASE","proxad");
+
+//----------------------------------------------------------------------
+// opens the connection with the database
+//----------------------------------------------------------------------
+function db_open_connection()
+{
+  $i=0;
+  $connection=0;
+
+  while ($i<5 && !$connection)
+    {
+      $connection=mysql_connect(METASERVER_DB_HOST,
+				METASERVER_DB_USER,
+				METASERVER_DB_PASSWORD);
+      sleep($i);
+      $i+=1;
+    }
+
+  if ($connection)
+    {
+      mysql_select_db(METASERVER_DB_BASE);
+      if ($i>1)
+	{
+	  db_handle_error("First attempt to open the metaserver MySQL database failed");
+	}
+    }
+  else
+    {
+      db_handle_error("Unable to open connection with the metaserver MySQL database");
+    }
+
+  return $connection;
+}
+
+//----------------------------------------------------------------------
+// closes the connection with the database
+//----------------------------------------------------------------------
+function db_close_connection($connection)
+{
+  if ($connection)
+    {
+      // Here we do not really close the connection since MySQL shares
+      // connections if they are opened with the same parameters,
+      // and it interferes with other php code on my web site.
+      // Anyway the connection will be closed at the end of the PHP page
+      //
+      // mysql_close($connection);
+    }
+}
+
+//----------------------------------------------------------------------
+// handles a system error 
+//----------------------------------------------------------------------
+function db_handle_error($message)
+{
+  // My provider uses a patched PHP3 system, which does not support
+  // the standard "mail" function but has a replacement called "email".
+  // It uses 1 more argument which is a username, used to fill the
+  // "From" field. For a standard install, comment the "email" line
+  // and uncomment the "mail" line.
+  email("webmaster","errors at ufoot.org","[php3error]",$message);
+  // mail("errors at xxx.xxx","[php3error]",$message);
+}
+
+//----------------------------------------------------------------------
+// quotes a string for inclusion in the database
+//----------------------------------------------------------------------
+function db_quote($field,$size=65535)
+{
+  $result="";
+  $len=strlen($field);
+
+  for ($i=0;($i<$len) && ($i<$size);++$i) 
+    {
+      // We filter all non ASCII 128 "normal" characters
+      $c=substr($field,$i,1);
+      $ascii=ord($c);
+      if ($ascii>=32 && $ascii<=127) 
+	{
+	  // We replace any ' by '', this is the SQL default
+	  if ($c=="'") 
+	    {
+	      $c="''";
+	    }
+	  // We filter $ \ " and %, one never knows...
+	  else if (strchr("\$\\\"%",$c))
+	    {
+	      $c="";
+	    }
+
+	  $result.=$c;
+	}
+    }
+
+  $result="'".$result."'";
+
+  return $result;
+}
+
+//----------------------------------------------------------------------
+// Executes a SELECT query in the database
+//----------------------------------------------------------------------
+function db_exec_query_select($connection,$query)
+{
+  $i=0;
+
+  if ($connection)
+    {
+      $res=mysql_query($query,$connection);
+
+      while ($arr=mysql_fetch_array($res,MYSQL_ASSOC))
+	{
+	  $data[$i]=$arr;
+	  $i++;
+	}
+    }
+  //  else
+  //  {
+  //   $text=mysql_error_text();
+  //  }
+
+  return $data;
+}
+
+//----------------------------------------------------------------------
+// Executes a query in the database, which is not a SELECT query
+//----------------------------------------------------------------------
+function db_exec_query($connection,$query)
+{
+  $rows=-1;
+
+  if ($connection)
+    {
+      $res=mysql_query($query,$connection);
+
+      if ($res)
+	{
+	  $rows=mysql_affected_rows($connection);
+	}
+    }
+  //  else
+  //  {
+  //   $text=mysql_error_text();
+  //  }
+
+  return $rows;
+}
+
+
+
+?>

Added: unstable/liquidwar/branches/upstream/current/www/php3/html.php3
===================================================================
--- unstable/liquidwar/branches/upstream/current/www/php3/html.php3	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/www/php3/html.php3	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,90 @@
+<?
+/*****************************************************************************/
+/* Meta-server which registers game servers                                  */
+/* Copyright (C) 2002-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Homepage       : http://www.ufoot.org                                     */
+/* Contact author : ufoot at ufoot.org                                          */
+/*****************************************************************************/
+
+//----------------------------------------------------------------------
+// Transforms text to HTML code, to avoid buggy and/or malicious HTML 
+//----------------------------------------------------------------------
+function html_format($text)
+{
+  $html=htmlentities($text);
+
+  /*
+   * Now if the HTML string is empty, we replace it by &nbsp; which
+   * avoids weird behaviors with cell borders in HTML tables.
+   */
+  if ($html=="")
+    {
+      $html="&nbsp;";
+    }
+
+  return $html;
+}
+
+//----------------------------------------------------------------------
+// Transforms a number of second into a readable uptime
+//----------------------------------------------------------------------
+function html_uptime($timestamp)
+{
+  $seconds=$timestamp%60;
+  $minutes=floor($timestamp/60)%60;
+  $hours=floor($timestamp/3600)%24;
+  $days=floor($timestamp/(3600*24));
+
+  if ($days>0)
+    {
+      if ($days>1)
+	{
+	  $uptime=$days." days";
+	}
+      else
+	{
+	  $uptime="1 day";
+	}
+    }
+  else if ($hours>0)
+    {
+      $uptime=$hours." h";
+    }
+  else if ($minutes>0)
+    {
+      $uptime=$minutes." min";
+    }
+  else 
+    {
+      $uptime=$seconds." sec";
+    }
+
+  return $uptime;
+}
+
+//----------------------------------------------------------------------
+// Transforms a UNIX timestamp into a readable date
+//----------------------------------------------------------------------
+function html_date($timestamp)
+{
+  $date=date("Y-m-d H:i:s",$timestamp);
+
+  return $date;
+}
+
+?>

Added: unstable/liquidwar/branches/upstream/current/www/php3/index.php3
===================================================================
--- unstable/liquidwar/branches/upstream/current/www/php3/index.php3	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/www/php3/index.php3	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,142 @@
+<?
+/*****************************************************************************/
+/* Meta-server which registers game servers                                  */
+/* Copyright (C) 2002-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Homepage       : http://www.ufoot.org                                     */
+/* Contact author : ufoot at ufoot.org                                          */
+/*****************************************************************************/
+
+require 'db.php3';
+require 'html.php3';
+require 'metaserver.php3';
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<HEAD>
+<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
+<TITLE>U-Foot's meta-server</TITLE>
+</HEAD>
+<BODY>
+<CENTER>
+<H1>U-Foot's meta-server</H1>
+</CENTER>
+<HR>
+<H2>Introduction</H2>
+I call meta-server the software which I run on my web site to allow the
+<A HREF="http://www.ufoot.org/liquidwar">Liquid War</A> and
+<A HREF="http://www.ufoot.org/u61">U61</A>
+servers to register themselves so that clients can automatically
+find out which servers are running in the world.
+<HR>
+<H2>List of active servers</H2>
+You can use this list "as is" but you can
+also get it directly from the game.
+<?
+$result=metaserver_list("1.0","","");
+?>
+<TABLE BORDER=1>
+<TR>
+<TH>Address</TH>
+<TH>Port</TH>
+<TH>Game</TH>
+<TH>Version</TH>
+<TH>Uptime</TH>
+<TH>Players</TH>
+<TH>Password</TH>
+<TH>Comment</TH>
+</TR>
+<?
+if ($result) 
+{
+  for ($i=0;$result[$i];++$i)
+  {
+    echo "<TR>";
+    echo "<TD>".html_format($result[$i]["address"])."</TD>";
+    echo "<TD>".html_format($result[$i]["port"])."</TD>";
+    echo "<TD>".html_format($result[$i]["game"])."</TD>";
+    echo "<TD>".html_format($result[$i]["version"])."</TD>";
+    echo "<TD>".html_uptime($result[$i]["uptime"])."</TD>";
+    echo "<TD>".html_format($result[$i]["busy_players"])."/".html_format($result[$i]["max_players"])."</TD>";
+    echo "<TD>".(html_format($result[$i]["password"]) ? "yes" : "no")."</TD>";
+    echo "<TD>".html_format($result[$i]["comment"])."</TD>";
+    echo "</TR>\n";
+  }
+}
+?>
+</TABLE>
+<HR>
+<H2>Chat</H2>
+This chat-box is not moderated, so I'm not responsible
+for its content. Still, if you think something's going wrong,
+<A HREF="mailto:ufoot at ufoot.org">contact me</A>. 
+<?
+if ($GLOBALS['message'] && isset($GLOBALS['post']))
+{
+  if (metaserver_write("1.0",$GLOBALS['game'],$GLOBALS['message']))
+  {
+    echo "<P>Message successfully posted.";
+  }
+  else
+  {
+    echo "<P><B>Message not posted.</B>";
+  }
+}
+?>
+<?
+$result=metaserver_read("1.0","",0);
+?>
+<TABLE BORDER=1>
+<TR>
+<TH>Address</TH>
+<TH>Age</TH>
+<TH>Game</TH>
+<TH>Message</TH>
+</TR>
+<?
+if ($result) 
+{
+  for ($i=0;$result[$i];++$i)
+  {
+    echo "<TR>";
+    echo "<TD>".html_format($result[$i]["address"])."</TD>";
+    echo "<TD>".html_uptime($result[$i]["age"])."</TD>";
+    echo "<TD>".html_format($result[$i]["game"])."</TD>";
+    echo "<TD>".html_format($result[$i]["message"])."</TD>";
+    echo "</TR>\n";
+  }
+}
+?>
+</TABLE>
+<FORM METHOD="POST" ACTION="index.php3">
+<TEXTAREA COLS=70 ROWS=15 NAME="message"></TEXTAREA>
+<BR>
+<SELECT NAME="game">
+<OPTION VALUE="none">Choose a game</OPTION>
+<OPTION VALUE="liquidwar">Liquid War</OPTION>
+<OPTION VALUE="u61">U61</OPTION>
+</SELECT>
+<INPUT TYPE="SUBMIT" NAME="post" VALUE="Post">
+<INPUT TYPE="SUBMIT" NAME="refresh" VALUE="Refresh">
+</FORM>
+<HR>
+<CENTER>
+More informations on
+<A HREF="http://www.ufoot.org">www.ufoot.org</A>.
+</CENTER>
+</BODY
+</HTML>

Added: unstable/liquidwar/branches/upstream/current/www/php3/list.php3
===================================================================
--- unstable/liquidwar/branches/upstream/current/www/php3/list.php3	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/www/php3/list.php3	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,59 @@
+<?
+/*****************************************************************************/
+/* Meta-server which registers game servers                                  */
+/* Copyright (C) 2002-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Homepage       : http://www.ufoot.org                                     */
+/* Contact author : ufoot at ufoot.org                                          */
+/*****************************************************************************/
+
+// Returns the list of available games
+
+require 'db.php3';
+require 'html.php3';
+require 'metaserver.php3';
+
+header("Content-Type: text/plain");
+
+$result=metaserver_list($protocol,
+			$game,
+			$version);
+
+if ($result) 
+{
+  for ($i=0;$result[$i];++$i)
+  {
+    echo db_quote($result[$i]["address"],METASERVER_SIZE_ADDRESS).",";
+    echo $result[$i]["port"].",";
+    echo db_quote($result[$i]["game"],METASERVER_SIZE_GAME).",";
+    echo db_quote($result[$i]["version"],METASERVER_SIZE_VERSION).",";
+    echo $result[$i]["uptime"].",";
+    echo $result[$i]["busy_players"].",";
+    echo $result[$i]["max_players"].",";
+    echo $result[$i]["password"].",";
+    echo db_quote($result[$i]["comment"],METASERVER_SIZE_COMMENT)."\n";
+  }
+}
+
+// We use this EOF trick otherwise there's no HTTP data sent if there
+// are no servers that match at all, and it ends in a dull "no status
+// line" error on the Liquid War client/server, which is stupid.
+// Therefore we send this "EOF" which will be ignored by the parser
+// anyways...
+echo "EOF\n";
+
+?>

Added: unstable/liquidwar/branches/upstream/current/www/php3/metaserver.php3
===================================================================
--- unstable/liquidwar/branches/upstream/current/www/php3/metaserver.php3	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/www/php3/metaserver.php3	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,366 @@
+<?
+/*****************************************************************************/
+/* Meta-server which registers game servers                                  */
+/* Copyright (C) 2002-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Homepage       : http://www.ufoot.org                                     */
+/* Contact author : ufoot at ufoot.org                                          */
+/*****************************************************************************/
+
+error_reporting(0);
+
+define("METASERVER_SIZE_ADDRESS",15);
+define("METASERVER_SIZE_GAME",25);
+define("METASERVER_SIZE_VERSION",25);
+define("METASERVER_SIZE_COMMENT",100);
+define("METASERVER_SIZE_MESSAGE",1000);
+
+// 5 minutes
+define("METASERVER_LIST_TIME_LIMIT",5*60);
+// 5 seconds
+define("METASERVER_CHAT_WRITE_LIMIT",5);
+// 1 month
+define("METASERVER_CHAT_PURGE_LIMIT",31*24*60*60);
+// 30 messages
+define("METASERVER_CHAT_MAX_MESSAGES",30);
+
+//----------------------------------------------------------------------
+// Cleans up the database, ie removes old inactive servers (high-level)
+//----------------------------------------------------------------------
+function metaserver_cleanup_list()
+{
+  $connection=db_open_connection();
+
+  $ok=metaserver_cleanup_list_ex($connection);
+
+  db_close_connection($connection);
+
+  return $ok;
+}
+
+//----------------------------------------------------------------------
+// Cleans up the database, ie removes old inactive servers (low-level)
+//----------------------------------------------------------------------
+function metaserver_cleanup_list_ex($connection)
+{
+  $now=time();
+
+  $limit=$now-METASERVER_LIST_TIME_LIMIT;
+
+  $query="DELETE FROM metaserver_list ".
+    "WHERE last_ping<".$limit;
+
+  db_exec_query($connection,$query);
+
+  $ok=1;
+
+  return $ok;
+}
+
+//----------------------------------------------------------------------
+// Registers a server in the database
+//----------------------------------------------------------------------
+function metaserver_register($protocol,
+			     $game,
+			     $version,
+			     $port,
+			     $busy_players,
+			     $max_players,
+			     $password,
+			     $comment)
+{
+  $connection=db_open_connection();
+
+  metaserver_cleanup_list_ex($connection);
+
+  $game=db_quote($game,METASERVER_SIZE_GAME);
+  $version=db_quote($version,METASERVER_SIZE_VERSION);
+  $ping=time();
+  $real_address=$GLOBALS['HTTP_X_FORWARDED_FOR'] ? $GLOBALS['HTTP_X_FORWARDED_FOR'] : $GLOBALS['REMOTE_ADDR'];
+  $address=db_quote($real_address,METASERVER_SIZE_ADDRESS);
+  $port=floor($port);
+  $busy_players=floor($busy_players);
+  $max_players=floor($max_players);
+  $password=floor($password);
+  $comment=db_quote($comment,METASERVER_SIZE_COMMENT);
+  
+  $query="SELECT ".
+    "address,".
+    "port ".
+    "FROM metaserver_list ".
+    "WHERE ".
+    "address=".$address." AND ".
+    "port=".$port;
+
+  $data=db_exec_query_select($connection,$query);
+
+  if ($data && $data[0])
+    {
+      $query="UPDATE metaserver_list SET ".
+	"game=".$game.",".
+	"version=".$version.",".
+	"last_ping=".$ping.",".
+	"busy_players=".$busy_players.",".
+	"max_players=".$max_players.",".
+	"password=".$password.",".
+	"comment=".$comment." ".
+	"WHERE ".
+	"address=".$address." AND ".
+	"port=".$port;
+    }
+  else
+    {
+      $query="INSERT INTO metaserver_list ".
+	"(address,".
+	"port,".
+	"game,".
+	"version,".
+	"first_ping,".
+	"last_ping,".
+	"busy_players,".
+	"max_players,".
+	"password,".
+	"comment) ".
+	"VALUES ".
+	"(".$address.",".
+	$port.",".
+	$game.",".
+	$version.",".
+	$ping.",".
+	$ping.",".
+	$busy_players.",".
+	$max_players.",".
+	$password.",".
+	$comment.")";
+    }
+
+  if (db_exec_query($connection,$query)==1)
+    {
+      $ok=1;
+    }
+  else
+    {
+      $ok=0;
+    }
+   
+  db_close_connection($connection);
+
+  return $ok;
+}
+
+//----------------------------------------------------------------------
+// Returns the list of available servers
+//----------------------------------------------------------------------
+function metaserver_list($protocol,
+			 $game,
+			 $version)
+{
+  $connection=db_open_connection();
+
+  metaserver_cleanup_list_ex($connection);
+
+  $query="SELECT ".
+    "address,".
+    "port,".
+    "game,".
+    "version,".
+    "first_ping,".
+    "last_ping,".
+    "busy_players,".
+    "max_players,".
+    "password,".
+    "comment ".
+    "FROM metaserver_list ";
+
+  if ($game)
+    {
+      $query.="WHERE game=".db_quote($game,METASERVER_SIZE_GAME." ");
+      if ($version)
+	{
+	  $query.="AND version=".db_quote($version,METASERVER_SIZE_VERSION." ");
+	}
+    }
+
+  $query.="ORDER BY busy_players DESC, first_ping DESC";
+
+  $data=db_exec_query_select($connection,$query);
+
+  $now=time();
+  for ($i=0;$data[$i];++$i)
+    {
+      $data[$i]["uptime"]=$now-$data[$i]["first_ping"];
+    }
+
+  db_close_connection($connection);
+
+  return $data;
+}
+
+//----------------------------------------------------------------------
+// Cleans up the database, ie removes old inactive servers (high-level)
+//----------------------------------------------------------------------
+function metaserver_cleanup_chat()
+{
+  $connection=db_open_connection();
+
+  $ok=metaserver_cleanup_chat_ex($connection);
+
+  db_close_connection($connection);
+
+  return $ok;
+}
+
+//----------------------------------------------------------------------
+// Cleans up the database, ie removes old inactive servers (low-level)
+//----------------------------------------------------------------------
+function metaserver_cleanup_chat_ex($connection)
+{
+  $now=time();
+
+  $limit=$now-METASERVER_CHAT_PURGE_LIMIT;
+
+  $query="DELETE FROM metaserver_chat ".
+    "WHERE post_date<".$limit;
+
+  db_exec_query($connection,$query);
+
+  $ok=1;
+
+  return $ok;
+}
+
+//----------------------------------------------------------------------
+// Registers a server in the database
+//----------------------------------------------------------------------
+function metaserver_write($protocol,
+			  $game,
+			  $message)
+{
+  if ($game && $message)
+    {
+      $ok=0;
+
+      $connection=db_open_connection();
+
+      metaserver_cleanup_chat_ex($connection);
+
+      $address=db_quote($GLOBALS['REMOTE_ADDR'],METASERVER_SIZE_ADDRESS);
+      $post_date=time();
+      $game=db_quote($game,METASERVER_SIZE_GAME);
+      $message=db_quote($message,METASERVER_SIZE_MESSAGE);
+  
+      $query="SELECT ".
+	"MAX(post_date) AS max_post_date ".
+	"FROM metaserver_chat ".
+	"WHERE ".
+	"address=".$address;
+
+      $forbidden=0;
+  
+      $data=db_exec_query_select($connection,$query);
+
+      if ($data && $data[0])
+	{
+	  if ($data[0]["max_post_date"]>$post_date-METASERVER_CHAT_WRITE_LIMIT)
+	    {
+	      $forbidden=1;
+	    }
+	}
+      
+      if (!$forbidden)
+	{
+	  $query="INSERT INTO metaserver_chat ".
+	    "(address,".
+	    "post_date,".
+	    "game,".
+	    "message)".
+	    "VALUES ".
+	    "(".$address.",".
+	    $post_date.",".
+	    $game.",".
+	    $message.")";
+
+	  if (db_exec_query($connection,$query)==1)
+	    {
+	      $ok=1;
+	    }
+	}
+      
+      db_close_connection($connection);
+    }
+  else
+    {
+      $ok=1;
+    }
+
+  return $ok;
+}
+
+//----------------------------------------------------------------------
+// Returns the list of available servers
+//----------------------------------------------------------------------
+function metaserver_read($protocol,
+			 $game,
+			 $limit)
+{
+  $connection=db_open_connection();
+
+  metaserver_cleanup_chat_ex($connection);
+
+  if (!$limit)
+    {
+      $limit=METASERVER_CHAT_MAX_MESSAGES;
+    }
+
+  $query="SELECT ".
+    "address,".
+    "post_date,".
+    "game,".
+    "message ".
+    "FROM metaserver_chat ";
+
+  if ($game)
+    {
+      $query.="WHERE game=".db_quote($game,METASERVER_SIZE_GAME." ");
+    }
+
+  $query.="ORDER BY post_date DESC ".
+    "LIMIT ".$limit;
+
+  $data=db_exec_query_select($connection,$query);
+
+  $size = sizeof($data);
+  for ($i=0;$i<floor($size/2);++$i)
+    {
+      $j=$size-$i-1;
+      $temp=$data[$i];
+      $data[$i]=$data[$j];
+      $data[$j]=$temp;
+    }				    
+
+  $now=time();
+  for ($i=0;$data[$i];++$i)
+    {
+      $data[$i]["age"]=$now-$data[$i]["post_date"];
+    }
+
+  db_close_connection($connection);
+
+  return $data;
+}
+
+?>

Added: unstable/liquidwar/branches/upstream/current/www/php3/register.php3
===================================================================
--- unstable/liquidwar/branches/upstream/current/www/php3/register.php3	2006-09-12 22:16:26 UTC (rev 30)
+++ unstable/liquidwar/branches/upstream/current/www/php3/register.php3	2006-11-13 18:23:22 UTC (rev 31)
@@ -0,0 +1,50 @@
+<?
+/*****************************************************************************/
+/* Meta-server which registers game servers                                  */
+/* Copyright (C) 2002-2005 Christian Mauduit                                 */
+/*                                                                           */
+/* 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 */
+/*                                                                           */
+/* Homepage       : http://www.ufoot.org                                     */
+/* Contact author : ufoot at ufoot.org                                          */
+/*****************************************************************************/
+
+// system page called by servers to register themselves
+
+require 'db.php3';
+require 'html.php3';
+require 'metaserver.php3';
+
+header("Content-Type: text/plain");
+
+$result=metaserver_register($protocol,
+			    $game,
+			    $version,
+			    $port,
+			    $busy_players,
+			    $max_players,
+			    $password,
+			    $comment);
+
+if ($result) 
+{
+  echo "OK\n";
+}
+else
+{
+  echo "error\n";
+}
+
+?>




More information about the Pkg-allegro-commits mailing list