Liquid War 6

Up: (dir)   [Contents][Index]

Top

Liquid War 6, a unique multiplayer wargame.

Table of Contents


Next: , Up: Top   [Contents][Index]

1 Introduction

Read this chapter to discover Liquid War 6.


Next: , Up: Introduction   [Contents][Index]

1.1 In a nutshell

Liquid War 6 is a unique multiplayer wargame. Your army is a blob of liquid and you have to try and eat your opponents. Rules are very simple yet original, they have been invented by Thomas Colcombet. It is possible to play alone against the computer but the game is really designed to be played with friends, on a single computer, on a LAN, or on Internet.

An older version, Liquid War 5, is available, but is not part of the GNU Project. Only Liquid War 6 is part of the GNU Project, it is a complete rewrite.

The official page of Liquid War 6 is http://www.gnu.org/software/liquidwar6/. For more information, you can read the Wikipedia article about Liquid War.


Next: , Previous: , Up: Introduction   [Contents][Index]

1.2 Project status

1.2.1 What works, and what does not (yet)

As of today, the game is in beta state. It can be installed, and you can toy arround with. You can even play with. It is still far from being complete as some key features are still missing.

What works:

In the near future:

In the long run:

You might be interested in checking the following URLs, which give a view on opened tasks and bugs:

1.2.2 What has changed since Liquid War 5.x?

Liquid War 6 is a complete rewrite of Liquid War 5. The rewrite started in 2005. So a good question is “was the rewrite worth it?”...

Here’s a list of key improvements:

The most interesting change is still to come, and concerns network games.

Stay tuned.

1.2.3 Revision history

Liquid War 6 releases are “codenamed” after famous, historical, real or mythical characters. Here is a short revision history. For details, see the ChangeLog and NEWS files distributed with the game. Additionnally, there’s an ever-increasing “stamp” number which is incremented each time a build is done with a different source. Latest versions use the stamp as the revision number (the version 3rd number).

1.2.4 Road map

The game will probably be labelled “6.0.0” when network mode is up and running. Until then there will probably be other improvements concerning gameplay and appearance (“eye candy”). There’s a balance to keep between the major goals such as “make that network thingy work” and the very real fact that “hacking must be fun”.


Previous: , Up: Introduction   [Contents][Index]

1.3 How you can help

1.3.1 Help GNU

Please remember that development of Liquid War 6 is a volunteer effort, and you can also contribute to its development. For information about contributing to the GNU Project, please read How to help GNU.

1.3.2 Todo list

Here’s a short list of todo items. It is probably too early to start hacking the core engine itself, for it is still under heavy development, might undergo major rewrites, and it’s hard for documentation to keep up with the reality of the code. However, there are still many things to do.

Feel free to join the mailing-lists, this is clearly the best place to start with.

There’s also a list of opened tasks on Savannah at http://savannah.gnu.org/task/?group=liquidwar6 which you can browse online. Maybe there’s some task for you!

Alternatively, you can contact Christian Mauduit.


Next: , Previous: , Up: Top   [Contents][Index]

2 User’s manual

The Liquid War 6 user’s manual hopefully contains any usefull information to install the program and play the game. If you just want to enjoy Liquid War 6 without diving into map creation and programming, this is just for you.


Next: , Up: User's manual   [Contents][Index]

2.1 Mailing lists

2.1.1 General discussion

The main discussion list is <help-liquidwar6@gnu.org>, and is used to discuss all aspects of Liquid War 6, including installation, development, game strategies, and whatever subject players and hackers might want to talk about, provided it is Liquid War 6 related. If you don’t know on which list to subscribe, this is the one.

To subscribe to it, please send an empty mail with a Subject: header line of just "subscribe" to the -request list, that is <help-liquidwar6-request@gnu.org>.

You can also subscribe to the list using the Mailman web interface for help-liquidwar6 and consult help-liquidwar6 archives.

2.1.2 Announcements

Announcements about LiquidWar 6 are made on <info-liquidwar6@gnu.org>. Subscribe to it to be informed of major releases, and other significant news.

To subscribe to it, please send an empty mail with a Subject: header line of just "subscribe" to the -request list, that is <info-liquidwar6-request@gnu.org>.

You can also subscribe to the list using the Mailman web interface for info-liquidwar6 and consult info-liquidwar6 archives.

Please also consider reading the latest news on Savannah.

2.1.3 Bugs

There is also a special list used for reporting bugs, <bug-liquidwar6@gnu.org>. Please try and describe the bug as precisely as possible. The more accurate the description, the more chances it will get to be fixed.

While this is the standard GNU way of reporting bugs, modern SPAM standards make it very hard to filter real bug reports from junk on this list. It is more convenient to use a web interface, the URL is: http://savannah.gnu.org/bugs/?func=additem&group=liquidwar6 and you’re really encouraged to use it instead of sending emails.

Please take a look at the bug list before submitting new bugs.

2.1.4 IRC channel

IRC can be an interesting alternative to mailing-lists. There’s an open channel dedicated to Liquid War on freenode.net, you can access it on irc://irc.freenode.net/liquidwar that is, channel #liquidwar on irc.freenode.net.


Next: , Previous: , Up: User's manual   [Contents][Index]

2.2 Getting the game

2.2.1 Download source

Liquid War 6 can be found on:

Downloading the latest file from this place, and compile it yourself on your computer with a classical ./configure && make && make install is the recommended way to install Liquid War 6.

2.2.2 Download binaries

Some binary packages might be available. Your mileage may vary.

GNU/Linux based systems are supported, through Debian .deb and Red Hat RPM packages. There is also a Microsoft Windows installer.

However these binaries are not necessarly available for every single version of the game.

2.2.3 GIT repository

Latest work in progress versions can be obtained with GIT. Here’s the typicall command which will fetch the latest version:

git clone git://git.sv.gnu.org/liquidwar6.git

If you are behing a firewall and can’t use the native GIT protocol, you can rely on the (slower) http protocol:

git clone http://git.sv.gnu.org/r/liquidwar6.git

You can browse the code online, consult log summary, and in a general manner “follow” the project on http://git.savannah.gnu.org/gitweb/?p=liquidwar6.git and http://git.savannah.gnu.org/cgit/liquidwar6.git.

Beware, git does not contain all the files included in the official source tarball. For instance, the ./configure script is not present. You need to run :

autoreconf
./configure
make
make install

The autoreconf call is really mandatory the first time, autoconf is not enough. You will also need all the prerequisites needed to build the docs, generally speaking, getting the source from git requires more tools to build the package than picking a ready-to-use tarball.

2.2.4 Daily snapshots

Alternatively, you can download daily snapshots on http://www.ufoot.org/liquidwar/v6/snapshots/ These files used to be built every day, now they are generated by Jenkins whenever there’s a source change (commit). A simple make is done before generating source tarballs however a make distcheck is performed before generating binaries, therefore sometimes you can have the source but no associated tarballs.

Beware of revision numbers, snapshots can make you believe version X.Y is out when it’s only a release candidate at best, and most of the time just a work-in-progress.

Still, if you want bleeding edge versions, this is the way to go.

Documentation is automatically updated as well, and available on http://www.ufoot.org/liquidwar/v6/doc/.

2.2.5 Check integrity

Most binary packages (at least .deb and RPM GNU/Linux binaries) should be signed using GnuPG. The following keys are used when generating upstream/vendor packages:


Next: , Previous: , Up: User's manual   [Contents][Index]

2.3 Installation

This section covers installation from source. Other ways of installing the program are not described here.

2.3.1 Requirements

All these libraries are mandatory to compile the game. Liquid War 6 won’t compile, let alone run, without them. Some of them could probably be replaced by equivalent tools, but this would certainly require a programming effort and some changes in Liquid War 6 source code.

2.3.2 Optional libraries

While all these libraries are theorically optional (the game will successfully compile without them), you’ll obviously need, for instance, one graphics backend. Otherwise, you’ll simply have no display. This is not acceptable. As of today, one can reasonnably consider all SDL-related libraries are required. The rest is truely optional.

2.3.3 Optional tools

Those tools are used upstream to maintain the game, you normally do not need them to build the game “as is” but if you modify the source code and hack the game, you might be interested in installing them.

2.3.4 Installing requirements using RPM/DEB packages

You might find it convenient not to install all the requirements from source, but use your favorite GNU/Linux distribution packages.

On an RPM based GNU/Linux system, a typical command (tested with Fedora 15 “Lovelock”) could be:

yum install \
make gcc glibc glibc-devel binutils \
libgomp \
guile guile-devel gmp gmp-devel libgc1c2 libgc-dev \
libtool libtool-ltdl libtool-ltdl-devel \
zlib zlib-devel expat expat-devel \
libpng libpng-devel libjpeg libjpeg-devel \
sqlite sqlite-devel \
ncurses ncurses-devel readline readline-devel \
libGL libGL-devel libGLU libGLU-devel \
SDL SDL-devel SDL_image SDL_image-devel \
SDL_mixer SDL_mixer-devel \
freetype freetype-devel SDL_ttf SDL_ttf-devel \
libcaca libcaca-devel \
libcurl libcurl-devel \
gtk2-devel \
perl lcov global valgrind graphviz gv ImageMagick \
texinfo-tex \
indent emacs doxygen libxml \
CUnit CUnit-devel \
rpm-build

On a DEB package based GNU/Linux system this command (tested with Debian 6.0 “squeeze”) would be:

apt-get install \
make autoconf automake \
gcc libc6 libc6-dev binutils \
libgomp1 \
guile-2.0 guile-2.0-dev guile-2.0-libs libgmp10 libgmp3-dev \
libtool libltdl7 libltdl-dev \
zlib1g zlib1g-dev libexpat1 libexpat1-dev \
libpng12-0 libpng12-dev libjpeg8 libjpeg-dev \
libsqlite3-0 libsqlite3-dev \
libncurses5 libncurses5-dev libreadline6 libreadline6-dev \
libgl1-mesa-glx libgl1-mesa-dri libgl1-mesa-dev libglu1-mesa libglu1-mesa-dev \
libgles2-mesa libgles2-mesa-dev \
libsdl1.2debian libsdl1.2-dev libsdl-image1.2 libsdl-image1.2-dev \
libsdl-mixer1.2 libsdl-mixer1.2-dev \
libfreetype6 libfreetype6-dev libsdl-ttf2.0-0 libsdl-ttf2.0-dev \
libcaca0 caca-utils libcaca-dev \
libcurl4-gnutls-dev \
libgtk2.0-dev \
perl lcov global valgrind graphviz gv imagemagick \
texinfo texlive-base texlive-generic-extra \
texlive-fonts-recommended texlive-latex-extra \
indent emacs doxygen xsltproc pmccabe \
libcunit1-ncurses libcunit1-ncurses-dev \
google-perftools libgoogle-perftools-dev \
git git2cl \
zip nsis \
debhelper devscripts

Note that those requirements really depend on the exact distribution you have, package names may vary from one to another.

2.3.5 Compiling

Liquid War 6 uses GNU Automake, Autoconf and GNU Libtool.

Once all the requirements are installed, run:

./configure
make
make install

Liquid War 6 supports the standard ./configure --prefix=/my/path option (in fact, it supports much more than that) so you can install the game in any directory. You do not need to be root to install Liquid War 6.


Next: , Previous: , Up: User's manual   [Contents][Index]

2.4 Extra maps

2.4.1 The extra maps package

The main package contains some maps so that you can try out the game. Still, an additionnal package, called extra-maps or liquidwar6-extra-maps is available, containing more maps. It really does contain many of them, including most Liquid War 3 and Liquid War 5 legacy maps, plus new Liquid War 6 maps.

2.4.2 Install extra maps on GNU/Linux and POSIX systems

On GNU/Linux systems (and possibly any POSIX unixish system) running:

./configure
make
make install

will install the extra maps on your system automatically, they will then be available in the extra/ sub-directory when browsing maps.

The ./configure script has a --enable-liquidwar6 switch which will try and find automatically if there’s an existing liquidwar6 binary in the path. If there’s such a binary, it will run it and ask for its map-path and use this value automatically.

2.4.3 Raw install of extra maps (all-platforms)

Another solution, which works on all platforms including Microsoft Windows and Mac OS X but also works on GNU/Linux, is to simply unpack the extra-maps package (unzip or untar) in your custom map directory, or in the system map directory. There’s nothing else to do to install these maps but simply put them on your hard drive in the right directory.

Typically on an Microsoft Windows system, you would unpack the extra maps in C:\Program Files\Liquid War 6\map\ (system directory) and on a Mac OS X system you would unpack the extra maps in Liquid War 6.app/Contents/Resources/map/ (system directory) or $HOME/Library/Application Support/Liquid War 6/map (user directory). On a GNU/Linux or POSIX system you would unpack them in $HOME/.liquidwar6/map/ (user directory).

Next time you run the game, the maps should be browsable.

If you can’t see them, run liquidwar6 --audit and check that the place where you unpacked the files is actually searched by the binary.


Next: , Previous: , Up: User's manual   [Contents][Index]

2.5 Troubleshooting

2.5.1 Compilation problems

A quick survival guide:

If none of these help, consider reporting a bug, or search the mailing-lists for help.

2.5.2 Check installation

Here’s a check-list to ensure that your installation is correct:

2.5.3 Problems running the game

Now, game looks correctly installed, but you have problems running it.


Next: , Previous: , Up: User's manual   [Contents][Index]

2.6 Quick start

2.6.1 Quick start

Once the game is installed, run it, click on Quick start with the mouse, and control the red 'a' cursor with the mouse, or keyboard, both work. Try and surround the green team, it’s a stupid bot, you should win ;)

You army is formed by all the red pixels on the screen, they should try and rejoin the cursor (the blinking 'a' letter) using the shortest path. When red and green meet, they fight. Try it, toy arround.

The Quick start button will always make you play red against a green stupid bot, whatever other options you have set up.

Todo...


Next: , Previous: , Up: User's manual   [Contents][Index]

2.7 Strategy tips


Next: , Previous: , Up: User's manual   [Contents][Index]

2.8 User interface

2.8.1 A reduced set of keys

Liquid War 6 can be controlled using a reduced set of keys. This is to make the game more portable and allow possible ports to platforms where a full keyboard is not available. Depending on the graphics backend, exact mapping might change, they should hopefully be obvious and intuitive.

Those keys are:

Basically,

2.8.2 Combining mouse, keyboard and joysticks

It’s also possible to control the game with the mouse only, or with a joystick. By default the interface will trap all events and respond on any of these possible devices.

KeyboardMouseJoystickMenu actionIn-game
upmouse pointerstickprevious menu itemmove cursor up
downmouse pointersticknext menu itemmove cursor down
leftmouse pointerstickchange menu item valuemove cursor left
rightmouse pointerstickchange menu item valuemove cursor right
enterleft-clickbutton Avalidate menuvalidate chat line
escright-clickbutton Bback to previous menuquit game
ctrlright-click or double-click on any buttonbutton CN/Afire
altmiddle-click or triple-click on any buttonbutton DN/Aalternate fire
pgupwheel upbutton Eprevious menu itemzoom in
pgdownwheel downbutton Fnext menu itemzoom out

A final word about joystick buttons: there’s no such thing as standard joystick buttons, some will come with A,B,C,D, others will have A,B,start,select,L,R, there’s no way to know. By default, the game will use the buttons with the lowest indexes (returned by your driver) for the most usefull functions. Validate menu entries is the most usefull action, zooming in and out the one you can live without.

2.8.3 Quit with F10

There’s also an (almost) hardcoded shortcut which will quit the game immediately, or at least as quickly as possible, without any prompt or warning.

It is the F10 key.

Think of this feature as the procastinator’s “whoops, here comes my boss!!!” emergency function.


Next: , Previous: , Up: User's manual   [Contents][Index]

2.9 Solo game

2.9.1 Current state

As of today, Liquid War 6 is essentially a solo game since network is not working. It allows you to toy arround in arcade mode on any map you wish.

A real solo mode with campaign and goals to reach is planned, how it will be implemented is yet to be defined.

2.9.2 Team profiles

By default, teams behave differently, some of them move more rapidly, some are more aggressive but vulnerable, some are more defensive but do not attack as strong as others. This aspect of the game is under active tuning, things might be unfair by now, you can toy arround with the various team-profile-... options, any report is appreciated.

Note that this is very different from Liquid War 5, and can give very different gaming experiences, you can artificially set up arbitrary strong bots, for instance.

Here’s a description of the default color settings:

2.9.3 Weapons

Additionnally, when profiles are used, each team has two weapons, a primary weapon and an alternate one. Think of weapons as special (usually nasty) tricks you can play on your opponents.

Here’s a description of available weapons:

Note that this is in progress, some of them are NOT IMPLEMENTED YET.


Next: , Previous: , Up: User's manual   [Contents][Index]

2.10 Network games

2.10.1 Choose your “public url”

Liquid War 6 needs to name your “node” (you can think as your server instance of the game) and have a unique URL (address) to publish and give to other nodes.

If only one network adapter is attached to your computer and your address IP is A.B.C.D then by default the game will pick automatically the address http://A.B.C.D:8056/ and it should work flawlessly.

Problems can arise if you have a peculiar network configuration, if you have multiple non-loopback network interfaces, if you use NAT to protect yourself from intruders and/or if your context forces you to do so. In that case, Liquid War won’t be able to guess a correct URL automatically. So you need to set it up manually either by editing the public-url entry in the config file, changing environment variable LW6_PUBLIC_URL or passing the --public-url=http://<host>:<port>/ argument when running the game. Typically, if you are behind a firewall which does NAT, use the firewall address. The right address is the address which, given to remote hosts, will allow them to connect on your game instance.

2.10.2 Starting a node

A node is started automatically when you run the game. Even if you don’t start to play, node starts in the background and exchanges data with other nodes, mostly to discover them and maintain its internal map of existing nodes and games.

So even without starting a network game, you should be able to point a web browser on your node and see a web page describing it. Your node address is displayed on stdout (console) when starting the game. If in doubt, try http://localhost:8056/ which should work unless you modified defaults settings.

When you start a network game, the program simply changes your node state from “idle” to “accepting connections”.

2.10.3 Connecting to a node

The interface should show you the list of available nodes, just pick one and try and connect to it.

Note that once you’re connected on a remote node, you’re still acting as an independant node, and other nodes might connect to your node as well as to the other nodes. In short, there’s no real server or client, everyone is a client for someone, and can act as a server.

Nodes connected together form a “community”, which can disband, accept new nodes, and in a general manner has its own immaterial life, the first node which created the game might disappear, game can continue without it.

This is why the main network module is called libp2p, this is a reference to the term “peer to peer”.

2.10.4 Communities

Once a node is connected to another one, they’ve started a “community”. Formally, a stand-alone node accepting for connection is already a community, even if it has only one member, but the only really interesting communities are those formed with several nodes.

A community can’t be reached through a given server, to connect to one you just need to connect on one of its member nodes. All nodes are equivalent, there’s no master, no root node, nodes collaborate to share the same real-time information and maintaine an up-to-date game state.

Of course, conflicts can arise, and in that case nodes need to agree on an acceptable solution. Normally, the program takes decisions automatically (for instance, it could decide to “kick” a node out of the community) so the player does not have to care about this, but this is expected to be one of the most tricky (and passionating) part of Liquid War 6 hacking.

2.10.5 Firewall settings

By default, Liquid War 6 will communicate on port 8056, in both TCP and UDP, and in both ways too (in/out). It’s possible to play with partial connectivity, in extreme case, you can even play without direct internet access, using only a mere web proxy.

However, things will go faster and be much easier if the program can use its default native protocol.

Here’s an example of a typicall iptables configuration which allows you to play the game full-featured. It’s assumed that by default all packets are dropped, this configuration will just open the necessary ports.

# outgoing TCP on port 8056 (liquidwar6)
iptables -A OUTPUT -p tcp --dport 8056 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --sport 8056 -m state --state ESTABLISHED -j ACCEPT
# incoming TCP on port 8056 (liquidwar6)
iptables -A INPUT -p tcp --dport 8056 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --sport 8056 -m state --state ESTABLISHED -j ACCEPT
# outgoing UDP on port 8056 (liquidwar6)
iptables -A OUTPUT -p udp --dport 8056 --sport 1024:65535 -j ACCEPT
iptables -A INPUT -p udp --sport 8056 --dport 1024:65535 -j ACCEPT
# incoming UDP on port 8056 (liquidwar6)
iptables -A INPUT -p udp --dport 8056 --sport 1024:65535 -j ACCEPT
iptables -A OUTPUT -p udp --sport 8056 --dport 1024:65535 -j ACCEPT

If you can’t change firewall settings and only have access to the web through a web proxy, it can still be possible to play (with some restrictions such as your node not being seen by others) if mod-http is available. This in turn depends on wether libcurl support was activated when compiling the game. To use the proxy, you can set the http_proxy environment variable. For detailed informations, please refer to libcurl doccumentation.

2.10.6 Is the game secure?

As stated in the license, the program comes with NO WARRANTY. Period.

However, an important effort has been made so that it can reasonnably be used online, exposed to various “common” attacks.

As far as security is concerned, there are two different issues:

Here’s a list of various steps which have been taken to make the program more secure:

This being said, Liquid War 6 does not use any strong encryption library to protect the data it sends. All the checksum machinery might be vulnerable to a brute-force and/or strong cryptographic attack, so in theory it’s possible to fool the program.

In practise, if you want real privacy, play over a VPN (Virtual Private Network).


Next: , Previous: , Up: User's manual   [Contents][Index]

2.11 Graphics

2.11.1 Standard, high and low resolution

Liquid War 6 will try and pick up a default resolution when the game is launched the first time. It won’t use your maximum screen resolution but will instead list all available fullscreen modes, and pick up one which is usually something like two thirds of the highest mode. This is to allow switching back and forth between fullscreen and windowed mode using the same settings. This automatically picked-up resolution really depends on your hardware and driver. It is called “standard” in the graphics options menu.

Then it is possible to automatically select the minimum and maximum resolution your hardware allows in fullscreen mode. These are called “low” and “high” in the graphics options menu. Just click on the button that display the resolution, it will change and use the next setting. In windowed mode, the game won’t accept the highest available mode but will instead use a percentage of it, defined by the --windowed-mode-limit parameter.

You might still be in a case where this is not enough. For instance your maximum resolution is 1600x1200, Liquid War 6 picks a default mode of 1280x960 for you but for some reason you want to play in 800x600, fullscreen. In this case, simply switch to windowed mode, resize the window with the mouse (the resolution button will show you the current resolution) and just choose a resolution near 800x600. It does not even need to be exactly 800x600, 798x603 would probably fit. Then when switching back to fullscreen, you’ll be in 800x600, the game will automatically pick up the fullscreen mode which is closest to the current windowed mode resolution.

2.11.2 Display rate

By default the game will try and run at 60 frames per second. Given the nature of Liquid War 6, this is probably enough. Higher values will maybe give a slightly smoother display, but barely noticeable.

You can activate the display of frames per seconds (aka “fps”) through the menu (“options -> system”) or with the command line (“–display-fps”).

On a single processor system, reducing the number of frames per second might allow the rest of the game run faster. So if you notice the game is really slow, in terms of “fighters move slowly” then you might be happy reducing the display rate and therefore giving power back to the other parts of the program. On a dual-core (or more) or on a multi-processor system, this is probably useless since the game is threaded and has a dedicated thread for display purposes. The command line option to reduce the number of frames per second is --target-fps.

Additionnally, the parameter --gfx-cpu-usage allows you to force the display thread to “take a rest” and go idle for some time. This is advanced settings, most users won’t touch this.


Next: , Previous: , Up: User's manual   [Contents][Index]

2.12 Sound & music

2.12.1 Current status

As of today, the game is capable of playing Ogg Vorbis audio files. That’s it.

2.12.2 The future

In the long run, what is planned is to support Csound which would allow very cool effects, such as dynamically changing the music while the game is running, typically following the action. If there’s a lot of fight, the music could reflect this.

For now this is only vaporware, just a nice idea among others, nothing implmented yet.


Next: , Previous: , Up: User's manual   [Contents][Index]

2.13 Config file

The config file is a simple XML file. It uses XML only to benefit standard parsing tools, but it’s not a structured XML file, in the sense that the tree is so simple that all items are at the same level. It is just a simple key-value binding.

This file is in $HOME/.liquidwar6/config.xml on GNU/Linux and POSIX systems, in C:\Documents and Settings\<username>\Liquid War 6\config.xml on Microsoft Windows and in /Users/<username>/Library/Application Support/Liquid War 6/config.xml on Mac OS X.

You’re free to edit it manually, but all parameters are changeable with command line options. The program will overwrite this file each time it exits, so if you put comments in it, they will disappear. The advantage of this is that if you mispell something, or if for some reason the game does not understand a value, then when rewriting the file, it will show you it just did not get it.

The file embeds the documentation for all its entries, it is therefore rather verbose. The documentation is the same you will find online or by quering the game with the --about option, also the same you would get reading this manual.


Next: , Previous: , Up: User's manual   [Contents][Index]

2.14 Logs

Liquid War 6 uses stdout to output important messages, and stderr to log warnings and errors. It will also use syslog if available.

Additionnally, a verbose log is available in $HOME/.liquidwar6/log.csv on GNU/Linux and POSIX systems, in C:\Documents and Settings\<username>\Liquid War 6\log.csv on Microsoft Windows and in /Users/<username>/Library/Application Support/Liquid War 6/log.csv on Mac OS X.

You can read this using any spreadsheet software capable of reading csv file. It uses the tab (\t) character as a separator. It contains valuable informations including version and most default values for the game, and for each line logged, it says where in the code the log function was called. A must-have for debugging.


Previous: , Up: User's manual   [Contents][Index]

2.15 Report bugs

There are two ways to report bugs:

The latter (Savannah) is much preferred, because the mailing-list is bloated with spam... It also offers a list of bugs which you should read before submitting a new one.


Next: , Previous: , Up: Top   [Contents][Index]

3 Hacker’s guide

This hacker’s guide is for anyone who is curious about the game, and wants to know how it works. It covers many aspects from simple map creation to technical program internals. A great effort has been done in Liquid War 6 so that it should be much more hackable than previous versions. Any feedback is welcome.


Next: , Up: Hacker's guide   [Contents][Index]

3.1 Designing levels

3.1.1 Why is level design so important?

As of Liquid War 5, most levels have been contributed by players. While the maintainer of Liquid War 6 has technical knowledge to develop the game, artistic talent and taste might not be his domain of excellence 8-)

Therefore contribution are truely welcomed when they take the form of a new, original, fun and good looking level. It’s believed the levels often make the game much more than its engine. This is true for any type of game, and Liquid War is no exception.

So this section is here to help players understand how to hack existing levels, and create new ones, in the hope that 1) they can enjoy their own creations and 2) possibly share their work with others.

Note that this manual might refer to levels and maps: they are just two different names to describe the very same thing. It’s an alias.

3.1.2 Format overview

Liquid War 6 stores level information in a plain directory.

There is no such thing as an opaque .dat binary file. The name of the level is the name of the directory itself, and its elements are the files contained in it.

Files must follow a precise naming scheme. For instance Liquid War 6 expects a map.png file to be present in each map directory.

All image files in a level use the Portable Network Graphics or JPEG format. It is possible that in the long term, Liquid War 6 will be able to handle levels as .tar.gz or .zip files. In that case these files will only be a compressed image of the actual level directory.

See the ./map/ directory of the source Liquid War 6 distribution to see example of maps.

3.1.3 Resolution (map size)

Liquid War 6 does enforce a limit on map size. This is not to frustrate map designers and/or players, simply, it would be a lie to pretend the game can handle arbitrary big maps.

They might look great on your computer but will become unplayable soon on an older machine. And most of the time they don’t look that great, carefully crafted 1280×720 just looks awesome and can represent a great level complexity.

Here are the technical limits:

TypeMax widthMax heightMax surface
Texture3 0002 0006 000 000
Logical map1 5001 0001 000 000

The texture can be somewhat bigger than the logical map, this allows for pretty levels while limiting the horsepower needed to move the fighters and animate everything. Note that you could technically feed the game with a map.png that is bigger than the logical map limit, only it will be downscaled when being loaded.

The texture limits are generous enough to accept a full-HD 1920x1080 image, or a 4/3 1600x1200 image, while the “one million pixels” logical map limit is enough to store a 16/9 1280x720 map or a 4/3 1024x768.

Keep in mind that the logical map (map.png) will probably be scaled whatsoever, even if it’s within the absolute limits (the game adapts the resolution to your computer speed) and your texture will rarely appear in its native resolution, will probably be distorted, and so on.

3.1.4 Metadata

Older versions of Liquid War 6 used to load a plain README file and use this as metadata. Title was take from map directory name. This is still supported, but it now also supports the addition of a metadata.xml file in which you can describe your map.

The following files can be defined:

3.1.5 map.png

This is the only required file in a level.

In fact, the existence of map.png makes a directory a level. When checking wether a directory is a correct level, Liquid War 6 simply tests the existence and validity of map.png.

This image is a simple black & white area, where white zones are the background, the sea, the places where fighters can move, and black zones are the foreground, the walls, the places where fighters can’t go.

This informations can be stored in a 2-color indexed file, or in a grayscaled or even truecolor RGB file, but color information won’t be used. Internally, Liquid War 6 will read the color of every point. If it is over 127 on a 0 to 255 scale, it will be considered as background, if it is below 127, it will be considered as foreground.

3.1.6 layer2.png ... layer7.png

Liquid War 6 can handle mutiple layer maps. Think of a pile of maps, one being on top of the other. This allows you to create a volume, the game considers every layer has two axis x and y, and the z axis is to travel through layers. First layer corresponds to z=0, second layer to z=1, and so on.

Here are the files you can use to define layers:

A layerX.png file should be designed exactly like map.png. In fact, map.png could simply have been called layer1.png.

Up to 6 extra layers can be defined (from layer2.png to layer7.png). This is a hardcoded limit. It allows you to define 7 different layers, including the top map.png layer. Keep in mind this layer system is not real 3D, it’s more a “2D and a half” model. Adding layers can considerably slow down the game, so it’s wise to try and use as few layers as possible. Technically, 3 layers will allow you to build bridges and tunnels, which is probably the most usefull construction using layers. Fighters can also have difficulties navigating through layers so piling up layers in narrow “vertical” z-axis based tunnels is probably not a great idea.

The ufoot/concept/pass map of the liquidwar6-extra-maps demonstrates basic layer usage.

3.1.7 texture.png, texture.jpeg and texture-alpha.jpeg

It is possible to define a texture for the map by putting a texture.png or texture.jpeg file. It does not need to have the same dimensions as the map itself. Indeed, textures can be much more precise than the actual logical map.

There’s no theorical limit on how big a texture can be, more precisely, it can be much bigger than any hardware/driver maximum texture size. In practice, a too big texture will waste your video card RAM, and slow everything down. Sizes ranging from 640x480 to 1600x1200 are reasonable texture sizes.

If you don’t define this, the map.png file will be used as the texture, and also import colors from style.xml if defined.

Note that the shape of the texture defines the shape of the map, that is, the ratio with which it will appear on the screen.

The PNG alpha layer will be used for transparency. But to save disk space, it can be convienient to prefer the JPEG format, use texture.jpeg instead of texture.png and store the alpha layer in a separated file, called texture-alpha.jpeg. This avoids handling heavy PNG files, PNG compression not being performant on most textures.

In texture-alpha.jpeg, black is considered opaque, and white is transparent. Different levels of gray correspond to different levels of opacity. Previous versions of the game used the other way of doing things (black is transparent) because this is technically, the most obvious way to do things. Black is 0 and transparent is 0. But for a human “reader” of the map this does not make sense. One generally expects white to be the equivalent of “undrawn” or “blank”, well, if it’s undecided, void, transparent, whatever, it’s white. When the Gimp flattens an image, it becomes white, not black.

So white is transparent. Period.

3.1.8 glue.png and boost.png

If there’s a glue.png or boost.png file in the map directory (you can use one of them or both) then they will be interpreted as follow:

There can be, at the same place, some gray or black in both boost.png and glue.png. How this will behave exactly is not really clear at this stage, the recommendation is not to do this (it does not really make sense anyway) but if you do it, game won’t complain.

It’s also wise not to abuse of boost.png for obviously, a map filled with “boosted” zones at a X10 pace will require much more CPU than the same map with no such setting. This might fool the automatic resampling algorithm and lead to maps that are unplayable. The spirit of boost.png is just to make a few spots go faster.

It’s also important to note that behaving faster or slower means moving faster or slower but also attacking faster or slower, and, in a general manner doing any action with a different pace.

3.1.9 danger.png and medicine.png

If there’s a danger.png or medicine.png file in the map directory (you can use one of them or both) then they will be interpreted as follow:

There can be, at the same place, some gray or black in both medicine.png and danger.png. How this will behave exactly is not really clear at this stage, the recommendation is not to do this (it does not really make sense anyway) but if you do it, game won’t complain.

3.1.10 one-way-<direction>.png

The four files:

can be used to force the fighters to go in one given direction, on some parts of the map. If an area is black on one of this meta-layers, then fighters will go in the given direction. For instance, a black zone in one-way-north will make fighters go to the north (AKA “up” direction) regardless of the cursor position. The fact that this is a one-way path is understood by fighters and they will take this in account when choosing the shortest path to go somewhere. You can combine vertical and horizontal one-way informations, making diagonal one-way paths.

3.1.11 cursor.png and cursor-color.png

By default, a simple cursor will be displayed, but you can use a custom per-map cursor. Cursors are defined by two 64x64 bitmaps:

You can define only one of those bitmaps, if doing so, then the other layer will be empty, and won’t be filled with the default cursor data. Note that additionnally, a little letter (single character) will be displayed using the team color, so that’s yet another way to identify which teams the cursor belongs too. The PNG files really need to be PNG (JPEG won’t work) and need to be 64x64, any other size will be ignored.

3.1.12 rules.xml

Whereas style.xml is only about the appearance of the map, rules.xml allows the map designer to change pretty much any parameter.

Ultimately, the player can still ignore these settings and overide them with its own values, but the idea is: most game options are only pertinent in a given context. For instance, on some maps it’s interesting to move slowly, on some other it’s interesting to move fast. Some maps might be playable packed with fighters everywhere, some other might be much more fun with almost nobody on them.

The approach in Liquid War 5 was to make the options available, but let the player himself find the right settings for the right map. The consequence is that no one ever used all those cryptic options in the advanced options menu, and probably 99% of the players ended up playing with default settings. This is not that bad, but given the fact that changing a few parameters one can totally transform the gameplay, it has decided been that in Liquid War 6, the map designer suggests the right options that matches his map.

This does not prevent the player from toying with options himself, he can still do it.

There’s also one important point to note: all these options are technically implemented as integer parameters. We certainly do not want any float here, since, and it is a Liquid War specific behavior, the game must be 100,00% predictable and behave the same on every platform. As there is nothing like exactness when speaking of floats, those are forbidden here. As for strings, we are dealing here with low-level internals, and this section is not about telling a story. They are technical options only. Booleans are implemented with the usual false = 0 and true = 1 convention. Note that other config files in Liquid War 6 might rely on floats, strings, and booleans with conventionnal true and false values, but not this one. rules.xml is special.

This rules.xml file is a direct image of the internal “rules” structure, so it contains technical, sometimes not very user-friendly parameters. While hacking rules.xml directly is a good way to test things, most of the time, the other file hints.xml contains more high-level informations that do the job the right way. A typicall example is speed.

See rules.xml reference.

3.1.13 hints.xml

This parameter is only used by the map loader. The map itself contains none of these parameters, they are only clues (hints, in fact..) on “how to load the map” which are passed to the loader.

Let’s take an example : speed. This rules.xml file has a (rather) easy to use “speed” parameter, which will do all the job of finding the right resolution for your map, the right “rounds-per-sec” and “moves-per-round” parameters, in short, it will set many other parameters to fit your needs.

As far as the map designer is concerned, rules.xml and hints.xml could have been merged (but so would have style.xml) but internally they are very different: rules.xml contains the real parameters, the one used by the algorithm whereas hints.xml contains only instructions which are used once when loading the map and then disappear. The core algorithm has no idea of what was in hints.xml, once it’s loaded.

See hints.xml reference.

3.1.14 style.xml

This is a simple XML file defining various appearance parameters. It has absolutely no effect on gameplay. These settings can ultimately be overriden by the player, but the idea is that if the map designer thinks this level looks better with this or that option, let him say it in this file.

See style.xml reference.

3.1.15 teams.xml

In this file one can specify per-map team settings. In short, this is where you can say how many bots you want, which color, and so on. This can be on a per-map basis, so that each map has different customized settings, some maps might be fun with only one bot, some other maps might be fun packed with 8 opponents.

Technically, teams.xml will allow you to define up to 4 players and 9 bots. This is an awfull lot considering there are only 10 colors. Basically, it’s OK to simply define:

It might also be a clever idea to just set up player2 and bot1 being the same color, in case of a conflict the game will pick up another color, but in practice those two entries often correspond to “the second player, bot or human, coming on the battlefield”.

All in all, this represents 5 entries to set up (main player, other player or first bot which can be the same, then 3 more bots), it’s OK to have the rest undefined or set to defaults.

Note that this can also simply be unset, and in that case the game defaults will apply, and the user will be able to change them, whereas if you set these up, the player will somewhat force to used the map settings.

See teams.xml reference.

3.1.16 Resampling

This is a very important point. Liquid War almost *always* resamples maps, unless you ask it not to do it. This is not recommended, it is believed in the general case, letting the internal algorithm make its own decisions is better than trying to figure out oneself “which is the best resolution”.

The reason is, the right resolution (we’re talking here of the logical resolution, how many fighters wide is the battlefield) often depends on the speed and general ressources the of the computer the program is running on. The map designer does not have this information. The program does. It runs a bench at startup. So this way it can choose, at runtime, the resolution which fits best.

The recommended way of doing things is not to try to be too picky about rules.xml parameters related to speed and also let the default map size limits in hints.xml to their defaults. Do not use them unless debugging stuff. Then the program will resample the map so that the player can play on it at a reasonnable speed. If map is too big, and it’s often the case, then it will downsize it until there are sufficiently few fighters so that the CPU can handle the job. This, of course, is not rocket science. The bench calculation is a somewhat brute-force approach of doing things. Formally, we would have to run the map for good to figure out what is the right speed. Still, this bench gives good approximations.

Previous versions of the game relied heavily on ’fighter-scale’ to resample maps, but this is not the case anymore. The ’fighter-scale’ is now a minor parameter which is used to upsize maps if they are too small. In 99.9% of the cases, the map is first upsized by ’fighter-scale’ for this parameter is by default set low (1.0) then downsized by ’bench-value’ for real-life personnal computers can’t handle 1600x1200 maps in real-time. Not yet.

There are a bazillion options to control map size, including ’min-map-surface’. They are here because it’s important that, ultimately, people can do whatever they want with the game. But for map design, this is another story. Don’t use them. Rely on ’bench-value’ and just care about game speed. This is achieved by changing the “speed” parameter.

3.1.17 Music

It is possible to store your own custom music file within the map directory. You can call it whatever you want (you can keep its original name, which is something music authors usually appreciate, even if there’s no strong “attribution” clause on the license, it can be considered fair use not to fiddle to much with the name) you just have to place it in the same directory than the other files like map.png or texture.jpeg.

The following formats are known to work with the default SDL_mixer based mod_ogg backend:

To be more precise, here’s how things work:

3.1.18 Experience (“exp”)

In rules.xml you can set a special parameter which is exp and allows you to tell “a player can’t load this map if he doesn’t have at least N at his/her exp rating”. Gaining exp (stands for “experience”) isn’t hard, you just need to win a level with exp=N to gain exp=N+1.

By default, the player’s exp is 0 and levels default to 1, so this means only levels with exp set explicitely to 0 in rules.xml might be used. Then player wins that level and is given access to all maps by default, unless these are explicitely set with exp greater than 1.

In solo game, when a player wins a level, he’s automatically redirected to the map which is in the same directory and has exactly the exp he just gain. For instance, if you win a map with exp=5 then you’re chained to the first map (in alphabetical order) which has exp=6. By setting up the exp parameter the right way, with a map for each exp level one can transform a simple map directory in a scenario that player will automatically follow.

Last, but not least, the game, at startup, only allows you to play red, green, blue and yellow. Other colors are unlocked as you progress among levels. Same things with weapons, there are “liberated” continuously through the game.

This mechanics allows the following behavior:

As a final word, yes, it’s possible to cheat, fool the exp system, but it’s believed this is moot and lame.


Next: , Previous: , Up: Hacker's guide   [Contents][Index]

3.2 Translating

3.2.1 Using gettext

Liquid War 6 uses GNU gettext for all its messages. There’s an online manual about this tool. In practice, what you have to do as a translator is to edit the po/xx.po file with xx being your language / country code. For instance, to translate the game in French, one needs to edit po/fr.po.

3.2.2 Formatted strings

This is very important, you might already be aware of it if you are familiar with gettext, but still it’s worth mentionning : when a string contains special characters such as %d or %s (in a general manner, anything with a % it’s important that all translations contain exactly the same number of %ds and %ss than the original.

For instance:

"foo has %d bars (%s)"

can be translated to:

"ziblug zdonc %d zuc - %s - tac"

The number, order and type of % entries is preserved. To learn more about these formats, use info printf or man 3 printf. In a general manner, get informations about printf.

Additionnally, some strings are used by Scheme (Guile) code and not by C code. Thus, they don’t use the standard C/printf convention. In these strings, what you must preserve and be aware of is the tilde character ~. Very often you’ll see ~a in a string. As with the printf %, you must preserve the number, order and type of those. There is a complete online reference about this way of formatting strings.

3.2.3 Partial translation

Liquid War 6 has thousands and thousands of messages which could theorically be translated. In practise it’s counter-productive to spend time to translate those, as the game is still evolving constantly, and as most of these messages are technical messages which inform about rare bugs and strange conditions. All sort of informations which, while valuable, are not intented for end-users and are more destinated to be reported in bug reports. To select only the interesting messages to translate, the current gettext configuration only uses a reduced set of files.

As a side note, the file src/lib/hlp/hlp-reference.c contains all the entries for the various configuration options, anything that can be queried by liquidwar6 --about=<keyword>. This is several hundred messages. It might be interesting to translate them some day, but it’s obviously not a priority today.


Next: , Previous: , Up: Hacker's guide   [Contents][Index]

3.3 Architecture

3.3.1 C + Guile

Technically, Liquid War 6 is a collection of C functions which are exported to Guile. The main binary embeds a Guile interpreter, which will run a Guile script. This script calls the exported C functions, and glues them together.

It should be possible to implement the game without using Guile at all, using C code to make the various modules communicate together. This might seem an easier way to go, not involving several languages. However, using this script level is a good way to achieve several important goals:

Having Guile to implement high-level stuff also decreases, to some extent, the need for object-oriented features of C++. The big picture is : low level code that require speed, optimized data processing, is written in C. Code which is more high level and requires abstraction is written in scheme.

3.3.2 Threading and SMP

Liquid War 6 makes a heavy usage of threads. Early versions of the game did not have this feature but starting with 0.0.7beta, one can really consider the game is heavily threaded.

There’s basically:

So globally, if you have an SMP system, the game will be happy with it. It will also run on a single processor, as the program uses POSIX pthreads it’s capable to run on any computer which has pthreads implemented for it.

But, and this is a strong limitation, without pthreads, the game won’t run. At all. Or at least, not unless it’s almost completely rewritten.

3.3.3 Internal libraries

The C code is splitted into several internal libraries. This allow independant testing of various game modules.

The main module, the most important one, is libker, (stands for “kernel”). This is were the core algorithm is. To some extent, the rest of the code is just about how to provide this module with the right data and environment. Logically, if you profle the game, you should find out that a great part of the CPU time is spent here. Code here is about spreading gradients, moving fighters and cursors.

The libmap module is here to handle maps, it contains the code to manipulate maps in memory. But it does not know how to load them from disk. This is the responsability of another module, libldr, which is linked against libraries such as libpng or libjpeg and does the job of transforming those standard formats into a usable in-memory structure. The libgen module also works the same way, creating pseudo-random maps. There’s still a another moduled involved in map handling, it’s libtsk, whose job is to load a level in the background. It has a 2-steps asynchronous loading system which allows the game to load maps while the user interface is still responsive, and give a preview of the map as soon as possible, when loading continues in the background, building optimizing structures which are usefull when playing but not mandatory just to show the map.

At the other end of the algorithm-chain, the libpil module will “pilot” things. It’s this module which will translate text readable orders (typically adapted for network usage) into function calls. It has event lists, keeps them in the right order, and will also permanently maintain three different states of the game. A backup state which can be used any time to go back in time and get the game in a stable 100% sure state. A reference state which is correct but ever changing. Basically backup plus all the orders received between backup and reference gives reference. And finally a draft state which is as up to date as possible but might be wrong. This is typically interesting in network game, where we want to show something moving, something fast, even if there’s lag on the network and other computers fail to send information in time. In this case we display draft while still keeping reference and updating it when we finally receive valid informations. Backup would be used to send bootstrap information when people are joining a new game, or to check up if things are going right.

A special libbot module is here to handle bot algorithms. A bot is just a simple move function which takes a game state as an input, and returns an x,y position, just the way a mouse handler would. How complex a bot is “under the hood” depends on the type of bot. Current bots are really basic. Additionnally, libsim will run dummy fight simulations to find out wether some team has a real advantage on another one, speaking of team profiles depending on colors.

The libgfx module handles all the graphics stuff. It is itself splitted in several sub-modules, that is, it does not do anything but load a module such as mod-gl1 which will actually contain the implementation. In an object-oriented language, it would be an abstract class, an inteface. The implementation does not need to be thread-safe. It’s better if it is, for theorically it could be possible to fire Liquid War 6 with two display backends running at the same time on the same game instance, but this code has yet to be written, and it’s a rare dual headed configuration which probably has no real-life usage. If only one graphics backend is activated at a time, the rest of the implementation garantees there will never be two concurrent calls to a function is this module. It is the libdsp (“display”) which handles this. It fires a thread for rendering purposes, and sends information to this thread, detecting automatically if it’s necessary to acquire a mutex and update rendering informations. For the caller, this is transparent, one just has to call an update function from time to time. The module will even perform “dirty-reads” on a game state being calculated, to render things in real time, as soon as possible.

An experimental libvox module is under design/development and might, in the future, provide a real-time voxel renderer. Still pre-alpha stage.

To ease up the implementation of different graphics backends, a libgui module contains code which is meant to be used by any graphics backend. It’s just a factorisation module, containing common code and interfaces, related to displaying things. This is where, for instance, one can find a high level menu object. In the same spirit, libmat contains generic math, vector and matrix code, which is commonly used in 3D interfaces.

The libsnd module handles sound. It’s also an abstract class, an interface, which uses dynamic backends as implementations.

The libnet module is a wrapper over different network APIs, it handles Winsock and POSIX sockets in a uniform manner. The libcli and libsrv contain network client and server code, implementing the various protocols in dynamically loadable sub-modules. It’s the role of libp2p to glue this together, handle the list of available servers, the message queue, verifying nobody is cheating, and so on. All this modules share information about current game state using code & structures defined in libnod,use message utilities (format, parse) defined in libmsg and share code concerning connections in libcnx. Additionnally, libdat provides facilities to store old network messages and sort them.

The libsys module contains most system and convenience functions, it handles logs, type conversions, timer, memory allocation, it’s the fundamental module every other module depends on. It has a compation libglb module with all the Gnulib shared code.

The libhlp is used to handle keywords and internal self-documentation (this is what is used by --list and --about), libcfg knows how to read and save config files, libcns handles the console, and libdyn can load .so shared files dynamically.

To glue all this, there are some Guile bindings with helper functions available in libscm which fills two needs, one being an easy way to check if Guile linking is working correctly without requiring all other modules to be available, and also performing automatic checks on some actions such as registering or executing a function.

Finally there are small modules like libimg (to make screenshots of the game) which have been separated because they required special libraries to link with and/or did not really fit in existing modules for dependencies reasons.

So well, this is a lot of modules. The list might move a bit, but the big picture is here. Each module is testable separately.

Below is a Graphviz diagram, which shows the modules dependencies.

Diagram showing modules and libraries dependencies

3.4 Memory structures

The most important memory structures in Liquid War 6 are:

All these structures are defined in the ker/ker.h header.

3.5 100% predictable algorithm

The core Liquid War 6 algorithm is 100% predictable, that is to say, given the same input, it will produce the same results, on any computer. Previous versions of the game also had this property. This is very important for network games, since in a network only informations such as “cursor A is at position x,y” are transmitted. Every node maintains its own internal game state, so it’s very important that every node comes with the same output given the same input.

For this reason Liquid War 6 never uses floating point numbers for its core algorithm, it uses fixed point numbers instead. It also never relies on a real “random” function but fakes random behavior by using predictable pseudo-random sources, implementation independant, such as checksums, or modulos.

There are also some optimizations which are not possible because of the predictability requirement, for instance one can not spread a gradient and move the fighters in concurrent threads, or move fighters from different teams in different threads.

If you read the code, you’ll find lots of checksums here and there, a global checksum not being enough for you never know where the problem happened. The test suite uses those facilities to garantee that the game will run the same on any platform.

Not being able to rely on a predictable algorithm would require to send whole game states on the network, and this is certainly way too much data to transmit. A moderate 200x200 map has a memory footprint of possibly several megabytes, so serializing this and sending it to multiple computers at a fast-paced rate is very hard, if possible at all, even with a high bandwidth. We’re talking about Internet play here.


Next: , Previous: , Up: Hacker's guide   [Contents][Index]

3.6 Graphics backends

3.6.1 Modularity

Liquid War 6 has a modular architecture which allows the programmer (and the player) to plug pretty much any rendering/graphics backend, provided this one is... developped.

As of 2009 the only available backend was mod-gl1, it would display the game using 3D acceleration, if available, through the SDL library, using its GL bindings.

As of 2012, other backends are begin developped, the idea is that each backend can provide the user with enough visual feedback to play, and convey input informations to the core engine.

The rest of the game is exactly the same, this means playing with mod-gl1 you can do exactly the same things than with mod-caca.

3.6.2 List of backends

3.6.3 How to write a new backend

The starting point for any hack are the files src/lib/gfx/gfx.h. This is where the API is defined.

Basically, the type lw6gfx_backend_t contains all the required callbacks. You must provide an implementation for each function.

Let’s take an example, taken from mod-gl1. When calling lw6gfx_get_video_mode and passing it a first argument which is a valid mod-gl1 backend, the function mod_gl1_utils_get_video_mode will be called. How this is done is a little C casting wizardry.

To understand how this works, read the files:

All the functions should be defined, but some of them are obviously more important. The two most critical functions are:


Next: , Previous: , Up: Hacker's guide   [Contents][Index]

3.7 Core algorithm

3.7.1 Introduction

Since Liquid War 3 the algorithm to power Liquid War is pretty much unchanged, at least, there has been no revolution, the basic principles remain the same. This has been explained in Liquid War 5 doc, but is repeated here, along with the specific Liquid War 6 stuff.

The very important things to remember are:

3.7.2 Level, game struct, game state and pilot

Most of the algorithm code has something to do with the following types (which are structs):

Most of the time, hacking on the algorithm, changing the gameplay, does not require to touch anything but the code in src/lib/ker.

See See libmap. See See libker. See See libpil.

3.7.3 Getting informations about where fighters are

One of the key functions is lw6ker_game_state_get_fighter_id, which will return the id of a fighter at a given position. Then its companion function lw6ker_game_state_get_fighter_by_id can be called, it will return a lw6ker_fighter_t, which contains the real data.

The type lw6ker_fighter_t is not opaque and can be freely accessed by the caller, which, typically, is a graphics backend trying to display informations. Try and grep for the string “lw6ker_game_state_get_fighter_id” withing the src/lib/gfx source tree for examples.

One thing that is very important when hacking on libker: you should always leave the lw6ker_game_state_t struct in a state that is compatible with a correct usage of public “getters” in src/lib/ker/ker.h. The reason is that this code can be executed by separate threads, more precisely, in “dirty read” mode, the rendering thread will try and display a “game state” while this very “game state” is being updated by another thread.


Next: , Previous: , Up: Hacker's guide   [Contents][Index]

3.8 Compilation tips

3.8.1 Advanced ./configure options

In addition to all the common Autoconf switches such as --prefix, Liquid War 6 has some custom switches:

3.8.2 Debian packages

Liquid War 6 does have a ./debian in both main and extra maps packages, so it’s “debianized”. To build the main .deb package, untar the main source tarball, then:

make dist
cd pkg
cp ../liquidwar6-X.Y.Z.tar.gz . # X.Y.Z is the version
make deb

Note that you have to copy the source tarball to ./pkg and move to this directory before typing make deb. This is, among other things, to simplify the main Makefile.

To build the extra maps .deb package, untar the extra maps tarball, then:

make deb

3.8.3 Red Hat packages

Liquid War 6 does have a .spec files in both main and extra maps packages. To build the main .rpm package, untar the main source tarball, then:

make dist
cd pkg
cp ../liquidwar6-X.Y.Z.tar.gz . # X.Y.Z is the version
make rpm

Note that you have to copy the source tarball to ./pkg and move to this directory before typing make rpm. This is, among other things, to simplify the main Makefile.

To build the extra maps .rpm package, untar the extra maps tarball, then:

make rpm

3.8.4 Microsoft Windows msys/mingw32 port

This section describes how to compile the game from source under Microsoft Windows. Note that players are encouraged to use a free system such as GNU/Linux, which is the platform Liquid War 6 is being hacked on by default. If you encounter problems with this port, you’ll probably save time by installing a double-boot with GNU/Linux coexisting with your previous Microsoft Windows install.

Basically, Liquid War 6 requires MinGW. More precisely, it requires MSYS. A standard Cygwin installation won’t work, because it is too UNIXish to allow third party libraries like SDL to compile natively. You might argue that SDL is available for Cygwin, but in reality, the Cygwin port of SDL is a MinGW port. Indeed, Cygwin brings all standard POSIX functions including the use of main instead of WinMain and I suspect this is a problem for graphical libraries like SDL which do require some sort of direct access to the OS low-level functions. Therefore, MinGW is more adapted for it does not define all these functions, and allows any library to hook on Microsoft Windows internals directly. Point is then, you also loose the cool effect of Cygwin which is to have a complete glibc available, including network functions like select defined the POSIX way, and not the WinSock way. If you ever ported code from POSIX sockets to WinSock 2, you know what I mean. Using MinGW is also embarassing for some libraries won’t compile easily, and for instance programs which heavily rely on a real TTY interface to work are usually hard to port. This includes ncurses and GNU readline. Liquid War 6 tries to have workarrounds for all this, and in some cases the workarround is simply that embarassing code is not compiled on Microsoft Windows. For this reason, some features are not available on this platform. Period.

Now the reason you need MSYS and not only MinGW is that MSYS will allow ./configure scripts to run, and this eases up the porting process a lot. MinGW and MSYS packages are downloadable on the SourceForge MinGW download page. Alternatively, there is a mirror on ufoot.org, but files might be outdated.

To compile Liquid War 6, first download and unzip all the following files in the same directory, for instance C:\MSYS. If you do not have any tool to handle .tar.gz and .tar.bz2 files under Microsoft Windows, which is likely to be the case when MSYS is not installed yet, you can untar these on any GNU/Linux box, then upload the whole directory to the target Windows host.

This file list might contain file which are not absolutely mandatory for Liquid War 6, for instance the Fortran 77 compiler is absolutely useless, but installing it won’t harm either. Some packages might unzip things the right way, but some do it in a subfolder. You might need to run commands like:

cp -r coreutils*/* .
rm -rf coreutils*

Get rid of useless files:

rm ._.DS_Store .DS_Store 

It’s also mandatory to move everything that has been installed in /usr or /usr/local to / since MSYS has some builtin wizardry which maps /usr on /. You need to do this if you don’t unzip files from a MinGW shell, which is obviously the case when you first install it. Usefull command can be:

mv usr/* .
rmdir usr

Next, libintl is not correctly handled/detected by LW6, and can raise an error like "gcc.exe: C:/msys/local/lib/.libs/libintl.dll.a: No such file or directory" so one needs to copy some libraries in /usr/local/lib/.libs/:

mkdir local/lib/.libs
cp local/lib/libintl.* local/lib/.libs/

Another step is to edit /etc/profile and add lines like:

export CFLAGS="-g -I/usr/local/include"
export LDFLAGS="-L/usr/local/lib"
export GUILE_LOAD_PATH="C:\\MSYS\\local\\share\\guile\\1.8\\"

Close and re-launch your msys shell (rxvt) so that these changes take effect. Check that those values are correctly set:

env | grep FLAGS
env | grep GUILE

Finally, your MSYS environment is (hopefully...) working.

Now you need to compile the following programs, from source. Files are mirrored on ufoot.org for your convenience, however these might be outdated. Still, there are known to work. Proceed like if you were under a POSIX system. Some packages use the --disable-rpath swith, there are various reasons for which rpath is an issue. In the same manner, --disable-nls when linking against libintl or libiconv was painful.

For your convenience, a zip file containing a complete MSYS "Liquid War 6 ready" environment is available. It is simply the result of all the operations described above. Simply unzip msys-for-liquidwar6-20080819.zip (about 240 megs) in C:\MSYS\. All dependencies compiled in /local have been generated using the command:

cd /usr/local/src
./msys-for-liquidwar6-build.sh > ./msys-for-liquidwar6-build.log 2>&1

Note that this script does’t do everything, you’ll still need to edit Guile source code and patch it manually.

It might even be possible to use this MSYS environment under Wine. Simply unzip it under $HOME/.wine/drive_c, and run wine "$HOME/.wine/drive_c/windows/system32/cmd.exe" /c "c:\\msys\\msys.bat" and with luck, you’ll get a working shell. Note that this might allow you to compile the game, but running it is another story. Consider this MSYS over Wine trick as a hack enabling the use of free software only when compiling for Microsoft proprietary platform. It is not a reasonnable way to run the game. If running under a UNIXish platform, or better, GNU, simply run native code. Use the Windows 32-bit port only if you are jailed on a Microsoft system.

Now, let’s come to the real meat, untar the Liquid War 6 source tarball, launch your MSYS shell, and:

./configure
make
make install

Now the binary is in src/.libs/liquidwar6.exe (beware, src/liquidwar6.exe is only a wrapper). This binary is an MSYS/MinGW binary, so it read paths “à la” Microsoft, that is, it has no knowledge of what /usr is, for instance. It requires paths starting by C:\.

3.8.5 Mac OS X port

This is still experimental. Basically, install MacPorts, and most dependencies with, except for SDL which you compile from source. The idea is to compile SDL using the native OS X bindings (and not some other GL files you could have in /opt/local installed by MacPorts), then compile the game and other SDL dependencies against this SDL.

The SDL_mixer library might need to be told to compile itself without dynamic ogg support. By default it seems that it tries to load libvorbisfile.dylib at runtime, and it can fail. To disable this dynamic loading, use for instance :

/configure --prefix=/opt/extra --enable-music-ogg --disable-music-ogg-shared 

Also, it might seem obvious for Mac OS X users, but there are some important issues related to compiling options and handling dynamic libraries at runtime.

It is very important to have the right SDL flags when linking the Liquid War 6 binaries. For instance it could be:

-I/opt/extra/include -I/opt/local/include -Wl,-framework -Wl,CoreFoundation -I/opt/local/include -D_THREAD_SAFE -Wl,-framework -Wl,Cocoa -Wl,-framework -Wl,OpenGL -Wl,-framework -Wl,Cocoa 

The point is to have Cocoa and OpenGL support. Depending on the way you installed SDL, you might also need to include an SDL framework support, this is mostly if you installed SDL from .dmg binary images, and not from source with the command line. A typical output of sdl-config --libs is:

-L/opt/extra/lib -lSDLmain -lSDL -Wl,-framework,Cocoa

Another important issue is to include SDL.h, which in turn includes SDLmain.h, in all the .c source files defining the standard main function. This is done in liquidwar6 but should you try to link yourself on liquidwar6 libraries and/or hack code, you must do this or you’ll get errors when running the game. Such errors look like:

*** _NSAutoreleaseNoPool(): Object 0x420c90 of class NSCFNumber autoreleased with no pool in place - just leaking

The reason is that SDL replaces your main with its own version of it. One strong implication is that all the dynamic loading of SDL, which works on sandard GNU/Linux boxes, won’t work under Mac OS X, since SDL hard codes itself by patching main with #define C-preprocessor commands.

A .dmg file (disk image) containing a Liquid War 6.app folder (OS X application) is available for your convenience. It might work or not. In doubt, compile from source. The complicated part about this package (a “bundle” is OS X language) is that it needs to embed various libraries which are typically installed in /opt by MacPorts on a developper’s machine. So to build this package a heavy use of the utilility install_name_tool is required, normally all libraries needed ship with the binary, remaining depedencies concern frameworks which should be present on any working Mac OS X install. Still, this is only theory. Needs to be widely tested.

The layout of the bundle follows:

Additionnally, the Mac OS X port uses /Users/<username>/Library/Application Support/Liquid War 6/ to store configuration file, logs, etc. It does not use $HOME/.liquidwar6 like the default UNIX port.

The Mac OS X port also has a special behavior, in order to load some libraries with dlopen (SDL_image does this with libpng and libjpeg) it needs to set DYLD_FALLBACK_LIBARY_PATH to a value that contains these libraries. This is typically in the bundle distributed on the disk image. On a developper’s computer this problem does not appear for those libs are often in places like:

So the program sets DYLD_FALLBACK_LIBARY_PATH (but not DYLD_LIBRARY_PATH else it breaks internal OS X stuff which relies, for instance, on libjpeg library that has the same name but different contents) but it needs to do it before it is even run, else the various dyld functions do not acknowledge the change. That is, calling the C function setenv(), even before dlopen(), has no effect. So the program calls exec() to re-run itself with the right environment variable. This is why, on Mac OS X, there are two lines (exactly the same ones) displaying the program description when it is started in a terminal.

3.8.6 GP2X port

This is not working yet, but there are good hopes that some day, Liquid War 6 can run on a GP2X console. This handled gaming device uses a Linux kernel on an ARM processor, does support most GNU packages through cross-compilation, and has basic SDL support.

To compile Liquid War 6 for GP2X, you first need to set up a working “toolchain”. It’s suggested you do this on a working GNU/Linux box. There are several solutions, the recommended one being Open2x. Read the online documentation on how to install Open2x.

Basically, the following should work:

mkdir /opt/open2x # check that you can write here
svn co https://open2x.svn.sourceforge.net/svnroot/open2x/trunk/toolchain-new open2x-toolchain 
./open2x-gp2x-apps.sh
cd open2x-toolchain

Then, for your environment to be complete, you need to set up some environment variables. For instance:

export OPEN2X_SYSTEM_PREFIX=/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux
export GP2X_USER_PREFIX=$HOME/gp2x

export CC=${OPEN2X_SYSTEM_PREFIX}/bin/arm-open2x-linux-gcc
export CPP=${OPEN2X_SYSTEM_PREFIX}/bin/arm-open2x-linux-cpp
export CXX=${OPEN2X_SYSTEM_PREFIX}/bin/arm-open2x-linux-g++
export AS=${OPEN2X_SYSTEM_PREFIX}/bin/arm-open2x-linux-as

export CFLAGS=''-I${OPEN2X_PREFIX}/include -I${GP2X_USER_PREFIX}/include''
export CPPFLAGS=''-I${OPEN2X_PREFIX}/include -I${GP2X_USER_PREFIX}/include''
export CXXFLAGS=''-I${OPEN2X_PREFIX}/include -I${GP2X_USER_PREFIX}/include''
export LDFLAGS=''-L${OPEN2X_PREFIX}/lib -L${GP2X_USER_PREFIX}/lib''

export PATH=''${GP2X_USER_PREFIX}/bin:${OPEN2X_SYSTEM_PREFIX}/bin:$PATH''

In this setting, there’s a user $HOME/gp2x directory which will contain all the Liquid War 6 related libraries while the /opt/open2x remains untouched.

Then you need to install the requirements. All these packages need to be cross-compiled. To make things clear and non-ambiguous, even if you have CC set up in your environment variables, pass --build and --host arguments to the ./configure script of all these packages. A typical command is:

./configure --build=i686-pc-linux-gnu --host=arm-open2x-linux --prefix=${GP2X_USER_PREFIX}

Here’s the list of the requirements:

Next, one needs to install a special version of SDL, which targets the GP2X specifically. This is not a generic SDL, and it does have limitations, which are related to the GP2X peculiar hardware. There are installation instructions about how to do this. The following should work:

cvs -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/open2x login # blank password
cvs -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/open2x co libs-gp2x 

Next: , Previous: , Up: Hacker's guide   [Contents][Index]

3.9 Coding guidelines

3.9.1 Project goals reminder

One of the purposes of Liquid War 6 is to make a cleaner implementation of Liquid War than the previous one, namely Liquid War 5. While the latter has achieved the practical goal of providing a playable implementation of the game, it failed at providing an evolutive platform. Network capabilities where finally added to Liquid War 5, but anyone who played on Internet with someone a few hundreds of milliseconds away would agree that it’s far from being perfect. The main reason for this is that it is really had to hack on Liquid War 5, especially when you are not the core developper. The core developper himself, even knowing all the various hacks in the game, is very quickly lost when trying to implement major changes.

To put it short, Liquid War 5 is a global variable hell, a pile of hacks on top of a quick and dirty implementation. Still, it works.

With Liquid War 6, the idea is to take the time to make something stable, something nice which will enable developpers to implement the cool features, and have fun along the way. Of course, this is only a dream, and in the (hopefully "very") long run, Liquid War 6 will also end up as a big unmaintainable mess, like any real-life program, until then, it should remain hackable.

3.9.2 Common sense

Here are a few guidelines which I think are common sense advice, but they are still worth mentionning:

3.9.3 Unitary tests

Each of the internal libraries in Liquid War has a “test” program associated with it. For instance liquidwar6sys-test is associated to libliquidwar6sys, and its purpose is to test the features of this library.

While it is fairly easy to test out unitary functions which require no peculiar context, testing high-level functions which requires files, graphical and possibly network contexts to exist is obviously harder to achieve. There’s no easy way to draw the line, but the idea is to put in these test executables as many features as possible, to be sure that what is tested in them is rock solid, bullet proof, and that one can safely rely on it and trust that code when running it in a more complex environnement.

These test executables are also very good places to see a library API in action, find code fragments, and make experiments.

3.9.4 Memory allocation

Liquid War 6 provides macros to allocate and free memory. One should use them systematically, except when trying to free something allocated by another library, and in very special cases, mostly concerning low-low level operations which are seldom hacked on.

Usage of macros LW6SYS_MALLOC, LW6SYS_CALLOC and LW6SYS_FREE is straightforward, read any random chunk of code, for instance ./src/lib/sys/sys-test.c to see them in action. They are defined in sys/sys.h.

Once used, these macros will track every single call to malloc and free, and if there’s a difference, it will report it. It will also help you by showing what’s in the non-freed memory area, at which line of code it has been allocated, and when. This is very usefull to track down memory leaks. Of course a debugger could tell you some of these informations, but experience shows than when you encounter a memory bug, it’s very often impossible to reproduce it. So you one wastes time trying to reproduce the bug, whereas with this tool you have the information reported just when the problem happens.

3.9.5 Private and public interfaces

Each library exports a public interface and hides its internal. Since Liquid War 6 uses standard C and no C++, there’s no real standard way to handle public/private features. The convention used in Liquid War 6 is to show internal structures as opaque pointers (void *) whenever some function needs to operate on a structure which has possibly private fields. This way the caller function has no way to access the internals, and we are sure that no reference to any internal implementation specific feature will appear.

Here’s a code excerpt from src/gfx/setup.c:

void _lw6gfx_quit(_LW6GFX_CONTEXT *context) {
  /*
   * Implementation here.
   */
[...]
}

void lw6gfx_quit(void *context) {
  _lw6gfx_quit((_LW6GFX_CONTEXT *) context);
}

The function _lw6gfx_quit (note the “_”) is internal, declared in internal.h whereas the function lw6gfx_quit is public, and is therefore exported in gfx.h.

This way, functions in the program using lw6gfx_quit do not know what is in the _LW6GFX_CONTEXT structure, and they need not know it.

This does not mean it is not possible to have public structures, only these structures must reflect some truely public, accessible and safe to access structures.

3.9.6 Commit policy

Basic rules :

To check that a commit does not break everything, a good practice is to run a make check before committing / submitting anything.

Then, once it’s within the main GIT repository, check the Jenkins builds to see if the program still builds correctly.

3.9.7 Audit the code

Liquid War 6 is regularly audited with automated tools. You might need to pass --enable-gcov to --configure if you want to use thes tools yourself. More precisely:

Those tools certainly don’t garantee the code is perfect, but they do help improving the quality of the program. If you hack, it’s recommended you give them a try.


Next: , Previous: , Up: Hacker's guide   [Contents][Index]

3.10 Using the console

The console can be activated by passing --display-console when starting the game or by using the system options menu.

When the console is activated, a lw6> prompt should appear in the terminal which launched the program. If you started Liquid War 6 by clicking on an icon, console probably won’t work at all since stdout and stdin won’t be attached to anything.

The console allows you to type arbitray Scheme/Guile code.

Try, for instance:

(+ 1 2)
(display "foo\n")

You can really break things with this console, it gives you a direct access to all the program internals. At least, all the values which are accessible through the script interface, that is, many of them.

You can call any internal C function which has been exported to Guile, here are some examples:

(c-lw6sys-timestamp)
(c-lw6bot-get-backends)
(c-lw6sys-sleep 2.0)
(lw6-config-get-number "zoom")
(lw6-config-set-number! "zoom" 0.9)
(lw6-config-get-number "zoom")

While syntax (and possibly other) errors will be trapped by the interpreter, note that if you break things inside the game by, say, changing some global value, or in a general manner cause an error elsewhere in the code, the game will really raise a fatal error and stop. That’s how you can “break things”.

Still, this console is a very powerfull tool, very usefull for debugging but also for tweaking the game without restarting it and/or navigating through the menu interface.


Next: , Previous: , Up: Hacker's guide   [Contents][Index]

3.11 Advanced tweaking

3.11.1 Hacking ressources

Liquid War 6 tries to have as few hardcoded data as possible. So many constants, and pretty much all the image files, are accessible in the data directory. You can know where it is by launching liquidwar6 --show-data-dir. If you look in this directory you’ll find different files, among them XML files.

Let’s take an example. Try and find the file gfx/gl/hud/floating/gl-floating-const.xml. Edit the line with the clock-y1 entry. Change the number after "value". Re-run the program. Play a game. What happens? Logically you should see that “something” is not displayed at the same place than before.

You could also modify the textures (JPEG and PNG files). In a general manner it’s more cautious to keep them the same size but it depends, sometimes other sizes will work as well.

Many of these parameters are really too technical and obscure to have their place in the main config file (which is already rather big). Use at your own risks, you can really break things touching this, but you can also find out lots of things can be tuned.

3.11.2 Optimize for speed

Todo...


Next: , Previous: , Up: Hacker's guide   [Contents][Index]

3.12 Writing modules

Todo...


Next: , Previous: , Up: Hacker's guide   [Contents][Index]

3.13 Use as a library

Todo...


Next: , Previous: , Up: Hacker's guide   [Contents][Index]

3.14 Network protocol

This section describes how Liquid War 6 handles network messages. Note that for now this is purely theorical, more of a draft, a plan, it might change before being implemented.

3.14.1 No server, no client, only nodes

Liquid War 6 does not really have the notion of server or client, any instance of the program can act as both server and client, therefore we use the term node.

A node listens on a given port, in both TCP and UDP, and can connect to other nodes on the same port. The main identifier of a node is its public url, which is typically of the form http://<ip-address>:<port>/. This url is very important for it is (or at least should be) a unique identifier of the node over the network.

Liquid War has 3 ways to communicate:

On each of these channels, messages can be exchanged in two modes, an “out of band” mode (AKA “oob”), and a regular message oriented, here we speak of “connection”.

3.14.2 Out of band messages

There are only 3 out of band messages:

You can test out of band messages by simply connecting on your server with a command like:

telnet localhost 8056

At the telnet prompt, simply type:

INFO

and press return, and you should have a description of your node.

The complete syntax of OOB messages is:

<COMMAND> [password] [url]

The password and url parameters are optionnal. password can contain either the plain text password or a checksum calculated from the password which is, for security reasons, seeded with the public url of the node we’re connecting to, so that this password can’t be re-used on another node. url is simply a clue we give to the other node to help find us, the other node will automatically try to detect our IP address and use standard LW6 port 8056, but if for some reason we use a different setting, this is a good way to pass the hint.

Here are examples of valid messages:

LIST
PING http://myhost.mydomain:1234/
INFO secret http://myhost.mydomain:1234/
LIST 12ab34cd

If there’s only one argument, the parser will first try and interpret it as a URL. If it’s not parseable that way, it will consider it’s a password. The password, in turn, may be specified as clear text or as a 32-bit checksum.

As far as OOB is concerned, TCP and UDP work almost the same, HTTP is a bit different, the OOB commands are accessed through the following URLs:

OOB messages are usually sent many times in redundant mode on the network, as there’s no tracking of them, sending them through multiple channels ensures they make their way to the right place.

The parser for these messages is located in src/lib/msg/msg-oob.c.

3.14.3 Regular messages overview

All messages that are non-OOB share a common syntax. This is called the “envelope” of messages.

The general syntax is:

LW6 <VERSION> <PASSWORD_CHECKSUM> <PHYSICAL_TICKET_SIG> <LOGICAL_TICKET_SIG> <PHYSICAL_FROM_ID> <PHYSICAL_TO_ID> <LOGICAL_FROM_ID> <LOGICAL_TO_ID> <MSG>

Here’s an example:

LW6 0.1.3485 - 2d1dbed7 - 3003300330033003 2002200220022002 - - DATA 8 0 1 1000000035005 3003300330033003 SET 3001 11 1 1 0

In this example, the messages carried is DATA 8 0 1 1000000035005 3003300330033003 SET 3001 11 1 1 0, the rest is part of the envelope protocol.

Here’s what those fields mean:

It’s implemented in src/lib/msg/msg-envelope.c.

3.14.4 Regular control messages

To establish a connection, maintain it, and do the OOB job, a set of control message is used. Those messages carry a bunch of informations about who is sending them, in fact, they just contain the informations that would otherwise be handled by out-of-band messages, but it’s convenient to have the information first-hand rather than relying on the other protocol.

The syntax is:

LW6 <VERSION> <PASSWORD_CHECKSUM> <PHYSICAL_TICKET_SIG> <LOGICAL_TICKET_SIG> <PHYSICAL_FROM_ID> <PHYSICAL_TO_ID> <LOGICAL_FROM_ID> <LOGICAL_TO_ID> <COMMAND> <PROGRAM> <VERSION> <CODENAME> <STAMP> <ID> <URL> <TITLE> <DESCRIPTION> <HAS_PASSWORD> <BENCH> <OPEN_RELAY> <UPTIME> <COMMUNITY_ID> <ROUND> <LEVEL> <REQUIRED_BENCH> <NB_COLORS> <MAX_NB_COLORS> <NB_CURSORS> <MAX_NB_CURSORS> <NB_NODES> <MAX_NB_NODES> <PEER_LIST> <COMMAND_ARGS>

Example:

LW6 0.1.3485 - ffffffff - 1001100110011001 2002200220022002 - - HELLO liquidwar6 0.1.3485 "Davy Crockett" 3485 1001100110011001 http://localhost:8057/ cGF0 RHVtbXkgdGVzdCBub2RlIEE= 0 10 0 5 372057f45b3d2ba5 10005 "Default map" 5 4 10 4 26 1 12 ""

The fields, starting from LW6 up to (and including) <LOGICAL_TO_ID> are part of the envelope, described previously.

The message fields are:

Here are the different possibilities for the <COMMAND> field.

It’s implemented in src/lib/msg/msg-cmd.c.

3.14.5 Regular MISS messages

Todo...

3.14.6 Regular META messages

Todo...

3.14.7 Regular DATA messages

Todo...

3.14.8 Other raw technical stuff (WIP)

TCP messages:

LW6 [<passwd>] <version> <client-id>
<from-id> <to-id> <serial> <i> <n> <sig> MSG1
<from-id> <to-id> <serial> <i> <n> <sig> MSG2

TCP oobs:

<return> # only works anonymous, same as INFO
INFO [<passwd>] [<public-url>]
LIST [<passwd>] [<public-url>]
PING [<passwd>] [<public-url>]

UDP messages:

LW6 [<passwd>] <version> <client-id> <from-id> <to-id> <serial> <i> <n> <sig> MSG1
LW6 [<passwd>] <version> <client-id> <from-id> <to-id> <serial> <i> <n> <sig> MSG2

UDP oobs:

INFO [<passwd>] [<public-url>]
LIST [<passwd>] [<public-url>]
PING [<passwd>] [<public-url>]

HTTP messages:

client id & password passed in HTTP headers

/lw6/version/<from-id>/<to-id>/<serial>/<i>/<n>/sig/MSG1
/lw6/version/<from-id>/<to-id>/<serial>/<i>/<n>/sig/MSG2

HTTP public URLs:

/ -> index.html
/index.html
/favicon.ico
/screenshot.jpeg
/robots.txt
/gpl.txt
/info.txt
/list.txt
/ping.txt

MSG syntax:

<round> <server-id> <command> <arg1> ... <argN>

COMMAND examples:

2 1234abcd1234abcd REGISTER
3 1234abcd1234abcd ADD 5678 YELLOW
4 1234abcd1234abcd SET 5678 20 5
10 1234abcd1234abcd NOP
400 1234abcd1234abcd REMOVE 5678
1000 1234abcd1234abcd UNREGISTER

Sig is a checksum on string:

<from-id> <to-id> <serial> <i> <n> MSG

Next: , Previous: , Up: Hacker's guide   [Contents][Index]

3.15 Technical HOWTOs

3.15.1 Release check-list

Summary off all operations required for a release:

3.15.2 Add a new option

This describes how to add a new option to the game.

Unless this is done, program won’t accept the option.

Some options need more work, for instance:

3.15.3 Add a new internal library

This describes how to add a new libxyz internal library:

3.15.4 Add a new module

This describes how to add a new mod-ab module, for instance a new bot, but gfx, snd, cli or srv backends should work pretty much the same:


Next: , Previous: , Up: Hacker's guide   [Contents][Index]

3.16 Using GNU Arch

3.16.1 About GNU Arch

Since March, 4th 2010, Liquid War 6 uses GIT to handle source code, track changes, branches, and the rest. It replaces the GNU Arch repository. This old repository contains all sources up to version 0.0.7beta, following versions, including 0.0.8beta, must be retrieved from GIT.

So the following informations only concern those who are interested in previous versions of the game. Anybody else - probably you - should use GIT instead.

See Using GIT.

Still, this quick Arch survival guide is kept in the documentation.

Read the GNU Arch tutorial to learn how Arch works. Note that there are many other source control managers available, some of which provide functionnalities similar to GNU Arch / tla. GNU Arch has been chosen for Liquid War 6 because:

3.16.2 Getting the latest version from the repository

The repository for Liquid War 6 is accessible on http://arch.savannah.gnu.org/archives/liquidwar6. This is a read-only access, but with the distributed nature of GNU Arch, it still allows you to keep track of your own changes, and submit patches. Accessing it in read/write mode with sftp requires a Savannah account and special rights on the Liquid War 6 project.

Here are typicall commands one can use to get Liquid War 6 source from the GNU Arch repository:

tla register-archive http://arch.savannah.gnu.org/archives/liquidwar6
tla get -A liquidwar6@sv.gnu.org liquidwar6--beta

All the patches in the archive are signed with GnuPG, so you can check their authenticity with my public key.

You might need to edit your $HOME/.arch-params/signing/=default.check file and put the following text in it:

tla-gpg-check gpg_command="gpg --verify-files -"

3.16.3 Setting up your own arch repository

This section is for those who want to hack the game and set up their own repositories. This will enable you to keep track of your patches, package them, and help the core maintainer merging them in the main repository.

You can introduce yourself and create a repository by issuing commands like:

You can introduce yourself and create a repository by issuing commands like:

tla my-id me@home.net
tla register-archive me@home.net--2008 /home/me/tla-archives

Then, you can get create your own repository, with a command like:

tla tag -S liquidwar6@sv.gnu.org/liquidwar6--beta--0.1 me@home.net--2008/liquidwar6--beta--0.4

The idea is that you create, locally, a depot which has a name that matches the name on savannah (this is for convenience, you could technically give it any name...) and indicate that they represent, today, the same thing.

You can get a working copy of your depot with the command:

tla get me@home.net--2008/liquidwar6--beta--0.4

This will create a complete source tree, which you are free to modify, this is where you should hack.

3.16.4 Synchronizing your repository with upstream releases

To synchronize yourself with upstream developments, go into your copy (the directory created by tla get) and type:

tla star-merge liquidwar6@sv.gnu.org/liquidwar6--beta--0.1

This will apply locally all the changes that happened since the last synchronization. Of course this is one way to work, you can decide to cherry pick patches and such stuff, but for most dayly uses, a good’ol star-merge is fine.

Not that star-merge will only apply patches on your working copy, not on your repository. The only way to actually commit the modifications on the repository is to use the commit command.

3.16.5 Submitting patches

When using Arch, you can of course still send patches created with diff, or even send updated files directly, the way you would without revision control.

But it can be more convenient to either

Here’s an example of an mkpatch command, and which will compute the differences between a previous liquidwar6--beta--0.4--patch-2 snapshot and a not yet commited latest version:

tla mkpatch {arch}/++pristine-trees/unlocked/liquidwar6/liquidwar6--beta/liquidwar6--beta--0.4/me@home.net--2006/liquidwar6--beta--0.4--patch-2 . my-patch

This will create a my-patch directory, which can be gzipped and sent by mail.

3.16.6 Recover from broken lock

Sometimes, when signing a patch, you might enter the wrong passphrase several times, or you might press CTRL+D inadvertantly. In that case, tla will be in a half-broken state, telling you it can’t acquire revision lock... A quick workarround for this is to go to the depot, find the latest patch, and in this repository, create the following folders:

++revision-lock/+contents

Both are directories, note the two ++ and the single +. the +contents directory can be empty. Once you’ve done this, try to re-commit.


Next: , Previous: , Up: Hacker's guide   [Contents][Index]

3.17 Using GIT

3.17.1 About GIT

There’s no CVS or Subversion (AKA “SVN”) source depot for Liquid War 6. Instead, a GIT depot is used. GIT has many advantages over other source control managers (SCM), among them, it’s distributed, like GNU Arch.

You can find interesting informations on GIT here:

3.17.2 Getting the latest source

Simply install git and run the following command:

git clone git://git.sv.gnu.org/liquidwar6.git

If you are behing a firewall and can’t have direct TCP/IP access:

git clone http://git.sv.gnu.org/r/liquidwar6.git

Additionnally, source can be browsed online here: http://git.savannah.gnu.org/cgit/liquidwar6.git

3.17.3 Developper access

You need an ssh access on Savannah and appropriate rights on the project, then you can type:

git clone login@git.sv.gnu.org:/srv/git/liquidwar6.git

3.17.4 Submitting patches

If you have developper access to the project, then a simply git push will commit your changes.

If not (that is, if you checked out anonymously using git clone git://git.sv.gnu.org/liquidwar6.git for instance, you can still submit patches. Follow these steps:

Note that you can need to run git format-patch -p master (with master instead of origin) it not using a fresh checkout. Also consider adding the --stdout switch, eg git format-patch -p master --stdout > my-changes.patch if you’re not using a fresh checkout.


Previous: , Up: Hacker's guide   [Contents][Index]

3.18 Jenkins builds

Liquid War 6 uses Jenkins for continuous integration.

Each time a commit is done on the main GIT source tree, a build is triggered. The list of builds, their status, is available on:

It’s interesting, among other things, to look at the log produced when the game is built, as it contains the test suite output, and can provide usefull informations of what is supposed to happen when the game is built correctly, and what happens when things go wrong.


Next: , Previous: , Up: Top   [Contents][Index]

4 Reference

This chapter is a technical reference. Most of its content is self-generated by the program itself. That is to say, most if its content is already available to you if you have the game installed. Running liquidwar6 --list and liquidwar6 --about=<keyword> is very likely to give you the very same informations, the advantage being that you’ll be sure the information is up-to-date and corresponds to the exact version of the program you have. However, publishing this in a reader-friendly way is convenient, plus it enables web search engines to harvest the content.


Next: , Up: Reference   [Contents][Index]

4.1 Basic options

4.1.1 about

Command-line option: --about=<value>

Type: string

Will allow you to get informations about a given keyword. Let’s say that, for instance, you want informations about the keyword ’map-path’. Simply run ’liquidwar6 –about=map-path’. Note that this internal self-documentation system can describe command line switches as well as XML config file parameters or environment variables, and even some Guile script functions. The ’–list’ command line switch will give you the list of all available keywords.

4.1.2 audit

Command-line option: --audit

Display all path values, defaults and current settings. This output is very usefull to track down problems such as missing directories, broken installations. If you get an error message that suggests some file is missing, then give this option a try.

4.1.3 copyright

Command-line option: --copyright

Returns the copyright notice for the program.

4.1.4 credits

Command-line option: --credits

Gives hopefully extensive information on who contributed to the game.

4.1.5 debug

Command-line option: --debug

Enables debug mode. This will turn on maximum log information, and display everything on stderr, even messages which are normally only stored in the log file.

4.1.6 defaults

Command-line option: --defaults

Clears the config file and run the game with default settings. Use this if you suspect you have broken something by tweaking user settings, or when upgrading the game to a new version.

4.1.7 help

Command-line option: --help

Returns a short help for the program.

4.1.8 host

Command-line option: --host

Display all known system host properties, including os and cpu informations.

4.1.9 list

Command-line option: --list

Returns the list of all keywords which can be queried for information. This includes command-line options, environment variables, and so on. This is the companion option of ’–about’. Results obtained with ’–list’ can be passed to ’–about’.

4.1.10 modules

Command-line option: --modules

Tells which modules have been enabled when the game was compiled. It’s still possible to add or remove modules afterwards, but this option allows you to know how things were at first.

4.1.11 pedigree

Command-line option: --pedigree

Display all build values, these are general constants which can help debugging, tracing what binary you are running, and so on. It’s a good idea to take a look at the output of ’pedigree’ if you have problems running the game.

4.1.12 test

Command-line option: --test

Runs a (hopefully) complete test suite which will call most internal Liquid War 6 functions and check out wether they work, in a simple context, without any game interference. Usefull for troubleshooting.

4.1.13 version

Command-line option: --version

Returns the version of the program, as defined by the GNU Coding Standards.


Next: , Previous: , Up: Reference   [Contents][Index]

4.2 Doc options

4.2.1 example-hints-xml

Command-line option: --example-hints-xml

Dumps on stdout an example hints.xml file. Such a file is normally shipped with the game. It is indeed generated using this command.

4.2.2 example-rules-xml

Command-line option: --example-rules-xml

Dumps on stdout an example options.xml file. Such a file is normally shipped with the game. It is indeed generated using this command.

4.2.3 example-style-xml

Command-line option: --example-style-xml

Dumps on stdout an example style.xml file. Such a file is normally shipped with the game. It is indeed generated using this command.

4.2.4 example-teams-xml

Command-line option: --example-teams-xml

Dumps on stdout an example teams.xml file. Such a file is normally shipped with the game. It is indeed generated using this command.

4.2.5 list-advanced

Command-line option: --list-advanced

List advanced options which can be used for fine-tuning the game.

4.2.6 list-aliases

Command-line option: --list-aliases

List the keyword aliases. These are here for convenience.

4.2.7 list-doc

Command-line option: --list-doc

List documentation-related command line options. These commands allow you to list all the keywords related to a given domain.

4.2.8 list-funcs

Command-line option: --list-funcs

List the C-functions which are exported to Guile, thus usable in scripts.

4.2.9 list-graphics

Command-line option: --list-graphics

List graphics options (resolution, fullscreen...).

4.2.10 list-hooks

Command-line option: --list-hooks

List user-modifiable hooks.

4.2.11 list-input

Command-line option: --list-input

List input (AKA controls) related options. Use these to change keyboard, joystick and mouse settingds.

4.2.12 list-map

Command-line option: --list-map

List map-related entries, excluding rules.xml, hints.xml and style.xml entries.

4.2.13 list-map-hints

Command-line option: --list-map-hints

List ’hints.xml’ entries. These parameters enable you to modify the behavior of the map loader.

4.2.14 list-map-rules

Command-line option: --list-map-rules

List ’options.xml’ entries. These parameters enable you to modify the gameplay.

4.2.15 list-map-style

Command-line option: --list-map-style

List ’style.xml’ entries. These parameters enable you to modify the aspect of the game.

4.2.16 list-map-teams

Command-line option: --list-map-teams

List ’teams.xml’ entries. These parameters enable you to specify which teams should play on the map.

4.2.17 list-network

Command-line option: --list-network

List network options.

4.2.18 list-path

Command-line option: --list-path

List parameters which allow you to override the defaults of the game, and force the game your own file paths and directories.

4.2.19 list-players

Command-line option: --list-players

List player-related entries, that is to say ’who plays’.

4.2.20 list-quick

Command-line option: --list-quick

List quick help entries, this includes the GNU standard options and a few troubleshooting tools.

4.2.21 list-show

Command-line option: --list-show

List command-line options which begin with ’–show-...’. These will display on the console many internal parameters. Usefull when debugging.

4.2.22 list-sound

Command-line option: --list-sound

List sound options (volume...).

4.2.23 list-team-colors

Command-line option: --list-team-colors

List the team colors, there should be 10 of them

4.2.24 list-weapons

Command-line option: --list-weapons

List the available weapons.


Next: , Previous: , Up: Reference   [Contents][Index]

4.3 Show options

4.3.1 show-build-abs-srcdir

Command-line option: --show-build-abs-srcdir

Shows the top source directory on the machine where the binary was compiled, as an absolute path.

4.3.2 show-build-bin-id

Command-line option: --show-build-bin-id

Shows the internal ’bin-id’ value. This value does not mean anything in itself but it’s supposed to change each time you compile the game.

4.3.3 show-build-bugs-url

Command-line option: --show-build-bugs-url

Shows the URL to make bug reports.

4.3.4 show-build-cflags

Command-line option: --show-build-cflags

Shows what value you should put in ’CFLAGS’ (environment variable) if you want to compile programs that use Liquid War 6 as a library, and include ’liquidwar6.h’.

4.3.5 show-build-codename

Command-line option: --show-build-codename

Shows the codename associated with this version, generally the name of someone famous who is war-related (a general, an emperor...).

4.3.6 show-build-configure-args

Command-line option: --show-build-configure-args

Shows the arguments that have been passed to the GNU Autoconf ’./configure’ script when building the program. This can be very usefull if you want to know how the program has been built.

4.3.7 show-build-copyright

Command-line option: --show-build-copyright

Shows a very short copyright notice.

4.3.8 show-build-datadir

Command-line option: --show-build-datadir

Shows the ’datadir’ value as passed to the GNU Autoconf ’./configure’ script when compiling the program. Default is ’/usr/local/share’. This is the generic, non Liquid War 6 specific data directory. Liquid War 6 related data is stored elsewhere (usually in a sub-directory) see the ’data-dir’ switch for more information. ’datadir’ is not ’data-dir’. That’s the point.

4.3.9 show-build-date

Command-line option: --show-build-date

Shows the date when the binary was compiled.

4.3.10 show-build-docdir

Command-line option: --show-build-docdir

Shows the ’docdir’ value as passed to the GNU Autoconf ’./configure’ script when compiling the program. Default is ’/usr/local/share/doc/liquidwar6’.

4.3.11 show-build-enable-allinone

Command-line option: --show-build-enable-allinone

Shows wether the ’allinone’ option has been chosen when building the game. This depends on parameters passed to ’./configure’.

4.3.12 show-build-enable-console

Command-line option: --show-build-enable-console

Shows wether the console has been enabled when building the game. This depends on parameters passed to ’./configure’ and also on the presence of ncurses and readline.

4.3.13 show-build-enable-fullstatic

Command-line option: --show-build-enable-fullstatic

Shows wether the ’fullstatic’ option has been chosen when building the game. This depends on parameters passed to ’./configure’.

4.3.14 show-build-enable-gcov

Command-line option: --show-build-enable-gcov

Shows wether the game was build with suitable informations for gcov. This depends on parameters passed to ’./configure’.

4.3.15 show-build-enable-gprof

Command-line option: --show-build-enable-gprof

Shows wether the game was build with suitable informations for gprof. This depends on parameters passed to ’./configure’.

4.3.16 show-build-enable-gtk

Command-line option: --show-build-enable-gtk

Shows wether GTK+ support has been enabled when building the game. This depends on parameters passed to ’./configure’ and also on the presence of GTK+ headers and libs. It uses pkg-config to detect it.

4.3.17 show-build-enable-instrument

Command-line option: --show-build-enable-instrument

Shows wether the game was build with the ’-finstrument-functions’ GCC switch. This depends on parameters passed to ’./configure’.

4.3.18 show-build-enable-mod-caca

Command-line option: --show-build-enable-mod-caca

Shows wether the mod-caca graphical backend has been enabled when building the game. This depends on parameters passed to ’./configure’ and also on the presence of libcaca related libraries.

4.3.19 show-build-enable-mod-csound

Command-line option: --show-build-enable-mod-csound

Shows wether the mod-csound audio backend has been enabled when building the game. This depends on parameters passed to ’./configure’ and also on the presence of the csound library.

4.3.20 show-build-enable-mod-gl1

Command-line option: --show-build-enable-mod-gl1

Shows wether the mod-gl1 graphical backend has been enabled when building the game. This depends on parameters passed to ’./configure’ and also on the presence of SDL and OpenGL related libraries.

4.3.21 show-build-enable-mod-gles2

Command-line option: --show-build-enable-mod-gles2

Shows wether the mod-gles2 graphical backend has been enabled when building the game. This depends on parameters passed to ’./configure’ and also on the presence of SDL and OpenGL ES related libraries.

4.3.22 show-build-enable-mod-http

Command-line option: --show-build-enable-mod-http

Shows wether the mod-http network backend has been enabled when building the game. This depends on parameters passed to ’./configure’ and also on the presence of libCurl.

4.3.23 show-build-enable-mod-ogg

Command-line option: --show-build-enable-mod-ogg

Shows wether the mod-ogg audio backend has been enabled when building the game. This depends on parameters passed to ’./configure’ and also on the presence of SDL and related libraries.

4.3.24 show-build-enable-mod-soft

Command-line option: --show-build-enable-mod-soft

Shows wether the mod-soft graphical backend has been enabled when building the game. This depends on parameters passed to ’./configure’ and also on the presence of SDL related libraries.

4.3.25 show-build-enable-openmp

Command-line option: --show-build-enable-openmp

Shows wether the program was built with OpenMP support. This depends on parameters passed to ’./configure’.

4.3.26 show-build-enable-optimize

Command-line option: --show-build-enable-optimize

Shows wether the ’optimize’ option has been chosen when building the game. This depends on parameters passed to ’./configure’.

4.3.27 show-build-enable-paranoid

Command-line option: --show-build-enable-paranoid

Shows wether the game was build with paranoid memory management. This is for debugging purposes, the default already includes some controls, with turned it’s really... paranoid.

4.3.28 show-build-enable-profiler

Command-line option: --show-build-enable-profiler

Shows wether the game was build with Google Profiler support. This depends on parameters passed to ’./configure’.

4.3.29 show-build-enable-valgrind

Command-line option: --show-build-enable-valgrind

Shows wether the game was build with valgrind later use in mind. This depends on parameters passed to ’./configure’.

4.3.30 show-build-endianness

Command-line option: --show-build-endianness

Returns the endianness. ’little’ corresponds to x86-like systems, ’big’ to ppc-like systems.

4.3.31 show-build-gcc-version

Command-line option: --show-build-gcc-version

Returns the version of the GNU C compiler which was used to compile the program.

4.3.32 show-build-gnu

Command-line option: --show-build-gnu

Returns 1 (true) if host OS is a GNU system, or at least has been considered as such when compiling, 0 (false) if not.

4.3.33 show-build-gp2x

Command-line option: --show-build-gp2x

Returns 1 (true) if host is a GP2X, 0 (false) if not.

4.3.34 show-build-home-url

Command-line option: --show-build-home-url

Shows the URL of the program, its homepage.

4.3.35 show-build-host-cpu

Command-line option: --show-build-host-cpu

Shows the host CPU, as defined by ’host_cpu’ in GNU Autoconf.

4.3.36 show-build-host-os

Command-line option: --show-build-host-os

Shows the host OS, as defined by ’host_os’ in GNU Autoconf.

4.3.37 show-build-hostname

Command-line option: --show-build-hostname

Shows the name of the host where the binary was compiled.

4.3.38 show-build-includedir

Command-line option: --show-build-includedir

Shows the ’includedir’ value as passed to the GNU Autoconf ’./configure’ script when compiling the program. Default is ’/usr/local/include’.

4.3.39 show-build-ldflags

Command-line option: --show-build-ldflags

Shows what value you should put in ’LDFLAGS’ (environment variable) if you want to link programs against libliquidwar6.

4.3.40 show-build-libdir

Command-line option: --show-build-libdir

Shows the ’libdir’ value as passed to the GNU Autoconf ’./configure’ script when compiling the program. Default is ’/usr/local/lib’. This is the generic, non Liquid War 6 specific library directory. Dedicated Liquid War 6 modules are stored elsewhere (usually in a sub-directory) see the ’mod-dir’ switch for more information.

4.3.41 show-build-license

Command-line option: --show-build-license

Shows the license of the program (GNU GPL v3 or later).

4.3.42 show-build-localedir

Command-line option: --show-build-localedir

Shows the ’localedir’ value as passed to the GNU Autoconf ’./configure’ script when compiling the program. Default is ’/usr/local/share/locale’.

4.3.43 show-build-mac-os-x

Command-line option: --show-build-mac-os-x

Returns 1 (true) if host OS is Mac OS X, 0 (false) if not.

4.3.44 show-build-md5sum

Command-line option: --show-build-md5sum

Shows the MD5 checksum, which has been calculated from the C source files. Complementary with ’show-build-stamp’.

4.3.45 show-build-ms-windows

Command-line option: --show-build-ms-windows

Returns 1 (true) if host OS is Microsoft Windows, 0 (false) if not.

4.3.46 show-build-package-id

Command-line option: --show-build-package-id

Shows the package tarname with its version, that is, ’liquidwar6-<version>

4.3.47 show-build-package-name

Command-line option: --show-build-package-name

Shows the package name, that is, ’Liquid War 6’.

4.3.48 show-build-package-string

Command-line option: --show-build-package-string

Shows the package string, that is, ’Liquid War 6 <version>

4.3.49 show-build-package-tarname

Command-line option: --show-build-package-tarname

Shows the package tarname, that is, liquidwar6.

4.3.50 show-build-pointer-size

Command-line option: --show-build-pointer-size

Returns the pointer size, in bytes. Should be 4 on 32-bit systems and 8 on 64-bit systems.

4.3.51 show-build-prefix

Command-line option: --show-build-prefix

Shows the ’prefix’ value as passed to the GNU Autoconf ’./configure’ script when compiling the program. Default is ’/usr/local’.

4.3.52 show-build-stamp

Command-line option: --show-build-stamp

Shows the build stamp. A very usefull value, more precise than the version to track down binaries. It is incremented each time the core C code is updated. It won’t reflect all the programs for it does not take scripts in account, but if you are running a work-in-progress version, it might be very convenient to use this to know what your are running exactly. It’s also used as the revision number (the third number afer MAJOR.MINOR).

4.3.53 show-build-time

Command-line option: --show-build-time

Shows the time when the binary was compiled.

4.3.54 show-build-top-srcdir

Command-line option: --show-build-top-srcdir

Shows the top source directory on the machine where the binary was compiled, as a (possibly) relative path.

4.3.55 show-build-unix

Command-line option: --show-build-unix

Returns 1 (true) if host OS is a UNIX system, or at least has been considered as such when compiling, 0 (false) if not.

4.3.56 show-build-version

Command-line option: --show-build-version

Shows the version. Note that this is different from the standard GNU ’version’ command line option which shows a complete message with a short copyright notice. This one will just return the version, without the package tarname or anything else.

4.3.57 show-build-version-base

Command-line option: --show-build-version-base

Shows the version base. This is basically MAJOR.MINOR and determines the level of compatibility of the program. Two programs with the same base version should be able to communicate on the network, share data files and even binary modules if on the same platform.

4.3.58 show-build-version-major

Command-line option: --show-build-version-major

Shows the major version number. This is just used to differenciate alpha/beta releases (using 0) from stable releases (using 6).

4.3.59 show-build-version-minor

Command-line option: --show-build-version-minor

Shows the minor version number. This is manually increased at each significant, public release of the game.

4.3.60 show-build-x86

Command-line option: --show-build-x86

Tells wether the CPU belongs to the x86 family.

4.3.61 show-config-file

Command-line option: --show-config-file

Shows the config file path. Default is ’$HOME/.liquidwar6/config.xml’.

4.3.62 show-cwd

Command-line option: --show-cwd

Shows the current working directory, the value that the pwd command would return.

4.3.63 show-data-dir

Command-line option: --show-data-dir

Shows the data directory path. This is where the games searches for most of its data,the most important exception being maps, which are stored elsewhere. Default is ’/usr/local/share/liquidwar6-<version>/data’.

4.3.64 show-default-config-file

Command-line option: --show-default-config-file

Shows the default config file path. Default is ’$HOME/.liquidwar6/config.xml’.

4.3.65 show-default-data-dir

Command-line option: --show-default-data-dir

Shows the default data directory path. This is where the games searches for most of its data,the most important exception being maps, which are stored elsewhere. Default is ’/usr/local/share/liquidwar6-<version>/data’.

4.3.66 show-default-log-file

Command-line option: --show-default-log-file

Shows the default log file path. Default is ’$HOME/.liquidwar6/log.csv’.

4.3.67 show-default-map-dir

Command-line option: --show-default-map-dir

Shows the default map directory. This is where builtin maps are stored. Default is ’/usr/local/share/liquidwar6-<version>/map’.

4.3.68 show-default-map-path

Command-line option: --show-default-map-path

Shows the default map search path. This is where the game searches for maps. It’s the combination of command-line arguments and builtin paths. Might return more directories than the one specified in a single ’map-path=dir1:dir2’ argument.

4.3.69 show-default-mod-dir

Command-line option: --show-default-mod-dir

Shows the default module directory path. This is where all dynamically loaded modules are stored. Default is ’/usr/local/lib/liquidwar6-<version>’.

4.3.70 show-default-music-dir

Command-line option: --show-default-music-dir

Shows the default music directory. This is where builtin musics are stored. Default is ’/usr/local/share/liquidwar6-<version>/music’.

4.3.71 show-default-music-path

Command-line option: --show-default-music-path

Shows the default music search path. This is where the game searches for musics. It’s the combination of command-line arguments and builtin paths. Might return more directories than the one specified in a single ’music-path=dir1:dir2’ argument.

4.3.72 show-default-prefix

Command-line option: --show-default-prefix

Shows the default prefix used. This should logically be the value passed to the GNU Autoconf ./configure script when building the game. Most other path are deduced from this one. Default is ’/usr/local’.

4.3.73 show-default-script-file

Command-line option: --show-default-script-file

Shows the default main script file path. This file is very important, since the program is more or less a hudge scheme interpreter, and this file is the file loaded by Guile. In short, it is the main program. Default is ’/usr/local/share/liquidwar6-<version>/script/liquidwar6.scm’.

4.3.74 show-default-user-dir

Command-line option: --show-default-user-dir

Shows the default user directory path. This is where run-time data, config files, log files, are stored. Default is ’$HOME/.liquidwar6/’.

4.3.75 show-log-file

Command-line option: --show-log-file

Shows the log file path. Default is ’$HOME/.liquidwar6/log.csv’.

4.3.76 show-map-dir

Command-line option: --show-map-dir

Shows the map directory. This is where builtin maps are stored. Default is ’/usr/local/share/liquidwar6-<version>/map’.

4.3.77 show-map-path

Command-line option: --show-map-path

Shows the map search path. This is where the game searches for maps. It’s the combination of command-line arguments and builtin paths. Might return more directories than the one specified in a single ’map-path=dir1:dir2’ argument.

4.3.78 show-mod-dir

Command-line option: --show-mod-dir

Shows the module directory path. This is where all dynamically loaded modules are stored. Default is ’/usr/local/lib/liquidwar6-<version>’.

4.3.79 show-music-dir

Command-line option: --show-music-dir

Shows the music directory. This is where builtin maps are stored. Default is ’/usr/local/share/liquidwar6-<version>/music’.

4.3.80 show-music-path

Command-line option: --show-music-path

Shows the music search path. This is where the game searches for musics. It’s the combination of command-line arguments and builtin paths. Might return more directories than the one specified in a single ’music-path=dir1:dir2’ argument.

4.3.81 show-prefix

Command-line option: --show-prefix

Shows the prefix used. This should logically be the value passed to the GNU Autoconf ./configure script when building the game. Most other path are deduced from this one. Default is ’/usr/local’.

4.3.82 show-run-dir

Command-line option: --show-run-dir

Shows the run directory, usually the path where the binary is. It depends on how and where the program is launched. It is guessed from the argc/argv values at runtime.

4.3.83 show-script-file

Command-line option: --show-script-file

Shows the main script file path. This file is very important, since the program is more or less a hudge scheme interpreter, and this file is the file loaded by Guile. In short, it is the main program. Default is ’/usr/local/share/liquidwar6-<version>/script/liquidwar6.scm’.

4.3.84 show-user-dir

Command-line option: --show-user-dir

Shows the user directory path. This is where run-time data, config files, log files, are stored. Default is ’$HOME/.liquidwar6/’.


Next: , Previous: , Up: Reference   [Contents][Index]

4.4 Path options

4.4.1 config-file

Command-line option: --config-file

Type: string

Default value: $HOME/.liquidwar6/config.xml

Set the config file path. This enables you to use whatever config file you like, keeping all other informations in the same place.

4.4.2 data-dir

Command-line option: --data-dir

Type: string

Default value: /usr/local/share/liquidwar6-<version>/data

Set the data directory. By changing ths value you’ll be able to use an alternative data directory.

4.4.3 log-file

Command-line option: --log-file=<value>
Environment variable: LW6_LOG_FILE
XML key: log-file

Type: string

Default value: $HOME/.liquidwar6/log.csv

Set the log file path. This enables you to use whatever log file you like, keeping all other informations in the same place.

4.4.4 map-dir

Command-line option: --map-dir

Type: string

Default value: /usr/local/share/liquidwar6-<version>/map

Set the map directory path. By changing this value you’ll be able to play with your own maps in your own directory. Note that there are other ways to achieve that, but using this option will work. However, a side effect is that you might not see builtin maps anymore.

4.4.5 map-path

Command-line option: --map-path=<value>
Environment variable: LW6_MAP_PATH
XML key: map-path

Type: string

Default value: $HOME/.liquidwar6/map:/usr/local/share/liquidwar6-<version>/map

Set the map search path. By changing this value you’ll be able to play with your own maps in your own directory. This is different from ’map-dir’, since it includes ’map-dir’, plus it adds a number of other search paths. Unlike most other parameters, the values given from the command-line, from the environment variables, or from the config file, are not overwritten, but appended. That is to say if you specify a ’map-path’ with the command-line argument ’map-path=path’, but also define the ’LW6_MAP_PATH’ value and finally edit ’config.xml’ to change the ’map-path’ entry in it, you’ll end up with the game searching for maps in all these directories. Additionnally, ’map-dir’ and ’<user-dir>/map’ will always be in the list. Any given value can itself include several pathes, separated by the path separator. This separator is ’:’ on GNU/Linux, and ’;’ on Microsoft Windows. For instance, on a GNU/Linux box, you could use the command-line argument ’map-path=/foo/bar/map:/home/user/map/:/map’.

4.4.6 mod-dir

Command-line option: --mod-dir

Type: string

Default value: /usr/local/lib/liquidwar6-<version>

Set the module directory path. By changing this you will load dynamic shared libraries (game specific modules such as the graphical backend) from an alternative place. Use this at your own risks, for there can always be a binary incompatibility. You’ve been warned.

4.4.7 music-dir

Command-line option: --music-dir=<value>
Environment variable: LW6_MUSIC_DIR
XML key: music-dir

Type: string

Default value: /usr/local/share/liquidwar6-<version>/music

Set the music directory path. By changing this value you’ll be able to use your own musics in your own directory. Note that there are other ways to achieve that, but using this option will work. The major side effect is that using this option, you really replace the existing builtin musics by your own. If you simply want to add musics you can store them in $HOME/.liquidwar6/music or in the map directory itself.

4.4.8 music-path

Command-line option: --music-path=<value>
Environment variable: LW6_MUSIC_PATH
XML key: music-path

Type: string

Default value: $HOME/.liquidwar6/music:/usr/local/share/liquidwar6-<version>/music

Set the music search path. By changing this value you’ll be able to play with your own musics in your own directory. This is different from ’music-dir’, since it includes ’music-dir’, plus it adds a number of other search paths. Unlike most other parameters, the values given from the command-line, from the environment variables, or from the config file, are not overwritten, but appended. That is to say if you specify a ’music-path’ with the command-line argument ’music-path=path’, but also define the ’LW6_MUSIC_PATH’ value and finally edit ’config.xml’ to change the ’music-path’ entry in it, you’ll end up with the game searching for musics in all these directories. Additionnally, ’music-dir’ and ’<user-dir>/music’ will always be in the list. Any given value can itself include several pathes, separated by the path separator. This separator is ’:’ on GNU/Linux, and ’;’ on Microsoft Windows. For instance, on a GNU/Linux box, you could use the command-line argument ’music-path=/foo/bar/music:/home/user/music/:/music’.

4.4.9 prefix

Command-line option: --prefix

Type: string

Default value: /usr/local

Override the prefix value given to the GNU Autoconf ./configure script when building the game. Not all path will be changed, some of them might remain the same, for instance message translations (localedir). But most game-specific data including maps, graphics, sounds, will be searched according to the new given parameter.

4.4.10 script-file

Command-line option: --script-file

Type: string

Default value: /usr/local/share/liquidwar6-<version>/script/liquidwar6.scm

Set the main script file path. This file is very important, since the program is more or less a hudge scheme interpreter, and this file is the file loaded by Guile. In short, it is the main program.

4.4.11 user-dir

Command-line option: --user-dir=<value>
Environment variable: LW6_USER_DIR
XML key: user-dir

Type: string

Default value: $HOME/.liquidwar6

Set the user directory path. This is where run-time data, config files, log files, are stored. If you override this value, other parameters such as where the config and log files reside, will change.


Next: , Previous: , Up: Reference   [Contents][Index]

4.5 Players options

4.5.1 player1-control

Command-line option: --player1-control=<value>
Environment variable: LW6_PLAYER1_CONTROL
XML key: player1-control

Type: string

Default value: mouse

Control for the first player, must be mouse, keyboard, joystick1, joystick2 or custom.

4.5.2 player1-name

Command-line option: --player1-name=<value>
Environment variable: LW6_PLAYER1_NAME
XML key: player1-name

Type: string

Default value: <username>

Name of the first player, the player used by default. A default value is provided, you can of course, change it at will.

4.5.3 player1-status

Command-line option: --player1-status=<value>
Environment variable: LW6_PLAYER1_STATUS
XML key: player1-status

Type: boolean

Default value: true

Status of the first player, true if player is activated, false if idle.

4.5.4 player2-control

Command-line option: --player2-control=<value>
Environment variable: LW6_PLAYER2_CONTROL
XML key: player2-control

Type: string

Default value: keyboard

Control for the second player, must be mouse, keyboard, joystick1, joystick2 or custom.

4.5.5 player2-name

Command-line option: --player2-name=<value>
Environment variable: LW6_PLAYER2_NAME
XML key: player2-name

Type: string

Default value: player2-<hostname>

Name of the second player. A default value is provided, you’ll certainly want to change it.

4.5.6 player2-status

Command-line option: --player2-status=<value>
Environment variable: LW6_PLAYER2_STATUS
XML key: player2-status

Type: boolean

Default value: true

Status of the second player, true if player is activated, false if idle.

4.5.7 player3-control

Command-line option: --player3-control=<value>
Environment variable: LW6_PLAYER3_CONTROL
XML key: player3-control

Type: string

Default value: joystick1

Control for the third player, must be mouse, keyboard, joystick1, joystick2 or custom.

4.5.8 player3-name

Command-line option: --player3-name=<value>
Environment variable: LW6_PLAYER3_NAME
XML key: player3-name

Type: string

Default value: player3-<hostname>

Name of the third player. A default value is provided, you’ll certainly want to change it.

4.5.9 player3-status

Command-line option: --player3-status=<value>
Environment variable: LW6_PLAYER3_STATUS
XML key: player3-status

Type: boolean

Default value: false

Status of the third player, true if player is activated, false if idle.

4.5.10 player4-control

Command-line option: --player4-control=<value>
Environment variable: LW6_PLAYER4_CONTROL
XML key: player4-control

Type: string

Default value: joystick2

Control for the fourth player, must be mouse, keyboard, joystick1, joystick2 or custom.

4.5.11 player4-name

Command-line option: --player4-name=<value>
Environment variable: LW6_PLAYER4_NAME
XML key: player4-name

Type: string

Default value: player4-<hostname>

Name of the fourth player. A default value is provided, you’ll certainly want to change it.

4.5.12 player4-status

Command-line option: --player4-status=<value>
Environment variable: LW6_PLAYER4_STATUS
XML key: player4-status

Type: boolean

Default value: false

Status of the fourth player, true if player is activated, false if idle.


Next: , Previous: , Up: Reference   [Contents][Index]

4.6 Input options

4.6.1 auto-release-delay

Command-line option: --auto-release-delay=<value>
Environment variable: LW6_AUTO_RELEASE_DELAY
XML key: auto-release-delay

Type: integer

Default value: 250

Time, in milliseconds, before which a key is automatically released. This might or might not be used by the graphics backend, it’s typically used by backends which don’t always handle key releases events the right way, that is, don’t fire them. Libcaca is a good example of such a case.

4.6.2 click-to-focus

Command-line option: --click-to-focus=<value>
Environment variable: LW6_CLICK_TO_FOCUS
XML key: click-to-focus

Type: boolean

Default value: false

If set to true, you’ll need to click with the mouse to select a menuitem or move the cursor in the game. If not, some actions will be taken automatically without the need to click.

4.6.3 cursor-sensitivity

Command-line option: --cursor-sensitivity=<value>
Environment variable: LW6_CURSOR_SENSITIVITY
XML key: cursor-sensitivity

Type: float

Default value: 1.0

Keyboard and joystick sensitivity while moving the cursor. 1.0 is the default, 0.1 is slow, 10 is reponsive. This is used for moving the cursor during the game only, the option has no impact on menu navigation.

4.6.4 custom-alt

Command-line option: --custom-alt=<value>
Environment variable: LW6_CUSTOM_ALT
XML key: custom-alt

Type: string

Default value: (c-lw6gui-keyboard-is-pressed 110) ; SDLK_n

Guile custom code associated to the ALT key equivalent.

4.6.5 custom-ctrl

Command-line option: --custom-ctrl=<value>
Environment variable: LW6_CUSTOM_CTRL
XML key: custom-ctrl

Type: string

Default value: (c-lw6gui-keyboard-is-pressed 98) ; SDLK_b

Guile custom code associated to the CTRL key equivalent.

4.6.6 custom-down

Command-line option: --custom-down=<value>
Environment variable: LW6_CUSTOM_DOWN
XML key: custom-down

Type: string

Default value: (c-lw6gui-keyboard-is-pressed 100) ; SDLK_d

Guile custom code associated to the DOWN key equivalent.

4.6.7 custom-enter

Command-line option: --custom-enter=<value>
Environment variable: LW6_CUSTOM_ENTER
XML key: custom-enter

Type: string

Default value: (c-lw6gui-keyboard-is-pressed 103) ; SDLK_g

Guile custom code associated to the ENTER key equivalent.

4.6.8 custom-esc

Command-line option: --custom-esc=<value>
Environment variable: LW6_CUSTOM_ESC
XML key: custom-esc

Type: string

Default value: (c-lw6gui-keyboard-is-pressed 102) ; SDLK_f

Guile custom code associated to the ESC key equivalent.

4.6.9 custom-left

Command-line option: --custom-left=<value>
Environment variable: LW6_CUSTOM_LEFT
XML key: custom-left

Type: string

Default value: (c-lw6gui-keyboard-is-pressed 99) ; SDLK_c

Guile custom code associated to the LEFT key equivalent.

4.6.10 custom-pgdown

Command-line option: --custom-pgdown=<value>
Environment variable: LW6_CUSTOM_PGDOWN
XML key: custom-pgdown

Type: string

Default value: (c-lw6gui-keyboard-is-pressed 115) ; SDLK_s

Guile custom code associated to the PGDOWN key equivalent.

4.6.11 custom-pgup

Command-line option: --custom-pgup=<value>
Environment variable: LW6_CUSTOM_PGUP
XML key: custom-pgup

Type: string

Default value: (c-lw6gui-keyboard-is-pressed 119) ; SDLK_w

Guile custom code associated to the PGUP key equivalent.

4.6.12 custom-right

Command-line option: --custom-right=<value>
Environment variable: LW6_CUSTOM_RIGHT
XML key: custom-right

Type: string

Default value: (c-lw6gui-keyboard-is-pressed 118) ; SDLK_v

Guile custom code associated to the RIGHT key equivalent.

4.6.13 custom-up

Command-line option: --custom-up=<value>
Environment variable: LW6_CUSTOM_UP
XML key: custom-up

Type: string

Default value: (c-lw6gui-keyboard-is-pressed 101) ; SDLK_e

Custom keycode to be used as the UP key equivalent.

4.6.14 double-click-delay

Command-line option: --double-click-delay=<value>
Environment variable: LW6_DOUBLE_CLICK_DELAY
XML key: double-click-delay

Type: integer

Default value: 333

Time, in milliseconds, determining wether two consecutive clicks make a double-click or not.

4.6.15 max-cursor-speed

Command-line option: --max-cursor-speed=<value>
Environment variable: LW6_MAX_CURSOR_SPEED
XML key: max-cursor-speed

Type: float

Default value: 10.0

Maximum cursor speed when cursor is controlled with keyboard or joystick joystick 1. Consider using cursor-sensitivity too.

4.6.16 mouse-sensitivity

Command-line option: --mouse-sensitivity=<value>
Environment variable: LW6_MOUSE_SENSITIVITY
XML key: mouse-sensitivity

Type: float

Default value: 1.0

Mouse sensitivity, 1.0 is the default, 0.1 is slow, 10 is reponsive. This is used for moving the cursor during the game only, the option has no impact on menu navigation.

4.6.17 repeat-delay

Command-line option: --repeat-delay=<value>
Environment variable: LW6_REPEAT_DELAY
XML key: repeat-delay

Type: integer

Default value: 500

Time, in milliseconds, before key repeat will start, use 0 to disable.

4.6.18 repeat-interval

Command-line option: --repeat-interval=<value>
Environment variable: LW6_REPEAT_INTERVAL
XML key: repeat-interval

Type: integer

Default value: 100

Time, in milliseconds, between two repeats, once repeat has started, use 0 to disable.

4.6.19 use-double-click

Command-line option: --use-double-click=<value>
Environment variable: LW6_USE_DOUBLE_CLICK
XML key: use-double-click

Type: boolean

Default value: false

Wether to use double-click feature, mostly usefull if running on a system that has only one button (such as a tablet-PC or anything with a tactile screen), if your mouse has three buttons, disabling this might avoid some confusion. Basically, if enabled, double-click is equivalent to right-click (fire) and triple-click is equivalent to middle-click (alternate fire).

4.6.20 use-esc-button

Command-line option: --use-esc-button=<value>
Environment variable: LW6_USE_ESC_BUTTON
XML key: use-esc-button

Type: boolean

Default value: true

Decides wether to display an ’esc’ (escape) button in the interface. This is usefull for people who control the game with the mouse only, and have a single buttons, or on a touchscreen.

4.6.21 zoom-step

Command-line option: --zoom-step=<value>
Environment variable: LW6_ZOOM_STEP
XML key: zoom-step

Type: float

Default value: 1.1

A value, strictly greater than 1, which will be used when zooming. The greater it is, the more sensible the zoom is.

4.6.22 zoom-stick-delay

Command-line option: --zoom-stick-delay=<value>
Environment variable: LW6_ZOOM_STICK_DELAY
XML key: zoom-stick-delay

Type: float

Default value: 1000

How long, in msec, the zoom will stick to its default value.


Next: , Previous: , Up: Reference   [Contents][Index]

4.7 Graphics options

4.7.1 capture

Command-line option: --capture=<value>
Environment variable: LW6_CAPTURE
XML key: capture

Type: boolean

Default value: false

Enables capture mode, in which a BMP file is dumped on the disk (in your user directory, search for a ’capture’ sub-directory).

4.7.2 fullscreen

Command-line option: --fullscreen=<value>
Environment variable: LW6_FULLSCREEN
XML key: fullscreen

Type: boolean

Default value: false

Force the game to fun fullscreen. Note that the graphics backend might ignore this hint.

4.7.3 gfx-backend

Command-line option: --gfx-backend=<value>
Environment variable: LW6_GFX_BACKEND
XML key: gfx-backend

Type: string

Default value: gl1

Sets the graphics backend AKA ’gfx’ to use. For now the only reasonnable choice is ’gl1’ and will use an OpenGL v1 / SDL 3D-accelerated driver.

4.7.4 gfx-quality

Command-line option: --gfx-quality=<value>
Environment variable: LW6_GFX_QUALITY
XML key: gfx-quality

Type: integer

Default value: 1 Min value: 0 Max value: 2

Sets the overall quality of the graphics backend. Depending on the backend, this can mean different things. For instance for the ’gl’ backend, this can change texture filtering (nearest, linear, bilinear...). This is not the same as ’pixelize’ which is a per-map option and emulates an old school appearance.

4.7.5 height

Command-line option: --height=<value>
Environment variable: LW6_HEIGHT
XML key: height

Type: integer

Default value: -1

Run the game with the given screen height.Note that the graphics backend might ignore this hint. Use with its companion option ’width’. A negative value will force the use of a default value.

4.7.6 width

Command-line option: --width=<value>
Environment variable: LW6_WIDTH
XML key: width

Type: integer

Default value: -1

Run the game with the given screen width. Note that the graphics backend might ignore this hint. Use with its companion option ’height’.A negative value will force the use of a default value.

4.7.7 windowed-mode-limit

Command-line option: --windowed-mode-limit=<value>
Environment variable: LW6_WINDOWED_MODE_LIMIT
XML key: windowed-mode-limit

Type: float

Default value: 0.95

When switching back from fullscreen mode to windowed mode, if we’re in maximum resolution, then this coefficient will be applied before resizing the window. The idea is that (obviously) a windowed mode is prefered when a little smaller that totally fullscreen. So set this to a value just below 1.0.


Next: , Previous: , Up: Reference   [Contents][Index]

4.8 Sound options

4.8.1 ambiance-exclude

Command-line option: --ambiance-exclude=<value>
Environment variable: LW6_AMBIANCE_EXCLUDE
XML key: ambiance-exclude

Type: string

Default value:

If this string is present in a music file name, this file won’t be played during the menus, it will be excluded from the list.

4.8.2 ambiance-file

Command-line option: --ambiance-file=<value>
Environment variable: LW6_AMBIANCE_FILE
XML key: ambiance-file

Type: string

Default value:

A music file which will be used to be played during the menus. If not found, game will fallback on random files.

4.8.3 ambiance-filter

Command-line option: --ambiance-filter=<value>
Environment variable: LW6_AMBIANCE_FILTER
XML key: ambiance-filter

Type: string

Default value: Chadburn

A music filter, used to select the files which are played while navigating in the menus. It works like ’music-filter’ except this one is not related to a peculiar map. This is not a complex regex-enabled filter, just a plain string search. Even the ’*’ wildcard won’t work.

4.8.4 fx-volume

Command-line option: --fx-volume=<value>
Environment variable: LW6_FX_VOLUME
XML key: fx-volume

Type: float

Default value: 0.3 Min value: 0 Max value: 1

Set the sound effects volume. This is a floating point value. 0 is mute. Maximum value is 1.

4.8.5 music-volume

Command-line option: --music-volume=<value>
Environment variable: LW6_MUSIC_VOLUME
XML key: music-volume

Type: float

Default value: 0.6 Min value: 0 Max value: 1

Set the music volume.This is a floating point value. 0 is mute. Maximum value is 1.

4.8.6 snd-backend

Command-line option: --snd-backend=<value>
Environment variable: LW6_SND_BACKEND
XML key: snd-backend

Type: string

Default value: ogg

Sets the sound backend AKA ’snd’ to use. Can be ’ogg’ or ’csound’ but only ’ogg’ will produce sound in the current release.

4.8.7 water-volume

Command-line option: --water-volume=<value>
Environment variable: LW6_WATER_VOLUME
XML key: water-volume

Type: float

Default value: 0.2 Min value: 0 Max value: 1

Set the volume for water sounds. This is a floating point value. 0 is mute. Maximum value is 1.


Next: , Previous: , Up: Reference   [Contents][Index]

4.9 Network options

4.9.1 bind-ip

Command-line option: --bind-ip=<value>
Environment variable: LW6_BIND_IP
XML key: bind-ip

Type: string

Default value: 0.0.0.0

The IP address to bind on when listening to network messages. You can use this to specifically use a given network interface, the default will listen on any available interface.

4.9.2 bind-port

Command-line option: --bind-port=<value>
Environment variable: LW6_BIND_PORT
XML key: bind-port

Type: integer

Default value: 8056 Min value: 1 Max value: 65535

The IP port to bind on when listening to network messages. The default should work out of the box, and will ease up the discovery process. That is, if you use your own settings, automatic detection of your server by other servers might not work so well.

4.9.3 broadcast

Command-line option: --broadcast=<value>
Environment variable: LW6_BROADCAST
XML key: broadcast

Type: boolean

Default value: true

Allows the program to send broadcast messages on the network. It can be usefull to disable those if you don’t use UDP node discovery and/or if there’s a sysadmin arround who does not enjoy permanent broadcasts on his LAN.

4.9.4 cli-backends

Command-line option: --cli-backends=<value>
Environment variable: LW6_CLI_BACKENDS
XML key: cli-backends

Type: string

Default value: tcp,udp,http

The client backends to use. Most of the time the default is fine, change it only if you specifically want to disactivate some protocol, or if you want to activate a custom-made client backend. It’s a comma separated list.

4.9.5 known-nodes

Command-line option: --known-nodes=<value>
Environment variable: LW6_KNOWN_NODES
XML key: known-nodes

Type: string

Default value: http://ufoot.org:8056/,http://ufoot.hd.free.fr:8056/

List of known nodes, nodes which the program will try to contact first to get the list of other nodes. This is mostly usefull when program is launched for the first time, after this it should keep an up-to-date list of known servers in its internal database and automatically reconnect to them next time it starts. You might want to change this if you really want to connect to a given server which is not publically listed. The list is comma separated.

4.9.6 node-description

Command-line option: --node-description=<value>
Environment variable: LW6_NODE_DESCRIPTION
XML key: node-description

Type: string

Default value: No description.

The description of your node, that is a text that describes your server. This will typically appear when pointing a web client on the public server URL, it is for general information, so if there’s something special about your server, say it here.

4.9.7 node-title

Command-line option: --node-title=<value>
Environment variable: LW6_NODE_TITLE
XML key: node-title

Type: string

Default value:

The title of your node, that is the name which will be displayed when listing servers. This is different from player name, for there can be several players on a single computer. By default this will be set to hostname.

4.9.8 password

Command-line option: --password=<value>
Environment variable: LW6_PASSWORD
XML key: password

Type: string

Default value:

The password to use for network games. Do not use a valuable password, as this is stored as clear text on your hard drive. Still, the game will only send a hash/checksum of the password on the network so eavesdropper won’t be able to read it. They can see the hash/checksum and use it if clever, but they can’t guess the real password. A blank password means anyone can join your games when you act like a server.

4.9.9 public-url

Command-line option: --public-url=<value>
Environment variable: LW6_PUBLIC_URL
XML key: public-url

Type: string

Default value:

The public URL of your server. By default the game will pick up one for you. In fact, the clients discovering your server should guess the public URL, probably http://<your-ip>:<your-port>/ but you might need to use your own settings if you are using NAT or an Apache reverse-proxy to rewrite HTTP requests.

4.9.10 skip-network

Command-line option: --skip-network=<value>
Environment variable: LW6_SKIP_NETWORK
XML key: skip-network

Type: boolean

Default value: false

If set, then game won’t do anything network related. No listen, no connect, no nothing. You are playing locally.

4.9.11 srv-backends

Command-line option: --srv-backends=<value>
Environment variable: LW6_SRV_BACKENDS
XML key: srv-backends

Type: string

Default value: tcpd,udpd,httpd

The server backends to use. Most of the time the default is fine, change it only if you specifically want to disactivate some protocol, or if you want to activate a custom-made server backend. It’s a comma separated list.


Next: , Previous: , Up: Reference   [Contents][Index]

4.10 Map parameters

4.10.1 chosen-map

Command-line option: --chosen-map=<value>
Environment variable: LW6_CHOSEN_MAP
XML key: chosen-map

Type: string

Default value: subflower

The last map chosen by the player, locally. This is the map which will be used for a quick-start game, a local game, or a game started as a server.

4.10.2 force

Command-line option: --force=<value>
Environment variable: LW6_FORCE
XML key: force

Type: string

Default value: respawn-team,color-conflict-mode

A comma separated list of options which should be ignored when reading map XML files. For instance, if this contains ’rounds-per-sec,moves-per-round’ then whatever values were defined for this in ’rules.xml’, then game will ignore them and use the user’s values, stored in ’config.xml’, running the game at the requested speed. This ultimately allows the player to control everything despite the values set by the map designer.

4.10.3 use-cursor-texture

Command-line option: --use-cursor-texture=<value>
Environment variable: LW6_USE_CURSOR_TEXTURE
XML key: use-cursor-texture

Type: boolean

Default value: true

Defines wether the cursor textures should be used. If unset, then the default builtin cursor texture will be used instead of the map specific one.

4.10.4 use-hints-xml

Command-line option: --use-hints-xml=<value>
Environment variable: LW6_USE_HINTS_XML
XML key: use-hints-xml

Type: boolean

Default value: true

If set, then hints will be picked up from the map defined hints.xml, if it exists. This is the default.

4.10.5 use-music-file

Command-line option: --use-music-file=<value>
Environment variable: LW6_USE_MUSIC_FILE
XML key: use-music-file

Type: boolean

Default value: true

If set, then the program will use the ’music-file’ attribute to choose the music to play. If unset, then a random builtin music will be picked up, regardless of what is specified in ’music-file’.

4.10.6 use-rules-xml

Command-line option: --use-rules-xml=<value>
Environment variable: LW6_USE_RULES_XML
XML key: use-rules-xml

Type: boolean

Default value: true

If set, then rules will be picked up from the map defined rules.xml, if it exists. This is the default. Use force-time and force-size to override this and use user-defined values anyway.

4.10.7 use-style-xml

Command-line option: --use-style-xml=<value>
Environment variable: LW6_USE_STYLE_XML
XML key: use-style-xml

Type: boolean

Default value: true

If set, then style will be picked up from the map defined style.xml, if it exists. This is the default. Use force-time and force-background to override this and use user-defined values anyway.

4.10.8 use-teams-xml

Command-line option: --use-teams-xml=<value>
Environment variable: LW6_USE_TEAMS_XML
XML key: use-teams-xml

Type: boolean

Default value: true

If set, then teams will be picked up from the map defined teams.xml, if it exists. This is the default. Use force-time and force-background to override this and use user-defined values anyway.

4.10.9 use-texture

Command-line option: --use-texture=<value>
Environment variable: LW6_USE_TEXTURE
XML key: use-texture

Type: boolean

Default value: true

Defines wether the map texture should be used. Of course if there’s no map texture, the texture... won’t be used. But if there is one, this parameter will force the game to ignore it and play with solid colors. This probably won’t look as nice as the textured map in most cases, but some players might find it more readable and confortable to play when throwing eye candy away.


Next: , Previous: , Up: Reference   [Contents][Index]

4.11 Map rules.xml

4.11.1 boost-power

Command-line option: --boost-power=<value>
Environment variable: LW6_BOOST_POWER
XML key: boost-power

Type: integer

Default value: 3 Min value: 1 Max value: 10

Defines how fast and powerfull the boost is. That is, if on ’boost.png’ it’s pitch black and this parameter is set to 3, then fighters will move and act 3 times than what they would do normally.

4.11.2 color-conflict-mode

Command-line option: --color-conflict-mode=<value>
Environment variable: LW6_COLOR_CONFLICT_MODE
XML key: color-conflict-mode

Type: integer

Default value: 1 Min value: 0 Max value: 2

How to handle color conflicts, that is, when a player requests a color, but this color is already used, what should be done? If 0, wether a color already exists won’t affect the color of a new cursor. If 1, then two players on the same computer will be allowed to share the same color/team, but if another computer is already playing with a color, any new computer will need to use another team. If 2, then it’s impossible for a new cursor to use a pre-existing color, any new cursor will require a new color, if that color is already used, a new color will be picked randomly.

4.11.3 cursor-pot-init

Command-line option: --cursor-pot-init=<value>
Environment variable: LW6_CURSOR_POT_INIT
XML key: cursor-pot-init

Type: integer

Default value: 100000 Min value: 5000 Max value: 500000

Defines the cursor potential at startup. Not really any reason to change it. Theorically, there could be maps where the default value doesn’t fit, but none has been seen yet.

4.11.4 danger-power

Command-line option: --danger-power=<value>
Environment variable: LW6_DANGER_POWER
XML key: danger-power

Type: integer

Default value: 200 Min value: 0 Max value: 10000

Defines how dangerous are the black zones defined in ’danger.png’. The value is used to decrease the fighter health at each move, so you should compare its value to something like ’fighter-attack’. Being on a dangerous zone is a bit like being attacked by an invisible and unknown ennemy.

4.11.5 exp

Command-line option: --exp=<value>
Environment variable: LW6_EXP
XML key: exp

Type: integer

Default value: 1 Min value: 0 Max value: 99

Level of experience (AKA exp) required to play the current level. If this level is validated (that is, won) then player will be granted with a level of exp+1 and be able to play all the next levels. An exp of 0 means the level is playable by a pure beginner.

4.11.6 fighter-attack

Command-line option: --fighter-attack=<value>
Environment variable: LW6_FIGHTER_ATTACK
XML key: fighter-attack

Type: integer

Default value: 500 Min value: 1 Max value: 10000

Defines how hard fighters will attack others, that is, in one attack, how many life-points the attacked fighter will loose. Increasing this will cause your opponents to melt faster when you attack them. With a low value, it will take ages to take on your opponents. Different styles of game. Can radically change the gameplay.

4.11.7 fighter-defense

Command-line option: --fighter-defense=<value>
Environment variable: LW6_FIGHTER_DEFENSE
XML key: fighter-defense

Type: integer

Default value: 50 Min value: 0 Max value: 10000

Defines how fast fighters will regenerate after an attack. When this parameter is set low, an attacked fighter, which is very dark and almost dead will take a very long time to regain energy. If the parameter is set high, it can almost instantaneously regain energy.

4.11.8 fighter-new-health

Command-line option: --fighter-new-health=<value>
Environment variable: LW6_FIGHTER_NEW_HEALTH
XML key: fighter-new-health

Type: integer

Default value: 5000 Min value: 1 Max value: 10000

Defines how healthy fighters will be when they appear on the map. This can be either at the beginning of the game of when a fighter changes team. Setting this low will allow battefields to switch from one side to another very fast, for freshly gained fighters will be feeble and very likely to return to their original camp. To calibrate this parameter, keep in mind that the absolute maximum health a fighter can have is always 10000 (ten-thousands).

4.11.9 fighter-regenerate

Command-line option: --fighter-regenerate=<value>
Environment variable: LW6_FIGHTER_REGENERATE
XML key: fighter-regenerate

Type: integer

Default value: 5 Min value: 0 Max value: 10000

Defines at which speed fighters will self-regenerate, without even begin packed together. This will allow lone fighters to regenerate a bit by hiding somewhere in the map. This is typically a low value, might even be 0.

4.11.10 frags-fade-out

Command-line option: --frags-fade-out=<value>
Environment variable: LW6_FRAGS_FADE_OUT
XML key: frags-fade-out

Type: integer

Default value: 100 Min value: 10 Max value: 100

When a player looses (in deathmatch mode) all player points will be multiplicated by this percentage, for instance if it’s 90 and player had 50 points, then player will only have 45 points, then points corresponding to the new death will be added/substrated to its total. This is to avoid players with thousands of points in advance, and keep everyone in the race. A low value will minimize the importance of game start. This is only used in modes where frags are distributed in a proportional way.

4.11.11 frags-mode

Command-line option: --frags-mode=<value>
Environment variable: LW6_FRAGS_MODE
XML key: frags-mode

Type: integer

Default value: 2 Min value: 0 Max value: 3

Defines how points are calculated in deathmatch mode, 0 is old school simple mode. 1 is in a mode in which 1 point is attributed to every winner, and looser looses all the corresponding points (total is always 0). 2 isproportional mode, with a total of 0 kept constant, that is, loosers loose as many points as attributed to winners. 3 is a mode in which at each death, winners are attributed a number of points proportional to their fighters, and loosers scores remain untouched.

4.11.12 frags-to-distribute

Command-line option: --frags-to-distribute=<value>
Environment variable: LW6_FRAGS_TO_DISTRIBUTE
XML key: frags-to-distribute

Type: integer

Default value: 100 Min value: 10 Max value: 1000

Defines how many points will be distributed when in deathmatch mode. When a player looses, this amont of points will be substracted to its total, and the same amount of points will be distributed to other live players, proportionnally to how many fighters they have on the battlefield.

4.11.13 glue-power

Command-line option: --glue-power=<value>
Environment variable: LW6_GLUE_POWER
XML key: glue-power

Type: integer

Default value: 20 Min value: 1 Max value: 100

Defines how sticky and powerfull the glue is. That is, if on ’glue.png’ it’s pitch black and this parameter is set to 3, then fighters will take 3 steps to do what would normally take only one step.

4.11.14 highest-team-color-allowed

Command-line option: --highest-team-color-allowed=<value>
Environment variable: LW6_HIGHEST_TEAM_COLOR_ALLOWED
XML key: highest-team-color-allowed

Type: integer

Default value: 9 Min value: 3 Max value: 9

Id of the greatest/highest color one can use. Normally, you can leave this untouched, the program will automatically fit this according to your exp. Setting an artificially low value will just cause normally available colors to disappear, setting it to a high value does nothing, if you still don’t have access to some colors, you still don’t, period.

4.11.15 highest-weapon-allowed

Command-line option: --highest-weapon-allowed=<value>
Environment variable: LW6_HIGHEST_WEAPON_ALLOWED
XML key: highest-weapon-allowed

Type: integer

Default value: 19 Min value: 7 Max value: 19

Id of the greatest/highest weapon one can use. Normally, you can leave this untouched, the program will automatically fit this according to your exp. Setting an artificially low value will just cause normally available weapons to disappear, setting it to a high value does nothing, if you still don’t have access to some weapons, you still don’t, period.

4.11.16 max-cursor-pot

Command-line option: --max-cursor-pot=<value>
Environment variable: LW6_MAX_CURSOR_POT
XML key: max-cursor-pot

Type: integer

Default value: 1000000 Min value: 50000 Max value: 5000000

Defines the maximum cursor potential. Not really any reason to change it. Any high value should produce the same results. Low values might reveal algorithm bugs and inconsistencies.

4.11.17 max-cursor-pot-offset

Command-line option: --max-cursor-pot-offset=<value>
Environment variable: LW6_MAX_CURSOR_POT_OFFSET
XML key: max-cursor-pot-offset

Type: integer

Default value: 100 Min value: 1 Max value: 10000

Defines the maximum cursor potential offset. The idea is that in some cases, the potential of a cursor can increase in burst mode, for instance to make this cursor more important than others, so that fighters rally to it, neglecting other cursors (talking about a multi-cursor controlled team). This parameter is here to limit this burst effect and avoid bugs.

4.11.18 max-nb-cursors

Command-line option: --max-nb-cursors=<value>
Environment variable: LW6_MAX_NB_CURSORS
XML key: max-nb-cursors

Type: integer

Default value: 26 Min value: 2 Max value: 26

Defines the maximum number of cursors who can enter the game. Really makes sense in network games. Default value is 26, the maximum.

4.11.19 max-nb-nodes

Command-line option: --max-nb-nodes=<value>
Environment variable: LW6_MAX_NB_NODES
XML key: max-nb-nodes

Type: integer

Default value: 12 Min value: 2 Max value: 15

Defines the maximum number of servers who can enter the game. Really makes sense in network games. Default value is 10, and should fit in most cases. Can be raised up to 26.

4.11.20 max-nb-teams

Command-line option: --max-nb-teams=<value>
Environment variable: LW6_MAX_NB_TEAMS
XML key: max-nb-teams

Type: integer

Default value: 10 Min value: 2 Max value: 10

Defines the maximum number of teams who can enter the game. Really makes sense in network games. Default value is 10, the maximum.

4.11.21 max-round-delta

Command-line option: --max-round-delta=<value>
Environment variable: LW6_MAX_ROUND_DELTA
XML key: max-round-delta

Type: integer

Default value: 1000 Min value: 1 Max value: 10000

This is the companion value of ’round-delta’. Will put an absolute limit to the delta, which (what did you think?) is of course incremented in some cases by the core algorithm. If in doubt, don’t touch.

4.11.22 max-zone-size

Command-line option: --max-zone-size=<value>
Environment variable: LW6_MAX_ZONE_SIZE
XML key: max-zone-size

Type: integer

Default value: 8 Min value: 1 Max value: 64

Defines the maximum zone size, which is an internal and rather technical parameter. The idea is that to optimize things, Liquid War 6 divides the battlefield in squares, where it can, and tries to make these squares as big as possible, the idea being that everywhere in this square, fighters follow the same intructions. Just a technical optimization. The problem is that setting it too high will reveal the optimization and its tradeoffs to the player, who will see the fighter behave strangely, following invisible paths. Plus, it’s ugly. Depending on your tastes (speed, look’n’feel) you’ll prefer something nice or something fast. Note that anyways passed a certain value, this does not optimize anything anymore. In doubt, don’t touch it.

4.11.23 medicine-power

Command-line option: --medicine-power=<value>
Environment variable: LW6_MEDICINE_POWER
XML key: medicine-power

Type: integer

Default value: 100 Min value: 0 Max value: 10000

Defines how fast fighter will automatically regenerate on black zones defined in ’medicine.png’. The value is used to decrease the fighter health at each move, so you should compare its value to something like ’fighter-defense’. Being on a medicined zone is a bit like being defended by an invisible and unknown friend.

4.11.24 moves-per-round

Command-line option: --moves-per-round=<value>
Environment variable: LW6_MOVES_PER_ROUND
XML key: moves-per-round

Type: integer

Default value: 2 Min value: 1 Max value: 50

Defines how many times fighters move per round. Increasing this will just make fighters move faster, but won’t change anything for the rest, that is keyboard and mouse responsivity, and network traffic will stay the same. Multiplying the number of moves per round by the number of rounds per second will give the number of moves per second, which is, in fact, how fast fighters move on the screen.

4.11.25 nb-attack-tries

Command-line option: --nb-attack-tries=<value>
Environment variable: LW6_NB_ATTACK_TRIES
XML key: nb-attack-tries

Type: integer

Default value: 3 Min value: 1 Max value: 7

Defines how many tries a fighter will do before giving-up attacking and choosing another behvior (defense). By tries we mean: how many directions it will try. Going North? Going North-West? Setting this to a low value will make fighters somewhat less aggressive. This idea is that they’ll prefer to switch to the next option, that is, defense/regeneration, if there’s no opponent right in front of them.

4.11.26 nb-defense-tries

Command-line option: --nb-defense-tries=<value>
Environment variable: LW6_NB_DEFENSE_TRIES
XML key: nb-defense-tries

Type: integer

Default value: 1 Min value: 1 Max value: 7

Defines how many tries a fighter will do before giving-up attacking and choosing another behavior (do nothing). By tries we mean: how many directions it will try. Going North? Going North-West? Setting this to a low value, you’ll need a very compact pack of fighters for regeneration to operate, else fighters will hang arround unhealthy.

4.11.27 nb-move-tries

Command-line option: --nb-move-tries=<value>
Environment variable: LW6_NB_MOVE_TRIES
XML key: nb-move-tries

Type: integer

Default value: 5 Min value: 3 Max value: 7

Defines how many tries a fighter will do before giving-up moving and choosing another behvior (attack or defense). By tries we mean: how many directions it will try. Going North? Going North-West? Setting this to a low value, your fighters will look very stubborn and always try to move in one direction, neglecting the fact that they could dodge. This can lead to queues of fighters and other strange behaviors. On the other hand, setting it too high will cause fighter to always avoid the enemy, and groups of fighters will just pass each other without any fight. Matter of taste.

4.11.28 respawn-delay

Command-line option: --respawn-delay=<value>
Environment variable: LW6_RESPAWN_DELAY
XML key: respawn-delay

Type: integer

Default value: 3 Min value: 0 Max value: 30

Delay, in seconds, after which teams reappear on the battlefield, when in deathmatch mode. 0 means team right away.

4.11.29 respawn-position-mode

Command-line option: --respawn-position-mode=<value>
Environment variable: LW6_RESPAWN_POSITION_MODE
XML key: respawn-position-mode

Type: integer

Default value: 1 Min value: 0 Max value: 2

Defines how teams are set up on the map when respawning. 0 means teams respect the pre-defined start positions. 1 means that a random position will be picked, among the existing positions. That is, red could take green’s place. 2 means total randomness, teams can appear anywhere.

4.11.30 respawn-team

Command-line option: --respawn-team=<value>
Environment variable: LW6_RESPAWN_TEAM
XML key: respawn-team

Type: integer

Default value: 1 Min value: 0 Max value: 1

Defines what to do when a team dies. If set to 0, team disappears forever, if set to 1, team reappears automatically with fresh fighters. It’s a deathmatch mode, where the winner is not the one who stays alive the longest time, since it makes no real sens in this case, but the one who has died less often than others.

4.11.31 round-delta

Command-line option: --round-delta=<value>
Environment variable: LW6_ROUND_DELTA
XML key: round-delta

Type: integer

Default value: 1 Min value: 0 Max value: 100

Conditions by how much the cursor potential will be incremented each time gradient is spreaded. Sounds cryptic? It is. The idea is that at each time you move your cursor of 1 pixel, theorically, you’ll need in the worst case to move of 1 more pixel to reach any point on the map. Of course this is not true but this is the default asumption, and gradient spread will fix that. Only in Liquid War 6 this is not even the worst case, for you can control your cursor with the mouse and cross walls. Whenever you cross a wall, you might have done a great distance from the fighters’ point of view, if the map is a maze. Thus this parameter, which corrects things, experience shows it does give acceptable results to increase the cursor potential by more than one at each turn. Toy arround with this if you find fighters take wrong paths on some given map. If in doubt, don’t touch.

4.11.32 rounds-per-sec

Command-line option: --rounds-per-sec=<value>
Environment variable: LW6_ROUNDS_PER_SEC
XML key: rounds-per-sec

Type: integer

Default value: 50 Min value: 1 Max value: 200

Defines the overall speed of the game. All other settings being equal, raising this value will cause the game to behave faster. Everything will be faster, except probably the display since your computer will calculate more game positions in a given time and spend more CPU time. It will also increase network traffic. Values between 10 and 50 really make sense.

4.11.33 side-attack-factor

Command-line option: --side-attack-factor=<value>
Environment variable: LW6_SIDE_ATTACK_FACTOR
XML key: side-attack-factor

Type: integer

Default value: 20 Min value: 0 Max value: 100

Defines how hard fighters will attack sideways. It’s an algorithm trick, fighters attack by default the opponent right in front, but if there’s no fighter there, they will still try to attack someone else, maybe sideways. But doing this their attack is not as strong. This parameter enables you to tune this. This is a percentage.

4.11.34 side-defense-factor

Command-line option: --side-defense-factor=<value>
Environment variable: LW6_SIDE_DEFENSE_FACTOR
XML key: side-defense-factor

Type: integer

Default value: 20 Min value: 0 Max value: 100

Defines how fast fighters will regenerate, when being side by side instead of being right in front of the other. This is a percentage.

4.11.35 single-army-size

Command-line option: --single-army-size=<value>
Environment variable: LW6_SINGLE_ARMY_SIZE
XML key: single-army-size

Type: integer

Default value: 30 Min value: 1 Max value: 95

Defines the proportion of the whole available space, which will be occupied by an army at the beginning of the game. You can either imagine playing with almost empty maps, or play very crowded with almost no space left. This is a percentage, but will be multiplied by itself to get the actual surface. That is, 50 means 50%*50%, that is, a square of 1/2 the size of a square map, so it represents 25% (1/4) of the total surface.

4.11.36 spread-mode

Command-line option: --spread-mode=<value>
Environment variable: LW6_SPREAD_MODE
XML key: spread-mode

Type: integer

Default value: 1 Min value: 0 Max value: 2

If set to 1, then gradient spread will be slower but gain in terms of homogeneity and consistency. You could consider setting this to 0 on very very big maps to save CPU cycles, else the default should work fine.

4.11.37 spread-thread

Command-line option: --spread-thread=<value>
Environment variable: LW6_SPREAD_THREAD
XML key: spread-thread

Type: integer

Default value: 0 Min value: 0 Max value: 1

If set to 1, the core algorithm with fire a separate thread to spread the gradient. By default this is turned off (set to 0). Consider this as an experimental feature, the program is already rather heavily threaded, turning this on will probably not offer any significant performance gain, even on SMP systems. This might change in the future.

4.11.38 spreads-per-round

Command-line option: --spreads-per-round=<value>
Environment variable: LW6_SPREADS_PER_ROUND
XML key: spreads-per-round

Type: integer

Default value: 5 Min value: 1 Max value: 100

Defines how many times the gradient is spread per round. Gradient spread is a very Liquid War 6 specific feature, just remember that the more often you do it, the more accurately fighters will move. That is, you will be sure they really take the shortest path. Usually this does not have much effect, the default value should fit in most cases, but you might want to decrease it on very simple maps where the gradient is obvious, or increase it on complex maps where you want fighters to be real smart.

4.11.39 start-blue-x

Command-line option: --start-blue-x=<value>
Environment variable: LW6_START_BLUE_X
XML key: start-blue-x

Type: integer

Default value: 90 Min value: 0 Max value: 100

X start position for the blue team. This is a percentage of map width, value between 0 and 100.

4.11.40 start-blue-y

Command-line option: --start-blue-y=<value>
Environment variable: LW6_START_BLUE_Y
XML key: start-blue-y

Type: integer

Default value: 10 Min value: 0 Max value: 100

Y start position for the blue team. This is a percentage of map height, value between 0 and 100.

4.11.41 start-cyan-x

Command-line option: --start-cyan-x=<value>
Environment variable: LW6_START_CYAN_X
XML key: start-cyan-x

Type: integer

Default value: 35 Min value: 0 Max value: 100

X start position for the cyan team. This is a percentage of map width, value between 0 and 100.

4.11.42 start-cyan-y

Command-line option: --start-cyan-y=<value>
Environment variable: LW6_START_CYAN_Y
XML key: start-cyan-y

Type: integer

Default value: 10 Min value: 0 Max value: 100

Y start position for the cyan team. This is a percentage of map height, value between 0 and 100.

4.11.43 start-green-x

Command-line option: --start-green-x=<value>
Environment variable: LW6_START_GREEN_X
XML key: start-green-x

Type: integer

Default value: 90 Min value: 0 Max value: 100

X start position for the green team. This is a percentage of map width, value between 0 and 100.

4.11.44 start-green-y

Command-line option: --start-green-y=<value>
Environment variable: LW6_START_GREEN_Y
XML key: start-green-y

Type: integer

Default value: 90 Min value: 0 Max value: 100

Y start position for the green team. This is a percentage of map height, value between 0 and 100.

4.11.45 start-lightblue-x

Command-line option: --start-lightblue-x=<value>
Environment variable: LW6_START_LIGHTBLUE_X
XML key: start-lightblue-x

Type: integer

Default value: 35 Min value: 0 Max value: 100

X start position for the lightblue team. This is a percentage of map width, value between 0 and 100.

4.11.46 start-lightblue-y

Command-line option: --start-lightblue-y=<value>
Environment variable: LW6_START_LIGHTBLUE_Y
XML key: start-lightblue-y

Type: integer

Default value: 90 Min value: 0 Max value: 100

Y start position for the lightblue team. This is a percentage of map height, value between 0 and 100.

4.11.47 start-magenta-x

Command-line option: --start-magenta-x=<value>
Environment variable: LW6_START_MAGENTA_X
XML key: start-magenta-x

Type: integer

Default value: 65 Min value: 0 Max value: 100

X start position for the magenta team. This is a percentage of map width, value between 0 and 100.

4.11.48 start-magenta-y

Command-line option: --start-magenta-y=<value>
Environment variable: LW6_START_MAGENTA_Y
XML key: start-magenta-y

Type: integer

Default value: 90 Min value: 0 Max value: 100

Y start position for the magenta team. This is a percentage of map height, value between 0 and 100.

4.11.49 start-orange-x

Command-line option: --start-orange-x=<value>
Environment variable: LW6_START_ORANGE_X
XML key: start-orange-x

Type: integer

Default value: 65 Min value: 0 Max value: 100

X start position for the orange team. This is a percentage of map width, value between 0 and 100.

4.11.50 start-orange-y

Command-line option: --start-orange-y=<value>
Environment variable: LW6_START_ORANGE_Y
XML key: start-orange-y

Type: integer

Default value: 10 Min value: 0 Max value: 100

Y start position for the orange team. This is a percentage of map height, value between 0 and 100.

4.11.51 start-pink-x

Command-line option: --start-pink-x=<value>
Environment variable: LW6_START_PINK_X
XML key: start-pink-x

Type: integer

Default value: 10 Min value: 0 Max value: 100

X start position for the pink team. This is a percentage of map width, value between 0 and 100.

4.11.52 start-pink-y

Command-line option: --start-pink-y=<value>
Environment variable: LW6_START_PINK_Y
XML key: start-pink-y

Type: integer

Default value: 50 Min value: 0 Max value: 100

Y start position for the pink team. This is a percentage of map height, value between 0 and 100.

4.11.53 start-position-mode

Command-line option: --start-position-mode=<value>
Environment variable: LW6_START_POSITION_MODE
XML key: start-position-mode

Type: integer

Default value: 0 Min value: 0 Max value: 2

Defines how teams are set up on the map at game startup. 0 means teams respect the pre-defined start positions. 1 means that a random position will be picked, among the existing positions. That is, red could take green’s place. 2 means total randomness, teams can appear anywhere.

4.11.54 start-purple-x

Command-line option: --start-purple-x=<value>
Environment variable: LW6_START_PURPLE_X
XML key: start-purple-x

Type: integer

Default value: 90 Min value: 0 Max value: 100

X start position for the purple team. This is a percentage of map width, value between 0 and 100.

4.11.55 start-purple-y

Command-line option: --start-purple-y=<value>
Environment variable: LW6_START_PURPLE_Y
XML key: start-purple-y

Type: integer

Default value: 50 Min value: 0 Max value: 100

Y start position for the purple team. This is a percentage of map height, value between 0 and 100.

4.11.56 start-red-x

Command-line option: --start-red-x=<value>
Environment variable: LW6_START_RED_X
XML key: start-red-x

Type: integer

Default value: 10 Min value: 0 Max value: 100

X start position for the red team. This is a percentage of map width, value between 0 and 100.

4.11.57 start-red-y

Command-line option: --start-red-y=<value>
Environment variable: LW6_START_RED_Y
XML key: start-red-y

Type: integer

Default value: 10 Min value: 0 Max value: 100

Y start position for the red team. This is a percentage of map height, value between 0 and 100.

4.11.58 start-yellow-x

Command-line option: --start-yellow-x=<value>
Environment variable: LW6_START_YELLOW_X
XML key: start-yellow-x

Type: integer

Default value: 10 Min value: 0 Max value: 100

X start position for the yellow team. This is a percentage of map width, value between 0 and 100.

4.11.59 start-yellow-y

Command-line option: --start-yellow-y=<value>
Environment variable: LW6_START_YELLOW_Y
XML key: start-yellow-y

Type: integer

Default value: 90 Min value: 0 Max value: 100

Y start position for the yellow team. This is a percentage of map height, value between 0 and 100.

4.11.60 team-profile-blue-aggressive

Command-line option: --team-profile-blue-aggressive=<value>
Environment variable: LW6_TEAM_PROFILE_BLUE_AGGRESSIVE
XML key: team-profile-blue-aggressive

Type: integer

Default value: 150 Min value: 5 Max value: 2000

Defines how aggressive the blue team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.

4.11.61 team-profile-blue-fast

Command-line option: --team-profile-blue-fast=<value>
Environment variable: LW6_TEAM_PROFILE_BLUE_FAST
XML key: team-profile-blue-fast

Type: integer

Default value: 50 Min value: 5 Max value: 2000

Changes the speed of the blue team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.

4.11.62 team-profile-blue-handicap

Command-line option: --team-profile-blue-handicap=<value>
Environment variable: LW6_TEAM_PROFILE_BLUE_HANDICAP
XML key: team-profile-blue-handicap

Type: integer

Default value: 100 Min value: 10 Max value: 1000

Defines the handicap for the blue team.

4.11.63 team-profile-blue-mobile

Command-line option: --team-profile-blue-mobile=<value>
Environment variable: LW6_TEAM_PROFILE_BLUE_MOBILE
XML key: team-profile-blue-mobile

Type: integer

Default value: 0 Min value: -3 Max value: 3

Increases (or decreases if negative) the number of move/attack/defense tries for the blue team. If set to a high value team will appear more mobile and do more things, but it won’t change its cruising speed. It’s not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.

4.11.64 team-profile-blue-vulnerable

Command-line option: --team-profile-blue-vulnerable=<value>
Environment variable: LW6_TEAM_PROFILE_BLUE_VULNERABLE
XML key: team-profile-blue-vulnerable

Type: integer

Default value: 60 Min value: 5 Max value: 2000

Defines how vulnerable the blue team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.

4.11.65 team-profile-blue-weapon-alternate-id

Command-line option: --team-profile-blue-weapon-alternate-id=<value>
Environment variable: LW6_TEAM_PROFILE_BLUE_WEAPON_ALTERNATE_ID
XML key: team-profile-blue-weapon-alternate-id

Type: integer

Default value: 8 Min value: 0 Max value: 19

Id of the default alternate weapon for the blue team, see the documentation about weapons to know what these ids mean.

4.11.66 team-profile-blue-weapon-id

Command-line option: --team-profile-blue-weapon-id=<value>
Environment variable: LW6_TEAM_PROFILE_BLUE_WEAPON_ID
XML key: team-profile-blue-weapon-id

Type: integer

Default value: 14 Min value: 0 Max value: 19

Id of the default weapon for the blue team, see the documentation about weapons to know what these ids mean.

4.11.67 team-profile-blue-weapon-mode

Command-line option: --team-profile-blue-weapon-mode=<value>
Environment variable: LW6_TEAM_PROFILE_BLUE_WEAPON_MODE
XML key: team-profile-blue-weapon-mode

Type: integer

Default value: 1 Min value: 0 Max value: 2

Weapon mode for blue team. 0 means there’s no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.

4.11.68 team-profile-cyan-aggressive

Command-line option: --team-profile-cyan-aggressive=<value>
Environment variable: LW6_TEAM_PROFILE_CYAN_AGGRESSIVE
XML key: team-profile-cyan-aggressive

Type: integer

Default value: 44 Min value: 5 Max value: 2000

Defines how aggressive the cyan team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.

4.11.69 team-profile-cyan-fast

Command-line option: --team-profile-cyan-fast=<value>
Environment variable: LW6_TEAM_PROFILE_CYAN_FAST
XML key: team-profile-cyan-fast

Type: integer

Default value: 40 Min value: 5 Max value: 2000

Changes the speed of the cyan team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.

4.11.70 team-profile-cyan-handicap

Command-line option: --team-profile-cyan-handicap=<value>
Environment variable: LW6_TEAM_PROFILE_CYAN_HANDICAP
XML key: team-profile-cyan-handicap

Type: integer

Default value: 100 Min value: 10 Max value: 1000

Defines the handicap for the cyan team.

4.11.71 team-profile-cyan-mobile

Command-line option: --team-profile-cyan-mobile=<value>
Environment variable: LW6_TEAM_PROFILE_CYAN_MOBILE
XML key: team-profile-cyan-mobile

Type: integer

Default value: 0 Min value: -3 Max value: 3

Increases (or decreases if negative) the number of move/attack/defense tries for the cyan team. If set to a high value team will appear more mobile and do more things, but it won’t change its cruising speed. It’s not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.

4.11.72 team-profile-cyan-vulnerable

Command-line option: --team-profile-cyan-vulnerable=<value>
Environment variable: LW6_TEAM_PROFILE_CYAN_VULNERABLE
XML key: team-profile-cyan-vulnerable

Type: integer

Default value: 12 Min value: 5 Max value: 2000

Defines how vulnerable the cyan team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.

4.11.73 team-profile-cyan-weapon-alternate-id

Command-line option: --team-profile-cyan-weapon-alternate-id=<value>
Environment variable: LW6_TEAM_PROFILE_CYAN_WEAPON_ALTERNATE_ID
XML key: team-profile-cyan-weapon-alternate-id

Type: integer

Default value: 12 Min value: 0 Max value: 19

Id of the default alternate weapon for the cyan team, see the documentation about weapons to know what these ids mean.

4.11.74 team-profile-cyan-weapon-id

Command-line option: --team-profile-cyan-weapon-id=<value>
Environment variable: LW6_TEAM_PROFILE_CYAN_WEAPON_ID
XML key: team-profile-cyan-weapon-id

Type: integer

Default value: 3 Min value: 0 Max value: 19

Id of the default weapon for the cyan team, see the documentation about weapons to know what these ids mean.

4.11.75 team-profile-cyan-weapon-mode

Command-line option: --team-profile-cyan-weapon-mode=<value>
Environment variable: LW6_TEAM_PROFILE_CYAN_WEAPON_MODE
XML key: team-profile-cyan-weapon-mode

Type: integer

Default value: 1 Min value: 0 Max value: 2

Weapon mode for cyan team. 0 means there’s no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.

4.11.76 team-profile-green-aggressive

Command-line option: --team-profile-green-aggressive=<value>
Environment variable: LW6_TEAM_PROFILE_GREEN_AGGRESSIVE
XML key: team-profile-green-aggressive

Type: integer

Default value: 70 Min value: 5 Max value: 2000

Defines how aggressive the green team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.

4.11.77 team-profile-green-fast

Command-line option: --team-profile-green-fast=<value>
Environment variable: LW6_TEAM_PROFILE_GREEN_FAST
XML key: team-profile-green-fast

Type: integer

Default value: 70 Min value: 5 Max value: 2000

Changes the speed of the green team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.

4.11.78 team-profile-green-handicap

Command-line option: --team-profile-green-handicap=<value>
Environment variable: LW6_TEAM_PROFILE_GREEN_HANDICAP
XML key: team-profile-green-handicap

Type: integer

Default value: 100 Min value: 10 Max value: 1000

Defines the handicap for the green team.

4.11.79 team-profile-green-mobile

Command-line option: --team-profile-green-mobile=<value>
Environment variable: LW6_TEAM_PROFILE_GREEN_MOBILE
XML key: team-profile-green-mobile

Type: integer

Default value: 0 Min value: -3 Max value: 3

Increases (or decreases if negative) the number of move/attack/defense tries for the green team. If set to a high value team will appear more mobile and do more things, but it won’t change its cruising speed. It’s not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.

4.11.80 team-profile-green-vulnerable

Command-line option: --team-profile-green-vulnerable=<value>
Environment variable: LW6_TEAM_PROFILE_GREEN_VULNERABLE
XML key: team-profile-green-vulnerable

Type: integer

Default value: 30 Min value: 5 Max value: 2000

Defines how vulnerable the green team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.

4.11.81 team-profile-green-weapon-alternate-id

Command-line option: --team-profile-green-weapon-alternate-id=<value>
Environment variable: LW6_TEAM_PROFILE_GREEN_WEAPON_ALTERNATE_ID
XML key: team-profile-green-weapon-alternate-id

Type: integer

Default value: 7 Min value: 0 Max value: 19

Id of the default alternate weapon for the green team, see the documentation about weapons to know what these ids mean.

4.11.82 team-profile-green-weapon-id

Command-line option: --team-profile-green-weapon-id=<value>
Environment variable: LW6_TEAM_PROFILE_GREEN_WEAPON_ID
XML key: team-profile-green-weapon-id

Type: integer

Default value: 13 Min value: 0 Max value: 19

Id of the default weapon for the green team, see the documentation about weapons to know what these ids mean.

4.11.83 team-profile-green-weapon-mode

Command-line option: --team-profile-green-weapon-mode=<value>
Environment variable: LW6_TEAM_PROFILE_GREEN_WEAPON_MODE
XML key: team-profile-green-weapon-mode

Type: integer

Default value: 1 Min value: 0 Max value: 2

Weapon mode for green team. 0 means there’s no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.

4.11.84 team-profile-lightblue-aggressive

Command-line option: --team-profile-lightblue-aggressive=<value>
Environment variable: LW6_TEAM_PROFILE_LIGHTBLUE_AGGRESSIVE
XML key: team-profile-lightblue-aggressive

Type: integer

Default value: 200 Min value: 5 Max value: 2000

Defines how aggressive the lightblue team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.

4.11.85 team-profile-lightblue-fast

Command-line option: --team-profile-lightblue-fast=<value>
Environment variable: LW6_TEAM_PROFILE_LIGHTBLUE_FAST
XML key: team-profile-lightblue-fast

Type: integer

Default value: 20 Min value: 5 Max value: 2000

Changes the speed of the lightblue team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.

4.11.86 team-profile-lightblue-handicap

Command-line option: --team-profile-lightblue-handicap=<value>
Environment variable: LW6_TEAM_PROFILE_LIGHTBLUE_HANDICAP
XML key: team-profile-lightblue-handicap

Type: integer

Default value: 100 Min value: 10 Max value: 1000

Defines the handicap for the lightblue team.

4.11.87 team-profile-lightblue-mobile

Command-line option: --team-profile-lightblue-mobile=<value>
Environment variable: LW6_TEAM_PROFILE_LIGHTBLUE_MOBILE
XML key: team-profile-lightblue-mobile

Type: integer

Default value: 0 Min value: -3 Max value: 3

Increases (or decreases if negative) the number of move/attack/defense tries for the lightblue team. If set to a high value team will appear more mobile and do more things, but it won’t change its cruising speed. It’s not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.

4.11.88 team-profile-lightblue-vulnerable

Command-line option: --team-profile-lightblue-vulnerable=<value>
Environment variable: LW6_TEAM_PROFILE_LIGHTBLUE_VULNERABLE
XML key: team-profile-lightblue-vulnerable

Type: integer

Default value: 8 Min value: 5 Max value: 2000

Defines how vulnerable the lightblue team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.

4.11.89 team-profile-lightblue-weapon-alternate-id

Command-line option: --team-profile-lightblue-weapon-alternate-id=<value>
Environment variable: LW6_TEAM_PROFILE_LIGHTBLUE_WEAPON_ALTERNATE_ID
XML key: team-profile-lightblue-weapon-alternate-id

Type: integer

Default value: 17 Min value: 0 Max value: 19

Id of the default alternate weapon for the lightblue team, see the documentation about weapons to know what these ids mean.

4.11.90 team-profile-lightblue-weapon-id

Command-line option: --team-profile-lightblue-weapon-id=<value>
Environment variable: LW6_TEAM_PROFILE_LIGHTBLUE_WEAPON_ID
XML key: team-profile-lightblue-weapon-id

Type: integer

Default value: 4 Min value: 0 Max value: 19

Id of the default weapon for the lightblue team, see the documentation about weapons to know what these ids mean.

4.11.91 team-profile-lightblue-weapon-mode

Command-line option: --team-profile-lightblue-weapon-mode=<value>
Environment variable: LW6_TEAM_PROFILE_LIGHTBLUE_WEAPON_MODE
XML key: team-profile-lightblue-weapon-mode

Type: integer

Default value: 1 Min value: 0 Max value: 2

Weapon mode for lightblue team. 0 means there’s no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.

4.11.92 team-profile-magenta-aggressive

Command-line option: --team-profile-magenta-aggressive=<value>
Environment variable: LW6_TEAM_PROFILE_MAGENTA_AGGRESSIVE
XML key: team-profile-magenta-aggressive

Type: integer

Default value: 192 Min value: 5 Max value: 2000

Defines how aggressive the magenta team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.

4.11.93 team-profile-magenta-fast

Command-line option: --team-profile-magenta-fast=<value>
Environment variable: LW6_TEAM_PROFILE_MAGENTA_FAST
XML key: team-profile-magenta-fast

Type: integer

Default value: 320 Min value: 5 Max value: 2000

Changes the speed of the magenta team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.

4.11.94 team-profile-magenta-handicap

Command-line option: --team-profile-magenta-handicap=<value>
Environment variable: LW6_TEAM_PROFILE_MAGENTA_HANDICAP
XML key: team-profile-magenta-handicap

Type: integer

Default value: 100 Min value: 10 Max value: 1000

Defines the handicap for the magenta team.

4.11.95 team-profile-magenta-mobile

Command-line option: --team-profile-magenta-mobile=<value>
Environment variable: LW6_TEAM_PROFILE_MAGENTA_MOBILE
XML key: team-profile-magenta-mobile

Type: integer

Default value: 0 Min value: -3 Max value: 3

Increases (or decreases if negative) the number of move/attack/defense tries for the magenta team. If set to a high value team will appear more mobile and do more things, but it won’t change its cruising speed. It’s not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.

4.11.96 team-profile-magenta-vulnerable

Command-line option: --team-profile-magenta-vulnerable=<value>
Environment variable: LW6_TEAM_PROFILE_MAGENTA_VULNERABLE
XML key: team-profile-magenta-vulnerable

Type: integer

Default value: 1920 Min value: 5 Max value: 2000

Defines how vulnerable the magenta team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.

4.11.97 team-profile-magenta-weapon-alternate-id

Command-line option: --team-profile-magenta-weapon-alternate-id=<value>
Environment variable: LW6_TEAM_PROFILE_MAGENTA_WEAPON_ALTERNATE_ID
XML key: team-profile-magenta-weapon-alternate-id

Type: integer

Default value: 15 Min value: 0 Max value: 19

Id of the default alternate weapon for the magenta team, see the documentation about weapons to know what these ids mean.

4.11.98 team-profile-magenta-weapon-id

Command-line option: --team-profile-magenta-weapon-id=<value>
Environment variable: LW6_TEAM_PROFILE_MAGENTA_WEAPON_ID
XML key: team-profile-magenta-weapon-id

Type: integer

Default value: 6 Min value: 0 Max value: 19

Id of the default weapon for the magenta team, see the documentation about weapons to know what these ids mean.

4.11.99 team-profile-magenta-weapon-mode

Command-line option: --team-profile-magenta-weapon-mode=<value>
Environment variable: LW6_TEAM_PROFILE_MAGENTA_WEAPON_MODE
XML key: team-profile-magenta-weapon-mode

Type: integer

Default value: 1 Min value: 0 Max value: 2

Weapon mode for magenta team. 0 means there’s no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.

4.11.100 team-profile-orange-aggressive

Command-line option: --team-profile-orange-aggressive=<value>
Environment variable: LW6_TEAM_PROFILE_ORANGE_AGGRESSIVE
XML key: team-profile-orange-aggressive

Type: integer

Default value: 48 Min value: 5 Max value: 2000

Defines how aggressive the orange team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.

4.11.101 team-profile-orange-fast

Command-line option: --team-profile-orange-fast=<value>
Environment variable: LW6_TEAM_PROFILE_ORANGE_FAST
XML key: team-profile-orange-fast

Type: integer

Default value: 160 Min value: 5 Max value: 2000

Changes the speed of the orange team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.

4.11.102 team-profile-orange-handicap

Command-line option: --team-profile-orange-handicap=<value>
Environment variable: LW6_TEAM_PROFILE_ORANGE_HANDICAP
XML key: team-profile-orange-handicap

Type: integer

Default value: 100 Min value: 10 Max value: 1000

Defines the handicap for the orange team.

4.11.103 team-profile-orange-mobile

Command-line option: --team-profile-orange-mobile=<value>
Environment variable: LW6_TEAM_PROFILE_ORANGE_MOBILE
XML key: team-profile-orange-mobile

Type: integer

Default value: 0 Min value: -3 Max value: 3

Increases (or decreases if negative) the number of move/attack/defense tries for the orange team. If set to a high value team will appear more mobile and do more things, but it won’t change its cruising speed. It’s not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.

4.11.104 team-profile-orange-vulnerable

Command-line option: --team-profile-orange-vulnerable=<value>
Environment variable: LW6_TEAM_PROFILE_ORANGE_VULNERABLE
XML key: team-profile-orange-vulnerable

Type: integer

Default value: 144 Min value: 5 Max value: 2000

Defines how vulnerable the orange team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.

4.11.105 team-profile-orange-weapon-alternate-id

Command-line option: --team-profile-orange-weapon-alternate-id=<value>
Environment variable: LW6_TEAM_PROFILE_ORANGE_WEAPON_ALTERNATE_ID
XML key: team-profile-orange-weapon-alternate-id

Type: integer

Default value: 16 Min value: 0 Max value: 19

Id of the default alternate weapon for the orange team, see the documentation about weapons to know what these ids mean.

4.11.106 team-profile-orange-weapon-id

Command-line option: --team-profile-orange-weapon-id=<value>
Environment variable: LW6_TEAM_PROFILE_ORANGE_WEAPON_ID
XML key: team-profile-orange-weapon-id

Type: integer

Default value: 0 Min value: 0 Max value: 19

Id of the default weapon for the orange team, see the documentation about weapons to know what these ids mean.

4.11.107 team-profile-orange-weapon-mode

Command-line option: --team-profile-orange-weapon-mode=<value>
Environment variable: LW6_TEAM_PROFILE_ORANGE_WEAPON_MODE
XML key: team-profile-orange-weapon-mode

Type: integer

Default value: 1 Min value: 0 Max value: 2

Weapon mode for orange team. 0 means there’s no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.

4.11.108 team-profile-pink-aggressive

Command-line option: --team-profile-pink-aggressive=<value>
Environment variable: LW6_TEAM_PROFILE_PINK_AGGRESSIVE
XML key: team-profile-pink-aggressive

Type: integer

Default value: 640 Min value: 5 Max value: 2000

Defines how aggressive the pink team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.

4.11.109 team-profile-pink-fast

Command-line option: --team-profile-pink-fast=<value>
Environment variable: LW6_TEAM_PROFILE_PINK_FAST
XML key: team-profile-pink-fast

Type: integer

Default value: 80 Min value: 5 Max value: 2000

Changes the speed of the pink team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.

4.11.110 team-profile-pink-handicap

Command-line option: --team-profile-pink-handicap=<value>
Environment variable: LW6_TEAM_PROFILE_PINK_HANDICAP
XML key: team-profile-pink-handicap

Type: integer

Default value: 100 Min value: 10 Max value: 1000

Defines the handicap for the pink team.

4.11.111 team-profile-pink-mobile

Command-line option: --team-profile-pink-mobile=<value>
Environment variable: LW6_TEAM_PROFILE_PINK_MOBILE
XML key: team-profile-pink-mobile

Type: integer

Default value: 0 Min value: -3 Max value: 3

Increases (or decreases if negative) the number of move/attack/defense tries for the pink team. If set to a high value team will appear more mobile and do more things, but it won’t change its cruising speed. It’s not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.

4.11.112 team-profile-pink-vulnerable

Command-line option: --team-profile-pink-vulnerable=<value>
Environment variable: LW6_TEAM_PROFILE_PINK_VULNERABLE
XML key: team-profile-pink-vulnerable

Type: integer

Default value: 640 Min value: 5 Max value: 2000

Defines how vulnerable the pink team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.

4.11.113 team-profile-pink-weapon-alternate-id

Command-line option: --team-profile-pink-weapon-alternate-id=<value>
Environment variable: LW6_TEAM_PROFILE_PINK_WEAPON_ALTERNATE_ID
XML key: team-profile-pink-weapon-alternate-id

Type: integer

Default value: 19 Min value: 0 Max value: 19

Id of the default alternate weapon for the pink team, see the documentation about weapons to know what these ids mean.

4.11.114 team-profile-pink-weapon-id

Command-line option: --team-profile-pink-weapon-id=<value>
Environment variable: LW6_TEAM_PROFILE_PINK_WEAPON_ID
XML key: team-profile-pink-weapon-id

Type: integer

Default value: 1 Min value: 0 Max value: 19

Id of the default weapon for the pink team, see the documentation about weapons to know what these ids mean.

4.11.115 team-profile-pink-weapon-mode

Command-line option: --team-profile-pink-weapon-mode=<value>
Environment variable: LW6_TEAM_PROFILE_PINK_WEAPON_MODE
XML key: team-profile-pink-weapon-mode

Type: integer

Default value: 1 Min value: 0 Max value: 2

Weapon mode for pink team. 0 means there’s no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.

4.11.116 team-profile-purple-aggressive

Command-line option: --team-profile-purple-aggressive=<value>
Environment variable: LW6_TEAM_PROFILE_PURPLE_AGGRESSIVE
XML key: team-profile-purple-aggressive

Type: integer

Default value: 32 Min value: 5 Max value: 2000

Defines how aggressive the purple team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.

4.11.117 team-profile-purple-fast

Command-line option: --team-profile-purple-fast=<value>
Environment variable: LW6_TEAM_PROFILE_PURPLE_FAST
XML key: team-profile-purple-fast

Type: integer

Default value: 80 Min value: 5 Max value: 2000

Changes the speed of the purple team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.

4.11.118 team-profile-purple-handicap

Command-line option: --team-profile-purple-handicap=<value>
Environment variable: LW6_TEAM_PROFILE_PURPLE_HANDICAP
XML key: team-profile-purple-handicap

Type: integer

Default value: 100 Min value: 10 Max value: 1000

Defines the handicap for the purple team.

4.11.119 team-profile-purple-mobile

Command-line option: --team-profile-purple-mobile=<value>
Environment variable: LW6_TEAM_PROFILE_PURPLE_MOBILE
XML key: team-profile-purple-mobile

Type: integer

Default value: 0 Min value: -3 Max value: 3

Increases (or decreases if negative) the number of move/attack/defense tries for the purple team. If set to a high value team will appear more mobile and do more things, but it won’t change its cruising speed. It’s not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.

4.11.120 team-profile-purple-vulnerable

Command-line option: --team-profile-purple-vulnerable=<value>
Environment variable: LW6_TEAM_PROFILE_PURPLE_VULNERABLE
XML key: team-profile-purple-vulnerable

Type: integer

Default value: 16 Min value: 5 Max value: 2000

Defines how vulnerable the purple team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.

4.11.121 team-profile-purple-weapon-alternate-id

Command-line option: --team-profile-purple-weapon-alternate-id=<value>
Environment variable: LW6_TEAM_PROFILE_PURPLE_WEAPON_ALTERNATE_ID
XML key: team-profile-purple-weapon-alternate-id

Type: integer

Default value: 18 Min value: 0 Max value: 19

Id of the default alternate weapon for the purple team, see the documentation about weapons to know what these ids mean.

4.11.122 team-profile-purple-weapon-id

Command-line option: --team-profile-purple-weapon-id=<value>
Environment variable: LW6_TEAM_PROFILE_PURPLE_WEAPON_ID
XML key: team-profile-purple-weapon-id

Type: integer

Default value: 11 Min value: 0 Max value: 19

Id of the default weapon for the purple team, see the documentation about weapons to know what these ids mean.

4.11.123 team-profile-purple-weapon-mode

Command-line option: --team-profile-purple-weapon-mode=<value>
Environment variable: LW6_TEAM_PROFILE_PURPLE_WEAPON_MODE
XML key: team-profile-purple-weapon-mode

Type: integer

Default value: 1 Min value: 0 Max value: 2

Weapon mode for purple team. 0 means there’s no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.

4.11.124 team-profile-red-aggressive

Command-line option: --team-profile-red-aggressive=<value>
Environment variable: LW6_TEAM_PROFILE_RED_AGGRESSIVE
XML key: team-profile-red-aggressive

Type: integer

Default value: 220 Min value: 5 Max value: 2000

Defines how aggressive the red team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.

4.11.125 team-profile-red-fast

Command-line option: --team-profile-red-fast=<value>
Environment variable: LW6_TEAM_PROFILE_RED_FAST
XML key: team-profile-red-fast

Type: integer

Default value: 160 Min value: 5 Max value: 2000

Changes the speed of the red team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.

4.11.126 team-profile-red-handicap

Command-line option: --team-profile-red-handicap=<value>
Environment variable: LW6_TEAM_PROFILE_RED_HANDICAP
XML key: team-profile-red-handicap

Type: integer

Default value: 100 Min value: 10 Max value: 1000

Defines the handicap for the red team.

4.11.127 team-profile-red-mobile

Command-line option: --team-profile-red-mobile=<value>
Environment variable: LW6_TEAM_PROFILE_RED_MOBILE
XML key: team-profile-red-mobile

Type: integer

Default value: 0 Min value: -3 Max value: 3

Increases (or decreases if negative) the number of move/attack/defense tries for the red team. If set to a high value team will appear more mobile and do more things, but it won’t change its cruising speed. It’s not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.

4.11.128 team-profile-red-vulnerable

Command-line option: --team-profile-red-vulnerable=<value>
Environment variable: LW6_TEAM_PROFILE_RED_VULNERABLE
XML key: team-profile-red-vulnerable

Type: integer

Default value: 110 Min value: 5 Max value: 2000

Defines how vulnerable the red team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.

4.11.129 team-profile-red-weapon-alternate-id

Command-line option: --team-profile-red-weapon-alternate-id=<value>
Environment variable: LW6_TEAM_PROFILE_RED_WEAPON_ALTERNATE_ID
XML key: team-profile-red-weapon-alternate-id

Type: integer

Default value: 2 Min value: 0 Max value: 19

Id of the default alternate weapon for the red team, see the documentation about weapons to know what these ids mean.

4.11.130 team-profile-red-weapon-id

Command-line option: --team-profile-red-weapon-id=<value>
Environment variable: LW6_TEAM_PROFILE_RED_WEAPON_ID
XML key: team-profile-red-weapon-id

Type: integer

Default value: 10 Min value: 0 Max value: 19

Id of the default weapon for the red team, see the documentation about weapons to know what these ids mean.

4.11.131 team-profile-red-weapon-mode

Command-line option: --team-profile-red-weapon-mode=<value>
Environment variable: LW6_TEAM_PROFILE_RED_WEAPON_MODE
XML key: team-profile-red-weapon-mode

Type: integer

Default value: 1 Min value: 0 Max value: 2

Weapon mode for red team. 0 means there’s no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.

4.11.132 team-profile-yellow-aggressive

Command-line option: --team-profile-yellow-aggressive=<value>
Environment variable: LW6_TEAM_PROFILE_YELLOW_AGGRESSIVE
XML key: team-profile-yellow-aggressive

Type: integer

Default value: 200 Min value: 5 Max value: 2000

Defines how aggressive the yellow team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.

4.11.133 team-profile-yellow-fast

Command-line option: --team-profile-yellow-fast=<value>
Environment variable: LW6_TEAM_PROFILE_YELLOW_FAST
XML key: team-profile-yellow-fast

Type: integer

Default value: 70 Min value: 5 Max value: 2000

Changes the speed of the yellow team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.

4.11.134 team-profile-yellow-handicap

Command-line option: --team-profile-yellow-handicap=<value>
Environment variable: LW6_TEAM_PROFILE_YELLOW_HANDICAP
XML key: team-profile-yellow-handicap

Type: integer

Default value: 100 Min value: 10 Max value: 1000

Defines the handicap for the yellow team.

4.11.135 team-profile-yellow-mobile

Command-line option: --team-profile-yellow-mobile=<value>
Environment variable: LW6_TEAM_PROFILE_YELLOW_MOBILE
XML key: team-profile-yellow-mobile

Type: integer

Default value: 0 Min value: -3 Max value: 3

Increases (or decreases if negative) the number of move/attack/defense tries for the yellow team. If set to a high value team will appear more mobile and do more things, but it won’t change its cruising speed. It’s not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.

4.11.136 team-profile-yellow-vulnerable

Command-line option: --team-profile-yellow-vulnerable=<value>
Environment variable: LW6_TEAM_PROFILE_YELLOW_VULNERABLE
XML key: team-profile-yellow-vulnerable

Type: integer

Default value: 90 Min value: 5 Max value: 2000

Defines how vulnerable the yellow team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.

4.11.137 team-profile-yellow-weapon-alternate-id

Command-line option: --team-profile-yellow-weapon-alternate-id=<value>
Environment variable: LW6_TEAM_PROFILE_YELLOW_WEAPON_ALTERNATE_ID
XML key: team-profile-yellow-weapon-alternate-id

Type: integer

Default value: 9 Min value: 0 Max value: 19

Id of the default alternate weapon for the yellow team, see the documentation about weapons to know what these ids mean.

4.11.138 team-profile-yellow-weapon-id

Command-line option: --team-profile-yellow-weapon-id=<value>
Environment variable: LW6_TEAM_PROFILE_YELLOW_WEAPON_ID
XML key: team-profile-yellow-weapon-id

Type: integer

Default value: 5 Min value: 0 Max value: 19

Id of the default weapon for the yellow team, see the documentation about weapons to know what these ids mean.

4.11.139 team-profile-yellow-weapon-mode

Command-line option: --team-profile-yellow-weapon-mode=<value>
Environment variable: LW6_TEAM_PROFILE_YELLOW_WEAPON_MODE
XML key: team-profile-yellow-weapon-mode

Type: integer

Default value: 1 Min value: 0 Max value: 2

Weapon mode for yellow team. 0 means there’s no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.

4.11.140 total-armies-size

Command-line option: --total-armies-size=<value>
Environment variable: LW6_TOTAL_ARMIES_SIZE
XML key: total-armies-size

Type: integer

Default value: 60 Min value: 1 Max value: 95

Defines the proportion of the whole available space, which can be occupied by all the armies present together. Setting this low, whenever a new team arrives on the map, fighters might be stolen to other teams, otherwise the ame would get too crowded. This allows you to play with reasonnably enough fighters with 2 players, while still allowing interesting gameplay with many players. This is a percentage, but will be multiplied by itself to get the actual surface. That is, 50 means 50%*50%, that is, a square of 1/2 the size of a square map, so it represents 25% (1/4) of the total surface.

4.11.141 total-time

Command-line option: --total-time=<value>
Environment variable: LW6_TOTAL_TIME
XML key: total-time

Type: integer

Default value: 900 Min value: 10 Max value: 864000

Defines the maximum time of the game, in seconds. Note that in some cases, the game can end much earlier if some player has managed to win before the bell rings. Also, technically, this value will be translated into rounds and moves, and the game engine will wait until enough rounds and moves have been played. So if the computer is too slow and the desired speed is not reached, then the game will last for a longer time.

4.11.142 use-team-profiles

Command-line option: --use-team-profiles=<value>
Environment variable: LW6_USE_TEAM_PROFILES
XML key: use-team-profiles

Type: integer

Default value: 1 Min value: 0 Max value: 1

If set, then all the team-profile-... values will be taken in account. This enables a mode in which teams behave differently according to their colors. If you disable this, then all teams will behave the same, which is more fair, but might not be as fun.

4.11.143 vertical-move

Command-line option: --vertical-move=<value>
Environment variable: LW6_VERTICAL_MOVE
XML key: vertical-move

Type: integer

Default value: 1 Min value: 0 Max value: 7

Defines when to process a vertical move (along the Z ’depth’ axis). If set to 0, fighters never spontaneously move along this axis. If set to 1, it will be tried just after the first move failed. If set to 2, it will be tried just after the second move failed. And so on.

4.11.144 weapon-charge-delay

Command-line option: --weapon-charge-delay=<value>
Environment variable: LW6_WEAPON_CHARGE_DELAY
XML key: weapon-charge-delay

Type: integer

Default value: 30 Min value: 1 Max value: 600

How long it will take for weapons to charge and be usable, by default. Unit is seconds.

4.11.145 weapon-charge-max

Command-line option: --weapon-charge-max=<value>
Environment variable: LW6_WEAPON_CHARGE_MAX
XML key: weapon-charge-max

Type: integer

Default value: 200 Min value: 100 Max value: 1000

Maximum (percentage) of charge intensity that one have. For instance, if this is 400, then if you wait four times more than required before firing, then you weapon will have four times its default power, but if you wait five times more it will still be four times more powerfull, it’s just the limit after which it’s useless to charge.

4.11.146 weapon-duration

Command-line option: --weapon-duration=<value>
Environment variable: LW6_WEAPON_DURATION
XML key: weapon-duration

Type: integer

Default value: 3 Min value: 1 Max value: 60

How long all weapons (for which duration makes sense) will last. Unit is seconds.

4.11.147 weapon-tune-berzerk-power

Command-line option: --weapon-tune-berzerk-power=<value>
Environment variable: LW6_WEAPON_TUNE_BERZERK_POWER
XML key: weapon-tune-berzerk-power

Type: integer

Default value: 3 Min value: 1 Max value: 100

Use to specifiy how strong berzerk mode is, if set to 3, then attacks will be 3 times as efficient in berzerk mode.

4.11.148 weapon-tune-turbo-power

Command-line option: --weapon-tune-turbo-power=<value>
Environment variable: LW6_WEAPON_TUNE_TURBO_POWER
XML key: weapon-tune-turbo-power

Type: integer

Default value: 3 Min value: 1 Max value: 10

Defines how fast fighters move in turbo mode, if set to 3, then fighters move and act 3 times as fast.

4.11.149 x-polarity

Command-line option: --x-polarity=<value>
Environment variable: LW6_X_POLARITY
XML key: x-polarity

Type: integer

Default value: 0 Min value: -1 Max value: 1

Defines how the map will be wrapped on the X (horizontal) axis. If set to 0, nothing is wrapped. If set to 1, the right and left borders are connected, any fighter can disappear on the right border and reappear on the left border, for instance. If set to -1, it will be wrapped but also inversed, that is on a 320x240 map, a fighter disappearing on the left border at position (0,60) will reapper on the right border at position (319,180). You can combine it with ’y-polarity’.

4.11.150 y-polarity

Command-line option: --y-polarity=<value>
Environment variable: LW6_Y_POLARITY
XML key: y-polarity

Type: integer

Default value: 0 Min value: -1 Max value: 1

Defines how the map will be wrapped on the Y (vertical) axis. If set to 0, nothing is wrapped. If set to 1, the top and bottom borders are connected, any fighter can disappear on the top border and reappear on the bottom border, for instance. If set to -1, it will be wrapped but also inversed, that is on a 320x240 map, a fighter disappearing on the bottom border at position (40,239) will reapper on the top border at position (280,0). You can combine it with ’x-polarity’.

4.11.151 z-polarity

Command-line option: --z-polarity=<value>
Environment variable: LW6_Z_POLARITY
XML key: z-polarity

Type: integer

Default value: 0 Min value: 0 Max value: 1

Defines how the map will be wrapped on the Z (deep) axis. If set to 0, nothing is wrapped. If set to 1, when using a 4 layer map, for instance, fighters on layer 1 will be able to go directly to layer 4 even if layers 2 and 3 are filled with walls. A value of -1 is forbidden, this is not like x and y axis, it does not really make sense. Consider this an advanced setting which might save a layer in some tricky cases, the default value of 0 should fit in most cases.


Next: , Previous: , Up: Reference   [Contents][Index]

4.12 Map hints.xml

4.12.1 background-color-auto

Command-line option: --background-color-auto=<value>
Environment variable: LW6_BACKGROUND_COLOR_AUTO
XML key: background-color-auto

Type: boolean

Default value: true

Defines wether hud colors will be set automatically from base and alternate colors. This is a time saver to keep map designers from requiring to redefined every single color in the game. You only need to set color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg. Then hud_color_frame_bg, hud_color_frame_fg, hud_color_text_bg and hud_color_text_fg will be automatically set.

4.12.2 downsize-using-bench-value

Command-line option: --downsize-using-bench-value=<value>
Environment variable: LW6_DOWNSIZE_USING_BENCH_VALUE
XML key: downsize-using-bench-value

Type: boolean

Default value: true

If set, then the game will automatically downsize a map according to the ’bench-value’ parameter. Downsizing means: a 1600x1200 maps becomes 200x150, for instance. Downsizing causes fighters to be bigger because map resolution is lower. This will avoid running the game on a too big map, with your computer not being able to handle it at the required speed.

4.12.3 downsize-using-fighter-scale

Command-line option: --downsize-using-fighter-scale=<value>
Environment variable: LW6_DOWNSIZE_USING_FIGHTER_SCALE
XML key: downsize-using-fighter-scale

Type: boolean

Default value: false

If set, then the game will automatically downsize a map according to the ’fighter-scale’ parameter. Downsizing means: a 1600x1200 maps becomes 200x150, for instance. Downsizing causes fighters to be bigger because map resolution is lower. This can be usefull if you don’t want fighters to be too small.

4.12.4 fighter-scale

Command-line option: --fighter-scale=<value>
Environment variable: LW6_FIGHTER_SCALE
XML key: fighter-scale

Type: float

Default value: 1.0

Defines how wide (in pixels) fighters must be. This parameter is very important and will largely condition the number of fighters on the map. It is used when loading the map. If it is, for instance, set to 1, there will be exactly a fighter per pixel on the screen. That is, if you play 640x480 on an empty map, the maximum fighters you could have is about 300000. The idea is that by changing the resolution, you also define the density of the map. In pratice, this is done in the hope that someone with a slow computer will pick up a low resolution and therefore play small levels. Conversely, someone with a brand new computer with powerfull CPU & GPU will use great resolutions and be happy with many fighters on the map. Still, changing the resolution after loading the map will not affet the number of fighters. Same for network games, the first player, who loads the map, defines its properties according to its own settings.

4.12.5 guess-colors

Command-line option: --guess-colors=<value>
Environment variable: LW6_GUESS_COLORS
XML key: guess-colors

Type: boolean

Default value: true

Defines wether colors should be set automatically from texture colors. If set to true, then the program will try to pick up colors automatically from the texture, and will override the values of the color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg parameters. How these colors are picked up can’t be garanteed, so if the map does not have strong contrast or if there can be any form of ambiguity, it’s safe to set this to false and define one’s own colors.

4.12.6 guess-moves-per-sec

Command-line option: --guess-moves-per-sec=<value>
Environment variable: LW6_GUESS_MOVES_PER_SEC
XML key: guess-moves-per-sec

Type: boolean

Default value: true

If set, then loader will use ’time-to-cross-level’ to guess the game speed parameters.

4.12.7 hud-color-auto

Command-line option: --hud-color-auto=<value>
Environment variable: LW6_HUD_COLOR_AUTO
XML key: hud-color-auto

Type: boolean

Default value: true

Defines wether hud colors will be set automatically from base and alternate colors. This is a time saver to keep map designers from requiring to redefined every single color in the game. You only need to set color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg. Then hud_color_frame_bg, hud_color_frame_fg, hud_color_text_bg and hud_color_text_fg will be automatically set.

4.12.8 max-map-height

Command-line option: --max-map-height=<value>
Environment variable: LW6_MAX_MAP_HEIGHT
XML key: max-map-height

Type: integer

Default value: 1000

Allows you to give a maximum map height. When designing a map you might wonder: this is dumb I’m conceiving this map I know its height, why should I limit it? Now think of the play who plays on a old slowish computer with a tiny screen. He might redefine this himself, and does not necessarly wishes to fire Gimp to rescale the map.

4.12.9 max-map-surface

Command-line option: --max-map-surface=<value>
Environment variable: LW6_MAX_MAP_SURFACE
XML key: max-map-surface

Type: integer

Default value: 1000000

Allows you to give a maximum map surface. Map surface is simply (width * height). This parameter is just here to save you the hassle of defining both ’max-map-width’ and ’max-map-height’ in a consistent manner.

4.12.10 max-map-width

Command-line option: --max-map-width=<value>
Environment variable: LW6_MAX_MAP_WIDTH
XML key: max-map-width

Type: integer

Default value: 1500

Allows you to give a maximum map width. When designing a map you might wonder: this is dumb I’m conceiving this map I know its width, why should I limit it? Now think of the play who plays on a old slowish computer with a tiny screen. He might redefine this himself, and does not necessarly wishes to fire Gimp to rescale the map.

4.12.11 menu-color-auto

Command-line option: --menu-color-auto=<value>
Environment variable: LW6_MENU_COLOR_AUTO
XML key: menu-color-auto

Type: boolean

Default value: true

Defines wether menu colors will be set automatically from base and alternate colors. This is a time saver to keep map designers from requiring to redefined every single color in the game. You only need to set color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg. Then menu_color_default_bg, menu_color_default_fg, menu_color_selected_bg, menu_color_selected_fg, menu_color_disabled_bg and menu_color_disabled_fg will be automatically set.

4.12.12 min-map-height

Command-line option: --min-map-height=<value>
Environment variable: LW6_MIN_MAP_HEIGHT
XML key: min-map-height

Type: integer

Default value: 30

Allows you to give a minimum map height. When designing a map you might wonder: this is dumb I’m conceiving this map I know its height, why should I limit it? Now think of the player who decided to play with highly-defined maps because he has a super calculator and a hudge screen. He might redefine this himself, and does not necessarly wishes to fire Gimp to rescale the map.

4.12.13 min-map-surface

Command-line option: --min-map-surface=<value>
Environment variable: LW6_MIN_MAP_SURFACE
XML key: min-map-surface

Type: integer

Default value: 3600

Allows you to give a minimum map surface. Map surface is simply (width * height). This parameter is just here to save you the hassle of defining both ’min-map-width’ and ’min-map-height’ in a consistent manner.

4.12.14 min-map-width

Command-line option: --min-map-width=<value>
Environment variable: LW6_MIN_MAP_WIDTH
XML key: min-map-width

Type: integer

Default value: 40

Allows you to give a minimum map width. When designing a map you might wonder: this is dumb I’m conceiving this map I know its width, why should I limit it? Now think of the player who decided to play with highly-defined maps because he has a super calculator and a hudge screen. He might redefine this himself, and does not necessarly wishes to fire Gimp to rescale the map.

4.12.15 resample

Command-line option: --resample=<value>
Environment variable: LW6_RESAMPLE
XML key: resample

Type: boolean

Default value: true

If set to true, maps will always be resampled to a size which depends on your screen resolution, zoom factor, and the rest. If false, maps will be set at the exact resolution of map.png.

4.12.16 speed

Command-line option: --speed=<value>
Environment variable: LW6_SPEED
XML key: speed

Type: float

Default value: 1.0

This parameter is the main parameter on which game speed depends. The map loader will garantee, by downscaling the map, that to cross the level (by crossing the level we mean, for instance, going from top-left corner to bottom-right corner in a straight line) a fighter will take a constant amount of time. Under the hood, the loader might of course rescale the map but it will also change game speed so that, at the end, fighters take a constant time to cross the level. This is, indeed, the most important thing, players do not care much if internally there are X or Y moves per second, the global game experience depends on how fast fighter movement looks on the screen. The default settings corresponds roughly to one second to cross the level. If you set this to 2.0, it will go twice faster.

4.12.17 system-color-auto

Command-line option: --system-color-auto=<value>
Environment variable: LW6_SYSTEM_COLOR_AUTO
XML key: system-color-auto

Type: boolean

Default value: true

Defines wether system colors will be set automatically from base and alternate colors. This is a time saver to keep map designers from requiring to redefined every single color in the game. You only need to set color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg. Then system_color_bg and system_color_fg will be automatically set.

4.12.18 upsize-using-bench-value

Command-line option: --upsize-using-bench-value=<value>
Environment variable: LW6_UPSIZE_USING_BENCH_VALUE
XML key: upsize-using-bench-value

Type: boolean

Default value: false

If set, then the game will automatically upsize a map according to the ’fighter-scale’ parameter. Upsizing means: a 160x120 maps becomes 400x300, for instance. Upsizing causes fighters to be smaller because map resolution is higher. This will avoid useless pixelish ’jumbo fighters’ look when your computer is powerfull enough to do better.

4.12.19 upsize-using-fighter-scale

Command-line option: --upsize-using-fighter-scale=<value>
Environment variable: LW6_UPSIZE_USING_FIGHTER_SCALE
XML key: upsize-using-fighter-scale

Type: boolean

Default value: true

If set, then the game will automatically upsize a map according to the ’fighter-scale’ parameter. Upsizing means: a 160x120 maps becomes 400x300, for instance. Upsizing causes fighters to be smaller because map resolution is higher. This can be usefull if you don’t want fighters to be too big.

4.12.20 view-color-auto

Command-line option: --view-color-auto=<value>
Environment variable: LW6_VIEW_COLOR_AUTO
XML key: view-color-auto

Type: boolean

Default value: true

Defines wether view colors will be set automatically from base and alternate colors. This is a time saver to keep map designers from requiring to redefined every single color in the game. You only need to set color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg. Then view_color_cursor_bg, view_color_cursor_fg, view_color_map_bg and view_color_map_fg will be automatically set.

4.12.21 wall-grease

Command-line option: --wall-grease=<value>
Environment variable: LW6_WALL_GREASE
XML key: wall-grease

Type: integer

Default value: 0 Min value: -5 Max value: 5

This parameter allows you to make walls (AKA map foreground) thicker, or thiner, when map is loaded. Indeed, when map are resampled, and especially when they are downscaled, some walls may disappear, or some passages may be blocked. The loader can’t automatically figure out wether it’s more important to keep an existing wall or to keep an open passage for fighters. This parameter helps doing so, if you set it to a low value, level will be less greasy, and many passages might open themselves. On the contrary, if grease is at a high level, then a thin line of almost isolated pixels might become a thick wall. There’s no real garantee your wall or passage will always be present, but it’s a same bet to assume on a ’tunnel-like’ level one needs to set grease to a low value, and on a ’wide open’ level with few walls one needs to set grease to a high value.


Next: , Previous: , Up: Reference   [Contents][Index]

4.13 Map style.xml

4.13.1 animation-density

Command-line option: --animation-density=<value>
Environment variable: LW6_ANIMATION_DENSITY
XML key: animation-density

Type: float

Default value: 1.0 Min value: 0 Max value: 10

Density of the background animation, that is, for instance, if the background animation is about displaying bubbles, using a high value will display many bubbles. A value of 1.0 corresponds to the default setting.

4.13.2 animation-speed

Command-line option: --animation-speed=<value>
Environment variable: LW6_ANIMATION_SPEED
XML key: animation-speed

Type: float

Default value: 1.0 Min value: 0 Max value: 10

Speed of the background animation, that is, for instance, if the background animation is about displaying bubbles, using a high value will cause bubbles to move very fast. A value of 1.0 corresponds to the default setting.

4.13.3 background-color-root-bg

Command-line option: --background-color-root-bg=<value>
Environment variable: LW6_BACKGROUND_COLOR_ROOT_BG
XML key: background-color-root-bg

Type: color

Default value: #000000

Defines the main background color. This is, for instance, the color which will be used to clear the screen before drawing thing. Will be automatically guessed from the map texture if color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.4 background-color-root-fg

Command-line option: --background-color-root-fg=<value>
Environment variable: LW6_BACKGROUND_COLOR_ROOT_FG
XML key: background-color-root-fg

Type: color

Default value: #cccccc

Defines a color which will be used together with color-base-bg to compose the background. It can be wise to have a minimum contrast between this color and color-base-bg, but it is not mandatory, especially if other colors are manually redefined. Will be automatically guessed from the map texture if color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.5 background-color-stuff-bg

Command-line option: --background-color-stuff-bg=<value>
Environment variable: LW6_BACKGROUND_COLOR_STUFF_BG
XML key: background-color-stuff-bg

Type: color

Default value: #333333

Defines a color which will be used together with color-alternate-fg to draw things (animations, sprites, text, whatever) in the background. It should be different enough from color-alternate-fg so that one can really distinguish these colors. Will be automatically guessed from the map texture if color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.6 background-color-stuff-fg

Command-line option: --background-color-stuff-fg=<value>
Environment variable: LW6_BACKGROUND_COLOR_STUFF_FG
XML key: background-color-stuff-fg

Type: color

Default value: #ffffff

Defines a color which will be used to draw things (animations, sprites, text, whatever) in the background. It should be different enough from color-alternate-bg so that one can really distinguish these colors. Think of this as the sprite, the text, the whatever-needs-to-be-seen-uses-this color. Will be automatically guessed from the map texture if color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.7 background-style

Command-line option: --background-style=<value>
Environment variable: LW6_BACKGROUND_STYLE
XML key: background-style

Type: string

Default value: bubbles

The background defines, of course, what is displayed at the background, but it also conditions the colors used for other items, such as the menus for instance. The possible values are ’void’ and ’bubbles’.

4.13.8 blink-cursor

Command-line option: --blink-cursor=<value>
Environment variable: LW6_BLINK_CURSOR
XML key: blink-cursor

Type: boolean

Default value: false

If set, then cursor will blink, allowing you to see what’s under the cursor. It’s just a matter of taste, you might to always have your cursor displayed, or prefer to have it disappear from time to time so that you can see the action below

4.13.9 color-alternate-bg

Command-line option: --color-alternate-bg=<value>
Environment variable: LW6_COLOR_ALTERNATE_BG
XML key: color-alternate-bg

Type: color

Default value: #333333

Defines the alternate color, more precisely, its bg (background) part. Colors are always defined by a bg/fg pair. Most colors in the game can be deduced from this one, usually to color a map you only need to define color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg.

4.13.10 color-alternate-fg

Command-line option: --color-alternate-fg=<value>
Environment variable: LW6_COLOR_ALTERNATE_FG
XML key: color-alternate-fg

Type: color

Default value: #ffffff

Defines the alternate color, more precisely, its fg (foreground) part. Colors are always defined by a bg/fg pair. Most colors in the game can be deduced from this one, usually to color a map you only need to define color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg.

4.13.11 color-base-bg

Command-line option: --color-base-bg=<value>
Environment variable: LW6_COLOR_BASE_BG
XML key: color-base-bg

Type: color

Default value: #000000

Defines the base color, more precisely, its bg (background) part. Colors are always defined by a bg/fg pair. Most colors in the game can be deduced from this one, usually to color a map you only need to define color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg.

4.13.12 color-base-fg

Command-line option: --color-base-fg=<value>
Environment variable: LW6_COLOR_BASE_FG
XML key: color-base-fg

Type: color

Default value: #cccccc

Defines the base color, more precisely, its fg (foreground) part. Colors are always defined by a bg/fg pair. Most colors in the game can be deduced from this one, usually to color a map you only need to define color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg.

4.13.13 colorize

Command-line option: --colorize=<value>
Environment variable: LW6_COLORIZE
XML key: colorize

Type: boolean

Default value: true

If set, then all background drawings including textures will use the background colors. This means, for instance, that if background colors are set automatically by color-auto from the map texture, then the background will adopt the same range of colors than the map itself. In short, the background will mimic the map.

4.13.14 colorize-cursor

Command-line option: --colorize-cursor=<value>
Environment variable: LW6_COLORIZE_CURSOR
XML key: colorize-cursor

Type: boolean

Default value: true

If set, then all cursors will use the automatic guessed colors, or the specified colors, but basically they won’t be displayed using their native colors. This can be usefull for you can wish to use a generic non-colored texture for your cursor and let it be colorized automatically so that it’s accorded to the level.

4.13.15 cursor-size

Command-line option: --cursor-size=<value>
Environment variable: LW6_CURSOR_SIZE
XML key: cursor-size

Type: float

Default value: 1.0 Min value: 0 Max value: 10

Size of the cursors on the map. 1 is the default, setting it to a higher value will make cursors bigger, a lower value will make them smaller.

4.13.16 hidden-layer-alpha

Command-line option: --hidden-layer-alpha=<value>
Environment variable: LW6_HIDDEN_LAYER_ALPHA
XML key: hidden-layer-alpha

Type: float

Default value: 0.1 Min value: 0 Max value: 1

Whenever players are supposed to be hidden behind a wall, for instance if they are in layer 2 and layer 1 is filled with walls, it’s still possible to see them, but with a low alpha value (almost transparent). This parameter allows you to trick this value, 0 will make these players absolutely invisible, 1 will make them totally opaque, like if they were on layer 1.

4.13.17 hud-color-frame-bg

Command-line option: --hud-color-frame-bg=<value>
Environment variable: LW6_HUD_COLOR_FRAME_BG
XML key: hud-color-frame-bg

Type: color

Default value: #000000

Defines the background color for the hud frame. Ignored if hud-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.18 hud-color-frame-fg

Command-line option: --hud-color-frame-fg=<value>
Environment variable: LW6_HUD_COLOR_FRAME_FG
XML key: hud-color-frame-fg

Type: color

Default value: #cccccc

Defines the foreground color for the hud frame. Ignored if hud-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.19 hud-color-text-bg

Command-line option: --hud-color-text-bg=<value>
Environment variable: LW6_HUD_COLOR_TEXT_BG
XML key: hud-color-text-bg

Type: color

Default value: #333333

Defines the background color for hud text. Ignored if hud-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.20 hud-color-text-fg

Command-line option: --hud-color-text-fg=<value>
Environment variable: LW6_HUD_COLOR_TEXT_FG
XML key: hud-color-text-fg

Type: color

Default value: #ffffff

Defines the foreground color for hud text. Ignored if hud-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.21 hud-style

Command-line option: --hud-style=<value>
Environment variable: LW6_HUD_STYLE
XML key: hud-style

Type: string

Default value: floating

The hud is where informations about the game are displayed. This means, who is winning, are other status-like informations. Possible values include ’floating’ and ’tactical’.

4.13.22 keep-ratio

Command-line option: --keep-ratio=<value>
Environment variable: LW6_KEEP_RATIO
XML key: keep-ratio

Type: boolean

Default value: true

Defines wether the map should keep its ratio, or if it should be stretched to fill the shape of your screen.

4.13.23 menu-color-default-bg

Command-line option: --menu-color-default-bg=<value>
Environment variable: LW6_MENU_COLOR_DEFAULT_BG
XML key: menu-color-default-bg

Type: color

Default value: #333333

Defines the default background color for menus. Ignored if menu-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.24 menu-color-default-fg

Command-line option: --menu-color-default-fg=<value>
Environment variable: LW6_MENU_COLOR_DEFAULT_FG
XML key: menu-color-default-fg

Type: color

Default value: #ffffff

Defines the default foreground color for menus. In fact, this is the main color for menu text, the color used to draw letters in menus. Ignored if menu-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.25 menu-color-disabled-bg

Command-line option: --menu-color-disabled-bg=<value>
Environment variable: LW6_MENU_COLOR_DISABLED_BG
XML key: menu-color-disabled-bg

Type: color

Default value: #000000

Defines the background color for a disabled menu item. Ignored if menu-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.26 menu-color-disabled-fg

Command-line option: --menu-color-disabled-fg=<value>
Environment variable: LW6_MENU_COLOR_DISABLED_FG
XML key: menu-color-disabled-fg

Type: color

Default value: #cccccc

Defines the foreground color for a disabled menu item. Ignored if menu-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.27 menu-color-selected-bg

Command-line option: --menu-color-selected-bg=<value>
Environment variable: LW6_MENU_COLOR_SELECTED_BG
XML key: menu-color-selected-bg

Type: color

Default value: #ffffff

Defines the background color for a selected menu item. Ignored if menu-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.28 menu-color-selected-fg

Command-line option: --menu-color-selected-fg=<value>
Environment variable: LW6_MENU_COLOR_SELECTED_FG
XML key: menu-color-selected-fg

Type: color

Default value: #333333

Defines the foreground color for a selected menu item. Ignored if menu-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.29 menu-style

Command-line option: --menu-style=<value>
Environment variable: LW6_MENU_STYLE
XML key: menu-style

Type: string

Default value: cylinder

The menu style is simply the name of the engine used to power the menu system. The only possible value, for now, is ’cylinder’.

4.13.30 music-exclude

Command-line option: --music-exclude=<value>
Environment variable: LW6_MUSIC_EXCLUDE
XML key: music-exclude

Type: string

Default value: Chadburn

If this string is found in a music file name, it will be excluded from the list when playing in random mode.

4.13.31 music-file

Command-line option: --music-file=<value>
Environment variable: LW6_MUSIC_FILE
XML key: music-file

Type: string

Default value:

Allows you to play a custom music file (typically your own ogg music) and override default game music. If file does not exist, game will use its internal music. The file will be searched for in the current ’music-path’ but also in the current map directory. No absolute or even relative path are allowed, only a plain filename with no slash or backslash. Avoid special characters at all cost.

4.13.32 music-filter

Command-line option: --music-filter=<value>
Environment variable: LW6_MUSIC_FILTER
XML key: music-filter

Type: string

Default value:

A music filter, used when files are played randomly. This is not a complex regex-enabled filter, just a plain string search. Even the ’*’ wildcard won’t work. If you want precise control on what music file to play, please consider reorganizing your files and/or use the ’music-file’ parameter.

4.13.33 pixelize

Command-line option: --pixelize=<value>
Environment variable: LW6_PIXELIZE
XML key: pixelize

Type: boolean

Default value: false

Depending on the renderer capabilities, will try to pixelize some parts of the game. This can be used to emulate the old LW5 appearance.

4.13.34 system-color-bg

Command-line option: --system-color-bg=<value>
Environment variable: LW6_SYSTEM_COLOR_BG
XML key: system-color-bg

Type: color

Default value: #333333

Defines the system background color, used when displaying system info, such as the number of frames per second. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.35 system-color-fg

Command-line option: --system-color-fg=<value>
Environment variable: LW6_SYSTEM_COLOR_FG
XML key: system-color-fg

Type: color

Default value: #ffffff

Defines the system foreground color, used when displaying system info, such as the number of frames per second. This will typically be text color. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.36 team-color-blue

Command-line option: --team-color-blue=<value>
Environment variable: LW6_TEAM_COLOR_BLUE
XML key: team-color-blue

Type: color

Default value: #0000ff

Defines the color for the blue team. Syntax is HTML-like, #RGB or #RRGGBB.

4.13.37 team-color-cyan

Command-line option: --team-color-cyan=<value>
Environment variable: LW6_TEAM_COLOR_CYAN
XML key: team-color-cyan

Type: color

Default value: #00ffff

Defines the color for the cyan team. Syntax is HTML-like, #RGB or #RRGGBB.

4.13.38 team-color-dead

Command-line option: --team-color-dead=<value>
Environment variable: LW6_TEAM_COLOR_DEAD
XML key: team-color-dead

Type: color

Default value: #000000

Defines the color for the teams when they are dead. By default it is black, this means when a team is weak it becomes black. Syntax is HTML-like, #RGB or #RRGGBB.

4.13.39 team-color-green

Command-line option: --team-color-green=<value>
Environment variable: LW6_TEAM_COLOR_GREEN
XML key: team-color-green

Type: color

Default value: #00ff00

Defines the color for the green team. Syntax is HTML-like, #RGB or #RRGGBB.

4.13.40 team-color-lightblue

Command-line option: --team-color-lightblue=<value>
Environment variable: LW6_TEAM_COLOR_LIGHTBLUE
XML key: team-color-lightblue

Type: color

Default value: #88bbff

Defines the color for the light blue team. Syntax is HTML-like, #RGB or #RRGGBB.

4.13.41 team-color-magenta

Command-line option: --team-color-magenta=<value>
Environment variable: LW6_TEAM_COLOR_MAGENTA
XML key: team-color-magenta

Type: color

Default value: #ff00ff

Defines the color for the magenta team. Syntax is HTML-like, #RGB or #RRGGBB.

4.13.42 team-color-orange

Command-line option: --team-color-orange=<value>
Environment variable: LW6_TEAM_COLOR_ORANGE
XML key: team-color-orange

Type: color

Default value: #ff8800

Defines the color for the orange team. Syntax is HTML-like, #RGB or #RRGGBB.

4.13.43 team-color-pink

Command-line option: --team-color-pink=<value>
Environment variable: LW6_TEAM_COLOR_PINK
XML key: team-color-pink

Type: color

Default value: #ff88bb

Defines the color for the pink team. Syntax is HTML-like, #RGB or #RRGGBB.

4.13.44 team-color-purple

Command-line option: --team-color-purple=<value>
Environment variable: LW6_TEAM_COLOR_PURPLE
XML key: team-color-purple

Type: color

Default value: #bb88ff

Defines the color for the purple team. Syntax is HTML-like, #RGB or #RRGGBB.

4.13.45 team-color-red

Command-line option: --team-color-red=<value>
Environment variable: LW6_TEAM_COLOR_RED
XML key: team-color-red

Type: color

Default value: #ff0000

Defines the color for the red team. Syntax is HTML-like, #RGB or #RRGGBB.

4.13.46 team-color-yellow

Command-line option: --team-color-yellow=<value>
Environment variable: LW6_TEAM_COLOR_YELLOW
XML key: team-color-yellow

Type: color

Default value: #ffff00

Defines the color for the yellow team. Syntax is HTML-like, #RGB or #RRGGBB.

4.13.47 view-color-cursor-bg

Command-line option: --view-color-cursor-bg=<value>
Environment variable: LW6_VIEW_COLOR_CURSOR_BG
XML key: view-color-cursor-bg

Type: color

Default value: #333333

Defines the background cursor color. Will typically be used to draw the shape of the cursor. Ignored if view-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.48 view-color-cursor-fg

Command-line option: --view-color-cursor-fg=<value>
Environment variable: LW6_VIEW_COLOR_CURSOR_FG
XML key: view-color-cursor-fg

Type: color

Default value: #ffffff

Defines the foreground cursor color. Will typically be used to draw text in the cursor. Ignored if view-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.49 view-color-map-bg

Command-line option: --view-color-map-bg=<value>
Environment variable: LW6_VIEW_COLOR_MAP_BG
XML key: view-color-map-bg

Type: color

Default value: #000000

Defines the background map color. If there’s no map texture defined or if use-texture is false, this is the color of the places where armies will go. Ignored if view-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.50 view-color-map-fg

Command-line option: --view-color-map-fg=<value>
Environment variable: LW6_VIEW_COLOR_MAP_FG
XML key: view-color-map-fg

Type: color

Default value: #cccccc

Defines the foreground map color. If there’s no map texture defined or if use-texture is false, this is the color of walls, what armies can’t go through. Ignored if view-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.

4.13.51 view-style

Command-line option: --view-style=<value>
Environment variable: LW6_VIEW_STYLE
XML key: view-style

Type: string

Default value: flat

The view style conditions which renderer is used for the map, the area where fighters are displayed. This is not the graphics backend. Indeed, the graphics backend defines which technical tool one uses (which library) one runs, wether this parameter says what kind of rendering one wants.

4.13.52 waves

Command-line option: --waves=<value>
Environment variable: LW6_WAVES
XML key: waves

Type: boolean

Default value: true

Activates the wave effect, that’s to say level appears to be under water when playing.

4.13.53 x-wrap

Command-line option: --x-wrap=<value>
Environment variable: LW6_X_WRAP
XML key: x-wrap

Type: boolean

Default value: true

Defines wether the map should be wrapped on the x axis. This is the companion of ’x-polarity’, if no polarity is defined, map can’t be wrapped, but in some cases, one might wish to have a map with polarity but without wrapping if, for instance, textures do not tile nicely.

4.13.54 y-wrap

Command-line option: --y-wrap=<value>
Environment variable: LW6_Y_WRAP
XML key: y-wrap

Type: boolean

Default value: true

Defines wether the map should be wrapped on the y axis. This is the companion of ’y-polarity’, if no polarity is defined, map can’t be wrapped, but in some cases, one might wish to have a map with polarity but without wrapping if, for instance, textures do not tile nicely.

4.13.55 zoom

Command-line option: --zoom=<value>
Environment variable: LW6_ZOOM
XML key: zoom

Type: float

Default value: 1.0

Defines the map zoom. If lower than 1.0, map will occupy only a fraction of the screen, if greater than 1.0, some areas will be outside the screen, and the player will need to scroll through it.

4.13.56 zoom-max

Command-line option: --zoom-max=<value>
Environment variable: LW6_ZOOM_MAX
XML key: zoom-max

Type: float

Default value: 30.0

Defines the max map zoom. If set to a high value, you’ll be able to dynamically view the map with hudge fighters, seeing only a fraction of the level.

4.13.57 zoom-min

Command-line option: --zoom-min=<value>
Environment variable: LW6_ZOOM_MIN
XML key: zoom-min

Type: float

Default value: 0.3

Defines the min map zoom. If set to a low value, you’ll be able to dynamically view a very small, reduced map.


Next: , Previous: , Up: Reference   [Contents][Index]

4.14 Map teams.xml

4.14.1 bot-iq

Command-line option: --bot-iq=<value>
Environment variable: LW6_BOT_IQ
XML key: bot-iq

Type: integer

Default value: 100 Min value: 0 Max value: 200

The IQ (intelligence quotient) of bots. Typically, a value of 100 will make the bot behave normally, performing at its best. A value of 0 will just make it act the worst way it can. Values over 100 probably won’t change anything compared to 100, but this truely depends on which bot backend you’re running.

4.14.2 bot-speed

Command-line option: --bot-speed=<value>
Environment variable: LW6_BOT_SPEED
XML key: bot-speed

Type: float

Default value: 1.0f

The speed of bots, 1 means normal speed, higher value will speed it up, lower will slow it down. Note that this only has an impact on bot engines, not on the game speed itself.

4.14.3 bot1-ai

Command-line option: --bot1-ai=<value>
Environment variable: LW6_BOT1_AI
XML key: bot1-ai

Type: string

Default value: idiot

AI engine for bot number 1.

4.14.4 bot1-color

Command-line option: --bot1-color=<value>
Environment variable: LW6_BOT1_COLOR
XML key: bot1-color

Type: string

Default value: green

Color for bot number 1.

4.14.5 bot2-ai

Command-line option: --bot2-ai=<value>
Environment variable: LW6_BOT2_AI
XML key: bot2-ai

Type: string

Default value: idiot

AI engine for bot number 2.

4.14.6 bot2-color

Command-line option: --bot2-color=<value>
Environment variable: LW6_BOT2_COLOR
XML key: bot2-color

Type: string

Default value: blue

Color for bot number 2.

4.14.7 bot3-ai

Command-line option: --bot3-ai=<value>
Environment variable: LW6_BOT3_AI
XML key: bot3-ai

Type: string

Default value: random

AI engine for bot number 3.

4.14.8 bot3-color

Command-line option: --bot3-color=<value>
Environment variable: LW6_BOT3_COLOR
XML key: bot3-color

Type: string

Default value: yellow

Color for bot number 3.

4.14.9 bot4-ai

Command-line option: --bot4-ai=<value>
Environment variable: LW6_BOT4_AI
XML key: bot4-ai

Type: string

Default value: follow

AI engine for bot number 4.

4.14.10 bot4-color

Command-line option: --bot4-color=<value>
Environment variable: LW6_BOT4_COLOR
XML key: bot4-color

Type: string

Default value: cyan

Color for bot number 4.

4.14.11 bot5-ai

Command-line option: --bot5-ai=<value>
Environment variable: LW6_BOT5_AI
XML key: bot5-ai

Type: string

Default value: random

AI engine for bot number 5.

4.14.12 bot5-color

Command-line option: --bot5-color=<value>
Environment variable: LW6_BOT5_COLOR
XML key: bot5-color

Type: string

Default value: magenta

Color for bot number 5.

4.14.13 bot6-ai

Command-line option: --bot6-ai=<value>
Environment variable: LW6_BOT6_AI
XML key: bot6-ai

Type: string

Default value: follow

AI engine for bot number 6.

4.14.14 bot6-color

Command-line option: --bot6-color=<value>
Environment variable: LW6_BOT6_COLOR
XML key: bot6-color

Type: string

Default value: orange

Color for bot number 6.

4.14.15 bot7-ai

Command-line option: --bot7-ai=<value>
Environment variable: LW6_BOT7_AI
XML key: bot7-ai

Type: string

Default value: idiot

AI engine for bot number 7.

4.14.16 bot7-color

Command-line option: --bot7-color=<value>
Environment variable: LW6_BOT7_COLOR
XML key: bot7-color

Type: string

Default value: lightblue

Color for bot number 7.

4.14.17 bot8-ai

Command-line option: --bot8-ai=<value>
Environment variable: LW6_BOT8_AI
XML key: bot8-ai

Type: string

Default value: idiot

AI engine for bot number 8.

4.14.18 bot8-color

Command-line option: --bot8-color=<value>
Environment variable: LW6_BOT8_COLOR
XML key: bot8-color

Type: string

Default value: purple

Color for bot number 8.

4.14.19 bot9-ai

Command-line option: --bot9-ai=<value>
Environment variable: LW6_BOT9_AI
XML key: bot9-ai

Type: string

Default value: idiot

AI engine for bot number 9.

4.14.20 bot9-color

Command-line option: --bot9-color=<value>
Environment variable: LW6_BOT9_COLOR
XML key: bot9-color

Type: string

Default value: pink

Color for bot number 9.

4.14.21 nb-bots

Command-line option: --nb-bots=<value>
Environment variable: LW6_NB_BOTS
XML key: nb-bots

Type: integer

Default value: 2 Min value: 0 Max value: 9

Number of bots on the map. 0 means no bots, if set to 1 the the bot1-... settings will be used, if set to 2 then bot1-... and bot2-... will be used, and so on.

4.14.22 player1-color

Command-line option: --player1-color=<value>
Environment variable: LW6_PLAYER1_COLOR
XML key: player1-color

Type: string

Default value: red

Color of the first player, must be red, green, blue, yellow, cyan, magenta, orange, lightblue, purple or pink

4.14.23 player2-color

Command-line option: --player2-color=<value>
Environment variable: LW6_PLAYER2_COLOR
XML key: player2-color

Type: string

Default value: green

Color of the second player, must be red, green, blue, yellow, cyan, magenta, orange, lightblue, purple or pink

4.14.24 player3-color

Command-line option: --player3-color=<value>
Environment variable: LW6_PLAYER3_COLOR
XML key: player3-color

Type: string

Default value: blue

Color of the third player, must be red, green, blue, yellow, cyan, magenta, orange, lightblue, purple or pink

4.14.25 player4-color

Command-line option: --player4-color=<value>
Environment variable: LW6_PLAYER4_COLOR
XML key: player4-color

Type: string

Default value: yellow

Color of the fourth player, must be red, green, blue, yellow, cyan, magenta, orange, lightblue, purple or pink


Next: , Previous: , Up: Reference   [Contents][Index]

4.15 Advanced settings

4.15.1 base64-decode

Command-line option: --base64-decode

If specified, program will take stdin and base64 decode it to stdout. This is for testing purpose (for network messages for instance). Will decode in standard base64 encoding using characters + and / but also the url-compliant version using - and /, see RFC 4648 for details.

4.15.2 base64-encode

Command-line option: --base64-encode

If specified, program will take stdin and base64 encode it to stdout. This is for testing purpose (for network messages for instance). Will *not* use standard base64 encoding using characters + and / but - and _ instead to be url-compliant, see RFC 4648 for details.

4.15.3 bench

Command-line option: --bench

Runs a benchmarking test which will report an approximative performance estimation of the game on your computer. The result is in an arbitrary unit, but it is logarithmic, and works the way the audio decibels do. That is, 30 is 10 times greater than 20. 10 is supposed to be a reference of a computer that can reasonnably run the game. So if you get 40, you are 1000 times powerfull enough. Negative values can technically show up on very slow computers.

4.15.4 bench-value

Command-line option: --bench-value=<value>
Environment variable: LW6_BENCH_VALUE
XML key: bench-value

Type: integer

Default value: LW6LDR_DEFAULT_BENCH_VALUE

Contains the current bench value of the computer running the game. This is used internally to choose the right map settings. You can override this value and use your own but... use at your own risk. Pretending you have a faster computer than what you really have can lead to confusion.

4.15.5 bin-id

Command-line option: --bin-id=<value>
Environment variable: LW6_BIN_ID
XML key: bin-id

Type: integer

Default value: 0

The internal ’bin-id’ value. Note that this is not necessarly equal to the value returned by ’show-build-bin-id’. When they are different, it is assumed this is because of a software upgrade.

4.15.6 check

Command-line option: --check

Running the game with ’–check’ is almost like running ’–test’, the difference is that ’–check’ will not run tests which involve graphics or sound backends, so it’s adapted to pure console mode. This can be usefull for automated checks on a build farm, or if you want to check things in a headless (pure console) environment.

4.15.7 commands-per-sec

Command-line option: --commands-per-sec=<value>
Environment variable: LW6_COMMANDS_PER_SEC
XML key: commands-per-sec

Type: integer

Default value: 10 Min value: 1 Max value: 1000

Defines the number of commands per second. When a command is generated, orders are actually sent to the game engine, for instance, ’this cursor moved there’. So this option will affect game responsiveness, setting this to a high value will make the game more responsive but consume bandwidth on network games.

4.15.8 cunit

Command-line option: --cunit

Running the game with ’–cunit’ is almost like running ’–test’, the difference is that ’–cunit’ will use CUnit interactive interface, allowing the user to cherry-pick some tests, and avoid running the whole suite just for one test. This can be usefull for debugging, when individual test binaries are not available.

4.15.9 daemon

Command-line option: --daemon

Start the game in daemon mode, this is typically used with the server mode, if you want the process to be detached from the console and executed in the background.

4.15.10 debug-layer-id

Command-line option: --debug-layer-id=<value>
Environment variable: LW6_DEBUG_LAYER_ID
XML key: debug-layer-id

Type: integer

Default value: 0 Min value: 0 Max value: 6

A team id which will be used for debugging purposes, for instance when displaying gradient.

4.15.11 debug-team-id

Command-line option: --debug-team-id=<value>
Environment variable: LW6_DEBUG_TEAM_ID
XML key: debug-team-id

Type: integer

Default value: 0 Min value: 0 Max value: 9

A team id which will be used for debugging purposes, for instance when displaying gradient.

4.15.12 demo

Command-line option: --demo

Start the game in demo mode. 2 bots play against each other forever.

4.15.13 dialog-timeout

Command-line option: --dialog-timeout=<value>
Environment variable: LW6_DIALOG_TIMEOUT
XML key: dialog-timeout

Type: integer

Default value: 3600 Min value: 0 Max value: 86400

Timeout, in seconds, after which a dialog will automatically be closed, wether user clicked on it or not. Mostly used for testing, to avoid program being stall on a visual prompt. 0 will simply disable this feature and wait forever. Note that some platforms might not support this. Interfaces using Gtk do support it.

4.15.14 dirty-read

Command-line option: --dirty-read=<value>
Environment variable: LW6_DIRTY_READ
XML key: dirty-read

Type: integer

Default value: 2 Min value: 0 Max value: 2

How to handle dirty reads and locks when displaying stuff. If set to 0, there will be no dirty reads at all, a lock (mutex) will be set whenever it’s needed. If set to 1, display might be done with inconsistent data, however the data itself won’t be modified while displaying. If set to 2, displayed data can (and will) be modified while the rendering thread is running.

4.15.15 display-background

Command-line option: --display-background=<value>
Environment variable: LW6_DISPLAY_BACKGROUND
XML key: display-background

Type: boolean

Default value: true

Decides wether the background animation/image should be displayed at all.

4.15.16 display-console

Command-line option: --display-console=<value>
Environment variable: LW6_DISPLAY_CONSOLE
XML key: display-console

Type: boolean

Default value: false

Defines wether the interactive system console must be displayed. Note that console support must have been enabled at compilation time. It might not be available on your computer, for instance if you are running a system such as Microsoft Windows.

4.15.17 display-cursors

Command-line option: --display-cursors=<value>
Environment variable: LW6_DISPLAY_CURSORS
XML key: display-cursors

Type: boolean

Default value: true

Debugging option which can be set to ’false’ to disable the display of cursors when playing.

4.15.18 display-debug-gradient

Command-line option: --display-debug-gradient=<value>
Environment variable: LW6_DISPLAY_DEBUG_GRADIENT
XML key: display-debug-gradient

Type: boolean

Default value: false

Set this to ’true’ to display the gradient, this is usefull to debug the core algorithm or understand how it works.

4.15.19 display-debug-zones

Command-line option: --display-debug-zones=<value>
Environment variable: LW6_DISPLAY_DEBUG_ZONES
XML key: display-debug-zones

Type: boolean

Default value: false

Set this to ’true’ to display the zones, this is usefull to debug the core algorithm or understand how it works.

4.15.20 display-fighters

Command-line option: --display-fighters=<value>
Environment variable: LW6_DISPLAY_FIGHTERS
XML key: display-fighters

Type: boolean

Default value: true

Debugging option which can be set to ’false’ to disable the display of fighters when playing.

4.15.21 display-fps

Command-line option: --display-fps=<value>
Environment variable: LW6_DISPLAY_FPS
XML key: display-fps

Type: boolean

Default value: false

Set this to ’true’ to display the number of frames per second. When this gets too low... play a smaller map, buy a new computer or contribute and hack Liquid War 6 so that it runs faster!

4.15.22 display-hud

Command-line option: --display-hud=<value>
Environment variable: LW6_DISPLAY_HUD
XML key: display-hud

Type: boolean

Default value: true

Decides wether the hud (informations while playing) should be displayed.

4.15.23 display-log

Command-line option: --display-log=<value>
Environment variable: LW6_DISPLAY_LOG
XML key: display-log

Type: boolean

Default value: true

Set this to ’false’ to disable the display of error messages on the screen. Mote that you can miss valuable informations.

4.15.24 display-map

Command-line option: --display-map=<value>
Environment variable: LW6_DISPLAY_MAP
XML key: display-map

Type: boolean

Default value: true

Debugging option which can be set to ’false’ to disable map (level) display when playing.

4.15.25 display-menu

Command-line option: --display-menu=<value>
Environment variable: LW6_DISPLAY_MENU
XML key: display-menu

Type: boolean

Default value: true

Debugging option which can be set to ’false’ to disable the display of menus.

4.15.26 display-meta

Command-line option: --display-meta=<value>
Environment variable: LW6_DISPLAY_META
XML key: display-meta

Type: boolean

Default value: true

Set to ’false’ to disable the display of meta information, this includes the help, tootips and breadcrumbs in menus.

4.15.27 display-mouse

Command-line option: --display-mouse=<value>
Environment variable: LW6_DISPLAY_MOUSE
XML key: display-mouse

Type: boolean

Default value: true

Set this to ’false’ to always hide the mouse pointer.

4.15.28 display-mps

Command-line option: --display-mps=<value>
Environment variable: LW6_DISPLAY_MPS
XML key: display-mps

Type: boolean

Default value: false

Set this to ’true’ to display the number of moves per second. In theory the game should maintain this constant but in practise it can get low if your computer is too slow or too busy.

4.15.29 display-preview

Command-line option: --display-preview=<value>
Environment variable: LW6_DISPLAY_PREVIEW
XML key: display-preview

Type: boolean

Default value: true

Decides wether a map preview should be displayed when choosing a level.

4.15.30 display-progress

Command-line option: --display-progress=<value>
Environment variable: LW6_DISPLAY_PROGRESS
XML key: display-progress

Type: boolean

Default value: true

Decides wether a progress bar should be displayed when a long operation is realized as a background task.

4.15.31 display-score

Command-line option: --display-score=<value>
Environment variable: LW6_DISPLAY_SCORE
XML key: display-score

Type: boolean

Default value: true

Decides wether the score screen should be displayed.

4.15.32 display-splash

Command-line option: --display-splash=<value>
Environment variable: LW6_DISPLAY_SPLASH
XML key: display-splash

Type: boolean

Default value: true

Set this to ’false’ to disable the display of the splash screen at game startup.

4.15.33 display-url

Command-line option: --display-url=<value>
Environment variable: LW6_DISPLAY_URL
XML key: display-url

Type: boolean

Default value: false

Set this to ’true’ to display the URL (homepage) of the game. This is mostly used when doing screenshots, so that generated images contain a link to the homepage.

4.15.34 executed-again

Command-line option: --executed-again=<value>
Environment variable: LW6_EXECUTED_AGAIN
XML key: executed-again

Type: boolean

Default value: false

This environment variable/keyword is used to detect wether the program has been launched by itself with an internal execv call. This is used as a workarround to set some environment variables (DYLD_LIBRARY_PATH on Mac OS X for instance) before the program is run, as sometimes using setenv() inside the program does not work.

4.15.35 gfx-cpu-usage

Command-line option: --gfx-cpu-usage=<value>
Environment variable: LW6_GFX_CPU_USAGE
XML key: gfx-cpu-usage

Type: float

Default value: 0.75 Min value: 0 Max value: 1

Percentage of the CPU which will be used by the display thread. It’s wise to leave some time to other threads to execute. The OS does it naturally, but setting this helps the whole process by explicitely pausing (sleep call) the display thread. You could change this to a low value if you have lagging games but smooth display.

4.15.36 gfx-debug

Command-line option: --gfx-debug=<value>
Environment variable: LW6_GFX_DEBUG
XML key: gfx-debug

Type: boolean

Default value: false

Enables dedicated graphics debugging tools. This is different from ’debug’ mode which is global, this one is really graphics specific.

4.15.37 io-per-sec

Command-line option: --io-per-sec=<value>
Environment variable: LW6_IO_PER_SEC
XML key: io-per-sec

Type: integer

Default value: 20 Min value: 1 Max value: 1000

Defines the number of calls to input/output functions per second. This can affect speed of menus but also cursors, but won’t change the speed of the game itself. It’s a cosmectic, comfort option.

4.15.38 jpeg-quality

Command-line option: --jpeg-quality=<value>
Environment variable: LW6_JPEG_QUALITY
XML key: jpeg-quality

Type: integer

Default value: 85 Min value: 0 Max value: 85

Quality used by libjpeg when creating screenshot images. The same value you would give to Gimp before exporting an image as a JPEG.

4.15.39 loader-sleep

Command-line option: --loader-sleep=<value>
Environment variable: LW6_LOADER_SLEEP
XML key: loader-sleep

Type: float

Default value: 0.5

Defines how long the loader thread should wait between two polls. Default value should fit in most cases.

4.15.40 local-bench-delta

Command-line option: --local-bench-delta=<value>
Environment variable: LW6_LOCAL_BENCH_DELTA
XML key: local-bench-delta

Type: integer

Default value: 0 Min value: -70 Max value: 20

A value which is added to bench before starting a local game. This is typically zero or negative, as adding to bench is like pretending your computer is faster than it really is.

4.15.41 log-level

Command-line option: --log-level=<value>
Environment variable: LW6_LOG_LEVEL
XML key: log-level

Type: integer

Default value: 3 Min value: 0 Max value: 4

Defines the log level, that is, how verbose the program will be regarding logs and console output. 0 (ERROR) is the minimum, only errors are reported. 1 (WARNING) means errors + warnings. 2 (NOTICE) displays most important messages. 3 (INFO) is the default, the log file will contain all messages but debug stuff. 4 (DEBUG) logs everything, including debug informations.

4.15.42 log-timeout

Command-line option: --log-timeout=<value>
Environment variable: LW6_LOG_TIMEOUT
XML key: log-timeout

Type: integer

Default value: 5000

Delay, in msec, for which a log message will stay displayed on the screen.

4.15.43 magic-number

Command-line option: --magic-number=<value>
Environment variable: LW6_MAGIC_NUMBER
XML key: magic-number

Type: integer

Default value: LW6LDR_DEFAULT_MAGIC_NUMBER

This ’magic’ number probably requires an explanation. It’s used to estimate how big a map can be built. The calculus is very approximative, basically bench_value*magic_number=total_fighters_on_map*rounds_per_sec*moves_per_round with total_fighters_on_map depending on various parameters such as map size but also how many fighters are on the map. The map loader will try and adjust the map size so that it is just big enough not to saturate your CPU while being as high-res as possible. The magic number in itself has no real meaning, the higher it gets, the more optimized it means the game is. Normally you shouldn’t change this but if you find the map resizing is too agressively pessimistic, or if for some reason bench returns bogus values, you can modify it.

4.15.44 max-local-bench-value

Command-line option: --max-local-bench-value=<value>
Environment variable: LW6_MAX_LOCAL_BENCH_VALUE
XML key: max-local-bench-value

Type: integer

Default value: LW6LDR_DEFAULT_MAX_LOCAL_BENCH_VALUE

Even if your computer is very fast, this parameter will be used to tame the optimism of the test, and do not load maps in very high detail. It’s believed at some point, it’s best to keep your extra power to deal with unordinary situations rather than waste it on useless details. Game should be fun with that setting, but if you really want to use your shiny CPU at its maximum, raise this.

4.15.45 max-network-bench-value

Command-line option: --max-network-bench-value=<value>
Environment variable: LW6_MAX_NETWORK_BENCH_VALUE
XML key: max-network-bench-value

Type: integer

Default value: LW6LDR_DEFAULT_MAX_NETWORK_BENCH_VALUE

On network games, we need to be sure everyone can play in correct conditions, therefore maps won’t be loaded with more details than this, by default. You’re free to increase this parameter but it can cause your games to be unjoignable by some people.

4.15.46 memory-bazooka-eraser

Command-line option: --memory-bazooka-eraser=<value>
Environment variable: LW6_MEMORY_BAZOOKA_ERASER
XML key: memory-bazooka-eraser

Type: boolean

Default value: true

The memory eraser is a tool which will systematically fill allocated memory with ’M’, and overwrite all allocated bytes with ’F’ before freeing memory. It will even handle realloc calls. This is usefull to track bugs. Indeed, with this option enabled, freshly allocated memory will never contain zeroes unless one calls calloc, and if you ever free some memory zone before being done with it, it will be filled with junk and therefore not be usable. The memory bazooka must be big enough if you want this feature to actually work.

4.15.47 memory-bazooka-size

Command-line option: --memory-bazooka-size=<value>
Environment variable: LW6_MEMORY_BAZOOKA_SIZE
XML key: memory-bazooka-size

Type: integer

Default value: 99991

The memory bazooka is a brute-force tool, conceived after a full night spent tracking some memory leak. The idea is to keep a track of all allocated pointers, when the data was allocated (timestamp), where in the code (file, line), and even point out what data there is in that place. A memory bazooka report at the end of the game will just show what’s left. There should be nothing. This parameter is here to avoid wasting CPU cycles on a feature which is very debug-oriented and does not really make sense for the casual user. Set it to 0 for best performance, something like 100 might just be helpfull, but 1000000 is the right way to seriously debug code.

4.15.48 net-log

Command-line option: --net-log=<value>
Environment variable: LW6_NET_LOG
XML key: net-log

Type: boolean

Default value: false

Activates network log, that is, logs everything sent/received over the network, except data which is sent through a third party library such as libCurl. This is mostly for debugging purpose, it can lead to rather big log files.

4.15.49 net-per-sec

Command-line option: --net-per-sec=<value>
Environment variable: LW6_NET_PER_SEC
XML key: net-per-sec

Type: integer

Default value: 500 Min value: 1 Max value: 1000

Defines the number of calls to network functions per second. This can technically change the network transfers speed, the higher the number, the faster it should be, but at the same time it can technically be more CPU greedy.

4.15.50 network-bench-delta

Command-line option: --network-bench-delta=<value>
Environment variable: LW6_NETWORK_BENCH_DELTA
XML key: network-bench-delta

Type: integer

Default value: -5 Min value: -70 Max value: 20

A value which is added to bench before starting a network game. This is typically a negative value, lower than the one added to local game. This is because network games can be more CPU greedy.

4.15.51 network-reliability

Command-line option: --network-reliability=<value>
Environment variable: LW6_NETWORK_RELIABILITY
XML key: network-reliability

Type: integer

Default value: 1000 Min value: 1 Max value: 1000000000

The program assumes network is non-reliable, however the problem with those assumptions is that when you test, network is always reliable, even with non-garanteed protocols like UDP. This option will force the program to actually ignore some calls to send or recv functions, simulating a network disfunction. This is to ensure the internal mecanisms correcting network problems do work for good, on daily regular use. It’s not possible to set it to a perfect behavior, never dropping any packet, however using the default settings you probably won’t even notice the performance drop induced by having to fix problems. The highest the number is, the most reliable network will look, the algorithm is simply to drop one message out of X.

4.15.52 open-relay

Command-line option: --open-relay=<value>
Environment variable: LW6_OPEN_RELAY
XML key: open-relay

Type: boolean

Default value: false

Enables forwarding of abritrary network messages. If open relay is forbidden, the game will only forward messages when physical sender and logical sender are the same. This is to say if messages come from A for C and is sent by A to B, B will forward it to C. But if message comes from X to C and is sent by A to B, then B won’t forward it. In practice, it means without open relay, messages can only be forwarded once.

4.15.53 pilot-lag

Command-line option: --pilot-lag=<value>
Environment variable: LW6_PILOT_LAG
XML key: pilot-lag

Type: integer

Default value: 10

Maximum lag, in rounds, until the game engine is slowed down. This will typically be usefull if your computer is too slow for the map resolution and the game speed you set up.

4.15.54 quick-start

Command-line option: --quick-start

Start the game just like if the player had requested a quick start, without showing any menu.

4.15.55 reset

Command-line option: --reset

Clears the config file so that the game will run with defaults next time. The idea is to get rid of traces of previous executions. The difference with ’–defaults’ is that ’–reset’ does not run the game, while ’–defaults’ does.

4.15.56 reset-config-on-upgrade

Command-line option: --reset-config-on-upgrade=<value>
Environment variable: LW6_RESET_CONFIG_ON_UPGRADE
XML key: reset-config-on-upgrade

Type: boolean

Default value: true

If set, then a reset (config file set to defaults) is run every time you upgrade the game.

4.15.57 screenshots-per-min

Command-line option: --screenshots-per-min=<value>
Environment variable: LW6_SCREENSHOTS_PER_MIN
XML key: screenshots-per-min

Type: integer

Default value: 12

Defines the number of screenshots / node info per minute. This can a quite costly operation, but still it must not be too low else screenshots are too outdated.

4.15.58 server

Command-line option: --server

Start the game in server mode, without requiring any graphics backend. Server mode is usefull if you just want to start a network node without hosting any real game on it. It can be used to list existing nodes and sessions or as a bounce server in case some clients can’t contact each other because firewalled. If you only want to start a server game on your computer, don’t use this option, just start the game normally and start a game server by clicking on the GUI buttons.

4.15.59 simulate-basic

Command-line option: --simulate-basic

Simulates some fights using the basic colors red, green, yellow and blue. Will output on the console a percentage based on scores obtained by the teams. This is typically for map designers and/or people who want to fiddle with team profiles, if some team is really stronger than another one, it should appear in these percentages.

4.15.60 simulate-full

Command-line option: --simulate-full

Simulates some fights using all available colors. This can be very long, it will run approximatively 1000 games consecutively, you can look in the log file to see the progress. Will output on the console a percentage based on scores obtained by the teams. This is typically for map designers and/or people who want to fiddle with team profiles, if some team is really stronger than another one, it should appear in these percentages.

4.15.61 target-fps

Command-line option: --target-fps=<value>
Environment variable: LW6_TARGET_FPS
XML key: target-fps

Type: integer

Default value: 60 Min value: 1 Max value: 1000

Defines how many frames will be displayed per second. Of course this is a maximum value, if your hardware can’t keep up with this value, display will just be slow, no matter what value you define here. Note that you might really wish to have something rather low here, to keep network and ’logic’ function responsiveness. Passed 60 frames per second, speed is really only for visual comfort, as Liquid War 6 is now so fast-paced that it requires 200 frames/sec to outperform opponents.

4.15.62 trap-errors

Command-line option: --trap-errors=<value>
Environment variable: LW6_TRAP_ERRORS
XML key: trap-errors

Type: boolean

Default value: false

If set to true, will trap segmentation fault and floating point errors, and display messages about those in a custom box instead of the default one

4.15.63 trojan

Command-line option: --trojan=<value>
Environment variable: LW6_TROJAN
XML key: trojan

Type: boolean

Default value: false

Make the program act like a (stupid) trojan horse, trying to fake messages, sending various inconsistent informations. This is to check the normal version of the program is able to detect such a fake and kick it out of the game. It’s of no use for regular players, be sure to unset this if you want to play for good.

4.15.64 z-decode

Command-line option: --z-decode

If specified, program will take stdin and z-decode it to stdout. This is for testing purpose (for network messages for instance). Z-decoding, here means verifying there a Z at the beginning, base64 decode and pass the content through Zlib inflating. I content is not Z-prefixed, will be returned as is.

4.15.65 z-encode

Command-line option: --z-encode

If specified, program will take stdin and z-encode it to stdout. This is for testing purpose (for network messages for instance). Z-encoding, here means passing the message through Zlib deflating then base64 encoding and prefix it with a Z.


Next: , Previous: , Up: Reference   [Contents][Index]

4.16 C to Guile

4.16.1 c-gettext

C function exported to Guile: c-gettext

Calls GNU gettext to convert string in current locale. Note that ’_’ (plain underscode) is exported as well, so that code can be written using ’_’ as a function.

4.16.2 c-lw6-exit

C function exported to Guile: c-lw6-exit

Wrapper on lw6_exit.

4.16.3 c-lw6-get-ret

C function exported to Guile: c-lw6-get-ret

Wrapper on lw6_get_ret.

4.16.4 c-lw6-release

C function exported to Guile: c-lw6-release

Wrapper on lw6_release.

4.16.5 c-lw6-set-ret

C function exported to Guile: c-lw6-set-ret

Wrapper on lw6_set_ret.

4.16.6 c-lw6bot-get-backends

C function exported to Guile: c-lw6bot-get-backends

Wrapper on lw6bot_get_backends.

4.16.7 c-lw6bot-new

C function exported to Guile: c-lw6bot-new

Wrapper on lw6bot_new.

4.16.8 c-lw6bot-next-move

C function exported to Guile: c-lw6bot-next-move

Wrapper on lw6bot_next_move.

4.16.9 c-lw6cfg-defaults

C function exported to Guile: c-lw6cfg-defaults

Wrapper on lw6cfg_defaults.

4.16.10 c-lw6cfg-get-option

C function exported to Guile: c-lw6cfg-get-option

Wrapper on lw6cfg_get_option.

4.16.11 c-lw6cfg-init

C function exported to Guile: c-lw6cfg-init

Wrapper on lw6cfg_init.

4.16.12 c-lw6cfg-load

C function exported to Guile: c-lw6cfg-load

Wrapper on lw6cfg_load.

4.16.13 c-lw6cfg-option-exists

C function exported to Guile: c-lw6cfg-option-exists

Wrapper on lw6cfg_option_exists.

4.16.14 c-lw6cfg-quit

C function exported to Guile: c-lw6cfg-quit

Wrapper on lw6cfg_quit.

4.16.15 c-lw6cfg-save

C function exported to Guile: c-lw6cfg-save

Wrapper on lw6cfg_save.

4.16.16 c-lw6cfg-set-option

C function exported to Guile: c-lw6cfg-set-option

Wrapper on lw6cfg_set_option.

4.16.17 c-lw6cfg-unified-get-log-file

C function exported to Guile: c-lw6cfg-unified-get-log-file

Wrapper on lw6cfg_unified_get_log_file.

4.16.18 c-lw6cfg-unified-get-map-path

C function exported to Guile: c-lw6cfg-unified-get-map-path

Wrapper on lw6cfg_unified_get_map_path.

4.16.19 c-lw6cfg-unified-get-music-path

C function exported to Guile: c-lw6cfg-unified-get-music-path

Wrapper on lw6cfg_unified_get_music_path.

4.16.20 c-lw6cfg-unified-get-user-dir

C function exported to Guile: c-lw6cfg-unified-get-user-dir

Wrapper on lw6cfg_unified_get_user_dir.

4.16.21 c-lw6cli-get-backends

C function exported to Guile: c-lw6cli-get-backends

Wrapper on lw6cli_get_backends.

4.16.22 c-lw6cns-console-support

C function exported to Guile: c-lw6cns-console-support

Wrapper on lw6cns_console_support.

4.16.23 c-lw6cns-init

C function exported to Guile: c-lw6cns-init

Wrapper on lw6cns_init.

4.16.24 c-lw6cns-poll

C function exported to Guile: c-lw6cns-poll

Wrapper on lw6cns_poll.

4.16.25 c-lw6cns-quit

C function exported to Guile: c-lw6cns-quit

Wrapper on lw6cns_quit.

4.16.26 c-lw6cns-term-support

C function exported to Guile: c-lw6cns-term-support

Wrapper on lw6cns_term_support.

4.16.27 c-lw6dsp-get-average-fps

C function exported to Guile: c-lw6dsp-get-average-fps

Wrapper on lw6dsp_get_average_fps.

4.16.28 c-lw6dsp-get-fullscreen-modes

C function exported to Guile: c-lw6dsp-get-fullscreen-modes

Wrapper on lw6dsp_get_fullscreen_modes.

4.16.29 c-lw6dsp-get-instant-fps

C function exported to Guile: c-lw6dsp-get-instant-fps

Wrapper on lw6dsp_get_instant_fps.

4.16.30 c-lw6dsp-get-last-frame-rendering-time

C function exported to Guile: c-lw6dsp-get-last-frame-rendering-time

Wrapper on lw6dsp_get_last_frame_rendering_time.

4.16.31 c-lw6dsp-get-nb-frames

C function exported to Guile: c-lw6dsp-get-nb-frames

Wrapper on lw6dsp_get_nb_frames.

4.16.32 c-lw6dsp-get-video-mode

C function exported to Guile: c-lw6dsp-get-video-mode

Wrapper on lw6dsp_get_video_mode.

4.16.33 c-lw6dsp-new

C function exported to Guile: c-lw6dsp-new

Wrapper on lw6dsp_new.

4.16.34 c-lw6dsp-release

C function exported to Guile: c-lw6dsp-release

Wrapper on lw6dsp_release.

4.16.35 c-lw6dsp-update

C function exported to Guile: c-lw6dsp-update

Wrapper on lw6dsp_update.

4.16.36 c-lw6gen-create-from-seed

C function exported to Guile: c-lw6gen-create-from-seed

Wrapper on lw6gen_create_from_seed.

4.16.37 c-lw6gen-seed-new

C function exported to Guile: c-lw6gen-seed-new

Wrapper on lw6gen_seed_new.

4.16.38 c-lw6gen-seed-normalize

C function exported to Guile: c-lw6gen-seed-normalize

Wrapper on lw6gen_seed_normalize.

4.16.39 c-lw6gfx-get-backends

C function exported to Guile: c-lw6gfx-get-backends

Wrapper on lw6gfx_get_backends.

4.16.40 c-lw6gui-default-look

C function exported to Guile: c-lw6gui-default-look

Wrapper on lw6gui_default_look.

4.16.41 c-lw6gui-input-reset

C function exported to Guile: c-lw6gui-input-reset

Wrapper on lw6gui_input_reset.

4.16.42 c-lw6gui-joystick1-get-move-pad

C function exported to Guile: c-lw6gui-joystick1-get-move-pad

Wrapper on lw6gui_joystick1_get_move_pad.

4.16.43 c-lw6gui-joystick1-pop-button-a

C function exported to Guile: c-lw6gui-joystick1-pop-button-a

Wrapper on lw6gui_joystick1_pop_button_a.

4.16.44 c-lw6gui-joystick1-pop-button-b

C function exported to Guile: c-lw6gui-joystick1-pop-button-b

Wrapper on lw6gui_joystick1_pop_button_b.

4.16.45 c-lw6gui-joystick1-pop-button-c

C function exported to Guile: c-lw6gui-joystick1-pop-button-c

Wrapper on lw6gui_joystick1_pop_button_c.

4.16.46 c-lw6gui-joystick1-pop-button-d

C function exported to Guile: c-lw6gui-joystick1-pop-button-d

Wrapper on lw6gui_joystick1_pop_button_d.

4.16.47 c-lw6gui-joystick1-pop-button-e

C function exported to Guile: c-lw6gui-joystick1-pop-button-e

Wrapper on lw6gui_joystick1_pop_button_e.

4.16.48 c-lw6gui-joystick1-pop-button-f

C function exported to Guile: c-lw6gui-joystick1-pop-button-f

Wrapper on lw6gui_joystick1_pop_button_f.

4.16.49 c-lw6gui-joystick1-pop-pad-down

C function exported to Guile: c-lw6gui-joystick1-pop-pad-down

Wrapper on lw6gui_joystick1_pop_pad_down.

4.16.50 c-lw6gui-joystick1-pop-pad-left

C function exported to Guile: c-lw6gui-joystick1-pop-pad-left

Wrapper on lw6gui_joystick1_pop_pad_left.

4.16.51 c-lw6gui-joystick1-pop-pad-right

C function exported to Guile: c-lw6gui-joystick1-pop-pad-right

Wrapper on lw6gui_joystick1_pop_pad_right.

4.16.52 c-lw6gui-joystick1-pop-pad-up

C function exported to Guile: c-lw6gui-joystick1-pop-pad-up

Wrapper on lw6gui_joystick1_pop_pad_up.

4.16.53 c-lw6gui-joystick2-get-move-pad

C function exported to Guile: c-lw6gui-joystick2-get-move-pad

Wrapper on lw6gui_joystick2_get_move_pad.

4.16.54 c-lw6gui-joystick2-pop-button-a

C function exported to Guile: c-lw6gui-joystick2-pop-button-a

Wrapper on lw6gui_joystick2_pop_button_a.

4.16.55 c-lw6gui-joystick2-pop-button-b

C function exported to Guile: c-lw6gui-joystick2-pop-button-b

Wrapper on lw6gui_joystick2_pop_button_b.

4.16.56 c-lw6gui-joystick2-pop-button-c

C function exported to Guile: c-lw6gui-joystick2-pop-button-c

Wrapper on lw6gui_joystick2_pop_button_c.

4.16.57 c-lw6gui-joystick2-pop-button-d

C function exported to Guile: c-lw6gui-joystick2-pop-button-d

Wrapper on lw6gui_joystick2_pop_button_d.

4.16.58 c-lw6gui-joystick2-pop-button-e

C function exported to Guile: c-lw6gui-joystick2-pop-button-e

Wrapper on lw6gui_joystick2_pop_button_e.

4.16.59 c-lw6gui-joystick2-pop-button-f

C function exported to Guile: c-lw6gui-joystick2-pop-button-f

Wrapper on lw6gui_joystick2_pop_button_f.

4.16.60 c-lw6gui-joystick2-pop-pad-down

C function exported to Guile: c-lw6gui-joystick2-pop-pad-down

Wrapper on lw6gui_joystick2_pop_pad_down.

4.16.61 c-lw6gui-joystick2-pop-pad-left

C function exported to Guile: c-lw6gui-joystick2-pop-pad-left

Wrapper on lw6gui_joystick2_pop_pad_left.

4.16.62 c-lw6gui-joystick2-pop-pad-right

C function exported to Guile: c-lw6gui-joystick2-pop-pad-right

Wrapper on lw6gui_joystick2_pop_pad_right.

4.16.63 c-lw6gui-joystick2-pop-pad-up

C function exported to Guile: c-lw6gui-joystick2-pop-pad-up

Wrapper on lw6gui_joystick2_pop_pad_up.

4.16.64 c-lw6gui-keyboard-get-move-pad

C function exported to Guile: c-lw6gui-keyboard-get-move-pad

Wrapper on lw6gui_keyboard_get_move_pad.

4.16.65 c-lw6gui-keyboard-is-pressed

C function exported to Guile: c-lw6gui-keyboard-is-pressed

Wrapper on lw6gui_keyboard_is_pressed.

4.16.66 c-lw6gui-keyboard-pop-arrow-down

C function exported to Guile: c-lw6gui-keyboard-pop-arrow-down

Wrapper on lw6gui_keyboard_pop_arrow_down.

4.16.67 c-lw6gui-keyboard-pop-arrow-left

C function exported to Guile: c-lw6gui-keyboard-pop-arrow-left

Wrapper on lw6gui_keyboard_pop_arrow_left.

4.16.68 c-lw6gui-keyboard-pop-arrow-right

C function exported to Guile: c-lw6gui-keyboard-pop-arrow-right

Wrapper on lw6gui_keyboard_pop_arrow_right.

4.16.69 c-lw6gui-keyboard-pop-arrow-up

C function exported to Guile: c-lw6gui-keyboard-pop-arrow-up

Wrapper on lw6gui_keyboard_pop_arrow_up.

4.16.70 c-lw6gui-keyboard-pop-key-alt

C function exported to Guile: c-lw6gui-keyboard-pop-key-alt

Wrapper on lw6gui_keyboard_pop_key_alt.

4.16.71 c-lw6gui-keyboard-pop-key-ctrl

C function exported to Guile: c-lw6gui-keyboard-pop-key-ctrl

Wrapper on lw6gui_keyboard_pop_key_ctrl.

4.16.72 c-lw6gui-keyboard-pop-key-enter

C function exported to Guile: c-lw6gui-keyboard-pop-key-enter

Wrapper on lw6gui_keyboard_pop_key_enter.

4.16.73 c-lw6gui-keyboard-pop-key-esc

C function exported to Guile: c-lw6gui-keyboard-pop-key-esc

Wrapper on lw6gui_keyboard_pop_key_esc.

4.16.74 c-lw6gui-keyboard-pop-key-pgdown

C function exported to Guile: c-lw6gui-keyboard-pop-key-pgdown

Wrapper on lw6gui_keyboard_pop_key_pgdown.

4.16.75 c-lw6gui-keyboard-pop-key-pgup

C function exported to Guile: c-lw6gui-keyboard-pop-key-pgup

Wrapper on lw6gui_keyboard_pop_key_pgup.

4.16.76 c-lw6gui-look-get

C function exported to Guile: c-lw6gui-look-get

Wrapper on lw6gui_look_get.

4.16.77 c-lw6gui-look-set

C function exported to Guile: c-lw6gui-look-set

Wrapper on lw6gui_look_set.

4.16.78 c-lw6gui-look-zoom-in

C function exported to Guile: c-lw6gui-look-zoom-in

Wrapper on lw6gui_look_zoom_in.

4.16.79 c-lw6gui-look-zoom-out

C function exported to Guile: c-lw6gui-look-zoom-out

Wrapper on lw6gui_look_zoom_out.

4.16.80 c-lw6gui-menu-append

C function exported to Guile: c-lw6gui-menu-append

Wrapper on lw6gui_menu_append.

4.16.81 c-lw6gui-menu-close-popup

C function exported to Guile: c-lw6gui-menu-close-popup

Wrapper on lw6gui_menu_close_popup.

4.16.82 c-lw6gui-menu-enable-esc

C function exported to Guile: c-lw6gui-menu-enable-esc

Wrapper on lw6gui_menu_enable_esc.

4.16.83 c-lw6gui-menu-has-popup

C function exported to Guile: c-lw6gui-menu-has-popup

Wrapper on lw6gui_menu_has_popup.

4.16.84 c-lw6gui-menu-new

C function exported to Guile: c-lw6gui-menu-new

Wrapper on lw6gui_menu_new.

4.16.85 c-lw6gui-menu-remove

C function exported to Guile: c-lw6gui-menu-remove

Wrapper on lw6gui_menu_remove.

4.16.86 c-lw6gui-menu-remove-all

C function exported to Guile: c-lw6gui-menu-remove-all

Wrapper on lw6gui_menu_remove_all.

4.16.87 c-lw6gui-menu-scroll-down

C function exported to Guile: c-lw6gui-menu-scroll-down

Wrapper on lw6gui_menu_scroll_down.

4.16.88 c-lw6gui-menu-scroll-up

C function exported to Guile: c-lw6gui-menu-scroll-up

Wrapper on lw6gui_menu_scroll_up.

4.16.89 c-lw6gui-menu-select

C function exported to Guile: c-lw6gui-menu-select

Wrapper on lw6gui_menu_select.

4.16.90 c-lw6gui-menu-select-esc

C function exported to Guile: c-lw6gui-menu-select-esc

Wrapper on lw6gui_menu_select_esc.

4.16.91 c-lw6gui-menu-set-breadcrumbs

C function exported to Guile: c-lw6gui-menu-set-breadcrumbs

Wrapper on lw6gui_menu_set_breadcrumbs.

4.16.92 c-lw6gui-menu-sync

C function exported to Guile: c-lw6gui-menu-sync

Wrapper on lw6gui_menu_sync.

4.16.93 c-lw6gui-mouse-get-state

C function exported to Guile: c-lw6gui-mouse-get-state

Wrapper on lw6gui_mouse_get_state.

4.16.94 c-lw6gui-mouse-poll-move

C function exported to Guile: c-lw6gui-mouse-poll-move

Wrapper on lw6gui_mouse_poll_move.

4.16.95 c-lw6gui-mouse-pop-button-left

C function exported to Guile: c-lw6gui-mouse-pop-button-left

Wrapper on lw6gui_mouse_pop_button_left.

4.16.96 c-lw6gui-mouse-pop-button-middle

C function exported to Guile: c-lw6gui-mouse-pop-button-middle

Wrapper on lw6gui_mouse_pop_button_middle.

4.16.97 c-lw6gui-mouse-pop-button-right

C function exported to Guile: c-lw6gui-mouse-pop-button-right

Wrapper on lw6gui_mouse_pop_button_right.

4.16.98 c-lw6gui-mouse-pop-double-click

C function exported to Guile: c-lw6gui-mouse-pop-double-click

Wrapper on lw6gui_mouse_pop_double_click.

4.16.99 c-lw6gui-mouse-pop-simple-click

C function exported to Guile: c-lw6gui-mouse-pop-simple-click

Wrapper on lw6gui_mouse_pop_simple_click.

4.16.100 c-lw6gui-mouse-pop-triple-click

C function exported to Guile: c-lw6gui-mouse-pop-triple-click

Wrapper on lw6gui_mouse_pop_triple_click.

4.16.101 c-lw6gui-mouse-pop-wheel-down

C function exported to Guile: c-lw6gui-mouse-pop-wheel-down

Wrapper on lw6gui_mouse_pop_wheel_down.

4.16.102 c-lw6gui-mouse-pop-wheel-up

C function exported to Guile: c-lw6gui-mouse-pop-wheel-up

Wrapper on lw6gui_mouse_pop_wheel_up.

4.16.103 c-lw6hlp-about

C function exported to Guile: c-lw6hlp-about

Wrapper on lw6hlp_about.

4.16.104 c-lw6hlp-get-default-value

C function exported to Guile: c-lw6hlp-get-default-value

Wrapper on lw6hlp_get_default_value.

4.16.105 c-lw6hlp-list

C function exported to Guile: c-lw6hlp-list

Wrapper on lw6hlp_list.

4.16.106 c-lw6hlp-list-advanced

C function exported to Guile: c-lw6hlp-list-advanced

Wrapper on lw6hlp_list_advanced.

4.16.107 c-lw6hlp-list-aliases

C function exported to Guile: c-lw6hlp-list-aliases

Wrapper on lw6hlp_list_aliases.

4.16.108 c-lw6hlp-list-doc

C function exported to Guile: c-lw6hlp-list-doc

Wrapper on lw6hlp_list_doc.

4.16.109 c-lw6hlp-list-funcs

C function exported to Guile: c-lw6hlp-list-funcs

Wrapper on lw6hlp_list_funcs.

4.16.110 c-lw6hlp-list-graphics

C function exported to Guile: c-lw6hlp-list-graphics

Wrapper on lw6hlp_list_graphics.

4.16.111 c-lw6hlp-list-hooks

C function exported to Guile: c-lw6hlp-list-hooks

Wrapper on lw6hlp_list_hooks.

4.16.112 c-lw6hlp-list-input

C function exported to Guile: c-lw6hlp-list-input

Wrapper on lw6hlp_list_input.

4.16.113 c-lw6hlp-list-map

C function exported to Guile: c-lw6hlp-list-map

Wrapper on lw6hlp_list_map.

4.16.114 c-lw6hlp-list-map-hints

C function exported to Guile: c-lw6hlp-list-map-hints

Wrapper on lw6hlp_list_map_hints.

4.16.115 c-lw6hlp-list-map-rules

C function exported to Guile: c-lw6hlp-list-map-rules

Wrapper on lw6hlp_list_map_rules.

4.16.116 c-lw6hlp-list-map-style

C function exported to Guile: c-lw6hlp-list-map-style

Wrapper on lw6hlp_list_map_style.

4.16.117 c-lw6hlp-list-map-teams

C function exported to Guile: c-lw6hlp-list-map-teams

Wrapper on lw6hlp_list_map_teams.

4.16.118 c-lw6hlp-list-network

C function exported to Guile: c-lw6hlp-list-network

Wrapper on lw6hlp_list_network.

4.16.119 c-lw6hlp-list-path

C function exported to Guile: c-lw6hlp-list-path

Wrapper on lw6hlp_list_path.

4.16.120 c-lw6hlp-list-players

C function exported to Guile: c-lw6hlp-list-players

Wrapper on lw6hlp_list_players.

4.16.121 c-lw6hlp-list-quick

C function exported to Guile: c-lw6hlp-list-quick

Wrapper on lw6hlp_list_quick.

4.16.122 c-lw6hlp-list-show

C function exported to Guile: c-lw6hlp-list-show

Wrapper on lw6hlp_list_show.

4.16.123 c-lw6hlp-list-sound

C function exported to Guile: c-lw6hlp-list-sound

Wrapper on lw6hlp_list_sound.

4.16.124 c-lw6hlp-list-team-colors

C function exported to Guile: c-lw6hlp-list-team-colors

Wrapper on lw6hlp_list_team_colors.

4.16.125 c-lw6hlp-list-weapons

C function exported to Guile: c-lw6hlp-list-weapons

Wrapper on lw6hlp_list_weapons.

4.16.126 c-lw6img-screenshot

C function exported to Guile: c-lw6img-screenshot

Wrapper on lw6img_screenshot.

4.16.127 c-lw6ker-add-cursor

C function exported to Guile: c-lw6ker-add-cursor

Wrapper on lw6ker_add_cursor.

4.16.128 c-lw6ker-build-game-state

C function exported to Guile: c-lw6ker-build-game-state

Wrapper on lw6ker_build_game_state.

4.16.129 c-lw6ker-build-game-struct

C function exported to Guile: c-lw6ker-build-game-struct

Wrapper on lw6ker_build_game_struct.

4.16.130 c-lw6ker-cursor-exists

C function exported to Guile: c-lw6ker-cursor-exists

Wrapper on lw6ker_cursor_exists.

4.16.131 c-lw6ker-did-cursor-win

C function exported to Guile: c-lw6ker-did-cursor-win

Wrapper on lw6ker_did_cursor_win.

4.16.132 c-lw6ker-do-round

C function exported to Guile: c-lw6ker-do-round

Wrapper on lw6ker_do_round.

4.16.133 c-lw6ker-dup-game-state

C function exported to Guile: c-lw6ker-dup-game-state

Wrapper on lw6ker_dup_game_state.

4.16.134 c-lw6ker-game-state-checksum

C function exported to Guile: c-lw6ker-game-state-checksum

Wrapper on lw6ker_game_state_checksum.

4.16.135 c-lw6ker-game-struct-checksum

C function exported to Guile: c-lw6ker-game-struct-checksum

Wrapper on lw6ker_game_struct_checksum.

4.16.136 c-lw6ker-get-cursor

C function exported to Guile: c-lw6ker-get-cursor

Wrapper on lw6ker_get_cursor.

4.16.137 c-lw6ker-get-moves

C function exported to Guile: c-lw6ker-get-moves

Wrapper on lw6ker_get_moves.

4.16.138 c-lw6ker-get-nb-colors

C function exported to Guile: c-lw6ker-get-nb-colors

Wrapper on lw6ker_game_state_get_nb_colors.

4.16.139 c-lw6ker-get-nb-cursors

C function exported to Guile: c-lw6ker-get-nb-cursors

Wrapper on lw6ker_game_state_get_nb_cursors.

4.16.140 c-lw6ker-get-nb-nodes

C function exported to Guile: c-lw6ker-get-nb-nodes

Wrapper on lw6ker_game_state_get_nb_nodes.

4.16.141 c-lw6ker-get-rounds

C function exported to Guile: c-lw6ker-get-rounds

Wrapper on lw6ker_get_rounds.

4.16.142 c-lw6ker-get-spreads

C function exported to Guile: c-lw6ker-get-spreads

Wrapper on lw6ker_get_spreads.

4.16.143 c-lw6ker-is-over

C function exported to Guile: c-lw6ker-is-over

Wrapper on lw6ker_is_over.

4.16.144 c-lw6ker-node-exists

C function exported to Guile: c-lw6ker-node-exists

Wrapper on lw6ker_node_exists.

4.16.145 c-lw6ker-register-node

C function exported to Guile: c-lw6ker-register-node

Wrapper on lw6ker_register_node.

4.16.146 c-lw6ker-remove-cursor

C function exported to Guile: c-lw6ker-remove-cursor

Wrapper on lw6ker_remove_cursor.

4.16.147 c-lw6ker-set-cursor

C function exported to Guile: c-lw6ker-set-cursor

Wrapper on lw6ker_set_cursor.

4.16.148 c-lw6ker-sync-game-state

C function exported to Guile: c-lw6ker-sync-game-state

Wrapper on lw6ker_sync_game_state.

4.16.149 c-lw6ker-unregister-node

C function exported to Guile: c-lw6ker-unregister-node

Wrapper on lw6ker_unregister_node.

4.16.150 c-lw6ldr-chain-entry

C function exported to Guile: c-lw6ldr-chain-entry

Wrapper on lw6ldr_chain_entry.

4.16.151 c-lw6ldr-exp-validate

C function exported to Guile: c-lw6ldr-exp-validate

Wrapper on lw6ldr_exp_validate.

4.16.152 c-lw6ldr-get-entries

C function exported to Guile: c-lw6ldr-get-entries

Wrapper on lw6ldr_get_entries.

4.16.153 c-lw6ldr-hints-get-default

C function exported to Guile: c-lw6ldr-hints-get-default

Wrapper on lw6ldr_hints_get_default.

4.16.154 c-lw6ldr-print-examples

C function exported to Guile: c-lw6ldr-print-examples

Wrapper on lw6ldr_print_examples.

4.16.155 c-lw6ldr-read

C function exported to Guile: c-lw6ldr-read

Wrapper on lw6ldr_read.

4.16.156 c-lw6ldr-read-relative

C function exported to Guile: c-lw6ldr-read-relative

Wrapper on lw6ldr_read_relative.

4.16.157 c-lw6map-exp-get-unlocked-team-color

C function exported to Guile: c-lw6map-exp-get-unlocked-team-color

Wrapper on lw6map_exp_get_unlocked_team_color.

4.16.158 c-lw6map-exp-get-unlocked-weapon

C function exported to Guile: c-lw6map-exp-get-unlocked-weapon

Wrapper on lw6map_exp_get_unlocked_weapon.

4.16.159 c-lw6map-exp-is-team-color-allowed

C function exported to Guile: c-lw6map-exp-is-team-color-allowed

Wrapper on lw6map_exp_is_team_color_allowed.

4.16.160 c-lw6map-exp-is-weapon-allowed

C function exported to Guile: c-lw6map-exp-is-weapon-allowed

Wrapper on lw6map_exp_is_weapon_allowed.

4.16.161 c-lw6map-get-look

C function exported to Guile: c-lw6map-get-look

Wrapper on lw6map_get_look.

4.16.162 c-lw6map-get-max-nb-colors

C function exported to Guile: c-lw6map-get-max-nb-colors

Wrapper on lw6map_get_max_nb_colors.

4.16.163 c-lw6map-get-max-nb-cursors

C function exported to Guile: c-lw6map-get-max-nb-cursors

Wrapper on lw6map_get_max_nb_cursors.

4.16.164 c-lw6map-get-max-nb-nodes

C function exported to Guile: c-lw6map-get-max-nb-nodes

Wrapper on lw6map_get_max_nb_nodes.

4.16.165 c-lw6map-get-music-dir

C function exported to Guile: c-lw6map-get-music-dir

Wrapper on lw6map_get_music_dir.

4.16.166 c-lw6map-get-title

C function exported to Guile: c-lw6map-get-title

Wrapper on lw6map_get_title.

4.16.167 c-lw6map-param-get

C function exported to Guile: c-lw6map-param-get

Wrapper on lw6map_param_get.

4.16.168 c-lw6map-rules-get-default

C function exported to Guile: c-lw6map-rules-get-default

Wrapper on lw6map_rules_get_default.

4.16.169 c-lw6map-rules-get-int

C function exported to Guile: c-lw6map-rules-get-int

Wrapper on lw6map_rules_get_int.

4.16.170 c-lw6map-rules-get-max

C function exported to Guile: c-lw6map-rules-get-max

Wrapper on lw6map_rules_get_max.

4.16.171 c-lw6map-rules-get-min

C function exported to Guile: c-lw6map-rules-get-min

Wrapper on lw6map_rules_get_min.

4.16.172 c-lw6map-style-get-default

C function exported to Guile: c-lw6map-style-get-default

Wrapper on lw6map_style_get_default.

4.16.173 c-lw6map-team-color-index-to-key

C function exported to Guile: c-lw6map-team-color-index-to-key

Wrapper on lw6map_team_color_index_to_key.

4.16.174 c-lw6map-team-color-index-to-label

C function exported to Guile: c-lw6map-team-color-index-to-label

Wrapper on lw6map_team_color_index_to_label.

4.16.175 c-lw6map-team-color-key-to-index

C function exported to Guile: c-lw6map-team-color-key-to-index

Wrapper on lw6map_team_color_key_to_index.

4.16.176 c-lw6map-team-color-list

C function exported to Guile: c-lw6map-team-color-list

Wrapper on lw6map_team_color_list.

4.16.177 c-lw6map-teams-get-default

C function exported to Guile: c-lw6map-teams-get-default

Wrapper on lw6map_teams_get_default.

4.16.178 c-lw6map-weapon-index-to-key

C function exported to Guile: c-lw6map-weapon-index-to-key

Wrapper on lw6map_weapon_index_to_key.

4.16.179 c-lw6map-weapon-index-to-label

C function exported to Guile: c-lw6map-weapon-index-to-label

Wrapper on lw6map_weapon_index_to_label.

4.16.180 c-lw6map-weapon-key-to-index

C function exported to Guile: c-lw6map-weapon-key-to-index

Wrapper on lw6map_weapon_key_to_index.

4.16.181 c-lw6map-weapon-list

C function exported to Guile: c-lw6map-weapon-list

Wrapper on lw6map_weapon_list.

4.16.182 c-lw6net-init

C function exported to Guile: c-lw6net-init

Wrapper on lw6net_init.

4.16.183 c-lw6net-quit

C function exported to Guile: c-lw6net-quit

Wrapper on lw6net_quit.

4.16.184 c-lw6p2p-db-default-name

C function exported to Guile: c-lw6p2p-db-default-name

Wrapper on lw6p2p_db_default_name.

4.16.185 c-lw6p2p-db-new

C function exported to Guile: c-lw6p2p-db-new

Wrapper on lw6p2p_db_new.

4.16.186 c-lw6p2p-db-reset

C function exported to Guile: c-lw6p2p-db-reset

Wrapper on lw6p2p_db_reset.

4.16.187 c-lw6p2p-node-calibrate

C function exported to Guile: c-lw6p2p-node-calibrate

Wrapper on lw6p2p_node_calibrate.

4.16.188 c-lw6p2p-node-client-join

C function exported to Guile: c-lw6p2p-node-client-join

Wrapper on lw6p2p_node_client_join.

4.16.189 c-lw6p2p-node-close

C function exported to Guile: c-lw6p2p-node-close

Wrapper on lw6p2p_node_close.

4.16.190 c-lw6p2p-node-disconnect

C function exported to Guile: c-lw6p2p-node-disconnect

Wrapper on lw6p2p_node_disconnect.

4.16.191 c-lw6p2p-node-get-entries

C function exported to Guile: c-lw6p2p-node-get-entries

Wrapper on lw6p2p_node_get_entries.

4.16.192 c-lw6p2p-node-get-id

C function exported to Guile: c-lw6p2p-node-get-id

Wrapper on lw6p2p_node_get_id.

4.16.193 c-lw6p2p-node-get-local-seq-0

C function exported to Guile: c-lw6p2p-node-get-local-seq-0

Wrapper on lw6p2p_node_get_local_seq_0.

4.16.194 c-lw6p2p-node-get-local-seq-last

C function exported to Guile: c-lw6p2p-node-get-local-seq-last

Wrapper on lw6p2p_node_get_local_seq_last.

4.16.195 c-lw6p2p-node-get-next-draft-msg

C function exported to Guile: c-lw6p2p-node-get-next-draft-msg

Wrapper on lw6p2p_node_get_next_draft_msg.

4.16.196 c-lw6p2p-node-get-next-reference-msg

C function exported to Guile: c-lw6p2p-node-get-next-reference-msg

Wrapper on lw6p2p_node_get_next_reference_msg.

4.16.197 c-lw6p2p-node-get-seq-draft

C function exported to Guile: c-lw6p2p-node-get-seq-draft

Wrapper on lw6p2p_node_get_seq_draft.

4.16.198 c-lw6p2p-node-get-seq-max

C function exported to Guile: c-lw6p2p-node-get-seq-max

Wrapper on lw6p2p_node_get_seq_max.

4.16.199 c-lw6p2p-node-get-seq-min

C function exported to Guile: c-lw6p2p-node-get-seq-min

Wrapper on lw6p2p_node_get_seq_min.

4.16.200 c-lw6p2p-node-get-seq-reference

C function exported to Guile: c-lw6p2p-node-get-seq-reference

Wrapper on lw6p2p_node_get_seq_reference.

4.16.201 c-lw6p2p-node-is-dump-needed

C function exported to Guile: c-lw6p2p-node-is-dump-needed

Wrapper on lw6p2p_node_is_dump_needed.

4.16.202 c-lw6p2p-node-is-peer-connected

C function exported to Guile: c-lw6p2p-node-is-peer-connected

Wrapper on lw6p2p_node_is_peer_connected.

4.16.203 c-lw6p2p-node-is-peer-registered

C function exported to Guile: c-lw6p2p-node-is-peer-registered

Wrapper on lw6p2p_node_is_peer_registered.

4.16.204 c-lw6p2p-node-is-seed-needed

C function exported to Guile: c-lw6p2p-node-is-seed-needed

Wrapper on lw6p2p_node_is_seed_needed.

4.16.205 c-lw6p2p-node-new

C function exported to Guile: c-lw6p2p-node-new

Wrapper on lw6p2p_node_new.

4.16.206 c-lw6p2p-node-poll

C function exported to Guile: c-lw6p2p-node-poll

Wrapper on lw6p2p_node_poll.

4.16.207 c-lw6p2p-node-put-local-msg

C function exported to Guile: c-lw6p2p-node-put-local-msg

Wrapper on lw6p2p_node_put_local_msg.

4.16.208 c-lw6p2p-node-refresh-peer

C function exported to Guile: c-lw6p2p-node-refresh-peer

Wrapper on lw6p2p_node_refresh_peer.

4.16.209 c-lw6p2p-node-server-start

C function exported to Guile: c-lw6p2p-node-server-start

Wrapper on lw6p2p_node_server_start.

4.16.210 c-lw6p2p-node-update-info

C function exported to Guile: c-lw6p2p-node-update-info

Wrapper on lw6p2p_node_update_info.

4.16.211 c-lw6pil-bench

C function exported to Guile: c-lw6pil-bench

Wrapper on lw6pil_bench.

4.16.212 c-lw6pil-build-pilot

C function exported to Guile: c-lw6pil-build-pilot

Wrapper on lw6pil_build_pilot.

4.16.213 c-lw6pil-calibrate

C function exported to Guile: c-lw6pil-calibrate

Wrapper on lw6pil_calibrate.

4.16.214 c-lw6pil-commit

C function exported to Guile: c-lw6pil-commit

Wrapper on lw6pil_commit.

4.16.215 c-lw6pil-did-cursor-win

C function exported to Guile: c-lw6pil-did-cursor-win

Wrapper on lw6pil_did_cursor_win.

4.16.216 c-lw6pil-dump-command-generate

C function exported to Guile: c-lw6pil-dump-command-generate

Wrapper on lw6pil_dump_command_generate.

4.16.217 c-lw6pil-execute-command

C function exported to Guile: c-lw6pil-execute-command

Wrapper on lw6pil_execute_command.

4.16.218 c-lw6pil-fix-coords

C function exported to Guile: c-lw6pil-fix-coords

Wrapper on lw6pil_coords_fix.

4.16.219 c-lw6pil-fix-coords-x10

C function exported to Guile: c-lw6pil-fix-coords-x10

Wrapper on lw6pil_coords_fix_x10.

4.16.220 c-lw6pil-get-last-commit-seq

C function exported to Guile: c-lw6pil-get-last-commit-seq

Wrapper on lw6pil_get_last_commit_seq.

4.16.221 c-lw6pil-get-looser

C function exported to Guile: c-lw6pil-get-looser

Wrapper on lw6pil_get_looser.

4.16.222 c-lw6pil-get-max-seq

C function exported to Guile: c-lw6pil-get-max-seq

Wrapper on lw6pil_get_max_seq.

4.16.223 c-lw6pil-get-next-seq

C function exported to Guile: c-lw6pil-get-next-seq

Wrapper on lw6pil_get_next_seq.

4.16.224 c-lw6pil-get-reference-current-seq

C function exported to Guile: c-lw6pil-get-reference-current-seq

Wrapper on lw6pil_get_reference_current_seq.

4.16.225 c-lw6pil-get-reference-target-seq

C function exported to Guile: c-lw6pil-get-reference-target-seq

Wrapper on lw6pil_get_reference_target_seq.

4.16.226 c-lw6pil-get-round-0

C function exported to Guile: c-lw6pil-get-round-0

Wrapper on lw6pil_get_round_0.

4.16.227 c-lw6pil-get-seq-0

C function exported to Guile: c-lw6pil-get-seq-0

Wrapper on lw6pil_get_seq_0.

4.16.228 c-lw6pil-get-winner

C function exported to Guile: c-lw6pil-get-winner

Wrapper on lw6pil_get_winner.

4.16.229 c-lw6pil-is-over

C function exported to Guile: c-lw6pil-is-over

Wrapper on lw6pil_is_over.

4.16.230 c-lw6pil-local-command

C function exported to Guile: c-lw6pil-local-command

Wrapper on lw6pil_local_command.

4.16.231 c-lw6pil-local-cursors-set-main

C function exported to Guile: c-lw6pil-local-cursors-set-main

Wrapper on lw6pil_local_cursors_set_main.

4.16.232 c-lw6pil-local-cursors-set-mouse-controlled

C function exported to Guile: c-lw6pil-local-cursors-set-mouse-controlled

Wrapper on lw6pil_local_cursors_set_mouse_controlled.

4.16.233 c-lw6pil-make-backup

C function exported to Guile: c-lw6pil-make-backup

Wrapper on lw6pil_make_backup.

4.16.234 c-lw6pil-poll-dump

C function exported to Guile: c-lw6pil-poll-dump

Wrapper on lw6pil_poll_dump.

4.16.235 c-lw6pil-round2seq

C function exported to Guile: c-lw6pil-round2seq

Wrapper on lw6pil_round2seq.

4.16.236 c-lw6pil-seed-command-generate

C function exported to Guile: c-lw6pil-seed-command-generate

Wrapper on lw6pil_seed_command_generate.

4.16.237 c-lw6pil-send-command

C function exported to Guile: c-lw6pil-send-command

Wrapper on lw6pil_send_command.

4.16.238 c-lw6pil-seq-random-0

C function exported to Guile: c-lw6pil-seq-random-0

Wrapper on lw6pil_seq_random_0.

4.16.239 c-lw6pil-seq2round

C function exported to Guile: c-lw6pil-seq2round

Wrapper on lw6pil_seq2round.

4.16.240 c-lw6pil-slow-down

C function exported to Guile: c-lw6pil-slow-down

Wrapper on lw6pil_slow_down.

4.16.241 c-lw6pil-speed-up

C function exported to Guile: c-lw6pil-speed-up

Wrapper on lw6pil_speed_up.

4.16.242 c-lw6pil-suite-get-checkpoint

C function exported to Guile: c-lw6pil-suite-get-checkpoint

Wrapper on lw6pil_suite_get_checkpoint.

4.16.243 c-lw6pil-suite-get-commands-by-node-index

C function exported to Guile: c-lw6pil-suite-get-commands-by-node-index

Wrapper on lw6pil_suite_get_command_by_node_index, returns the list of all steps.

4.16.244 c-lw6pil-suite-get-commands-by-stage

C function exported to Guile: c-lw6pil-suite-get-commands-by-stage

Wrapper on lw6pil_suite_get_command_by_stage, returns the list of all steps.

4.16.245 c-lw6pil-suite-get-node-id

C function exported to Guile: c-lw6pil-suite-get-node-id

Wrapper on lw6pil_suite_get_node_id.

4.16.246 c-lw6pil-suite-get-seq-0

C function exported to Guile: c-lw6pil-suite-get-seq-0

Wrapper on lw6pil_suite_get_seq_0.

4.16.247 c-lw6pil-suite-init

C function exported to Guile: c-lw6pil-suite-init

Wrapper on lw6pil_suite_init.

4.16.248 c-lw6pil-sync-from-backup

C function exported to Guile: c-lw6pil-sync-from-backup

Wrapper on lw6pil_sync_from_backup.

4.16.249 c-lw6pil-sync-from-draft

C function exported to Guile: c-lw6pil-sync-from-draft

Wrapper on lw6pil_sync_from_draft.

4.16.250 c-lw6pil-sync-from-reference

C function exported to Guile: c-lw6pil-sync-from-reference

Wrapper on lw6pil_sync_from_reference.

4.16.251 c-lw6snd-get-backends

C function exported to Guile: c-lw6snd-get-backends

Wrapper on lw6snd_get_backends.

4.16.252 c-lw6snd-is-music-file

C function exported to Guile: c-lw6snd-is-music-file

Wrapper on lw6snd_is_music_file.

4.16.253 c-lw6snd-new

C function exported to Guile: c-lw6snd-new

Wrapper on lw6snd_new.

4.16.254 c-lw6snd-play-fx

C function exported to Guile: c-lw6snd-play-fx

Wrapper on lw6snd_play_fx.

4.16.255 c-lw6snd-play-music-file

C function exported to Guile: c-lw6snd-play-music-file

Wrapper on lw6snd_play_music_file.

4.16.256 c-lw6snd-play-music-random

C function exported to Guile: c-lw6snd-play-music-random

Wrapper on lw6snd_play_music_random.

4.16.257 c-lw6snd-poll

C function exported to Guile: c-lw6snd-poll

Wrapper on lw6snd_poll.

4.16.258 c-lw6snd-release

C function exported to Guile: c-lw6snd-release

Wrapper on lw6snd_release.

4.16.259 c-lw6snd-set-fx-volume

C function exported to Guile: c-lw6snd-set-fx-volume

Wrapper on lw6snd_set_fx_volume.

4.16.260 c-lw6snd-set-music-volume

C function exported to Guile: c-lw6snd-set-music-volume

Wrapper on lw6snd_set_music_volume.

4.16.261 c-lw6snd-set-water-volume

C function exported to Guile: c-lw6snd-set-water-volume

Wrapper on lw6snd_set_water_volume.

4.16.262 c-lw6snd-stop-music

C function exported to Guile: c-lw6snd-stop-music

Wrapper on lw6snd_stop_music.

4.16.263 c-lw6srv-get-backends

C function exported to Guile: c-lw6srv-get-backends

Wrapper on lw6srv_get_backends.

4.16.264 c-lw6sys-build-get-abs-srcdir

C function exported to Guile: c-lw6sys-build-get-abs-srcdir

Wrapper on lw6sys_build_get_abs_srcdir.

4.16.265 c-lw6sys-build-get-bin-id

C function exported to Guile: c-lw6sys-build-get-bin-id

Wrapper on lw6sys_build_get_bin_id.

4.16.266 c-lw6sys-build-get-bugs-url

C function exported to Guile: c-lw6sys-build-get-bugs-url

Wrapper on lw6sys_build_get_bugs_url.

4.16.267 c-lw6sys-build-get-cflags

C function exported to Guile: c-lw6sys-build-get-cflags

Wrapper on lw6sys_build_get_cflags.

4.16.268 c-lw6sys-build-get-codename

C function exported to Guile: c-lw6sys-build-get-codename

Wrapper on lw6sys_build_get_codename.

4.16.269 c-lw6sys-build-get-configure-args

C function exported to Guile: c-lw6sys-build-get-configure-args

Wrapper on lw6sys_build_get_configure_args.

4.16.270 c-lw6sys-build-get-copyright

C function exported to Guile: c-lw6sys-build-get-copyright

Wrapper on lw6sys_build_get_copyright.

4.16.271 c-lw6sys-build-get-datadir

C function exported to Guile: c-lw6sys-build-get-datadir

Wrapper on lw6sys_build_get_datadir.

4.16.272 c-lw6sys-build-get-date

C function exported to Guile: c-lw6sys-build-get-date

Wrapper on lw6sys_build_get_date.

4.16.273 c-lw6sys-build-get-docdir

C function exported to Guile: c-lw6sys-build-get-docdir

Wrapper on lw6sys_build_get_docdir.

4.16.274 c-lw6sys-build-get-enable-allinone

C function exported to Guile: c-lw6sys-build-get-enable-allinone

Wrapper on lw6sys_build_get_enable_allinone.

4.16.275 c-lw6sys-build-get-enable-console

C function exported to Guile: c-lw6sys-build-get-enable-console

Wrapper on lw6sys_build_get_enable_console.

4.16.276 c-lw6sys-build-get-enable-fullstatic

C function exported to Guile: c-lw6sys-build-get-enable-fullstatic

Wrapper on lw6sys_build_get_enable_fullstatic.

4.16.277 c-lw6sys-build-get-enable-gcov

C function exported to Guile: c-lw6sys-build-get-enable-gcov

Wrapper on lw6sys_build_get_enable_gcov.

4.16.278 c-lw6sys-build-get-enable-gprof

C function exported to Guile: c-lw6sys-build-get-enable-gprof

Wrapper on lw6sys_build_get_enable_gprof.

4.16.279 c-lw6sys-build-get-enable-gtk

C function exported to Guile: c-lw6sys-build-get-enable-gtk

Wrapper on lw6sys_build_get_enable_gtk.

4.16.280 c-lw6sys-build-get-enable-instrument

C function exported to Guile: c-lw6sys-build-get-enable-instrument

Wrapper on lw6sys_build_get_enable_instrument.

4.16.281 c-lw6sys-build-get-enable-mod-caca

C function exported to Guile: c-lw6sys-build-get-enable-mod-caca

Wrapper on lw6sys_build_get_enable_mod_caca.

4.16.282 c-lw6sys-build-get-enable-mod-csound

C function exported to Guile: c-lw6sys-build-get-enable-mod-csound

Wrapper on lw6sys_build_get_enable_mod_csound.

4.16.283 c-lw6sys-build-get-enable-mod-gl1

C function exported to Guile: c-lw6sys-build-get-enable-mod-gl1

Wrapper on lw6sys_build_get_enable_mod_gl1.

4.16.284 c-lw6sys-build-get-enable-mod-gles2

C function exported to Guile: c-lw6sys-build-get-enable-mod-gles2

Wrapper on lw6sys_build_get_enable_mod_gles2.

4.16.285 c-lw6sys-build-get-enable-mod-http

C function exported to Guile: c-lw6sys-build-get-enable-mod-http

Wrapper on lw6sys_build_get_enable_mod_http.

4.16.286 c-lw6sys-build-get-enable-mod-ogg

C function exported to Guile: c-lw6sys-build-get-enable-mod-ogg

Wrapper on lw6sys_build_get_enable_mod_ogg.

4.16.287 c-lw6sys-build-get-enable-mod-soft

C function exported to Guile: c-lw6sys-build-get-enable-mod-soft

Wrapper on lw6sys_build_get_enable_mod_soft.

4.16.288 c-lw6sys-build-get-enable-openmp

C function exported to Guile: c-lw6sys-build-get-enable-openmp

Wrapper on lw6sys_build_get_enable_openmp.

4.16.289 c-lw6sys-build-get-enable-optimize

C function exported to Guile: c-lw6sys-build-get-enable-optimize

Wrapper on lw6sys_build_get_enable_optimize.

4.16.290 c-lw6sys-build-get-enable-paranoid

C function exported to Guile: c-lw6sys-build-get-enable-paranoid

Wrapper on lw6sys_build_get_enable_paranoid.

4.16.291 c-lw6sys-build-get-enable-profiler

C function exported to Guile: c-lw6sys-build-get-enable-profiler

Wrapper on lw6sys_build_get_enable_profiler.

4.16.292 c-lw6sys-build-get-enable-valgrind

C function exported to Guile: c-lw6sys-build-get-enable-valgrind

Wrapper on lw6sys_build_get_enable_valgrind.

4.16.293 c-lw6sys-build-get-endianness

C function exported to Guile: c-lw6sys-build-get-endianness

Wrapper on lw6sys_build_get_endianness.

4.16.294 c-lw6sys-build-get-gcc-version

C function exported to Guile: c-lw6sys-build-get-gcc-version

Wrapper on lw6sys_build_get_gcc_version.

4.16.295 c-lw6sys-build-get-home-url

C function exported to Guile: c-lw6sys-build-get-home-url

Wrapper on lw6sys_build_get_home_url.

4.16.296 c-lw6sys-build-get-host-cpu

C function exported to Guile: c-lw6sys-build-get-host-cpu

Wrapper on lw6sys_build_get_host_cpu.

4.16.297 c-lw6sys-build-get-host-os

C function exported to Guile: c-lw6sys-build-get-host-os

Wrapper on lw6sys_build_get_host_os.

4.16.298 c-lw6sys-build-get-hostname

C function exported to Guile: c-lw6sys-build-get-hostname

Wrapper on lw6sys_build_get_hostname.

4.16.299 c-lw6sys-build-get-includedir

C function exported to Guile: c-lw6sys-build-get-includedir

Wrapper on lw6sys_build_get_includedir.

4.16.300 c-lw6sys-build-get-ldflags

C function exported to Guile: c-lw6sys-build-get-ldflags

Wrapper on lw6sys_build_get_ldflags.

4.16.301 c-lw6sys-build-get-libdir

C function exported to Guile: c-lw6sys-build-get-libdir

Wrapper on lw6sys_build_get_libdir.

4.16.302 c-lw6sys-build-get-license

C function exported to Guile: c-lw6sys-build-get-license

Wrapper on lw6sys_build_get_license.

4.16.303 c-lw6sys-build-get-localedir

C function exported to Guile: c-lw6sys-build-get-localedir

Wrapper on lw6sys_build_get_localedir.

4.16.304 c-lw6sys-build-get-md5sum

C function exported to Guile: c-lw6sys-build-get-md5sum

Wrapper on lw6sys_build_get_md5sum.

4.16.305 c-lw6sys-build-get-package-id

C function exported to Guile: c-lw6sys-build-get-package-id

Wrapper on lw6sys_build_get_package_id.

4.16.306 c-lw6sys-build-get-package-name

C function exported to Guile: c-lw6sys-build-get-package-name

Wrapper on lw6sys_build_get_package_name.

4.16.307 c-lw6sys-build-get-package-string

C function exported to Guile: c-lw6sys-build-get-package-string

Wrapper on lw6sys_build_get_package_string.

4.16.308 c-lw6sys-build-get-package-tarname

C function exported to Guile: c-lw6sys-build-get-package-tarname

Wrapper on lw6sys_build_get_package_tarname.

4.16.309 c-lw6sys-build-get-pointer-size

C function exported to Guile: c-lw6sys-build-get-pointer-size

Wrapper on lw6sys_build_get_pointer_size.

4.16.310 c-lw6sys-build-get-prefix

C function exported to Guile: c-lw6sys-build-get-prefix

Wrapper on lw6sys_build_get_prefix.

4.16.311 c-lw6sys-build-get-stamp

C function exported to Guile: c-lw6sys-build-get-stamp

Wrapper on lw6sys_build_get_stamp.

4.16.312 c-lw6sys-build-get-time

C function exported to Guile: c-lw6sys-build-get-time

Wrapper on lw6sys_build_get_time.

4.16.313 c-lw6sys-build-get-top-srcdir

C function exported to Guile: c-lw6sys-build-get-top-srcdir

Wrapper on lw6sys_build_get_top_srcdir.

4.16.314 c-lw6sys-build-get-version

C function exported to Guile: c-lw6sys-build-get-version

Wrapper on lw6sys_build_get_version.

4.16.315 c-lw6sys-build-get-version-base

C function exported to Guile: c-lw6sys-build-get-version-base

Wrapper on lw6sys_build_get_version_base.

4.16.316 c-lw6sys-build-get-version-major

C function exported to Guile: c-lw6sys-build-get-version-major

Wrapper on lw6sys_build_get_version_major.

4.16.317 c-lw6sys-build-get-version-minor

C function exported to Guile: c-lw6sys-build-get-version-minor

Wrapper on lw6sys_build_get_version_minor.

4.16.318 c-lw6sys-build-is-gnu

C function exported to Guile: c-lw6sys-build-is-gnu

Wrapper on lw6sys_build_is_gnu.

4.16.319 c-lw6sys-build-is-gp2x

C function exported to Guile: c-lw6sys-build-is-gp2x

Wrapper on lw6sys_build_is_gp2x.

4.16.320 c-lw6sys-build-is-mac-os-x

C function exported to Guile: c-lw6sys-build-is-mac-os-x

Wrapper on lw6sys_build_is_mac_os_x.

4.16.321 c-lw6sys-build-is-ms-windows

C function exported to Guile: c-lw6sys-build-is-ms-windows

Wrapper on lw6sys_build_is_ms_windows.

4.16.322 c-lw6sys-build-is-unix

C function exported to Guile: c-lw6sys-build-is-unix

Wrapper on lw6sys_build_is_unix.

4.16.323 c-lw6sys-build-is-x86

C function exported to Guile: c-lw6sys-build-is-x86

Wrapper on lw6sys_build_is_x86.

4.16.324 c-lw6sys-debug-get

C function exported to Guile: c-lw6sys-debug-get

Wrapper on lw6sys_debug_get.

4.16.325 c-lw6sys-debug-set

C function exported to Guile: c-lw6sys-debug-set

Wrapper on lw6sys_debug_set.

4.16.326 c-lw6sys-delay

C function exported to Guile: c-lw6sys-delay

Wrapper on lw6sys_delay.

4.16.327 c-lw6sys-dump

C function exported to Guile: c-lw6sys-dump

Wrapper on lw6sys_dump.

4.16.328 c-lw6sys-dump-clear

C function exported to Guile: c-lw6sys-dump-clear

Wrapper on lw6sys_dump_clear.

4.16.329 c-lw6sys-generate-id-16

C function exported to Guile: c-lw6sys-generate-id-16

Wrapper on lw6sys_generate_id_16.

4.16.330 c-lw6sys-generate-id-32

C function exported to Guile: c-lw6sys-generate-id-32

Wrapper on lw6sys_generate_id_32.

4.16.331 c-lw6sys-generate-id-64

C function exported to Guile: c-lw6sys-generate-id-64

Wrapper on lw6sys_generate_id_64.

4.16.332 c-lw6sys-get-config-file

C function exported to Guile: c-lw6sys-get-config-file

Wrapper on lw6sys_get_config_file.

4.16.333 c-lw6sys-get-cwd

C function exported to Guile: c-lw6sys-get-cwd

Wrapper on lw6sys_get_cwd.

4.16.334 c-lw6sys-get-cycle

C function exported to Guile: c-lw6sys-get-cycle

Wrapper on lw6sys_get_cycle.

4.16.335 c-lw6sys-get-data-dir

C function exported to Guile: c-lw6sys-get-data-dir

Wrapper on lw6sys_get_data_dir.

4.16.336 c-lw6sys-get-default-config-file

C function exported to Guile: c-lw6sys-get-default-config-file

Wrapper on lw6sys_get_default_config_file.

4.16.337 c-lw6sys-get-default-data-dir

C function exported to Guile: c-lw6sys-get-default-data-dir

Wrapper on lw6sys_get_default_data_dir.

4.16.338 c-lw6sys-get-default-log-file

C function exported to Guile: c-lw6sys-get-default-log-file

Wrapper on lw6sys_get_default_log_file.

4.16.339 c-lw6sys-get-default-map-dir

C function exported to Guile: c-lw6sys-get-default-map-dir

Wrapper on lw6sys_get_default_map_dir.

4.16.340 c-lw6sys-get-default-map-path

C function exported to Guile: c-lw6sys-get-default-map-path

Wrapper on lw6sys_get_default_map_path.

4.16.341 c-lw6sys-get-default-mod-dir

C function exported to Guile: c-lw6sys-get-default-mod-dir

Wrapper on lw6sys_get_default_mod_dir.

4.16.342 c-lw6sys-get-default-music-dir

C function exported to Guile: c-lw6sys-get-default-music-dir

Wrapper on lw6sys_get_default_music_dir.

4.16.343 c-lw6sys-get-default-music-path

C function exported to Guile: c-lw6sys-get-default-music-path

Wrapper on lw6sys_get_default_music_path.

4.16.344 c-lw6sys-get-default-prefix

C function exported to Guile: c-lw6sys-get-default-prefix

Wrapper on lw6sys_get_default_prefix.

4.16.345 c-lw6sys-get-default-script-file

C function exported to Guile: c-lw6sys-get-default-script-file

Wrapper on lw6sys_get_default_script_file.

4.16.346 c-lw6sys-get-default-user-dir

C function exported to Guile: c-lw6sys-get-default-user-dir

Wrapper on lw6sys_get_default_user_dir.

4.16.347 c-lw6sys-get-hostname

C function exported to Guile: c-lw6sys-get-hostname

Wrapper on lw6sys_get_hostname.

4.16.348 c-lw6sys-get-log-file

C function exported to Guile: c-lw6sys-get-log-file

Wrapper on lw6sys_get_log_file.

4.16.349 c-lw6sys-get-map-dir

C function exported to Guile: c-lw6sys-get-map-dir

Wrapper on lw6sys_get_map_dir.

4.16.350 c-lw6sys-get-map-path

C function exported to Guile: c-lw6sys-get-map-path

Wrapper on lw6sys_get_map_path.

4.16.351 c-lw6sys-get-memory-bazooka-eraser

C function exported to Guile: c-lw6sys-get-memory-bazooka-eraser

Wrapper on lw6sys_get_memory_bazooka_eraser.

4.16.352 c-lw6sys-get-memory-bazooka-size

C function exported to Guile: c-lw6sys-get-memory-bazooka-size

Wrapper on lw6sys_get_memory_bazooka_size.

4.16.353 c-lw6sys-get-mod-dir

C function exported to Guile: c-lw6sys-get-mod-dir

Wrapper on lw6sys_get_mod_dir.

4.16.354 c-lw6sys-get-music-dir

C function exported to Guile: c-lw6sys-get-music-dir

Wrapper on lw6sys_get_music_dir.

4.16.355 c-lw6sys-get-music-path

C function exported to Guile: c-lw6sys-get-music-path

Wrapper on lw6sys_get_music_path.

4.16.356 c-lw6sys-get-prefix

C function exported to Guile: c-lw6sys-get-prefix

Wrapper on lw6sys_get_prefix.

4.16.357 c-lw6sys-get-run-dir

C function exported to Guile: c-lw6sys-get-run-dir

Wrapper on lw6sys_get_run_dir.

4.16.358 c-lw6sys-get-script-file

C function exported to Guile: c-lw6sys-get-script-file

Wrapper on lw6sys_get_script_file.

4.16.359 c-lw6sys-get-timestamp

C function exported to Guile: c-lw6sys-get-timestamp

Wrapper on lw6sys_get_timestamp.

4.16.360 c-lw6sys-get-uptime

C function exported to Guile: c-lw6sys-get-uptime

Wrapper on lw6sys_get_uptime.

4.16.361 c-lw6sys-get-user-dir

C function exported to Guile: c-lw6sys-get-user-dir

Wrapper on lw6sys_get_user_dir.

4.16.362 c-lw6sys-get-username

C function exported to Guile: c-lw6sys-get-username

Wrapper on lw6sys_get_username.

4.16.363 c-lw6sys-getenv

C function exported to Guile: c-lw6sys-getenv

Wrapper on lw6sys_getenv.

4.16.364 c-lw6sys-getenv-prefixed

C function exported to Guile: c-lw6sys-getenv-prefixed

Wrapper on lw6sys_getenv_prefixed.

4.16.365 c-lw6sys-idle

C function exported to Guile: c-lw6sys-idle

Wrapper on lw6sys_idle.

4.16.366 c-lw6sys-log

C function exported to Guile: c-lw6sys-log

Wrapper on lw6sys_log.

4.16.367 c-lw6sys-log-get-backtrace-mode

C function exported to Guile: c-lw6sys-log-get-backtrace-mode

Wrapper on lw6sys_log_get_backtrace_mode.

4.16.368 c-lw6sys-log-get-level

C function exported to Guile: c-lw6sys-log-get-level

Wrapper on lw6sys_log_get_level.

4.16.369 c-lw6sys-log-set-backtrace-mode

C function exported to Guile: c-lw6sys-log-set-backtrace-mode

Wrapper on lw6sys_log_set_backtrace_mode.

4.16.370 c-lw6sys-log-set-dialog-timeout

C function exported to Guile: c-lw6sys-log-set-dialog-timeout

Wrapper on lw6sys_log_set_dialog_timeout.

4.16.371 c-lw6sys-log-set-level

C function exported to Guile: c-lw6sys-log-set-level

Wrapper on lw6sys_log_set_level.

4.16.372 c-lw6sys-megabytes-available

C function exported to Guile: c-lw6sys-megabytes-available

Wrapper on lw6sys_megabytes_available.

4.16.373 c-lw6sys-openmp-get-num-procs

C function exported to Guile: c-lw6sys-openmp-get-num-procs

Wrapper on lw6sys_openmp_get_num_procs.

4.16.374 c-lw6sys-path-concat

C function exported to Guile: c-lw6sys-path-concat

Wrapper on lw6sys_path_concat.

4.16.375 c-lw6sys-path-file-only

C function exported to Guile: c-lw6sys-path-file-only

Wrapper on lw6sys_path_file_only.

4.16.376 c-lw6sys-path-parent

C function exported to Guile: c-lw6sys-path-parent

Wrapper on lw6sys_path_parent.

4.16.377 c-lw6sys-path-split

C function exported to Guile: c-lw6sys-path-split

Wrapper on lw6sys_path_split.

4.16.378 c-lw6sys-set-memory-bazooka-eraser

C function exported to Guile: c-lw6sys-set-memory-bazooka-eraser

Wrapper on lw6sys_set_memory_bazooka_eraser.

4.16.379 c-lw6sys-set-memory-bazooka-size

C function exported to Guile: c-lw6sys-set-memory-bazooka-size

Wrapper on lw6sys_set_memory_bazooka_size.

4.16.380 c-lw6sys-signal-custom

C function exported to Guile: c-lw6sys-signal-custom

Wrapper on lw6sys_signal_custom.

4.16.381 c-lw6sys-signal-default

C function exported to Guile: c-lw6sys-signal-default

Wrapper on lw6sys_signal_default.

4.16.382 c-lw6sys-signal-poll-quit

C function exported to Guile: c-lw6sys-signal-poll-quit

Wrapper on lw6sys_signal_poll_quit.

4.16.383 c-lw6sys-signal-send-quit

C function exported to Guile: c-lw6sys-signal-send-quit

Wrapper on lw6sys_signal_send_quit.

4.16.384 c-lw6sys-sleep

C function exported to Guile: c-lw6sys-sleep

Wrapper on lw6sys_sleep.

4.16.385 c-lw6sys-snooze

C function exported to Guile: c-lw6sys-snooze

Wrapper on lw6sys_snooze.

4.16.386 c-lw6sys-url-canonize

C function exported to Guile: c-lw6sys-url-canonize

Wrapper on lw6sys_url_canonize.

4.16.387 c-lw6tsk-loader-get-stage

C function exported to Guile: c-lw6tsk-loader-get-stage

Wrapper on lw6tsk_loader_get_stage.

4.16.388 c-lw6tsk-loader-new

C function exported to Guile: c-lw6tsk-loader-new

Wrapper on lw6tsk_loader_new.

4.16.389 c-lw6tsk-loader-pop

C function exported to Guile: c-lw6tsk-loader-pop

Wrapper on lw6tsk_loader_pop.

4.16.390 c-lw6tsk-loader-push-gen

C function exported to Guile: c-lw6tsk-loader-push-gen

Wrapper on lw6tsk_loader_push_gen.

4.16.391 c-lw6tsk-loader-push-ldr

C function exported to Guile: c-lw6tsk-loader-push-ldr

Wrapper on lw6tsk_loader_push_ldr.


Previous: , Up: Reference   [Contents][Index]

4.17 Script hooks


Previous: , Up: Top   [Contents][Index]

5 C API

This chapter contains a description of all modules and a list of all documented C functions in the program. It contains many references and is self-generated from C comments using gdoc by Simon Josefsson.

In order to reduce the number of pages of printed output, this complete reference is, by default, disabled in printable versions of the documentation (PostScript, PDF). This is both to make the manual more readable and to avoid wasting paper. Think about the environment.

It is however available in the HTML version of the documentation, which you can read online on http://www.gnu.org/software/liquidwar6/manual/html_node/.

Additionnally, the following adresses contain various view on the source code, giving informations on all the internal and public C interfaces:


Next: , Up: C API   [Contents][Index]

5.1 libliquidwar6

5.1.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/index.html.

5.1.2 API

Function: void lw6_resize_callback (lw6sys_context_t * sys_context, lw6gui_video_mode_t * video_mode)

sys_context: global system context

video_mode: the new video mode

This callback is here because gfx needs to update the config when the screen is resized. But... we did not want to make gfx depend on cfg "directly". It’s cleaner to pass parameters with Scheme, in the long run, it should make things easier. So this callback is the solution. Another side effect is that this way there’s a tangible obvious trace of this updating of config status by the gfx module. Seeing it sticking out like a thumb isn’t a bad thing.

Return value: none

Function: void lw6_release (lw6sys_context_t * sys_context)

sys_context: global system context

Functions which will call quit, free, destroy on whatever smob object that has threads and/or requires hardware ressources. This is to be called before the Guile interpreter ends. This is because when it garbage collects objects at the end of the program, it has no idea of what order to use when freeing objects. So if an object which uses another one in a thread is freed after the other is freed, you get a (rather unexplainabled if not warned) segfault.

Return value: none

Function: void lw6_exit (lw6sys_context_t * sys_context)

sys_context: global system context

Sends a quit message and displays a newline.

Return value: none

Function: void lw6_set_ret (lw6sys_context_t * sys_context, int ret)

sys_context: global system context

ret: return value to set, 1 for success, 0 for failure

Sets the ret value for the script.

Return value: none

Function: int lw6_get_ret (lw6sys_context_t * sys_context)

sys_context: global system context

Get the ret value for the script.

Return value: 1 if success, 0 if not.

Function: int lw6_fix_env (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: number of args as passed to main

argv: array of strings as passed to main

Fixes environment variables (path related) so that program can find its requirements. This must be called early in the program flow (else other calls might fail).

Return value: 1 if success, 0 if failure

Function: int lw6_register_funcs_bot (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the bot module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_register_funcs (lw6sys_context_t * sys_context)

sys_context: global system context

Register all the functions, make them callable from Guile. This is a very simple yet long and very usefull function, without it Guile has no knowledge of what LW6 is.

Return value: 1 on success, 0 if failed.

Function: extern void lw6_cns_handler (lw6sys_context_t * sys_context, char * c_line)

sys_context: global system context

c_line: the line typed by the user

This function will be called every time a message is typed on the console. It runs the given line in the current Guile environment.

Return value: none

Function: int lw6_register_funcs_cfg (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the cfg module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_register_funcs_cli (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the cli module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_register_funcs_cns (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the cns module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_register_funcs_dsp (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the dsp module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_register_funcs_gen (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the gen module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_register_funcs_gfx (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the gfx module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_register_funcs_gui (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the gui module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_register_funcs_hlp (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the hlp module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_register_funcs_img (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the img module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_register_funcs_ker (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the ker module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_register_funcs_ldr (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the ldr module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_register_funcs_map (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the map module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_register_funcs_net (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the net module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_register_funcs_p2p (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the p2p module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_register_funcs_pil (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the pil module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_register_funcs_snd (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the snd module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_register_funcs_srv (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the srv module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_register_funcs_sys (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the sys module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_register_funcs_tsk (lw6sys_context_t * sys_context)

sys_context: global system context

Register the functions of the tsk module, make them callable from Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_init_global (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: number of args as passed to main

argv: array of strings as passed to main

Initializes global values to their defaults.

Return value: 1 on success, 0 if failed

Function: void lw6_quit_global (lw6sys_context_t * sys_context)

sys_context: global system context

Frees global values. Will also garbage collect objects in case Guile failed to do it perfectly (or we failed to tell Guile how to do it). Important note: this function can only be called once in a program, usually at the end. If called twice, and typically, if *any* Guile code is run after it, the risk is that Guile code does not find objects that it should, or said differently, Guile might try to manipulate stuff that has been deleted without its being warned about it. In practice, libGC way of doing thing is usually a good thing, since it will from time to time keep objects in memory that shouldn’t, so there’s no point in changing that, but as we are pedantic in LW6 about the fact that everything at program exit must be perfectly freed, the problem arises. So well, only call this once at the end, else problem will show up, the usual form is a segfault on the delete callback, as when Guile finally runs its GC, the object does not exist any more.

Return value: none.

Function: int lw6_main (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: the argc parameter of the main function, that is, the number of command-line args.

argv: the argv parameter of the main function, that is, an array containing pointers on command-line args.

This function is directly called by main. This means by linking against libliquidwar6 and calling it, you would have a program that is almost exactly the "official" upstream liquidwar6 binary, except you can tweak it and have all the power to call whatever other functions you like, embed it. In short, everything the binary does, you can do it in your own binarn, by linking against the library and calling this function.

Return value: 1 if success, zero if failure. Note that this is the "standard" C / liquidwar6 way to proceed, but your main function should return 0 if success, else an error code. Typical use is "return !lw6_main(argc, argv);".

Function: int lw6_process_non_run_options (lw6sys_context_t * sys_context, int argc, const char * [] argv, int * run_game)

sys_context: global system context

argc: the number of command-line args, as passed to main

argv: an array of strings containing command-line args, as passed to main

run_game: a pointer to a boolean which will contain true (1) if the game must be launched, or false (0) if the option is such that game must be skipped. Example: –copyright, –help, ...

Interprets command line arguments, and if some need to be processed, typically those args that are used to display stuff on the console, then perform the corresponding actions.

Return value: non-zero if success, 0 if error. The error can be, for instance, the test suite returning "no, tests were not OK".

Function: SCM lw6_make_scm_dsp (lw6sys_context_t * sys_context, lw6dsp_backend_t * c_dsp)

sys_context: global system context

c_dsp: the display object

Creates an SCM ’dsp’ object from C data.

Return value: the SCM object

Function: lw6dsp_backend_t * lw6_scm_to_dsp (lw6sys_context_t * sys_context, SCM dsp)

sys_context: global system context

dsp: the dsp to convert (SCM object)

Gets the internal C pointer corresponding to the scheme ’dsp’ object.

Return value: a pointer, *not* a copy, must not be freed

Function: void lw6_free_dsp_smob (lw6sys_context_t * sys_context, lw6_dsp_smob_t * dsp_smob)

sys_context: global system context

dsp_smob: the smob to free

Frees a dsp smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.

Return value: none

Function: SCM lw6_make_scm_snd (lw6sys_context_t * sys_context, lw6snd_backend_t * c_snd)

sys_context: global system context

c_snd: the sound object

Creates an SCM ’snd’ object from C data.

Return value: the SCM object

Function: lw6snd_backend_t * lw6_scm_to_snd (lw6sys_context_t * sys_context, SCM snd)

sys_context: global system context

snd: the snd to convert (SCM object)

Gets the internal C pointer corresponding to the scheme ’snd’ object.

Return value: a pointer, *not* a copy, must not be freed

Function: void lw6_free_snd_smob (lw6sys_context_t * sys_context, lw6_snd_smob_t * snd_smob)

sys_context: global system context

snd_smob: the smob to free

Frees a snd smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.

Return value: none

Function: SCM lw6_make_scm_map (lw6sys_context_t * sys_context, lw6map_level_t * c_map)

sys_context: global system context

c_map: the map object

Creates an SCM ’map’ object from C data.

Return value: the SCM object

Function: lw6map_level_t * lw6_scm_to_map (lw6sys_context_t * sys_context, SCM map)

sys_context: global system context

map: the map to convert (SCM object)

Gets the internal C pointer corresponding to the scheme ’map’ object.

Return value: a pointer, *not* a copy, must not be freed

Function: void lw6_free_map_smob (lw6sys_context_t * sys_context, lw6_map_smob_t * map_smob)

sys_context: global system context

map_smob: the smob to free

Frees a map smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.

Return value: none

Function: SCM lw6_make_scm_menu (lw6sys_context_t * sys_context, lw6gui_menu_t * c_menu)

sys_context: global system context

c_menu: the menu object

Creates an SCM ’menu’ object from C data.

Return value: the SCM object

Function: lw6gui_menu_t * lw6_scm_to_menu (lw6sys_context_t * sys_context, SCM menu)

sys_context: global system context

menu: the menu to convert (SCM object)

Gets the internal C pointer corresponding to the scheme ’menu’ object.

Return value: a pointer, *not* a copy, must not be freed

Function: void lw6_free_menu_smob (lw6sys_context_t * sys_context, lw6_menu_smob_t * menu_smob)

sys_context: global system context

menu_smob: the smob to free

Frees a menu smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.

Return value: none

Function: SCM lw6_make_scm_game_struct (lw6sys_context_t * sys_context, lw6ker_game_struct_t * c_game_struct, SCM map)

sys_context: global system context

c_game_struct: the game struct object

map: the map (SCM object) referenced

Creates an SCM ’game-struct’ object from C data. Passing the map object enables the garbage collector not to free the map until the game struct is freed.

Return value: the SCM object

Function: lw6ker_game_struct_t * lw6_scm_to_game_struct (lw6sys_context_t * sys_context, SCM game_struct)

sys_context: global system context

game_struct: the game_struct to convert (SCM object)

Gets the internal C pointer corresponding to the scheme ’game_struct’ object.

Return value: a pointer, *not* a copy, must not be freed

Function: void lw6_free_game_struct_smob (lw6sys_context_t * sys_context, lw6_game_struct_smob_t * game_struct_smob)

sys_context: global system context

game_struct_smob: the smob to free

Frees a game_struct smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.

Return value: none

Function: SCM lw6_make_scm_game_state (lw6sys_context_t * sys_context, lw6ker_game_state_t * c_game_state, SCM game_struct)

sys_context: global system context

c_game_state: the game state object

game_struct: the game struct (SCM object) referenced

Creates an SCM ’game_state’ object from C data. Passing game_struct enables the garbage collector not to free the game_struct until the game_state is freed.

Return value: the SCM object

Function: lw6ker_game_state_t * lw6_scm_to_game_state (lw6sys_context_t * sys_context, SCM game_state)

sys_context: global system context

game_state: the game_state to convert (SCM object)

Gets the internal C pointer corresponding to the scheme ’game_state’ object.

Return value: a pointer, *not* a copy, must not be freed

Function: void lw6_free_game_state_smob (lw6sys_context_t * sys_context, lw6_game_state_smob_t * game_state_smob)

sys_context: global system context

game_state_smob: the smob to free

Frees a game_state smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.

Return value: none

Function: SCM lw6_make_scm_pilot (lw6sys_context_t * sys_context, lw6pil_pilot_t * c_pilot)

sys_context: global system context

c_pilot: the pilot object

Creates an SCM ’pilot’ object from C data.

Return value: the SCM object

Function: lw6pil_pilot_t * lw6_scm_to_pilot (lw6sys_context_t * sys_context, SCM pilot)

sys_context: global system context

pilot: the pilot to convert (SCM object)

Gets the internal C pointer corresponding to the scheme ’pilot’ object.

Return value: a pointer, *not* a copy, must not be freed

Function: void lw6_free_pilot_smob (lw6sys_context_t * sys_context, lw6_pilot_smob_t * pilot_smob)

sys_context: global system context

pilot_smob: the smob to free

Frees a pilot smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.

Return value: none

Function: SCM lw6_make_scm_bot (lw6sys_context_t * sys_context, lw6bot_backend_t * c_bot, SCM game_state, SCM pilot)

sys_context: global system context

c_bot: the bot object

game_state: the game state

pilot: the pilot

Creates an SCM ’bot’ object from C data. Passing game_state and pilot enables the garbage collector not the free them until bot is freed.

Return value: the SCM object

Function: lw6bot_backend_t * lw6_scm_to_bot (lw6sys_context_t * sys_context, SCM bot)

sys_context: global system context

bot: the bot to convert (SCM object)

Gets the internal C pointer corresponding to the scheme ’bot’ object.

Return value: a pointer, *not* a copy, must not be freed

Function: void lw6_free_bot_smob (lw6sys_context_t * sys_context, lw6_bot_smob_t * bot_smob)

sys_context: global system context

bot_smob: the smob to free

Frees a bot smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.

Return value: none

Function: SCM lw6_make_scm_look (lw6sys_context_t * sys_context, lw6gui_look_t * c_look)

sys_context: global system context

c_look: the look object

Creates an SCM ’look’ object from C data.

Return value: the SCM object

Function: lw6gui_look_t * lw6_scm_to_look (lw6sys_context_t * sys_context, SCM look)

sys_context: global system context

look: the look to convert (SCM object)

Gets the internal C pointer corresponding to the scheme ’look’ object.

Return value: a pointer, *not* a copy, must not be freed

Function: void lw6_free_look_smob (lw6sys_context_t * sys_context, lw6_look_smob_t * look_smob)

sys_context: global system context

look_smob: the smob to free

Frees a look smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.

Return value: none

Function: SCM lw6_make_scm_loader (lw6sys_context_t * sys_context, lw6tsk_loader_t * c_loader)

sys_context: global system context

c_loader: the loader object

Creates an SCM ’loader’ object from C data.

Return value: the SCM object

Function: lw6tsk_loader_t * lw6_scm_to_loader (lw6sys_context_t * sys_context, SCM loader)

sys_context: global system context

loader: the loader to convert (SCM object)

Gets the internal C pointer corresponding to the scheme ’loader’ object.

Return value: a pointer, *not* a copy, must not be freed

Function: void lw6_free_loader_smob (lw6sys_context_t * sys_context, lw6_loader_smob_t * loader_smob)

sys_context: global system context

loader_smob: the smob to free

Frees a loader smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.

Return value: none

Function: SCM lw6_make_scm_db (lw6sys_context_t * sys_context, lw6p2p_db_t * c_db)

sys_context: global system context

c_db: the database object

Creates an SCM ’db’ object from C data.

Return value: the SCM object

Function: lw6p2p_db_t * lw6_scm_to_db (lw6sys_context_t * sys_context, SCM db)

sys_context: global system context

db: the db to convert (SCM object)

Gets the internal C pointer corresponding to the scheme ’db’ object.

Return value: a pointer, *not* a copy, must not be freed

Function: void lw6_free_db_smob (lw6sys_context_t * sys_context, lw6_db_smob_t * db_smob)

sys_context: global system context

db_smob: the smob to free

Frees a db smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.

Return value: none

Function: SCM lw6_make_scm_node (lw6sys_context_t * sys_context, lw6p2p_node_t * c_node, SCM db)

sys_context: global system context

c_node: the node object

db: the db (SCM object) referenced

Creates an SCM ’node’ object from C data. Passing db enables the garbage collector not to free db until node is freed.

Return value: the SCM object

Function: lw6p2p_node_t * lw6_scm_to_node (lw6sys_context_t * sys_context, SCM node)

sys_context: global system context

node: the node to convert (SCM object)

Gets the internal C pointer corresponding to the scheme ’node’ object.

Return value: a pointer, *not* a copy, must not be freed

Function: void lw6_free_node_smob (lw6sys_context_t * sys_context, lw6_node_smob_t * node_smob)

sys_context: global system context

node_smob: the smob to free

Frees a node smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.

Return value: none

Function: SCM lw6_make_scm_jpeg (lw6sys_context_t * sys_context, lw6img_jpeg_t * c_jpeg)

sys_context: global system context

c_jpeg: the database object

Creates an SCM ’jpeg’ object from C data.

Return value: the SCM object

Function: lw6img_jpeg_t * lw6_scm_to_jpeg (lw6sys_context_t * sys_context, SCM jpeg)

sys_context: global system context

jpeg: the jpeg to convert (SCM object)

Gets the internal C pointer corresponding to the scheme ’jpeg’ object.

Return value: a pointer, *not* a copy, must not be freed

Function: void lw6_free_jpeg_smob (lw6sys_context_t * sys_context, lw6_jpeg_smob_t * jpeg_smob)

sys_context: global system context

jpeg_smob: the smob to free

Frees a jpeg smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.

Return value: none

Function: int lw6_register_smobs (lw6sys_context_t * sys_context)

sys_context: global system context

Register all smobs to Guile.

Return value: 1 on success, 0 if failed.

Function: int lw6_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the lw6 module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the liquidwar6 core module test suite, this will mostly test how Guile script integration works, loading a sample script and running it. It does not launch all the other sub modules tests.

Return value: 1 if test is successfull, 0 on error.


Next: , Previous: , Up: C API   [Contents][Index]

5.2 libbot

5.2.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/bot/index.html.

5.2.2 API

Function: int lw6bot_init (lw6sys_context_t * sys_context, lw6bot_backend_t * backend, lw6bot_seed_t * seed)

sys_context: global system context

backend: backend to use

seed: parameters required to build bot (game state, among other things)

Initializes a bot object. Must be performed before any other call. The seed is absolutely required, for a bot really needs to know what map/context it’s working on, including at creation time

Return value: 1 on success, 0 on failure.

Function: void lw6bot_quit (lw6sys_context_t * sys_context, lw6bot_backend_t * backend)

sys_context: global system context

backend: unitialize a bot backend

Closes a bot, but does not free all ressources.

Function: int lw6bot_next_move (lw6sys_context_t * sys_context, lw6bot_backend_t * backend, int * x, int * y)

sys_context: global system context

backend: bot to work on

x: next x position (out param)

y: next y position (out param)

Queries the bot for its next move, this is actually the one interesting function in the whole bot API.

Return value: 1 on success, 0 on failure.

Function: char * lw6bot_repr (lw6sys_context_t * sys_context, const lw6bot_backend_t * backend)

sys_context: global system context

backend: bot to represent

Gives a human readable representation of bot

Return value: dynamically allocated string.

Function: lw6sys_assoc_t * lw6bot_get_backends (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc, as passed to main

argv: argv, as passed to main

List available bot backends. The hash contains pairs with id and name for each backend. The id is the technical key you can use to load the backend, the name is something more readable you can display in an interface. The backend objects themselves are not instanciated by this (in fact, they are, but released on the fly) you need to load and initialize them afterwards.

Return value: hash containing id/name pairs.

Function: lw6bot_backend_t * lw6bot_create_backend (lw6sys_context_t * sys_context, int argc, const char * [] argv, const char * name)

sys_context: global system context

argc: argc, as passed to main

argv: argv, as passed to main

name: string containing bot key, typically got from lw6bot_get_backends

Creates a bot backend, this is just about loading the dynamic library if needed, and/or check bot engine is available, and connect to it. It does not perform initialization.

Return value: bot backend.

Function: void lw6bot_destroy_backend (lw6sys_context_t * sys_context, lw6bot_backend_t * backend)

sys_context: global system context

backend: bot backend to destroy

Frees the ressources associated to a bot, which must have been properly uninitialized before.

Return value: none.

Function: int lw6bot_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libbot module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6bot_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the bot module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Struct: lw6bot_backend_s

The bot backend is the first argument passed to any bot function, it contains reference to all the functions which can be used as well as a pointer on associated data. In OO, this would just be an object, with members and methods, using polymorphism through opaque pointers.

Member of lw6bot_backend_s: dl_handle

Type: lw6dyn_dl_handle_t *

Definition: lw6dyn_dl_handle_t* lw6bot_backend_s::dl_handle

Handle on dynamic library (if it makes sense).

Member of lw6bot_backend_s: bot_context

Type: void *

Definition: void* lw6bot_backend_s::bot_context

Bot specific data, what is behind this pointer really depends on the bot engine.

Member of lw6bot_backend_s: argc

Type: int

Definition: int lw6bot_backend_s::argc

The argc value passed to main.

Member of lw6bot_backend_s: argv

Type: const char **

Definition: const char** lw6bot_backend_s::argv

The argv value passed to main.

Member of lw6bot_backend_s: id

Type: u_int32_t

Definition: u_int32_t lw6bot_backend_s::id

The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Member of lw6bot_backend_s: seed

Type: lw6bot_seed_t

Definition: lw6bot_seed_t lw6bot_backend_s::seed

Parameters passed at initialization.

Member of lw6bot_backend_s: init

Type: void *(*

Definition: void*(* lw6bot_backend_s::init)(lw6sys_context_t *sys_context, int argc, const char *argv[], lw6bot_data_t *data)

Pointer on lw6bot_init callback code.

Member of lw6bot_backend_s: quit

Type: void(*

Definition: void(* lw6bot_backend_s::quit)(lw6sys_context_t *sys_context, void *bot_context)

Pointer on lw6bot_context callback code.

Member of lw6bot_backend_s: next_move

Type: int(*

Definition: int(* lw6bot_backend_s::next_move)(lw6sys_context_t *sys_context, void *bot_context, int *x, int *y, lw6bot_data_t *data)

Pointer on lw6bot_next_move callback code.

Member of lw6bot_backend_s: repr

Type: char *(*

Definition: char*(* lw6bot_backend_s::repr)(lw6sys_context_t *sys_context, void *bot_context, u_int32_t id)

Pointer on lw6bot_repr callback code.

Struct: lw6bot_data_s

Data used by a bot, those are essentially stable data passed as an argument plus changing data, that is, the game state.

Member of lw6bot_data_s: game_state

Type: const lw6ker_game_state_t *

Definition: const lw6ker_game_state_t* lw6bot_data_s::game_state

Game state the bot will have to base its reflexion upon. This not need be always the same game state, the pointer might change, but it should always refer to the same logical game, that is, at least, same struct.

Member of lw6bot_data_s: param

Type: lw6bot_param_t

Definition: lw6bot_param_t lw6bot_data_s::param

Constant parameters passed to the bot at creation.

Struct: lw6bot_param_s

Parameters usable by a bot engine. Those are the stable, fixed parameters passed at bot creation, they don’t change during the bot life.

Member of lw6bot_param_s: speed

Type: float

Definition: float lw6bot_param_s::speed

Speed of the bot, this is a value between 0.0f and 1.0f, 1 means normal speed, 0 is as slow as possible. Values over 1 will make the bot act/move faster than usual.

Member of lw6bot_param_s: iq

Type: int

Definition: int lw6bot_param_s::iq

IQ is supposed to reflect the cleverness of the bot. The default is 100 (this value is basically a percentage), 0 means just so stupid, and a high value, for instance 200, means very clever.

Member of lw6bot_param_s: cursor_id

Type: u_int16_t

Definition: u_int16_t lw6bot_param_s::cursor_id

The cursor ID, which is a 16-bit non-null integer.

Struct: lw6bot_seed_s

Parameters passed at bot creation, the only use for this is to simplify the protoype of the init function.

Member of lw6bot_seed_s: game_state

Type: const lw6ker_game_state_t *

Definition: const lw6ker_game_state_t* lw6bot_seed_s::game_state

Game state, that is, the level used, the fighters on it, the other cursors positions, and so on.

Member of lw6bot_seed_s: pilot

Type: lw6pil_pilot_t *

Definition: lw6pil_pilot_t* lw6bot_seed_s::pilot

This can be NULL, it’s a pilot object which can be used in some case, when, for instance, in dirty read mode, we want to read the level on the fly without syncing.

Member of lw6bot_seed_s: dirty_read

Type: int

Definition: int lw6bot_seed_s::dirty_read

The dirty read mode (between 0 and 2).

Member of lw6bot_seed_s: param

Type: lw6bot_param_t

Definition: lw6bot_param_t lw6bot_seed_s::param

Parameters given to the bot at creation.


Next: , Previous: , Up: C API   [Contents][Index]

5.3 mod-brute

5.3.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/bot/mod-brute/index.html.

5.3.2 API

Function: void mod_brute_is_GPL_compatible ()

Defined to tell mod_brute is compatible with GNU General Public License. Of course it is. This function does nothing, but the fact it’s declared makes its GPL compatibility obvious. Having this declared is required.

Return value: none

Function: void mod_brute_is_dlclose_safe ()

Defined to tell mod_brute has no dlclose issue, once can safely call lt_dlclose on it when done with it, without risking any segfault. Some other LW6 modules/shared libraries do have this problem.

Return value: none

Function: lw6sys_module_pedigree_t * mod_brute_get_pedigree (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the pedigree for mod-brute, giving details about the module, including name, description, licence, date/time of compilation.

Return value: dynamically allocated object.

Function: lw6bot_backend_t * mod_brute_create_backend (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a mod-brute backend.

Return value: backend pointer.


Next: , Previous: , Up: C API   [Contents][Index]

5.4 mod-follow

5.4.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/bot/mod-follow/index.html.

5.4.2 API

Function: void mod_follow_is_GPL_compatible ()

Defined to tell mod_follow is compatible with GNU General Public License. Of course it is. This function does nothing, but the fact it’s declared makes its GPL compatibility obvious. Having this declared is required.

Return value: none

Function: void mod_follow_is_dlclose_safe ()

Defined to tell mod_follow has no dlclose issue, once can safely call lt_dlclose on it when done with it, without risking any segfault. Some other LW6 modules/shared libraries do have this problem.

Return value: none

Function: lw6sys_module_pedigree_t * mod_follow_get_pedigree (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the pedigree for mod-follow, giving details about the module, including name, description, licence, date/time of compilation.

Return value: dynamically allocated object.

Function: lw6bot_backend_t * mod_follow_create_backend (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a mod-follow backend.

Return value: backend pointer.


Next: , Previous: , Up: C API   [Contents][Index]

5.5 mod-idiot

5.5.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/bot/mod-idiot/index.html.

5.5.2 API

Function: void mod_idiot_is_GPL_compatible ()

Defined to tell mod_idiot is compatible with GNU General Public License. Of course it is. This function does nothing, but the fact it’s declared makes its GPL compatibility obvious. Having this declared is required.

Return value: none

Function: void mod_idiot_is_dlclose_safe ()

Defined to tell mod_idiot has no dlclose issue, once can safely call lt_dlclose on it when done with it, without risking any segfault. Some other LW6 modules/shared libraries do have this problem.

Return value: none

Function: lw6sys_module_pedigree_t * mod_idiot_get_pedigree (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the pedigree for mod-idiot, giving details about the module, including name, description, licence, date/time of compilation.

Return value: dynamically allocated object.

Function: lw6bot_backend_t * mod_idiot_create_backend (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a mod-idiot backend.

Return value: backend pointer.


Next: , Previous: , Up: C API   [Contents][Index]

5.6 mod-random

5.6.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/bot/mod-random/index.html.

5.6.2 API

Function: void mod_random_is_GPL_compatible ()

Defined to tell mod_random is compatible with GNU General Public License. Of course it is. This function does nothing, but the fact it’s declared makes its GPL compatibility obvious. Having this declared is required.

Return value: none

Function: void mod_random_is_dlclose_safe ()

Defined to tell mod_random has no dlclose issue, once can safely call lt_dlclose on it when done with it, without risking any segfault. Some other LW6 modules/shared libraries do have this problem.

Return value: none

Function: lw6sys_module_pedigree_t * mod_random_get_pedigree (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the pedigree for mod-random, giving details about the module, including name, description, licence, date/time of compilation.

Return value: dynamically allocated object.

Function: lw6bot_backend_t * mod_random_create_backend (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a mod-random backend.

Return value: backend pointer.


Next: , Previous: , Up: C API   [Contents][Index]

5.7 libcfg

5.7.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/cfg/index.html.

5.7.2 API

Function: int lw6cfg_parse_command_line (lw6sys_context_t * sys_context, void * cfg_context)

sys_context: global system context

cfg_context: opaque pointer on a context

Overwrites any existing option with command line args

Return value: 1 if success, 0 if error

Function: int lw6cfg_defaults (lw6sys_context_t * sys_context, void * cfg_context)

sys_context: global system context

cfg_context: opaque pointer on a context

Sets all values to their defaults.

Return value: 1 if success, 0 if error

Function: int lw6cfg_merge_env (lw6sys_context_t * sys_context, void * cfg_context)

sys_context: global system context

cfg_context: a context returned by lw6cfg_init

Overwrites any existing vale in the config with environment variables prefixed by LW6_.

Return value: 1 if successfull, 0 if error.

Function: int lw6cfg_load_exp (lw6sys_context_t * sys_context, const char * user_dir, int * exp)

sys_context: global system context

user_dir: the user directory

exp: the exp (out param)

Gets exp from file.

Return value: 1 on success, 0 on failure

Function: int lw6cfg_save_exp (lw6sys_context_t * sys_context, const char * user_dir, int exp)

sys_context: global system context

user_dir: the user directory

exp: the exp

Saves exp to file.

Return value: 1 on success, 0 on failure

Function: char * lw6cfg_format (lw6sys_context_t * sys_context, const char * key, const char * value, lw6hlp_type_t type)

sys_context: global system context

key: the key of the value to format

value: the value to format

type: the type of the value to format

Formats, converts, a given value to its cannonical representation. Booleans will be converted to true/false, strings containing integers will be stripped from junk, and so on. This is a performance killer but will ensure everything is correct.

Return value: a newly allocated string, containing the same as the input, but reformatted the pedantic way.

Function: char * lw6cfg_format_guess_type (lw6sys_context_t * sys_context, const char * key, const char * value)

sys_context: global system context

key: the key of the value to format

value: the value to format

Formats, converts, a given value to its cannonical representation. Booleans will be converted to true/false, strings containing integers will be stripped from junk, and so on. This is a performance killer but will ensure everything is correct. This function will automatically guess the type of the value from its description in the help system.

Return value: a newly allocated string, containing the same as the input, but reformatted the pedantic way.

Function: int lw6cfg_load (lw6sys_context_t * sys_context, void * cfg_context, const char * filename)

sys_context: global system context

cfg_context: a context returned by lw6cfg_init

filename: a file path, absolute or relative

Loads the given config file, and stores its values into the current context. Parameters which are both in the config file and given as command line parameters, will be taken from the command-line.

Return value: 1 if successfull, 0 if error.

Function: int lw6cfg_option_exists (lw6sys_context_t * sys_context, void * cfg_context, const char * key)

sys_context: global system context

cfg_context: context to query

key: key to search

Returns wether a key exists within context or not.

Return value: 1 if exists, 0 if not

Function: char * lw6cfg_get_option (lw6sys_context_t * sys_context, void * cfg_context, const char * key)

sys_context: global system context

cfg_context: context to query

key: key to search

Returns the current value for a given query, the returned value is always a string, typically the string one would pass on the command line or set in a config file

Return value: pointer to string, must be freed.

Function: void lw6cfg_set_option (lw6sys_context_t * sys_context, void * cfg_context, const char * key, const char * value)

sys_context: global system context

cfg_context: context to modify

key: key to search and change

value: new value

Sets a given key to the specified value, this is a string only function, pass the value you would pass on the command line or set in a config file.

Return value: none

Function: int lw6cfg_get_option_int (lw6sys_context_t * sys_context, void * cfg_context, const char * key)

key: key to search

Returns an option as an integer. Note that this function does not know wether the parameter should really be an integer or not, so you can call it even on non-integer values, but of course results will have no real meaning.

Return value: option value converted to int

Function: void lw6cfg_set_option_int (lw6sys_context_t * sys_context, void * cfg_context, const char * key, int value)

sys_context: global system context

cfg_context: context to modify

key: key to search and change

value: new value

Set a config option to an integer value. Note that this function does not know wether the parameter should really be an integer or not, so you can call it even on non-integer values, at your own risk.

Return value: none.

Function: int lw6cfg_get_option_bool (lw6sys_context_t * sys_context, void * cfg_context, const char * key)

sys_context: global system context

cfg_context: context to query

key: key to search

Returns an option as a boolean. Note that this function does not know wether the parameter should really be a boolean or not, so you can call it even on non-boolean values, but of course results will have no real meaning.

Return value: option value converted to boolean

Function: void lw6cfg_set_option_bool (lw6sys_context_t * sys_context, void * cfg_context, const char * key, int value)

sys_context: global system context

cfg_context: context to modify

key: key to search and change

value: new value

Set a config option to a boolean value. Note that this function does not know wether the parameter should really be a boolean or not, so you can call it even on non-boolean values, at your own risk.

Return value: none.

Function: int lw6cfg_must_be_saved (lw6sys_context_t * sys_context, const char * key)

sys_context: global system context

key: key to test

Tells wether a key should be saved in the config file. Typically, some options you don’t want to savem such as the location of the config file itself. Most of those non-savable parameters are path-related. This does not mean no paths are saved in the config file.

Return value: 1 if must be saved, 0 if not

Function: int lw6cfg_save (lw6sys_context_t * sys_context, void * cfg_context, const char * filename)

sys_context: global system context

cfg_context: a context returned by lw6cfg_init

filename: a file path, absolute or relative

Save current options into the given config file. Before saving the file, all command line arguments will be read and will override current values. This means the saved file will contain values given as command line arguments.

Return value: 1 if successfull, 0 if error.

Function: void * lw6cfg_init (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: number of command line arguments, as given to main

argv: a list of command line arguments, as given to main

Initializes a config context object. This object is hidden behind an opaque void * pointer to avoid direct access to its elements.

Return value: an opaque pointer, must be freed with lw6cfg_quit.

Function: void lw6cfg_quit (lw6sys_context_t * sys_context, void * cfg_context)

sys_context: global system context

cfg_context: a context returned by lw6cfg_init

Frees a config cfg_context object. You must call this once you’re done with the context.

Return value: none.

Function: void lw6cfg_reset (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: number of command line arguments, as given to main

argv: a list of command line arguments, as given to main

Overwrites the config file with defaults. Use this to get rid of old configurations.

Function: int lw6cfg_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libcfg module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6cfg_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the cfg module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Function: char * lw6cfg_unified_get_value (lw6sys_context_t * sys_context, int argc, const char * [] argv, char * key)

sys_context: global system context

argc: number of command-line args, as passed to main

argv: arry of command-line args, as passed to main

key: the key to query

Unified "value" getter, which gets informations from environment variables, command line, and config file. The rules is that the command-line argument always has the last word. It will override any other value. Follows environment variables, which will be used if no command-line argument is supplied. Note that these are "LW6_" prefixed and uppercased environment variables as opposed to lowercased and "dash-separated" keys. Finally, if there’s no environment variable, nor any config-file corresponding entry, the value will be searched in the config file. If there’s no information in the config file, NULL is returned.

Return value: a string with the value. Can be NULL. Must be freed.

Function: char * lw6cfg_unified_get_user_dir (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: number of command-line args, as passed to main

argv: arry of command-line args, as passed to main

Gets the user dir, taking all parameters in account, that’s to say the "LW6_USER_DIR" env value, the "–user-dir" command-line paramater and the LW6DEF_USER_DIR config file entry.

Return value: the directory path, might be NULL, must be freed.

Function: char * lw6cfg_unified_get_log_file (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: number of command-line args, as passed to main

argv: arry of command-line args, as passed to main

Gets the log file, taking all parameters in account, that’s to say the "LW6_LOG_FILE" env value, the "–log-file" command-line paramater and the LW6DEF_LOG_FILE config file entry.

Return value: the directory path, might be NULL, must be freed.

Function: char * lw6cfg_unified_get_music_path (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: number of command-line args, as passed to main

argv: arry of command-line args, as passed to main

Gets the user dir, taking all parameters in account, that’s to say the "LW6_MUSIC_PATH" env value, the "–music-path" command-line paramater and the LW6DEF_MUSIC_PATH config file entry.

Return value: the directory path, might be NULL, must be freed.

Function: char * lw6cfg_unified_get_map_path (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: number of command-line args, as passed to main

argv: arry of command-line args, as passed to main

Gets the user dir, taking all parameters in account, that’s to say the "LW6_MAP_PATH" env value, the "–map-path" command-line paramater and the LW6DEF_MAP_PATH config file entry.

Return value: the directory path, might be NULL, must be freed.

Function: char * lw6cfg_xml_element (lw6sys_context_t * sys_context, lw6hlp_type_t type)

sys_context: global system context

type: type as an enum

Returns the string corresponding to a given type, suitable for use in XML files. For instance if you pass LW6HLP_TYPE_INT then you will obtain the string int (string of 3 chars containing i, n and t.

Return value: string, must not be freed.

Function: void lw6cfg_read_xml_int (lw6sys_context_t * sys_context, const char * xml_key, const char * xml_value, const char * target_key, int * value)

sys_context: global system context

xml_key: key found in XML file

xml_value: value found in XML file

target_key: key we’re searching for

value: the value if found (out param)

Tries to find a value in a key/value pair. If xml_key and target_key match, then will put the corresponding value (converted to int) in the value param. Typically, you would call this in a loop on every single entry found in an XML file, in an expat callback.

Return value: none.

Function: void lw6cfg_read_xml_bool (lw6sys_context_t * sys_context, const char * xml_key, const char * xml_value, const char * target_key, int * value)

sys_context: global system context

xml_key: key found in XML file

xml_value: value found in XML file

target_key: key we’re searching for

value: the value if found (out param)

Tries to find a value in a key/value pair. If xml_key and target_key match, then will put the corresponding value (converted to boolean) in the value param. Typically, you would call this in a loop on every single entry found in an XML file, in an expat callback.

Return value: none.

Function: void lw6cfg_read_xml_float (lw6sys_context_t * sys_context, const char * xml_key, const char * xml_value, const char * target_key, float * value)

sys_context: global system context

xml_key: key found in XML file

xml_value: value found in XML file

target_key: key we’re searching for

value: the value if found (out param)

Tries to find a value in a key/value pair. If xml_key and target_key match, then will put the corresponding value (converted to float) in the value param. Typically, you would call this in a loop on every single entry found in an XML file, in an expat callback.

Return value: none.

Function: void lw6cfg_read_xml_string (lw6sys_context_t * sys_context, const char * xml_key, const char * xml_value, const char * target_key, char ** value)

sys_context: global system context

xml_key: key found in XML file

xml_value: value found in XML file

target_key: key we’re searching for

value: the value if found (out param)

Tries to find a value in a key/value pair. If xml_key and target_key match, then will put the corresponding value (as a string) in the value param. Typically, you would call this in a loop on every single entry found in an XML file, in an expat callback.

Return value: none.

Function: void lw6cfg_read_xml_color (lw6sys_context_t * sys_context, const char * xml_key, const char * xml_value, const char * target_key, lw6sys_color_8_t * value)

sys_context: global system context

xml_key: key found in XML file

xml_value: value found in XML file

target_key: key we’re searching for

value: the value if found (out param)

Tries to find a value in a key/value pair. If xml_key and target_key match, then will put the corresponding value (converted to a color) in the value param. Typically, you would call this in a loop on every single entry found in an XML file, in an expat callback.

Return value: none.

Function: int lw6cfg_read_key_value_xml_file (lw6sys_context_t * sys_context, const char * filename, lw6cfg_read_xml_callback_func_t callback_func, void * callback_data)

sys_context: global system context

filename: full path of file to read

callback_func: callback function to be called on each element

callback_data: additionnal pointer passed to callback function

Will parse a file and call the given callback on each element. This is an over-simplified way to read XML file, in fact we just explain plain non-nested simple elements but this is exactly what LW config files are made of.

Return value: 1 on success, 0 on failure.

Function: void lw6cfg_write_xml_int (lw6sys_context_t * sys_context, FILE * f, const char * key, int value)

sys_context: global system context

f: file to write data to (append mode)

key: key to write

value: value to write

Writes an int entry into an opened XML file.

Return value: none.

Function: void lw6cfg_write_xml_bool (lw6sys_context_t * sys_context, FILE * f, const char * key, int value)

sys_context: global system context

f: file to write data to (append mode)

key: key to write

value: value to write

Writes a boolean entry into an opened XML file.

Return value: none.

Function: void lw6cfg_write_xml_float (lw6sys_context_t * sys_context, FILE * f, const char * key, float value)

sys_context: global system context

f: file to write data to (append mode)

key: key to write

value: value to write

Writes a float entry into an opened XML file.

Return value: none.

Function: void lw6cfg_write_xml_string (lw6sys_context_t * sys_context, FILE * f, const char * key, const char * value)

sys_context: global system context

f: file to write data to (append mode)

key: key to write

value: value to write

Writes a string entry into an opened XML file.

Return value: none.

Function: void lw6cfg_write_xml_color (lw6sys_context_t * sys_context, FILE * f, const char * key, lw6sys_color_8_t value)

sys_context: global system context

f: file to write data to (append mode)

key: key to write

value: value to write

Writes a color entry into an opened XML file.

Return value: none.

Function: void lw6cfg_write_xml_guess_type (lw6sys_context_t * sys_context, FILE * f, const char * key, const char * value)

sys_context: global system context

f: file to write data to (append mode)

key: key to write

value: value to write

Writes an entry into an opened XML file, will try and guess type from the internal help system, typically, if this is a standard config file entry (the one documented by the about command line function) it will pick up the right type. The reason not to use this all the times is that sometimes, one might to to store non-standard options, and additionnally, guessing the type does consume some CPU.

Return value: none.

Function: void lw6cfg_write_xml_guess_type_skip_same (lw6sys_context_t * sys_context, FILE * f, const char * key, const char * value)

sys_context: global system context

f: file to write data to (append mode)

key: key to write

value: value to write

Writes an entry into an opened XML file, will try and guess type from the internal help system, typically, if this is a standard config file entry (the one documented by the about command line function) it will pick up the right type. The reason not to use this all the times is that sometimes, one might to to store non-standard options, and additionnally, guessing the type does consume some CPU. Also, this function will write only values that are different from the default.

Return value: none.


Next: , Previous: , Up: C API   [Contents][Index]

5.8 libcli

5.8.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/cli/index.html.

5.8.2 API

Function: int lw6cli_init (lw6sys_context_t * sys_context, lw6cli_backend_t * backend)

sys_context: global system context

backend: backend to use

Initializes a client backend. Must be performed before any other call.

Return value: 1 on success, 0 on failure

Function: void lw6cli_quit (lw6sys_context_t * sys_context, lw6cli_backend_t * backend)

sys_context: global system context

backend: unitialize a cli backend

Closes a cli, but does not free all ressources.

Function: int lw6cli_process_oob (lw6sys_context_t * sys_context, lw6cli_backend_t * backend, lw6nod_info_t * node_info, lw6cli_oob_data_t * oob_data)

sys_context: global system context

backend: backend to use

node_info: information on the current node

oob_data: data of the out-of-band request

Processes the required out-of-band tasks, this typically, for a client, includes broadcasting. Depending on parameters passed in oob_data, might actually do a broadcast or simply call a given host and see what’s the answer. A typicall exchange is PING then INFO and finally LIST. It’s the responsability of the client to take the OOB initiative and contact the server.

Return value: 1 on success, 0 on failure.

Function: lw6cnx_connection_t * lw6cli_open (lw6sys_context_t * sys_context, lw6cli_backend_t * backend, const char * local_url, const char * remote_url, const char * remote_ip, int remote_port, const char * password, u_int64_t local_id, u_int64_t remote_id, int dns_ok, int network_reliability)

sys_context: global system context

backend: backend to use

local_url: our local public url

remote_url: the remote url we want to connect to

remote_ip: remote IP address

remote_port: remote IP port

password: password to use (if needed)

local_id: our local id

remote_id: the remote id

dns_ok: wether the remote announced URL matches DNS information

network_reliability: network reliability (the highest, the better)

Opens a connection with a remote host.

Return value: new object.

Function: void lw6cli_close (lw6sys_context_t * sys_context, lw6cli_backend_t * backend, lw6cnx_connection_t * connection)

sys_context: global system context

backend: backend to use

connection: connection to use

Closes a connection, this will free the connection object.

Return value: none.

Function: int lw6cli_send (lw6sys_context_t * sys_context, lw6cli_backend_t * backend, lw6cnx_connection_t * connection, int64_t now, u_int32_t physical_ticket_sig, u_int32_t logical_ticket_sig, u_int64_t logical_from_id, u_int64_t logical_to_id, const char * message)

sys_context: global system context

backend: backend to use

connection: connection to use

now: current timestamp

physical_ticket_sig: signature of physical sender

logical_ticket_sig: signature of logical sender

logical_from_id: id of logical sender

logical_to_id: id of logicial target

message: text of message to send

Sends a message to a peer over a given connection.

Return value: 1 on success, 0 on failure.

Function: int lw6cli_can_send (lw6sys_context_t * sys_context, lw6cli_backend_t * backend, lw6cnx_connection_t * connection)

sys_context: global system context

backend: backend to use

connection: connection to use

Tells wether a client connection can technically send messages. This does not garantee send will succeed, but if it’s not OK at this stage, it’s not even worth trying.

Return value: 1 if it can be used to send messages, 0 if not ready.

Function: void lw6cli_poll (lw6sys_context_t * sys_context, lw6cli_backend_t * backend, lw6cnx_connection_t * connection)

sys_context: global system context

backend: backend to use

connection: connection to use

Performs required duty on connection, depending on the backend, this can include sending messages and/or receiving them. Must be called on a regular basis.

Return value: none.

Function: char * lw6cli_repr (lw6sys_context_t * sys_context, const lw6cli_backend_t * backend, lw6cnx_connection_t * connection)

sys_context: global system context

backend: backend to use

connection: connection to represent

Gives a human readable representation of the connection.

Return value: dynamically allocated string.

Function: lw6cli_oob_t * lw6cli_oob_new (lw6sys_context_t * sys_context, const char * public_url, lw6cli_verify_callback_func_t verify_callback_func, void * verify_callback_data)

sys_context: global system context

public_url: the address of the distant server to test

verify_callback_func: a function which will be called when a node has been verified

verify_callback_data: additionnal data passed to the callback func

Create a new OOB structure, copying required objects. We need to make copies for this is for usage in a separate thread. The thread member is not set here since the right way to do things is first to set up data then to fire the thread.

Return value: new object

Function: void lw6cli_oob_free (lw6sys_context_t * sys_context, lw6cli_oob_t * oob)

sys_context: global system context

oob: the object to free

Frees an OOB structure.

Return value: none

Function: char * lw6cli_default_backends (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of the default cli backends.

Return value: comma separated string, must not be freed.

Function: lw6sys_assoc_t * lw6cli_get_backends (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc, as passed to main

argv: argv, as passed to main

List available cli backends. The hash contains pairs with id and name for each backend. The id is the technical key you can use to load the backend, the name is something more readable you can display in an interface. The backend objects themselves are not instanciated by this (in fact, they are, but released on the fly) you need to load and initialize them afterwards.

Return value: hash containing id/name pairs.

Function: lw6cli_backend_t * lw6cli_create_backend (lw6sys_context_t * sys_context, int argc, const char * [] argv, const char * name)

sys_context: global system context

argc: argc, as passed to main

argv: argv, as passed to main

name: string containing cli key, typically got from lw6cli_get_backends

Creates a cli backend, this is just about loading the dynamic library if needed, and/or check cli engine is available, and connect to it. It does not perform initialization.

Return value: cli backend.

Function: void lw6cli_destroy_backend (lw6sys_context_t * sys_context, lw6cli_backend_t * backend)

sys_context: global system context

backend: backend to destroy

Destroys a cli backend.

Return value: none.

Function: int lw6cli_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libcli module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6cli_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the cli module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Struct: lw6cli_backend_s

The cli backend is the first argument passed to any cli function, it contains reference to all the functions which can be used as well as a pointer on associated data. In OO, this would just be an object, with members and methods, using polymorphism through opaque pointers.

Member of lw6cli_backend_s: dl_handle

Type: lw6dyn_dl_handle_t *

Definition: lw6dyn_dl_handle_t* lw6cli_backend_s::dl_handle

Handle on dynamic library (if it makes sense).

Member of lw6cli_backend_s: cli_context

Type: void *

Definition: void* lw6cli_backend_s::cli_context

Cli specific data, what is behind this pointer really depends on the cli engine.

Member of lw6cli_backend_s: argc

Type: int

Definition: int lw6cli_backend_s::argc

The argc value passed to main.

Member of lw6cli_backend_s: argv

Type: const char **

Definition: const char** lw6cli_backend_s::argv

The argv value passed to main.

Member of lw6cli_backend_s: id

Type: u_int32_t

Definition: u_int32_t lw6cli_backend_s::id

The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Member of lw6cli_backend_s: name

Type: char *

Definition: char* lw6cli_backend_s::name

Module name.

Member of lw6cli_backend_s: properties

Type: lw6cnx_properties_t

Definition: lw6cnx_properties_t lw6cli_backend_s::properties

General backend properties.

Member of lw6cli_backend_s: init

Type: void *(*

Definition: void*(* lw6cli_backend_s::init)(lw6sys_context_t *sys_context, int argc, const char *argv[], lw6cnx_properties_t *properties)

Pointer on lw6cli_init callback code.

Member of lw6cli_backend_s: quit

Type: void(*

Definition: void(* lw6cli_backend_s::quit)(lw6sys_context_t *sys_context, void *cli_context)

Pointer on lw6cli_quit callback code.

Member of lw6cli_backend_s: process_oob

Type: int(*

Definition: int(* lw6cli_backend_s::process_oob)(lw6sys_context_t *sys_context, void *cli_context, lw6nod_info_t *node_info, lw6cli_oob_data_t *oob_data)

Pointer on lw6cli_process_oob callback code.

Member of lw6cli_backend_s: open

Type: lw6cnx_connection_t *(*

Definition: lw6cnx_connection_t*(* lw6cli_backend_s::open)(lw6sys_context_t *sys_context, void *cli_context, const char *local_url, const char *remote_url, const char *remote_ip, int remote_port, const char *password, u_int64_t local_id, u_int64_t remote_id, int dns_ok, int network_reliability)

Pointer on lw6cli_open callback code.

Member of lw6cli_backend_s: close

Type: void(*

Definition: void(* lw6cli_backend_s::close)(lw6sys_context_t *sys_context, void *cli_context, lw6cnx_connection_t *connection)

Pointer on lw6cli_close callback code.

Member of lw6cli_backend_s: send

Type: int(*

Definition: int(* lw6cli_backend_s::send)(lw6sys_context_t *sys_context, void *cli_context, lw6cnx_connection_t *connection, int64_t now, u_int32_t physical_ticket_sig, u_int32_t logical_ticket_sig, u_int64_t logical_from_id, u_int64_t logical_to_id, const char *message)

Pointer on lw6cli_send callback code.

Member of lw6cli_backend_s: can_send

Type: int(*

Definition: int(* lw6cli_backend_s::can_send)(lw6sys_context_t *sys_context, void *cli_context, lw6cnx_connection_t *connection)

Pointer on lw6cli_can_send callback code.

Member of lw6cli_backend_s: poll

Type: void(*

Definition: void(* lw6cli_backend_s::poll)(lw6sys_context_t *sys_context, void *cli_context, lw6cnx_connection_t *connection)

Pointer on lw6cli_poll callback code.

Member of lw6cli_backend_s: repr

Type: char *(*

Definition: char*(* lw6cli_backend_s::repr)(lw6sys_context_t *sys_context, void *cli_context, lw6cnx_connection_t *connection)

Pointer on lw6cli_repr callback code.

Struct: lw6cli_oob_data_s

Holds the data for the process_oob function, this is merely a utility struct to simplify headers/

Member of lw6cli_oob_data_s: creation_timestamp

Type: int64_t

Definition: int64_t lw6cli_oob_data_s::creation_timestamp

Creation timestamp of the OOB request, this is used to know wether we have already timed out or not. This is not the node creation timestamp.

Member of lw6cli_oob_data_s: do_not_finish

Type: int

Definition: volatile int lw6cli_oob_data_s::do_not_finish

Flag used to force finish, for instance when we want to delete the object quickly and do not want to wait until a long polling-based network operation finishes completely.

Member of lw6cli_oob_data_s: public_url

Type: char *

Definition: char* lw6cli_oob_data_s::public_url

Public URL of the node, we need this at hand to serve it quickly to peers, and be able to perform basic checks.

Member of lw6cli_oob_data_s: verify_callback_func

Type: lw6cli_verify_callback_func_t

Definition: lw6cli_verify_callback_func_t lw6cli_oob_data_s::verify_callback_func

Pointer on a function which will verify if peer is OK, and act accordinlgy if it’s OK or not. Note that the callback function might be called pretty much anytime in the heavily multithreaded context of LW6 so it must be reentrant and have mutexes if needed. Indeed, it’s very likely to update some shared list of available nodes.

Member of lw6cli_oob_data_s: verify_callback_data

Type: void *

Definition: void* lw6cli_oob_data_s::verify_callback_data

Data passed to the verify_callback function.

Struct: lw6cli_oob_s

Structure containing both the thread running an OOB request and its data. It was advantagious to separate thoses two and not make the thread a permanent member of the OOB data struct, since it allows the actual OOB code to be totally unaware of the thread running it, which is, to some extent, safer.

Member of lw6cli_oob_s: thread

Type: lw6sys_thread_handler_t *

Definition: lw6sys_thread_handler_t* lw6cli_oob_s::thread

Pointer on thread running the OOB request.

Member of lw6cli_oob_s: data

Type: lw6cli_oob_data_t

Definition: lw6cli_oob_data_t lw6cli_oob_s::data

Data used by the OOB request.


Next: , Previous: , Up: C API   [Contents][Index]

5.9 mod-http

5.9.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/cli/mod-http/index.html.

5.9.2 API

Function: void mod_http_is_GPL_compatible ()

Defined to tell mod_http is compatible with GNU General Public License. Of course it is. This function does nothing, but the fact it’s declared makes its GPL compatibility obvious. Having this declared is required.

Return value: none

Function: void mod_http_is_dlclose_safe ()

Defined to tell mod_http has no dlclose issue, once can safely call lt_dlclose on it when done with it, without risking any segfault. Some other LW6 modules/shared libraries do have this problem.

Return value: none

Function: lw6sys_module_pedigree_t * mod_http_get_pedigree (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the pedigree for mod-http, giving details about the module, including name, description, licence, date/time of compilation.

Return value: dynamically allocated object.

Function: lw6cli_backend_t * mod_http_create_backend (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a mod-http backend.

Return value: backend pointer.


Next: , Previous: , Up: C API   [Contents][Index]

5.10 mod-tcp

5.10.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/cli/mod-tcp/index.html.

5.10.2 API

Function: void mod_tcp_is_GPL_compatible ()

Defined to tell mod_tcp is compatible with GNU General Public License. Of course it is. This function does nothing, but the fact it’s declared makes its GPL compatibility obvious. Having this declared is required.

Return value: none

Function: void mod_tcp_is_dlclose_safe ()

Defined to tell mod_tcp has no dlclose issue, once can safely call lt_dlclose on it when done with it, without risking any segfault. Some other LW6 modules/shared libraries do have this problem.

Return value: none

Function: lw6sys_module_pedigree_t * mod_tcp_get_pedigree (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the pedigree for mod-tcp, giving details about the module, including name, description, licence, date/time of compilation.

Return value: dynamically allocated object.

Function: lw6cli_backend_t * mod_tcp_create_backend (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a mod-tcp backend.

Return value: backend pointer.


Next: , Previous: , Up: C API   [Contents][Index]

5.11 mod-udp

5.11.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/cli/mod-udp/index.html.

5.11.2 API

Function: void mod_udp_is_GPL_compatible ()

Defined to tell mod_udp is compatible with GNU General Public License. Of course it is. This function does nothing, but the fact it’s declared makes its GPL compatibility obvious. Having this declared is required.

Return value: none

Function: void mod_udp_is_dlclose_safe ()

Defined to tell mod_udp has no dlclose issue, once can safely call lt_dlclose on it when done with it, without risking any segfault. Some other LW6 modules/shared libraries do have this problem.

Return value: none

Function: lw6sys_module_pedigree_t * mod_udp_get_pedigree (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the pedigree for mod-udp, giving details about the module, including name, description, licence, date/time of compilation.

Return value: dynamically allocated object.

Function: lw6cli_backend_t * mod_udp_create_backend (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a mod-udp backend.

Return value: backend pointer.


Next: , Previous: , Up: C API   [Contents][Index]

5.12 libcns

5.12.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/cns/index.html.

5.12.2 API

Function: void lw6cns_handler_callback (char * line)

line: the input line

The global console handler. Because readline does not, or at least, because I did not find any proper way to pass it a general pointer along with the string, and since we need sys_context pretty much everywhere, we rely on using this handler which, in turn, calls the handler passed to lw6cns_handler_install with sys_context added as a first argument.

Return value: none.

Function: void lw6cns_handler_install (lw6sys_context_t * sys_context, lw6cns_callback_func_t callback)

sys_context: global system context

callback: handler function.

Installs a console handler.

Return value: none.

Function: void lw6cns_handler_poll (lw6sys_context_t * sys_context)

sys_context: global system context

Polling function for console, must be called on a regular basis.

Return value: none.

Function: void lw6cns_handler_remove (lw6sys_context_t * sys_context)

sys_context: global system context

Remove console handler.

Return value: none.

Function: void lw6cns_history_add_if_needed (lw6sys_context_t * sys_context, char * line)

sys_context: global system context

line: line to add

Adds a line to the console history, won’t add it if it’s NULL or empty.

Return value: none.

Function: int lw6cns_console_support (lw6sys_context_t * sys_context)

sys_context: global system context

Tells wether console is supported.

Return value: 1 if console can be enabled, 0 if not

Function: int lw6cns_term_support (lw6sys_context_t * sys_context)

sys_context: global system context

Tells wether program is likely to have proper term (xterm, Linux console) support.

Return value: 1 if has validated TERM support, 0 if not

Function: int lw6cns_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libcns module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6cns_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the cns module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.


Next: , Previous: , Up: C API   [Contents][Index]

5.13 libcnx

5.13.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/cnx/index.html.

5.13.2 API

Function: lw6cnx_connection_t * lw6cnx_connection_new (lw6sys_context_t * sys_context, const char * local_url, const char * remote_url, const char * remote_ip, int remote_port, const char * password, u_int64_t local_id, u_int64_t remote_id, int dns_ok, int network_reliability)

sys_context: global system context

local_url: the local public URL

remote_url: the remote public URL

remote_ip: the remote IP address

remote_port: the remote port

password: the password to use

local_id: the local ID

remote_id: the remote ID

dns_ok: 1 if no DNS mismatch, 0 if IP does not match public URL

network_reliability: drop 1 out of X packets

Create a connection object. This object in itself does nothing, it’s just to share common structures among modules, more precisely, between cli and srv code. It’s the responsability off the caller/backend to handle the backend_specific_data field which is NULL after this call.

Return value: newly allocated object.

Function: void lw6cnx_connection_free (lw6sys_context_t * sys_context, lw6cnx_connection_t * connection)

sys_context: global system context

connection: object to free

Frees a connection object. It’s the responsibility of the caller/backend to handle the backend_specific_data field.

Return value: none.

Function: int lw6cnx_connection_should_send_foo (lw6sys_context_t * sys_context, lw6cnx_connection_t * connection, int64_t now)

sys_context: global system context

connection: the connection concerned

now: the current timestamp

Tells wether a new foo message must be issued.

Return value: 1 if true, 0 if false.

Function: void lw6cnx_connection_init_foo_bar_key (lw6sys_context_t * sys_context, lw6cnx_connection_t * connection, int64_t now, int next_foo_delay)

sys_context: global system context

connection: the connection concerned

now: the current timestamp

next_foo_delay: the delay (msec) before next foo message is sent

Generates a new foo_bar_key, and schedules the next foo message send timestamp.

Return value: none.

Function: int lw6cnx_connection_lock_send (lw6sys_context_t * sys_context, lw6cnx_connection_t * connection)

sys_context: global system context

connection: the connexion to lock

Acquires a "send" lock on the connexion, the idea is to avoid too threads sending data using the same socket at the same time. Note that each backend must call this when accessing the socket, there’s no top-level lock for the sake of performance.

Return value: 1 on success, 0 if not.

Function: void lw6cnx_connection_unlock_send (lw6sys_context_t * sys_context, lw6cnx_connection_t * connection)

sys_context: global system context

connection: the connexion to lock

Releases a "send" lock on the connexion, the idea is to avoid too threads sending data using the same socket at the same time. Note that each backend must call this when accessing the socket, there’s no top-level lock for the sake of performance.

Return value: none.

Function: int lw6cnx_connection_reliability_filter (lw6sys_context_t * sys_context, lw6cnx_connection_t * connection)

sys_context: global system context

connection: the connexion concerned

Will filter and return true only in "rare" cases when packets must be artificially dropped for testing purpose.

Return value: 1 if message must be sent/received, 0 if not

Function: lw6cnx_packet_t * lw6cnx_packet_new (lw6sys_context_t * sys_context, u_int32_t logical_ticket_sig, u_int32_t physical_ticket_sig, u_int64_t logical_from_id, u_int64_t logical_to_id, const char * msg)

sys_context: global system context

logical_ticket_sig: logical signature

physical_ticket_sig: physical signature

logical_from_id: logical sender

logical_to_id: logical receiver

msg: the message text

Creates a new packet object, this simply allocates memory and copy the string. The string is duplicated, param msg can be freed.

Return value: new object.

Function: void lw6cnx_packet_free (lw6sys_context_t * sys_context, lw6cnx_packet_t * packet)

sys_context: global system context

packet: object to free

Frees a packet object.

Return value: none.

Function: u_int32_t lw6cnx_packet_checksum (lw6sys_context_t * sys_context, const lw6cnx_packet_t * packet)

sys_context: global system context

packet: packet to analyse

Calculates a checksum for a packet.

Return value: 32-bit checksum.

Function: int lw6cnx_packet_compare (lw6sys_context_t * sys_context, const lw6cnx_packet_t * a, const lw6cnx_packet_t * b)

sys_context: global system context

a: first packet to analyse

b: second packet to analyse

Compares two packets. The comparison is made using checksums, the result is a strcmp-like integer, which is adapted to sorting. The order has no real signification, it’s mostly used to re-order packets in a pseudo-random order, to ensure no algorithm relies on packets arriving in the right order.

Return value: -1 if a lower than b, 0 if a equals b, 1 if a is greater than b.

Function: int lw6cnx_packet_sort_callback (lw6sys_context_t * sys_context, void * func_data, const void * ptr_a, const void * ptr_b)

sys_context: global system context

func_data: additionnal data, function specific

ptr_a: first packet to analyse

ptr_b: second packet to analyse

Callback usable to sort packets, relies on lw6cnx_packet_compare internally.

Return value: -1 if ptr_a lower than ptr_b, 0 if ptr_a equals ptr_b, 1 if ptr_a is greater than ptr_b.

Function: char * lw6cnx_password_checksum (lw6sys_context_t * sys_context, const char * seed, const char * password)

sys_context: global system context

seed: a seed to blur the password, can be NULL

password: the password, can be NULL

Calculates the checksum of a password, and returns it as a string, ready to be sent on the network. If password is empty or NULL, then an empty (but not NULL unless internal error) string will be returned. All LW6 protocols should send these checksums instead of real passwords, then on server side value can be checked against both real password and its checksum. The seed is here so that eavesdropper can’t reuse the checksum to connect on random sessions. Seed can typically be the node ’public_url’ value.

Return value: a dynamically allocated string

Function: int lw6cnx_password_verify (lw6sys_context_t * sys_context, const char * seed, const char * password_here, const char * password_received)

sys_context: global system context

seed: a seed to blur the password, can be NULL

password_here: the local password, can be NULL

password_received: the password received from network, can be NULL

Tells wether a password received over the network is valid. The password_here argument (the local password) will be checksumed so that password_received is checked against both clear and checksumed values, so it can be in any form.

Return value: 1 if OK, passwords are the same, 0 if not.

Function: int lw6cnx_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libcnx module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6cnx_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the cnx module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Function: void lw6cnx_ticket_table_zero (lw6sys_context_t * sys_context, lw6cnx_ticket_table_t * ticket_table)

sys_context: global system context

ticket_table: the ticket table to fill with zero

Fills the ticket table struct with 0s.

Return value: none.

Function: int lw6cnx_ticket_table_init (lw6sys_context_t * sys_context, lw6cnx_ticket_table_t * ticket_table, int hash_size)

sys_context: global system context

ticket_table: the ticket table to init

hash_size: the hash size for both recv/send hashs

Initialize a ticket table, that is, set it up with two empty hashs. Recv hash is filled automatically as it’s queried for tickets, send hash must be filled explicitely with info from the network.

Return value: none.

Function: void lw6cnx_ticket_table_clear (lw6sys_context_t * sys_context, lw6cnx_ticket_table_t * ticket_table)

sys_context: global system context

ticket_table: the ticket table to clear

Clears the object (frees memory).

Return value: none.

Function: u_int64_t lw6cnx_ticket_table_get_recv (lw6sys_context_t * sys_context, lw6cnx_ticket_table_t * ticket_table, const char * peer_id)

sys_context: global system context

ticket_table: the ticket table to query

peer_id: the id of remote node

Gets the ticket used to communicate with peer, to check its incoming (recv) messages. If ticket does not exist yet, it’s automatically generated so tunction will always return a non-zero value.

Return value: the ticket used to check incoming messages.

Function: void lw6cnx_ticket_table_ack_recv (lw6sys_context_t * sys_context, lw6cnx_ticket_table_t * ticket_table, const char * peer_id, int ack_delay_msec)

sys_context: global system context

ticket_table: the ticket table to query

peer_id: the id of remote node

ack_delay_msec: delay before which we’ll consider the ticket as really received

Acknowledges the ticket used to communicate with peer, to check its incoming (recv) messages has been received. This is to avoid sending it again when it has been received, as it’s kept "forever" by peer, we never need to send it again. The delay is here to avoid checking tickets too quickly, for instance one could have sent the ticket yet, but for some reason some unsigned messages are still in the pipe, typically they transit through another slow channel such as httpd while the ticket was sent on udp.

Return value: none.

Function: int lw6cnx_ticket_table_was_recv_exchanged (lw6sys_context_t * sys_context, lw6cnx_ticket_table_t * ticket_table, const char * peer_id)

sys_context: global system context

ticket_table: the ticket table to query

peer_id: the id of remote node

Acknowledges the ticket used to communicate with peer, to check its incoming (recv) messages has been received. This is to avoid sending it again when it has been received, as it’s kept "forever" by peer, we never need to send it again.

Return value: the ticket used to check incoming messages.

Function: u_int64_t lw6cnx_ticket_table_get_send (lw6sys_context_t * sys_context, lw6cnx_ticket_table_t * ticket_table, const char * peer_id)

sys_context: global system context

ticket_table: the ticket table to query

peer_id: the id of remote node

Gets the ticket used to communicate with peer, to stamp the outgoing messages. If ticket does not exist yet, 0 is returned, indeed this value must be initialized with the value the peer gives us.

Return value: the ticket used to stamp outgoing messages.

Function: void lw6cnx_ticket_table_set_send (lw6sys_context_t * sys_context, lw6cnx_ticket_table_t * ticket_table, const char * peer_id, u_int64_t send_ticket)

sys_context: global system context

ticket_table: the ticket table to query

peer_id: the id of remote node

send_ticket: the ticket to use to stamp outgoing messages

Sets the ticket used to communicate with peer, to stamp the outgoing (send) messages. This value should be received from the network. Note that once it’s set, it’s impossible to change it, it will remain the same for the whole duration of the node existence.

Return value: NULL

Struct: lw6cnx_connection_s

This structure holds all data associated to a physical connexion with a remote peer. This includes informations about the local node, informations about the peer, and protocol specific details. Depending on which backend is used to handle the connection, it will behave differently. If you search for attributes such as socket id, search for them in backend_specific_data which is, in fact, handle by the backend code.

Member of lw6cnx_connection_s: local_url

Type: char *

Definition: char* lw6cnx_connection_s::local_url

URL of our local node.

Member of lw6cnx_connection_s: remote_url

Type: char *

Definition: char* lw6cnx_connection_s::remote_url

URL of the remote node.

Member of lw6cnx_connection_s: remote_ip

Type: char *

Definition: char* lw6cnx_connection_s::remote_ip

IP address of the remote node.

Member of lw6cnx_connection_s: remote_port

Type: int

Definition: int lw6cnx_connection_s::remote_port

IP port of the remote node.

Member of lw6cnx_connection_s: password

Type: char *

Definition: char* lw6cnx_connection_s::password

Password as clear text.

Member of lw6cnx_connection_s: password_send_checksum

Type: char *

Definition: char* lw6cnx_connection_s::password_send_checksum

Password as a checksum, what will be sent on the network.

Member of lw6cnx_connection_s: local_id_int

Type: u_int64_t

Definition: u_int64_t lw6cnx_connection_s::local_id_int

ID of the local node, as an unsigned 64-bit integer.

Member of lw6cnx_connection_s: local_id_str

Type: char *

Definition: char* lw6cnx_connection_s::local_id_str

ID of the local node, as an hexa string.

Member of lw6cnx_connection_s: remote_id_int

Type: u_int64_t

Definition: u_int64_t lw6cnx_connection_s::remote_id_int

ID of the remote node, as an unsigned 64-bit integer.

Member of lw6cnx_connection_s: remote_id_str

Type: char *

Definition: char* lw6cnx_connection_s::remote_id_str

ID of the local node, as an hexa string.

Member of lw6cnx_connection_s: dns_ok

Type: int

Definition: int lw6cnx_connection_s::dns_ok

Will be set to 1 if the peer domain name is the same as the one reported in the URL. For instance, if we get a connection from 23.45.23.45, but this host claims to be on www.foo.bar and DNS reports www.foo.bar as being 111.222.111.222 then there’s something strange. It could just be someone doing NAT, but in all cases it’s worth mentionning, so we keep the information here. Having 0 here is a bad point for the connection.

Member of lw6cnx_connection_s: network_reliability

Type: int

Definition: int lw6cnx_connection_s::network_reliability

The higher, the most reliable message sending will be. It can never be perfect, LW6 will always drop some packets from time to time, just to simulate real packet loss and be sure if it happens, it’s handled nicely.

Member of lw6cnx_connection_s: properties

Type: lw6cnx_properties_t

Definition: lw6cnx_properties_t lw6cnx_connection_s::properties

Properties got from the backend.

Member of lw6cnx_connection_s: recv_list

Type: lw6sys_list_r_t *

Definition: lw6sys_list_r_t* lw6cnx_connection_s::recv_list

List of messages received. This is a list_r and not a plain list because it can typically be filled and consumed in different threads.

Member of lw6cnx_connection_s: send_mutex

Type: lw6sys_mutex_t *

Definition: lw6sys_mutex_t* lw6cnx_connection_s::send_mutex

Send mutex, this will be used so that sending operations are properly serialized. Indeed, threads that respond on the fly could be likely to call this concurrently.

Member of lw6cnx_connection_s: foo_bar_key

Type: u_int32_t

Definition: u_int32_t lw6cnx_connection_s::foo_bar_key

This is used to handle keepalive. Actually, the protocol is that from time to time FOO key is sent and then each connection (in a tentacle object, typically) is supposed to respond BAR key to show it has received the latest message. This field just stores the value so that when we receive a BAR message we know which key to check against.

Member of lw6cnx_connection_s: last_send_foo_timestamp

Type: int64_t

Definition: int64_t lw6cnx_connection_s::last_send_foo_timestamp

The last time FOO was sent.

Member of lw6cnx_connection_s: next_send_foo_timestamp

Type: int64_t

Definition: int64_t lw6cnx_connection_s::next_send_foo_timestamp

The next time FOO needs to be sent.

Member of lw6cnx_connection_s: ping_msec

Type: int

Definition: int lw6cnx_connection_s::ping_msec

The current ping, updated when receiving BAR message.

Member of lw6cnx_connection_s: sent_nb_total

Type: int

Definition: int lw6cnx_connection_s::sent_nb_total

Number of sent messages on this cnx.

Member of lw6cnx_connection_s: sent_nb_success

Type: int

Definition: int lw6cnx_connection_s::sent_nb_success

Number of successfully sent messages on this cnx.

Member of lw6cnx_connection_s: sent_nb_fail

Type: int

Definition: int lw6cnx_connection_s::sent_nb_fail

Number of failed sent messages on this cnx.

Member of lw6cnx_connection_s: last_recv_timestamp

Type: int64_t

Definition: int64_t lw6cnx_connection_s::last_recv_timestamp

Last time something was received on this connection.

Member of lw6cnx_connection_s: backend_specific_data

Type: void *

Definition: void* lw6cnx_connection_s::backend_specific_data

Store backend data, this is when, for instance, a socket handle will be kept, or a library handle (CURL, to name it). Common code does not know what’s in there.

Struct: lw6cnx_packet_s

Used to hold a network message plus some metadata, such as who it is for, and who emitted the message.

Member of lw6cnx_packet_s: logical_ticket_sig

Type: u_int32_t

Definition: u_int32_t lw6cnx_packet_s::logical_ticket_sig

Logical signature for the packet.

Member of lw6cnx_packet_s: physical_ticket_sig

Type: u_int32_t

Definition: u_int32_t lw6cnx_packet_s::physical_ticket_sig

Physical signature for the packet.

Member of lw6cnx_packet_s: logical_from_id

Type: u_int64_t

Definition: u_int64_t lw6cnx_packet_s::logical_from_id

Logical sender.

Member of lw6cnx_packet_s: logical_to_id

Type: u_int64_t

Definition: u_int64_t lw6cnx_packet_s::logical_to_id

Logical receiver.

Member of lw6cnx_packet_s: msg

Type: char *

Definition: char* lw6cnx_packet_s::msg

Struct: lw6cnx_properties_s

Used to hold generic client/server properties, set up by the backend, can then be queried by the caller.

Member of lw6cnx_properties_s: hint_timeout

Type: int

Definition: int lw6cnx_properties_s::hint_timeout

Gives an idea of what timeout one can expect with this backend, this is not necessarly the exact timeout but it gives an order of magnitude. Unit is seconds.

Member of lw6cnx_properties_s: ping_alter_base

Type: int

Definition: int lw6cnx_properties_s::ping_alter_base

Modifies the ping returned by terrain experience, this is a way to help some kind of connections to be preferred over others. Set it to N to add N milliseconds to the real ping. Adding a few msecs, such as 1 or 5 will just give an advantage to a given connection while not giving really wrong results. High values like 50 or 100 seriously penalizes some kind of connections, which is whishable, think of the httpd way to send things for instance.

Member of lw6cnx_properties_s: ping_alter_percent

Type: int

Definition: int lw6cnx_properties_s::ping_alter_percent

Modifies the ping returned by terrain experience, this is a way to help some kind of connections to be preferred over others. Set it to 100 for default value, means 100% of real ping delay, set it to 50 to make the algorithm believe lag is twice lower (this means, connection twice faster) and set it to 1000 to make believe that everything is slow. In practice only a slight alteration should be required, one should still favor really fast connections when it’s proved in real life that they are faster!

Member of lw6cnx_properties_s: reliable

Type: int

Definition: int lw6cnx_properties_s::reliable

Wether this connexion is to be considered reliable or not. Well, in LW6, all connexions are unrealiable since LW6 will drop packets on purpose to simulate problems, but however, some are well-known to be unreliable (UDP...) while others are OK.

Member of lw6cnx_properties_s: backend_id

Type: const char *

Definition: const char* lw6cnx_properties_s::backend_id

The backend id, beware, this is a static string, must not be freed, and depends on backend library to be here, if this one is unloaded, will point to nowhere.

Struct: lw6cnx_ticket_table_s

A common, shared table, to store all the tickets associated with various connections. This needs to be in-memory and quite fast for it’s called very often (at each message, in fact) to perform sanity checks and avoid fakes/cheaters.

Member of lw6cnx_ticket_table_s: recv_spinlock

Type: lw6sys_spinlock_t *

Definition: lw6sys_spinlock_t* lw6cnx_ticket_table_s::recv_spinlock

Lock for the recv_table hash.

Member of lw6cnx_ticket_table_s: recv_ack_spinlock

Type: lw6sys_spinlock_t *

Definition: lw6sys_spinlock_t* lw6cnx_ticket_table_s::recv_ack_spinlock

Lock for the recv_ack_table hash.

Member of lw6cnx_ticket_table_s: send_spinlock

Type: lw6sys_spinlock_t *

Definition: lw6sys_spinlock_t* lw6cnx_ticket_table_s::send_spinlock

Lock for the send_table hash.

Member of lw6cnx_ticket_table_s: recv_table

Type: lw6sys_hash_t *

Definition: lw6sys_hash_t* lw6cnx_ticket_table_s::recv_table

Hash table containing the tickets for recv operations. This table is auto-generated, if one asks for a ticket for an unknown host, one is generated. The key is the ID (64-bit integer) of the host, as an hexa string.

Member of lw6cnx_ticket_table_s: recv_ack_table

Type: lw6sys_hash_t *

Definition: lw6sys_hash_t* lw6cnx_ticket_table_s::recv_ack_table

Hash table containing wether the send ticket was received by a given host. The data is just a NULL pointer, only if the key is present, we know we don’t need to resend our key to the peer. An easy way to know that the key was sent is if the peer was abled to produce a valid message/checksum. The key is the ID (64-bit integer) of the host, as an hexa string.

Member of lw6cnx_ticket_table_s: send_table

Type: lw6sys_hash_t *

Definition: lw6sys_hash_t* lw6cnx_ticket_table_s::send_table

Hash table containing the tickets for send operations. Those tickets are typically received from the peers themselves who generate them on the fly. The key is the ID (64-bit integer) of the host, as an hexa string.


Next: , Previous: , Up: C API   [Contents][Index]

5.14 libdat

5.14.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/dat/index.html.

5.14.2 API

Function: lw6dat_miss_t * lw6dat_miss_new (lw6sys_context_t * sys_context, u_int64_t from_id, int serial_min, int serial_max)

from_id: who needs to resend the message

serial_min: serial range begin (included)

serial_max: serial range end (included)

Creates a miss structure, simply allocates memory and pumps values into the right fields.

Return value: new dynamically allocated object

Function: void lw6dat_miss_free (lw6sys_context_t * sys_context, lw6dat_miss_t * miss)

miss: structure to free

Frees a miss structure, simply unallocates memory.

Return value: none.

Function: void lw6dat_miss_sync (lw6sys_context_t * sys_context, lw6dat_miss_t * dst, lw6dat_miss_t * src)

dst: target object

src: source object

Writes the contents of src to dst

Return value: none.

Function: int lw6dat_miss_is_same (lw6sys_context_t * sys_context, lw6dat_miss_t * a, lw6dat_miss_t * b)

a: first element to compare

b: second element to compare

Compares two miss objects, returning true if they are the same.

Return value: 1 if same, else 0.

Function: int lw6dat_miss_is_included (lw6sys_context_t * sys_context, lw6dat_miss_t * a, lw6dat_miss_t * b)

a: first element to compare

b: second element to compare

Compares two miss objects, returning true if a is included in b.

Return value: 1 if included, else 0.

Function: int lw6dat_miss_overlaps (lw6sys_context_t * sys_context, lw6dat_miss_t * a, lw6dat_miss_t * b)

a: first element to compare

b: second element to compare

Compares two miss objects, returning true if a overlaps with b.

Return value: 1 if included, else 0.

Function: int lw6dat_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libdat module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6dat_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the dat module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6dat_warehouse_init (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse, u_int64_t local_node_id, int64_t seq_0)

sys_context: global system context

warehouse: object to initialize

local_node_id: id of local node, used to handle local messages

seq_0: initial seq number

Initializes a warehouse object. Won’t free anything, will just erase values if they’re here

Return value: new object, allocated dynamically

Function: lw6dat_warehouse_t * lw6dat_warehouse_new (lw6sys_context_t * sys_context, u_int64_t local_node_id, int64_t seq_0)

sys_context: global system context

local_node_id: id of local node, used to handle local messages

seq_0: initial seq number

Creates a new warehouse object.

Return value: new object, allocated dynamically

Function: void lw6dat_warehouse_free (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse)

sys_context: global system context

warehouse: the object to free

Frees a warehouse object.

Return value: new object, allocated dynamically

Function: void lw6dat_warehouse_clear (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse)

sys_context: global system context

warehouse: the object to clear

Clears a warehouse object. Clears means emptying everything and resetting the current seq_id to the minimal/start value.

Return value: none.

Function: void lw6dat_warehouse_purge (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse)

sys_context: global system context

warehouse: the object to purge

Purges a warehouse object. Purges means emptying everything but keeping the current seq_id and the nodes list unchanged.

Return value: none.

Function: int lw6dat_warehouse_get_nb_nodes (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse)

sys_context: global system context

warehouse: the warehouse object to query.

Tells how many nodes are registered in the object.

Return value: integer, number of nodes

Function: u_int64_t lw6dat_warehouse_get_local_id (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse)

sys_context: global system context

warehouse: the warehouse object to query.

Returns the local id.

Return value: 64-bit id.

Function: int lw6dat_warehouse_get_local_serial (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse)

sys_context: global system context

warehouse: the warehouse object to query.

Returns the latest (highest) serial number given for local node.

Return value: integer, latest serial number

Function: int64_t lw6dat_warehouse_get_local_seq_0 (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse)

sys_context: global system context

warehouse: the warehouse object to query

Gives the warehouse seq_0 number, any seq below does not make sense.

Return value: long integer.

Function: void lw6dat_warehouse_set_local_seq_0 (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse, int64_t seq_0)

sys_context: global system context

warehouse: the warehouse object to modify

seq_0: the new seq value

Set the warehouse seq_0 number, any seq below does not make sense.

Return value: none.

Function: int64_t lw6dat_warehouse_get_local_seq_last (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse)

sys_context: global system context

warehouse: the warehouse object to query

Gives the warehouse seq_last number, this is the seq that corresponds to the last local message put in this warehouse. This is usefull to get the last seq used and, for instance, put a NOP message just for keepalive purposes.

Return value: long integer.

Function: int lw6dat_warehouse_register_node (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse, u_int64_t node_id, int serial_0, int64_t seq_0)

sys_context: global system context

warehouse: object to update

node_id: id of node to register

serial_0: serial number of first message

seq_0: initial seq number

Registers a node, in practice this is automatically done when receiving a data message but it might be interesting to do it elsewhere and force it.

Return value: the stack index of the registered node, <0 is invalid.

Function: int lw6dat_warehouse_is_node_registered (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse, u_int64_t node_id)

sys_context: global system context

warehouse: object to update

node_id: id of node to register

Tells wether a node is registered or not in our list.

Return value: 1 if registered, 0 if not.

Function: int lw6dat_warehouse_put_atom_str (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse, u_int64_t logical_from, const char * full_str)

sys_context: global system context

warehouse: warehouse object to use

logical_from: from who the message came from originally

full_str: message of the form serial i n seq from cmd

Puts an atomic string in the object, this kind of string is typically received on the network.

Return value: 1 on success, 0 on error

Function: int lw6dat_warehouse_calc_serial_draft_and_reference (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse)

sys_context: global system context

warehouse: object to work on

The various get_seq functions can perform slowly if we don’t pre-calculate the serial number of draft and reference atoms. So this calculation is not within the functions themselves but can be cached by using this function. Just call it and after you might query the object for reference and draft info.

Return value: 1 if some valid informations were found, else 0, which means no interesting (complete) atoms where found, and there’s probably nothing to do yet.

Function: int lw6dat_warehouse_put_local_msg (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse, const char * msg)

sys_context: global system context

warehouse: warehouse object to use

msg: message

Puts a message in the object. The message will be splitted into several atoms if needed, it can be arbitrary long.

Return value: 1 on success, 0 on error

Function: int64_t lw6dat_warehouse_get_seq_min (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse)

sys_context: global system context

warehouse: object to query

Tells the lowest seq referenced in the warehouse. Does not mean this is the lowest ever received, only we really have no chances of going below that point, nothing is stored, either complete or partial, below that.

Return value: integer.

Function: int64_t lw6dat_warehouse_get_seq_max (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse)

sys_context: global system context

warehouse: object to query

Tells the highest seq referenced in the warehouse. Does not mean an actual message can be built from it, only we’ve got some traces of such a high seq.

Return value: integer.

Function: int64_t lw6dat_warehouse_get_seq_draft (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse)

sys_context: global system context

warehouse: object to query

Tells the highest seq that can be considered as a valid draft. This is not exactly the maximimum seq encountered, for here we want at least one complete message and not just one chunk of data (an atom) referring to a high seq, we want the complete stuff. However there can be missing messages in between.

Return value: integer.

Function: int64_t lw6dat_warehouse_get_seq_reference (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse)

sys_context: global system context

warehouse: object to query

Tells the highest seq that can be considered as a reference. Being considered as a reference means we received all messages for this seq *and* at least one message from the following seq, and this for every node involved. This being said, we’re sure to have the right information, nothing is missing.

Return value: integer.

Function: lw6sys_list_t * lw6dat_warehouse_get_msg_list_by_seq (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse, int64_t seq_min, int64_t seq_max, int for_reference, lw6sys_progress_t * progress)

sys_context: global system context

warehouse: object to query

seq_min: lowest sequence number (round or chat index)

seq_max: highest sequence number (round or chat index)

for_reference: set to 1 if this is for reference building else 0 for draft

progress: progress indicator (read/write).

Gets the list of messages for a given sequence (round or chat index), polling all the nodes. The from and to boundaries are included.

Return value: a list of strings.

Function: lw6sys_list_t * lw6dat_warehouse_get_atom_str_list_not_sent (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse, u_int64_t logical_to)

sys_context: global system context

warehouse: object to query

logical_to: the id of the node that we want to send data to

Returns all the messages that were not sent for the given warehouse.

Return value: a list of strings, containing atoms.

Function: lw6sys_list_t * lw6dat_warehouse_get_miss_list (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse, int max_range, lw6sys_progress_t * progress)

sys_context: global system context

warehouse: object to query

max_range: max range of the returned list (-1 if none)

progress: progress indicator, to show advancement to end-user

Returns a list of lw6dat_miss_t objects which contains informations about the messages which need to be re-sent by peers. The function will always return something, the list is not cleared if it’s called several times, so one should not poll this too often. Additionnally, the max_range parameter can be used to limit the size of the returned ranges, to avoid querying for too many messages at once.

Return value: a list of pointers to lw6dat_miss_t structs, NULL on failure.

Function: void lw6dat_warehouse_miss_invalidate (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse, u_int64_t from_id, u_int64_t to_id, int serial_min, int serial_max)

sys_context: global system context

warehouse: object to modify

from_id: node which needs to resend data

to_id: node which needs to get the data

serial_min: minimum serial number to send

serial_max: maximum serial number to send

Re-sends messages in a given serial range. Actually, does not really resend messages, but marks them as needing to be sent again. We might, or not, have those messages in stock, if we have them we send them, if not we just do nothing, someone else might have them.

Return value: none

Function: void lw6dat_warehouse_update_serial_miss_max (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse, u_int64_t remote_id, int serial)

sys_context: global system context

warehouse: object to update

remote_id: id of remote host to update (which stack)

serial: new max serial value

Return value: none

Function: void lw6dat_warehouse_reset_nb_atom_parts_since_last_poll (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse)

sys_context: global system context

warehouse: data warehouse to reset

Resets the nb_atom_parts_since_last_poll attribute of every stack.

Return value: none

Function: int lw6dat_warehouse_get_nb_atom_parts_since_last_poll (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse, u_int64_t remote_id)

sys_context: global system context

warehouse: data warehouse to get info from

remote_id: remote id to get info about

Returns the nb_atom_parts_since_last_poll attribute of the stack concerning the remote_id. The idea is to track down, since the last call to the companion reset function, how many "atom parts" have been received, by "atom part" we mean atoms representing a splitted message. Usually this corresponds to very long messages and if this number of splitted messages is large enough, we don’t send MISS commands, as it would overload the network for nothing.

Return value: number of atom parts received since last reset.

Function: int lw6dat_warehouse_meta_put (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse, int64_t seq)

sys_context: global system context

warehouse: data warehouse to put message into

seq: seq to use to stamp the message

Puts a META message in the warehouse. The META message purpose is to tell other warehouses (on other nodes, peers) that the list of peers is updated. This typically happens when a node joins in.

Return value: 1 on success, 0 if failed.

Function: int lw6dat_warehouse_meta_get (lw6sys_context_t * sys_context, lw6dat_warehouse_t * warehouse, lw6msg_meta_array_t * meta_array, int64_t seq)

sys_context: global system context

warehouse: data warehouse to put message into

meta_array: current informations sendable by a meta message

seq: seq to use to stamp the message

Gets the data required for a META message. Note that this function can be called in other contexts to know who is registered within the warehouse, which, as an opaque type, doesn’t export that info otherwise.

Return value: 1 on success, 0 if failed.

Struct: lw6dat_miss_s

Used to get informations about "what messages are missing", The struct typically contains informations to send a MISS message on the network, that is, who needs to resend the information, and the message serial range. The informations "who needs it" need not be stored as this is logically our local node.

Member of lw6dat_miss_s: from_id

Type: u_int64_t

Definition: u_int64_t lw6dat_miss_s::from_id

Id of node which needs to resend the information.

Member of lw6dat_miss_s: serial_min

Type: int

Definition: int lw6dat_miss_s::serial_min

Minimum serial, included in the range.

Member of lw6dat_miss_s: serial_max

Type: int

Definition: int lw6dat_miss_s::serial_max

Maximum serial, included in the range.

Struct: lw6dat_warehouse_s

Contains all recent messages sent to peers, and received from them, int fact this is a local database, think of it as a giant array, containing all messages. This is usefull both resend messages if one peer wants one and also to check wether informations are consistent and nobody is cheating. This structure is hiddent, casted to the real stuff internally if needed, so that other parts of the code don’t rely on specific implementation.

Member of lw6dat_warehouse_s: dummy

Type: int

Definition: int lw6dat_warehouse_s::dummy

Dummy field, unused.


Next: , Previous: , Up: C API   [Contents][Index]

5.15 libdef

5.15.1 Overview

5.15.2 API

There are no functions in libdef, only a header file with constants.


Next: , Previous: , Up: C API   [Contents][Index]

5.16 libdsp

5.16.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/dsp/index.html.

5.16.2 API

Function: lw6dsp_backend_t * lw6dsp_create_backend (lw6sys_context_t * sys_context, int argc, const char * [] argv, const char * gfx_backend_name)

sys_context: global system context

argc: argc as passed to main

argv: argv as passed to main

gfx_backend_name: the id/name of the gfx backend to use

Creates a dsp_backend object. The created object won’t be displaying things until lw6dsp_init is called. No thread is created, but the graphics backend is loaded into memory. If video mode is not available, it will appear later, when trying to start displaying things, this function only allocates memory and checks code is available in case of a dynamically loaded gfx backend.

Return value: a newly allocated object.

Function: void lw6dsp_destroy_backend (lw6sys_context_t * sys_context, lw6dsp_backend_t * dsp_backend)

sys_context: global system context

dsp_backend: the dsp_backend object to free

Frees all ressources used by a dsp_backend object. Note that you must call this on a inactive ’stopped’ dsp_backend object.

Return value: none.

Function: char * lw6dsp_repr (lw6sys_context_t * sys_context, const lw6dsp_backend_t * dsp_backend)

sys_context: global system context

dsp_backend: the object to represent

Gives a short human-readable description of the object.

Return value: a newly allocated string, must be freed.

Function: int lw6dsp_init (lw6sys_context_t * sys_context, lw6dsp_backend_t * dsp_backend, const lw6dsp_param_t * param, lw6gui_resize_callback_func_t resize_callback)

sys_context: global system context

dsp_backend: the dsp_backend to start

param: parameters to pass to the display funcs

resize_callback: a function which will be called when there’s a resize event

Starts a dsp_backend object, that is, fire a separate thread and start rendering. This will set up a video mode, so it’s very likely to fail if for some reason the video context isn’t right, for instance if you try to set up graphical stuff but only have console access.

Return value: 1 if success, 0 if error.

Function: void lw6dsp_quit (lw6sys_context_t * sys_context, lw6dsp_backend_t * dsp_backend)

sys_context: global system context

dsp_backend: the dsp_backend to stop

Stops a dsp_backend, that is, cancel rendering and unset the video mode, hardware shouldn’t be used any more after this call.

Return value: none.

Function: int lw6dsp_update (lw6sys_context_t * sys_context, lw6dsp_backend_t * dsp_backend, const lw6dsp_param_t * param)

sys_context: global system context

dsp_backend: the dsp_backend to update

param: parameters to pass to the dsp_backend funcs

Passes a new set of parameters to the display function. This is in fact the only way to pass informations to the dsp_backend object once it’s been started. This function will acquire a mutex, copy parameters, then give control back to the main thread while display keeps on going with new parameters in the background. It will get input informations. You really must call it often otherwise the screen won’t get updated, or, at least, it will always display the same informations. It should be reasonnable to call this 10 or 20 times per second, the display itself can be faster, run at 60 or 100 fps to show smooth animation (eye candy).

Return value: 1 if success, 0 if error.

Function: int lw6dsp_get_nb_frames (lw6sys_context_t * sys_context, lw6dsp_backend_t * dsp_backend)

sys_context: global system context

dsp_backend: the dsp_backend to query

Returns the number of frames displayed since the display was started.

Return value: the number of frames displayed.

Function: int lw6dsp_get_last_frame_rendering_time (lw6sys_context_t * sys_context, lw6dsp_backend_t * dsp_backend)

dsp_backend: the dsp_backend to query

Returns the rendering time of the last frame. Gives clues about performance.

Return value: the number of milliseconds it took to draw screen

Function: int lw6dsp_get_instant_fps (lw6sys_context_t * sys_context, lw6dsp_backend_t * dsp_backend)

sys_context: global system context

dsp_backend: the dsp_backend to query

Returns the current frames per sec display rate. This is the instant value, it changes very often even if display seems smooth.

Return value: the current instant display rate.

Function: int lw6dsp_get_average_fps (lw6sys_context_t * sys_context, lw6dsp_backend_t * dsp_backend)

sys_context: global system context

dsp_backend: the dsp_backend to query

Returns the current frames per sec display rate. This is not absolutely accurate but fits for displaying info to the player, it’s an average.

Return value: the current averaged display rate.

Function: int lw6dsp_get_video_mode (lw6sys_context_t * sys_context, lw6dsp_backend_t * dsp_backend, lw6gui_video_mode_t * video_mode)

sys_context: global system context

dsp_backend: the dsp_backend to query

video_mode: a structure which will contain the results

Returns the current video mode, the one obtained by the driver. This function is also a way to know wether display is running correcly or not, by testing its return value.

Return value: 1 if ok, 0 if failure (mode not set)

Function: int lw6dsp_get_fullscreen_modes (lw6sys_context_t * sys_context, lw6dsp_backend_t * dsp_backend, lw6gui_fullscreen_modes_t * fullscreen_modes)

sys_context: global system context

dsp_backend: the dsp_backend to query

fullscreen_modes: a structure which will contain the results

Returns the current available fullscreen modes. Note that this one will only work if display is started, unlike lw6gfx_get_fullscreen_modes which is used internally. The reason is that in this dsp module context, we need the thread to be launched, and the thread does start/stop display on its own.

Return value: 1 if ok, 0 if failure (mode not set)

Function: void lw6dsp_param_zero (lw6sys_context_t * sys_context, lw6dsp_param_t * param)

sys_context: global system context

param: the structure to initialize

Fills a display param struct with zeros, this is mandatory before any use. Think of it as a raw memset.

Return value: none.

Function: int lw6dsp_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libdsp module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6dsp_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the dsp module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Struct: lw6dsp_backend_s

The dsp backend is the first argument passed to any dsp function, it contains reference to all the functions which can be used as well as a pointer on associated data. In OO, this would just be an object, with members and methods, using polymorphism through opaque pointers.

Member of lw6dsp_backend_s: id

Type: u_int32_t

Definition: u_int32_t lw6dsp_backend_s::id

The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Member of lw6dsp_backend_s: thread

Type: lw6sys_thread_handler_t *

Definition: lw6sys_thread_handler_t* lw6dsp_backend_s::thread

Thread running the display code. In fact running in a separate thread is the whole point of this display object.

Member of lw6dsp_backend_s: data

Type: void *

Definition: void* lw6dsp_backend_s::data

Data used by the display code. This is an opaque pointer, the internal structure will store details such as mutexes, parameters, information about the graphics backend, and so on.

Member of lw6dsp_backend_s: input

Type: lw6gui_input_t *

Definition: lw6gui_input_t* lw6dsp_backend_s::input

Input structure, will be updated by the display thread, so that it contains up-to-date information. This is actually the only way to get input from the user.

Struct: lw6dsp_misc_s

Miscellaneous parameters for display. One of the idea with this structure is that one must be able to compare two of them with a simple memcmp. Even the progress pointer can be compared this way, the rest is just plain data.

Member of lw6dsp_misc_s: mask

Type: int

Definition: int lw6dsp_misc_s::mask

Display mask, define what must be displayed.

Member of lw6dsp_misc_s: target_fps

Type: int

Definition: int lw6dsp_misc_s::target_fps

How many frames per second the engine needs to display.

Member of lw6dsp_misc_s: gfx_cpu_usage

Type: float

Definition: float lw6dsp_misc_s::gfx_cpu_usage

How much CPU need be used, the maximum is 1.0f, the idea behind this parameter is that if you set it to a low value, the display thread will yield timeslices letting other threads speed up. On a single-core CPU this can be usefull if the main calculation thread, the one that updates the game state, is falling behind.

Member of lw6dsp_misc_s: dirty_read

Type: int

Definition: int lw6dsp_misc_s::dirty_read

Dirty read mode.

Member of lw6dsp_misc_s: capture

Type: int

Definition: int lw6dsp_misc_s::capture

Wether we want to capture screen and dump it on disk.

Member of lw6dsp_misc_s: gfx_debug

Type: int

Definition: int lw6dsp_misc_s::gfx_debug

Wether to enable GFX debug mode.

Member of lw6dsp_misc_s: debug_team_id

Type: int

Definition: int lw6dsp_misc_s::debug_team_id

Parameter for debug mode, team ID to show info about.

Member of lw6dsp_misc_s: debug_layer_id

Type: int

Definition: int lw6dsp_misc_s::debug_layer_id

Parameter for debug mode, layer ID to show info about.

Member of lw6dsp_misc_s: repeat_settings

Type: lw6gui_repeat_settings_t

Definition: lw6gui_repeat_settings_t lw6dsp_misc_s::repeat_settings

Repeat settings, used by the input module.

Member of lw6dsp_misc_s: log_timeout

Type: int

Definition: int lw6dsp_misc_s::log_timeout

Delay after which messages disappear, in milliseconds.

Member of lw6dsp_misc_s: progress

Type: float *

Definition: volatile float* lw6dsp_misc_s::progress

Pointer on progress float, provides feedback to user.

Struct: lw6dsp_param_s

Parameters used by the display thread. Be carefull, those need be modify with adequate functions, else a (serious) race condition could occur.

Member of lw6dsp_param_s: misc

Type: lw6dsp_misc_t

Definition: lw6dsp_misc_t lw6dsp_param_s::misc

Miscellaneous parameters, things that didn’t fit elsewhere.

Member of lw6dsp_param_s: video_mode

Type: lw6gui_video_mode_t

Definition: lw6gui_video_mode_t lw6dsp_param_s::video_mode

Video mode. This is separated from the misc parameters for it requires special handling, indeed changing resolution might need calls to special functions to set up a new graphical context.

Member of lw6dsp_param_s: look

Type: lw6gui_look_t *

Definition: lw6gui_look_t* lw6dsp_param_s::look

Visual parameters.

Member of lw6dsp_param_s: menu

Type: lw6gui_menu_t *

Definition: lw6gui_menu_t* lw6dsp_param_s::menu

Menu object, the main interface to gather and transmit informations to the user, when not playing.

Member of lw6dsp_param_s: level

Type: lw6map_level_t *

Definition: lw6map_level_t* lw6dsp_param_s::level

The level, as loaded from disk.

Member of lw6dsp_param_s: game_struct

Type: lw6ker_game_struct_t *

Definition: lw6ker_game_struct_t* lw6dsp_param_s::game_struct

The game struct, that is the level post-processed to be usable by game algorithms.

Member of lw6dsp_param_s: game_state

Type: lw6ker_game_state_t *

Definition: lw6ker_game_state_t* lw6dsp_param_s::game_state

Changeable state of the game. Not that this pointer must really always be available, you can technically change its value but any value passed to it must be available and valid as long as the display is running, else you end up with a good old segfault.

Member of lw6dsp_param_s: pilot

Type: lw6pil_pilot_t *

Definition: lw6pil_pilot_t* lw6dsp_param_s::pilot

If in dirty-read mode, then game_state will be fetched from this object. It can be NULL if you don’t want to use the pilot.


Next: , Previous: , Up: C API   [Contents][Index]

5.17 libdyn

5.17.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/dyn/index.html.

5.17.2 API

Function: lw6dyn_dl_handle_t * lw6dyn_dlopen_backend_so (lw6sys_context_t * sys_context, const char * so_file)

sys_context: global system context

Opens a .so file directly, using a valid (full) path name.

Return value: a handle to the module, once it’s opened. You might still need to call a module specific init function, but it’s another story.

Function: lw6dyn_dl_handle_t * lw6dyn_dlopen_shared_so (lw6sys_context_t * sys_context, const char * so_file)

sys_context: global system context

Opens a .so file directly, using a valid (full) path name.

Return value: a handle to the shared code, once it’s opened. You might still need to call a module specific init function, but it’s another story.

Function: lw6dyn_dl_handle_t * lw6dyn_dlopen_backend (lw6sys_context_t * sys_context, int argc, const char * [] argv, const char * top_level_lib, const char * backend_name)

sys_context: global system context

argc: the number of command-line arguments as passed to main

top_level_lib: the top-level library concerned, this means is it "cli", "gfx", "snd" or "srv". This will tell the function to search for the .so file in the correct subdirectory. Think of this as a category.

Opens a .so file corresponding to the given backend, it is capable to search for system libraries installed after "make install" but if not found, it will also search in the current build directory, finding the .so files in hidden .libs subdirectories.

Return value: a handle to the module, once it’s opened. You might still need to call a module specific init function, but it’s another story.

Function: lw6dyn_dl_handle_t * lw6dyn_dlopen_shared (lw6sys_context_t * sys_context, int argc, const char * [] argv, const char * top_level_lib, const char * shared_name)

sys_context: global system context

argc: the number of command-line arguments as passed to main

top_level_lib: the top-level library concerned, this means is it "cli", "gfx", "snd" or "srv". This will tell the function to search for the .so file in the correct subdirectory. Think of this as a category.

Opens a .so file corresponding to the given shared code, it is capable to search for system libraries installed after "make install" but if not found, it will also search in the current build directory, finding the .so files in hidden .libs subdirectories.

Return value: a handle to the shared code, once it’s opened. This is different from a real module, there’s no real prototype, it just loads code.

Function: int lw6dyn_dlclose_backend (lw6sys_context_t * sys_context, lw6dyn_dl_handle_t * handle)

sys_context: global system context

handle: the backend to close.

Closes an opened backend. Note that you must call any backend specific clear, destroy, deinit, exit, function before.

Return value: 1 if success, 0 on error.

Function: int lw6dyn_dlclose_shared (lw6sys_context_t * sys_context, lw6dyn_dl_handle_t * handle)

sys_context: global system context

handle: the shared code library to close.

Closes an opened shared code library. Note that you must call any shared code library specific clear, destroy, deinit, exit, function before.

Return value: 1 if success, 0 on error.

Function: void * lw6dyn_dlsym (lw6sys_context_t * sys_context, lw6dyn_dl_handle_t * handle, const char * func_name)

sys_context: global system context

handle: the backend concerned

func_name: the function name, as a NULL terminated string

Finds a C function in the given backend.

Return value: a pointer to the function, NULL if not found.

Function: lw6sys_assoc_t * lw6dyn_list_backends (lw6sys_context_t * sys_context, int argc, const char * [] argv, const char * top_level_lib)

sys_context: global system context

argc: the number of command line args, as passed to main

argv: the commind line args, as passed to main

top_level_lib: the library category to query (gfx, snd, cli, srv ...)

Returns an assoc which lists all the available modules. The key of the assoc entries in the module internal name such as ’gl’ and the value associated is a NULL terminated string describing the module, for instance ’OpenGL’.

Return value: an assoc object containing key/label pairs.

Function: char * lw6dyn_path_find_backend (lw6sys_context_t * sys_context, int argc, const char * [] argv, const char * top_level_lib, const char * backend_name)

sys_context: global system context

argc: the number of command-line arguments as passed to main

top_level_lib: the top-level library concerned, this means is it "cli", "gfx", "snd" or "srv". This will tell the function to search for the .so file in the correct subdirectory. Think of this as a category.

backend_name: the actual name of the backend, this is the name of the .so file, between "libmod_" and ".so". For instance, to find "libmod_gl.so", the right argument is "gl1".

Get the full path to a .so file corresponding to the given backend, it is capable to search for system libraries installed after "make install" but if not found, it will also search in the current build directory, finding the .so files in hidden .libs subdirectories.

Return value: the full path of the .so file, needs to be freed.

Function: char * lw6dyn_path_find_shared (lw6sys_context_t * sys_context, int argc, const char * [] argv, const char * top_level_lib, const char * shared_name)

sys_context: global system context

argc: the number of command-line arguments as passed to main

top_level_lib: the top-level library concerned, this means is it "cli", "gfx", "snd" or "srv". This will tell the function to search for the .so file in the correct subdirectory. Think of this as a category.

shared_name: the actual name of the shared code, this is the name of the .so file, between "libshared_" and ".so". For instance, to find "libshared_sdl.so", the right argument is "sdl".

Get the full path to a .so file corresponding to the given shared code entry, it is capable to search for system libraries installed after "make install" but if not found, it will also search in the current build directory, finding the .so files in hidden .libs subdirectories. This is different from the standard module loader, since it will search for .so files with a slightly different name. The idea is to distinguish modules that are truely loadable and shared code that can’t be used standalone and can’t either be stuffed in the main binary since it refers to external dynamic library which will only be loaded at runtime.

Return value: the full path of the .so file, needs to be freed.

Function: int lw6dyn_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libdyn module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6dyn_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the dyn module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Struct: lw6dyn_dl_handle_s

Handle on dynamic library. Well, actually, ltdl does already provide something like, so why use our own wrapper? It happens storing the library path, that’s to say what .so files it comes from, is usefull for debugging, so this structure bundles those two informations together.

Member of lw6dyn_dl_handle_s: handle

Type: lt_dlhandle

Definition: lt_dlhandle lw6dyn_dl_handle_s::handle

Libtool handler.

Member of lw6dyn_dl_handle_s: library_path

Type: char *

Definition: char* lw6dyn_dl_handle_s::library_path

Path to .so file containing the code, or whatever file is relevant on the current platform, the idea is to keep track of where the library comes from.

Member of lw6dyn_dl_handle_s: is_backend

Type: int

Definition: int lw6dyn_dl_handle_s::is_backend

True (1) if the handle is a backend or false (0) if it’s just some shared code.

Member of lw6dyn_dl_handle_s: is_dlclose_safe

Type: int

Definition: int lw6dyn_dl_handle_s::is_dlclose_safe

True (1) if one can safely call dlclose on this backend. Set to false (0) if low level dlclose must be skipped. For some reason, some (external) libraries really do not behave well when unloaded on the fly, even if we stop threads using them and don’t use them anymore. The workarround is to have this flag defined, to skip the internal close to dlclose. LW will still free the memory, but won’t call libtool dlclose for real. Libtool keeps track of this internally and won’t reload it on next call, maintain reference counts etc. so there’s no real harm. Except it just looks ugly not to be able to truely unload the module.


Next: , Previous: , Up: C API   [Contents][Index]

5.18 libgen

5.18.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/gen/index.html.

5.18.2 API

Function: lw6map_level_t * lw6gen_create_from_seed (lw6sys_context_t * sys_context, const char * seed, int map_w, int map_h)

sys_context: global system context

seed: a random seed used to generate the map

map_w: width of the screen, in pixels

map_h: height of the screen, in pixels

Builds a complete, usable map from the string passed in seed. Each triplet composed of seed/map_w/map_h should build the same map on any computer, in any context, for a given version of the game (no backwards compatibility).

Return value: new map on success, NULL on failure.

Function: char * lw6gen_seed_new (lw6sys_context_t * sys_context)

sys_context: global system context

Generate a new random seed. The seed is composed of letters and numbers.

Return value: newly allocated string.

Function: char * lw6gen_seed_normalize (lw6sys_context_t * sys_context, const char * seed)

sys_context: global system context

seed: the seed to normalize

Builds a normalized seed from an arbitrary string. The idea is to avoid sending strange stuff on the network and/or storing strange stuff in config files, so we process correct strings only

Return value: newly allocated string.

Function: char lw6gen_seed_char (lw6sys_context_t * sys_context)

sys_context: global system context

Returns a random char suitable for seed (letter or digit).

Return value: a single char

Function: int lw6gen_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libgen module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6gen_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the gen module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.


Next: , Previous: , Up: C API   [Contents][Index]

5.19 libgfx

5.19.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/gfx/index.html.

5.19.2 API

Function: int lw6gfx_init (lw6sys_context_t * sys_context, lw6gfx_backend_t * backend, lw6gui_video_mode_t * video_mode, lw6gui_resize_callback_func_t resize_callback)

sys_context: global system context

backend: the graphical backend to use

video_mode: the video mode to use at start up

resize_callback: a callback function which will be called at each resize event

Sets up the graphical backend for good, initializing a video mode and allocating ressources. This call can typically fail if there’s no device available, if the user doesn’t have enough rights to access the hardware, and so on.

Return value: 1 on success, 0 if not

Function: void lw6gfx_quit (lw6sys_context_t * sys_context, lw6gfx_backend_t * backend)

sys_context: global system context

backend: the backend to quit

Uninitializes the backend, that is, exits the graphical mode. All threads that use graphics must be closed when this is called.

Return value: none.

Function: char * lw6gfx_repr (lw6sys_context_t * sys_context, const lw6gfx_backend_t * backend)

sys_context: global system context

backend: the backend to represent

Returns a readable version of the backend object.

Return value: a newly allocated pointer.

Function: int lw6gfx_set_video_mode (lw6sys_context_t * sys_context, lw6gfx_backend_t * backend, lw6gui_video_mode_t * video_mode)

sys_context: global system context

backend: the backend to use

video_mode: the new video mode

This function changes the video mode. Note that the first time you set up the graphical environment you must call lw6gfx_init but to change the current mode, use this function. It should reload backend data automatically if needed (textures for instance). Note that before giving up and failing this function will try alternate video modes, and you’re not garanteed to have the right mode after the call, even if it returns true. To check this, use lw6gfx_get_video_mode.

Return value: 1 on success, 0 on failure;

Function: int lw6gfx_get_video_mode (lw6sys_context_t * sys_context, lw6gfx_backend_t * backend, lw6gui_video_mode_t * video_mode)

sys_context: global system context

backend: the backend to use

video_mode: the current video mode (will be overwritten, out parameter)

This function returns the current video mode.

Return value: 1 on success, 0 on failure;

Function: int lw6gfx_get_fullscreen_modes (lw6sys_context_t * sys_context, lw6gfx_backend_t * backend, lw6gui_fullscreen_modes_t * fullscreen_modes)

sys_context: global system context

backend: the backend to use

fullscreen_modes: the available fullscreen modes (will be overwritten, out parameter)

This function returns the current video mode.

Return value: 1 on success, 0 on failure;

Function: lw6gui_input_t * lw6gfx_pump_events (lw6sys_context_t * sys_context, lw6gfx_backend_t * backend)

sys_context: global system context

backend: the backend to use

This function "pumps" events, that is gets pending events, puts them in queues, maintains internal states up to date. You really must call this very often or no input will be processed at all.

Return value: a pointer on the internal input state, musn’t be freed.

Function: int lw6gfx_display (lw6sys_context_t * sys_context, lw6gfx_backend_t * backend, int mask, const lw6gui_look_t * look, const lw6map_level_t * level, const lw6ker_game_struct_t * game_struct, const lw6ker_game_state_t * game_state, lw6pil_local_cursors_t * local_cursors, lw6gui_menu_t * menu, float progress, float fps, float mps, const char ** log_list, int capture, int gfx_debug, int debug_team_id, int debug_layer_id)

sys_context: global system context

backend: the graphical backend to use

mask: display flag, tells what to display

look: the look, the skin, contains display options

level: the level to display

game_struct: the game_struct associated with the level

game_state: the game_state associated with the level

local_cursors: the cursor to center the focus on

menu: the menu to display

progress: the value of the progress indicator

fps: the number of frames per second to display

mps: the number of moves per second to display

log_list: log messages to display

capture: wether to enable capture mode or not

gfx_debug: wether to enable gfx debugging tools

debug_team_id: for debug display, team to display informations about

debug_layer_id: for debug display, layer to display

This is the major drawing function, the one that encapsulates all others. As the program uses a separate thread to display things, we just pass this function many parameters, and let it do its job alone. So many parameters might sometimes be useless. It also allows the graphics backend decide wether menus and hud and background should interact. Or not.

Return value: 1 on success, 0 on failure.

Function: lw6sys_assoc_t * lw6gfx_get_backends (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc, as passed to main

argv: argv, as passed to main

List available gfx backends. The hash contains pairs with id and name for each backend. The id is the technical key you can use to load the backend, the name is something more readable you can display in an interface. The backend objects themselves are not instanciated by this (in fact, they are, but released on the fly) you need to load and initialize them afterwards.

Return value: hash containing id/name pairs.

Function: lw6gfx_backend_t * lw6gfx_create_backend (lw6sys_context_t * sys_context, int argc, const char * [] argv, const char * name)

sys_context: global system context

argc: argc, as passed to main

argv: argv, as passed to main

name: string containing gfx key, typically got from lw6gfx_get_backends

Creates a gfx backend, this is just about loading the dynamic library if needed, and/or check gfx engine is available, and connect to it. It does not perform initialization.

Return value: gfx backend.

Function: void lw6gfx_destroy_backend (lw6sys_context_t * sys_context, lw6gfx_backend_t * backend)

sys_context: global system context

backend: gfx backend to destroy

Frees the ressources associated to a gfx, which must have been properly uninitialized before.

Return value: none.

Function: int lw6gfx_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libgfx module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6gfx_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the gfx module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Struct: lw6gfx_backend_s

The gfx backend is the first argument passed to any gfx function, it contains reference to all the functions which can be used as well as a pointer on associated data. In OO, this would just be an object, with members and methods, using polymorphism through opaque pointers.

Member of lw6gfx_backend_s: dl_handle

Type: lw6dyn_dl_handle_t *

Definition: lw6dyn_dl_handle_t* lw6gfx_backend_s::dl_handle

Handle on dynamic library (if it makes sense).

Member of lw6gfx_backend_s: gfx_context

Type: void *

Definition: void* lw6gfx_backend_s::gfx_context

Gfx specific data, what is behind this pointer really depends on the gfx engine.

Member of lw6gfx_backend_s: argc

Type: int

Definition: int lw6gfx_backend_s::argc

The argc value passed to main.

Member of lw6gfx_backend_s: argv

Type: const char **

Definition: const char** lw6gfx_backend_s::argv

The argv value passed to main.

Member of lw6gfx_backend_s: call_lock

Type: lw6sys_mutex_t *

Definition: lw6sys_mutex_t* lw6gfx_backend_s::call_lock

Lock used to avoid concurrent access to underlying libs.

Member of lw6gfx_backend_s: id

Type: u_int32_t

Definition: u_int32_t lw6gfx_backend_s::id

The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Member of lw6gfx_backend_s: init

Type: void *(*

Definition: void*(* lw6gfx_backend_s::init)(lw6sys_context_t *sys_context, int argc, const char *argv[], lw6gui_video_mode_t *video_mode, lw6gui_resize_callback_func_t resize_callback)

Pointer on lw6gfx_init callback code.

Member of lw6gfx_backend_s: quit

Type: void(*

Definition: void(* lw6gfx_backend_s::quit)(lw6sys_context_t *sys_context, void *gfx_context)

Pointer on lw6gfx_quit callback code.

Member of lw6gfx_backend_s: repr

Type: char *(*

Definition: char*(* lw6gfx_backend_s::repr)(lw6sys_context_t *sys_context, void *gfx_context, u_int32_t id)

Pointer on lw6gfx_repr callback code.

Member of lw6gfx_backend_s: set_video_mode

Type: int(*

Definition: int(* lw6gfx_backend_s::set_video_mode)(lw6sys_context_t *sys_context, void *gfx_context, lw6gui_video_mode_t *video_mode)

Pointer on lw6gfx_set_video_mode callback code.

Member of lw6gfx_backend_s: get_video_mode

Type: int(*

Definition: int(* lw6gfx_backend_s::get_video_mode)(lw6sys_context_t *sys_context, void *gfx_context, lw6gui_video_mode_t *video_mode)

Pointer on lw6gfx_get_video_mode callback code.

Member of lw6gfx_backend_s: get_fullscreen_modes

Type: int(*

Definition: int(* lw6gfx_backend_s::get_fullscreen_modes)(lw6sys_context_t *sys_context, void *gfx_context, lw6gui_fullscreen_modes_t *modes)

Pointer on lw6gfx_get_fullscreen_modes callback code.

Member of lw6gfx_backend_s: pump_events

Type: lw6gui_input_t *(*

Definition: lw6gui_input_t*(* lw6gfx_backend_s::pump_events)(lw6sys_context_t *sys_context, void *gfx_context)

Pointer on lw6gfx_pump_events code.

Member of lw6gfx_backend_s: display

Type: int(*

Definition: int(* lw6gfx_backend_s::display)(lw6sys_context_t *sys_context, void *gfx_context, int mask, const lw6gui_look_t *look, const lw6map_level_t *level, const lw6ker_game_struct_t *game_struct, const lw6ker_game_state_t *game_state, lw6pil_local_cursors_t *local_cursors, lw6gui_menu_t *menu, float progress, float fps, float mps, const char **log_list, int capture, int gfx_debug, int debug_team_id, int debug_layer_id)

Pointer on lw6gfx_display code.


Next: , Previous: , Up: C API   [Contents][Index]

5.20 mod-gl1

5.20.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/gfx/mod-gl1/gl-utils/index.html (as there are many sub-directories in this module, please refer to the test coverage directory index for complete information).

5.20.2 API

Function: void mod_gl1_is_GPL_compatible ()

Defined to tell mod_gl1 is compatible with GNU General Public License Of course it is. This function does nothing, but the fact it’s declared makes its GPL compatibility obvious. Having this declared is required.

Return value: none

Function: lw6sys_module_pedigree_t * mod_gl1_get_pedigree (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the pedigree for mod-gl1, giving details about the module, including name, description, licence, date/time of compilation.

Return value: dynamically allocated object.

Function: lw6gfx_backend_t * mod_gl1_create_backend (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a mod-gl1 backend.

Return value: backend pointer.


Next: , Previous: , Up: C API   [Contents][Index]

5.21 mod-gles2

5.21.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/gfx/mod-gles2/index.html (as there are many sub-directories in this module, please refer to the test coverage directory index for complete information).

5.21.2 API

Function: void mod_gles2_is_GPL_compatible ()

Defined to tell mod_gles2 is compatible with GNU General Public License Of course it is. This function does nothing, but the fact it’s declared makes its GPL compatibility obvious. Having this declared is required.

Return value: none

Function: lw6sys_module_pedigree_t * mod_gles2_get_pedigree (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the pedigree for mod-gles2, giving details about the module, including name, description, licence, date/time of compilation.

Return value: dynamically allocated object.

Function: lw6gfx_backend_t * mod_gles2_create_backend (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a mod-gles2 backend.

Return value: backend pointer.


Next: , Previous: , Up: C API   [Contents][Index]

5.22 mod-soft

5.22.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/gfx/mod-soft/index.html (as there are many sub-directories in this module, please refer to the test coverage directory index for complete information).

5.22.2 API

Function: void mod_soft_is_GPL_compatible ()

Defined to tell mod_soft is compatible with GNU General Public License Of course it is. This function does nothing, but the fact it’s declared makes its GPL compatibility obvious. Having this declared is required.

Return value: none

Function: lw6sys_module_pedigree_t * mod_soft_get_pedigree (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the pedigree for mod-soft, giving details about the module, including name, description, licence, date/time of compilation.

Return value: dynamically allocated object.

Function: lw6gfx_backend_t * mod_soft_create_backend (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a mod-soft backend.

Return value: backend pointer.


Next: , Previous: , Up: C API   [Contents][Index]

5.23 shared-sdl

5.23.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/gfx/shared-sdl/index.html (as there are many sub-directories in this module, please refer to the test coverage directory index for complete information).

5.23.2 API

Function: void shared_sdl_is_GPL_compatible ()

Defined to tell shared_sdl is compatible with GNU General Public License Of course it is. This function does nothing, but the fact it’s declared makes its GPL compatibility obvious. Having this declared is required.

Return value: none


Next: , Previous: , Up: C API   [Contents][Index]

5.24 mod-caca

5.24.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/gfx/mod-caca/index.html (as there are many sub-directories in this module, please refer to the test coverage directory index for complete information).

5.24.2 API

Function: void mod_caca_is_GPL_compatible ()

Defined to tell mod_caca is compatible with GNU General Public License Of course it is. This function does nothing, but the fact it’s declared makes its GPL compatibility obvious. Having this declared is required.

Return value: none

Function: lw6sys_module_pedigree_t * mod_caca_get_pedigree (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the pedigree for mod-caca, giving details about the module, including name, description, licence, date/time of compilation.

Return value: dynamically allocated object.

Function: lw6gfx_backend_t * mod_caca_create_backend (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a mod-caca backend.

Return value: backend pointer.


Next: , Previous: , Up: C API   [Contents][Index]

5.25 libglb

5.25.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/glb/index.html.

5.25.2 API

Function: char * lw6glb_base64_encode_bin (lw6sys_context_t * sys_context, const char * buf, int size)

sys_context: global system context

buf: the data to encode

size: the size of data to encode

Encodes data into base64. Memory allocation is done automatically.

Return value: newly allocated string.

Function: char * lw6glb_base64_decode_bin (lw6sys_context_t * sys_context, int * size, const char * base64_str)

sys_context: global system context

size: the size of the decoded data

base64_str: the string to decode

Decodes data from base64. Memory allocation is done automatically. Note that this function only works for strings, other data might not be handled correctly.

Return value: newly allocated pointer, NULL on error.

Function: char * lw6glb_base64_encode_str (lw6sys_context_t * sys_context, const char * str)

sys_context: global system context

str: the string to encode

Encodes a string into base64.

Return value: newly allocated string.

Function: char * lw6glb_base64_decode_str (lw6sys_context_t * sys_context, const char * str)

sys_context: global system context

str: the string to decode

Decodes a string from base64.

Return value: newly allocated string, NULL on error.

Function: char * lw6glb_base64_encode_bin_prefix (lw6sys_context_t * sys_context, const char * buf, int size, const char * prefix)

sys_context: global system context

buf: the data to encode

size: the size of data to encode

prefix: a prefix string

Encodes data into base64. Memory allocation is done automatically. The encoded string will be prefixed with prefix.

Return value: newly allocated string.

Function: char * lw6glb_base64_decode_bin_prefix (lw6sys_context_t * sys_context, int * size, const char * base64_str, const char * prefix)

sys_context: global system context

size: the size of the decoded data

base64_str: the string to decode

prefix: a prefix string

Decodes data from base64. Memory allocation is done automatically. Note that this function only works for strings, other data might not be handled correctly. The encoded is expected to start with prefix prefix and then contain base64 data.

Return value: newly allocated pointer, NULL on error.

Function: char * lw6glb_base64_encode_str_prefix (lw6sys_context_t * sys_context, const char * str, const char * prefix)

sys_context: global system context

str: the string to encode

prefix: a prefix string

Encodes a string into base64. The encoded string will be prefixed with prefix.

Return value: newly allocated string.

Function: char * lw6glb_base64_decode_str_prefix (lw6sys_context_t * sys_context, const char * str, const char * prefix)

sys_context: global system context

str: the string to decode

prefix: a prefix string

Decodes a string from base64. The encoded is expected to start with prefix prefix and then contain base64 data.

Return value: newly allocated string, NULL on error.

Function: char * lw6glb_sha1_hmac_80_bin (lw6sys_context_t * sys_context, const char * key, int key_size, const char * buf, int buf_size)

sys_context: global system context

key: the key buffer key_size

buf: the data to analyse

buf_size: the size of data to analyse

Calculates an SHA-1 sum of buffer, using key to seed calc.

Return value: newly allocated string, containing 20 chars checksum.

Function: char * lw6glb_sha1_hmac_80_str (lw6sys_context_t * sys_context, const char * key, const char * str)

sys_context: global system context

key: a key (string)

str: the string to calculate the checksum for

Calculates an SHA-1 sum of a string, using key to seed calc.

Return value: newly allocated string, containing 20 chars checksum.

Function: u_int32_t lw6glb_sha1_hmac_32_bin (lw6sys_context_t * sys_context, const char * key, int key_size, const char * buf, int buf_size)

sys_context: global system context

key: the key buffer

key_size: the key buffer size

buf: the data to analyse

buf_size: the size of data to analyse

Calculates an SHA-1 sum of buffer, using key to seed calc.

Return value: a 32-bit unsigned integer

Function: u_int32_t lw6glb_sha1_hmac_32_str (lw6sys_context_t * sys_context, const char * key, const char * str)

sys_context: global system context

key: a key (string)

str: the string to calculate the checksum for

Calculates an SHA-1 sum of a string, using key to seed calc.

Return value: a 32-bit unsigned integer

Function: int lw6glb_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libglb module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6glb_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the glb module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.


Next: , Previous: , Up: C API   [Contents][Index]

5.26 libgui

5.26.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/gui/index.html.

5.26.2 API

Function: void lw6gui_button_register_down (lw6sys_context_t * sys_context, lw6gui_button_t * button, int64_t timestamp)

sys_context: global system context

button: the button to update

timestamp: the current ticks (milliseconds)

Registers a "down" (press) event on a button.

Return value: none.

Function: void lw6gui_button_register_up (lw6sys_context_t * sys_context, lw6gui_button_t * button)

sys_context: global system context

button: the button to update

Registers a "up" (release) event on a button.

Return value: none.

Function: int lw6gui_button_is_pressed (lw6sys_context_t * sys_context, const lw6gui_button_t * button)

sys_context: global system context

button: the button to query

Tells wether a button is pressed or not.

Return value: 1 if pressed, 0 if not.

Function: int lw6gui_button_pop_press (lw6sys_context_t * sys_context, lw6gui_button_t * button)

sys_context: global system context

button: the button to query

Tells how many times the button has been pressed. Typical usage: the button is pressed, released, pressed, released several times. Then, after all this, you want to know how many times it has been pressed. Querying its state with lw6gui_button_is_pressed won’t tell you much but this pop_press function will return 1 for each press there’s been.

Return value: 1 if there’s a press event in the queue, 0 if empty.

Function: int lw6gui_button_pop_simple_click (lw6sys_context_t * sys_context, lw6gui_button_t * button)

sys_context: global system context

button: the button to query

Tells how many times the button has been simpleclicked. This is different from a simple press, in fact, there’s a delay, we must wait until the double-click delay is elapsed to make sure this is a simple click... Designed for use with mouse to differentiate fire and alternate fire.

Return value: 1 if there’s a simpleclick event in the queue, 0 if empty.

Function: int lw6gui_button_pop_double_click (lw6sys_context_t * sys_context, lw6gui_button_t * button)

sys_context: global system context

button: the button to query

Tells how many times the button has been doubleclicked. Typical usage: the button is doubleclicked, released, doubleclicked, released several times. Then, after all this, you want to know how many times it has been doubleclicked.

Return value: 1 if there’s a doubleclick event in the queue, 0 if empty.

Function: int lw6gui_button_pop_triple_click (lw6sys_context_t * sys_context, lw6gui_button_t * button)

sys_context: global system context

button: the button to query

Tells how many times the button has been tripleclicked. Typical usage: the button is tripleclicked, released, tripleclicked, released several times. Then, after all this, you want to know how many times it has been tripleclicked.

Return value: 1 if there’s a tripleclick event in the queue, 0 if empty.

Function: void lw6gui_button_update_repeat (lw6sys_context_t * sys_context, lw6gui_button_t * button, lw6gui_repeat_settings_t * repeat_settings, int64_t timestamp, int auto_release_enabled)

sys_context: global system context

button: the button to update

repeat_settings: the repeat settings

timestamp: the current ticks (milliseconds)

Updates the repeat informations for a button, must be called regularly, as often as possible.

Return value: none.

Function: int lw6gui_button_sync (lw6sys_context_t * sys_context, lw6gui_button_t * dst, lw6gui_button_t * src)

sys_context: global system context

dst: the target button object

src: the source button object

Synchronizes two button objects. This is typically used to pass data from one thread to another. This is not a simple copy, it will handle data such as "when was it pressed last" it an intelligent manner, popping src data to put it in dst, and clearing src.

Return value: 1 if success, O if failure.

Function: int lw6gui_coord_calc_xy (lw6sys_context_t * sys_context, float * dst_x, float * dst_y, float dst_x0, float dst_y0, float dst_w, float dst_h, float src_x, float src_y, float src_x0, float src_y0, float src_w, float src_h)

sys_context: global system context

dst_x: the x coord to return

dst_y: the y coord to return

dst_x0: the x coord of point 0 in destination coord system

dst_y0: the y coord of point 0 in destination coord system

dst_w: the width of the area in destination coord system

dst_h: the width of the area in destination coord system

src_x: the x coord in source coord system

src_y: the y coord in source coord system

src_x0: the x coord of point 0 in source coord system

src_y0: the y coord of point 0 in source coord system

src_w: the width of the area in source coord system

src_h: the width of the area in source coord system

Registers a "down" (press) event on a button.

Return value: 1 if OK, 0 if error (unable to calculate).

Function: void lw6gui_coords_fix_xy_float (lw6sys_context_t * sys_context, float * x, float * y, int * x_flip, int * y_flip, float w, float h, int x_polarity, int y_polarity)

sys_context: global system context

x: x coord (in/out param)

y: y coord (in/out param)

x_flip: flip on x (out param, -1 or +1)

y_flip: flip on y (out param, -1 or +1)

w: width

h: height

x_polarity: x polarity (-1, 0 or 1)

y_polarity: y polarity (-1, 0 or 1)

Same as lw6map_fix_coords except it operates on floats. Usefull for cursor and other rendering operations. Additionnally, will keep track of inversions, that is to say if map is flip in one or another way. Be carefull, the flip values are -1 or 1 so that it’s easy to multiply an offset by it, for instance, but this means testing if flip is not 0 will always return true, you must test if flip is stritly positive or negative.

Return value: none

Function: int lw6gui_input_init (lw6sys_context_t * sys_context, lw6gui_input_t * input)

sys_context: global system context

input: the input struct to initialise

Initialises an input structure, don’t use twice, it won’t free a previous init.

Return value: a pointer to the newly allocated object.

Function: void lw6gui_input_quit (lw6sys_context_t * sys_context, lw6gui_input_t * input)

sys_context: global system context

input: the input struct to uninitialise

Unitialises an input structure, need to call it to free event queue.

Return value: a pointer to the newly allocated object.

Function: lw6gui_input_t * lw6gui_input_new (lw6sys_context_t * sys_context)

sys_context: global system context

Creates an input structure, which can be used to handle input state & buffer.

Return value: a pointer to the newly allocated object.

Function: void lw6gui_input_free (lw6sys_context_t * sys_context, lw6gui_input_t * input)

sys_context: global system context

input: the input object to free.

Deletes an input structure.

Return value: none.

Function: int lw6gui_input_reset (lw6sys_context_t * sys_context, lw6gui_input_t * input)

sys_context: global system context

input: the input struct to reset

Resets an input structure. Must have been initialized before. It will empty all queues and mark everything as unpressed.

Return value: 1 on success, 0 if failure.

Function: void lw6gui_input_update_repeat (lw6sys_context_t * sys_context, lw6gui_input_t * input, lw6gui_repeat_settings_t * repeat_settings, int64_t timestamp)

sys_context: global system context

input: the input to update

repeat_settings: the repeat settings (delay + interval)

timestamp: the current ticks (milliseconds)

Updates the repeat informations for an input, must be called regularly, as often as possible.

Return value: none.

Function: void lw6gui_input_register_change (lw6sys_context_t * sys_context, lw6gui_input_t * input)

sys_context: global system context

input: the input to update

Tells an input object that one of its descendants has been modified. This will affect the return value of lw6gui_input_need_sync

Return value: none.

Function: int lw6gui_input_need_sync (lw6sys_context_t * sys_context, const lw6gui_input_t * input)

sys_context: global system context

input: the input to test

Tests wether an input object contains was modified and needs synchronisation.

Return value: 1 if sync is need, 0 if not.

Function: int lw6gui_input_sync (lw6sys_context_t * sys_context, lw6gui_input_t * dst, lw6gui_input_t * src)

sys_context: global system context

dst: the target input object

src: the source input object

Synchronizes two input objects. This is typically used to pass data from one thread to another. This is not a copy, it will brute-force copy the static data such as mouse position, but anything like a queue will be treated in a "empty source and fill target with data" scheme. So source will be affected by this, the key buffer will be emptied, and so on. And if there are key in the target buffer, they won’t be overwritten but kept in front of the FIFO list.

Return value: 1 if success, O if failure.

Function: void lw6gui_input_enable_auto_release (lw6sys_context_t * sys_context, lw6gui_input_t * input)

sys_context: global system context

input: input object to modify

Enables auto_release mode, in this mode, it’s assummed after some time any key is automatically released.

Return value: none.

Function: int lw6gui_joystick_check_index (lw6sys_context_t * sys_context, int i)

sys_context: global system context

i: index to check

Checks wether the index is correct. Does not mean the joystick exists, it’s just to avoid out of bounds errors.

Return value: 1 if within range, 0 if not.

Function: void lw6gui_joystick_update_axis_x (lw6sys_context_t * sys_context, lw6gui_joystick_t * joystick, int x, int limit, int64_t timestamp)

sys_context: global system context

joystick: joystick to update

x: x-axis position, as returned by the driver

limit: the limit, under this, buttons are considered unpressed.

timestamp: current ticks (timestamp in ms)

Updates the x axis of a joystick, this will convert an information of analog type such as "joystick is here" to a pad-like information such as "pressed in that direction".

Return value: 1 if within range, 0 if not.

Function: void lw6gui_joystick_update_axis_y (lw6sys_context_t * sys_context, lw6gui_joystick_t * joystick, int y, int limit, int64_t timestamp)

sys_context: global system context

joystick: joystick to update

limit: the limit, under this, buttons are considered unpressed.

timestamp: current ticks (timestamp in ms)

Updates the y axis of a joystick, this will convert an information of analog type such as "joystick is here" to a pad-like information such as "pressed in that direction".

Return value: 1 if within range, 0 if not.

Function: void lw6gui_joystick_update_repeat (lw6sys_context_t * sys_context, lw6gui_joystick_t * joystick, lw6gui_repeat_settings_t * repeat_settings, int64_t timestamp)

sys_context: global system context

joystick: the joystick to update

repeat_settings: the repeat settings (delay + interval)

timestamp: the current ticks (milliseconds)

Updates the repeat informations for a joystick, must be called regularly, as often as possible.

Return value: none.

Function: int lw6gui_joystick_sync (lw6sys_context_t * sys_context, lw6gui_joystick_t * dst, lw6gui_joystick_t * src)

sys_context: global system context

dst: the target joystick object

src: the source joystick object

Synchronizes two joystick objects. This is typically used to pass data from one thread to another.

Return value: 1 if success, O if failure.

Function: void lw6gui_joystick_get_move_pad (lw6sys_context_t * sys_context, const lw6gui_joystick_t * joystick, lw6gui_move_pad_t * move_pad)

sys_context: global system context

joystick: the joystick to query

move_pad: the structure which will contain the results

Returns the state of the joystick in a uniform, non-device specific structure containing only the up/down/left/right information.

Return value: none, the value are stored in move_pad.

Function: int lw6gui_keyboard_check_keysym (lw6sys_context_t * sys_context, int keysym)

sys_context: global system context

keysym: the keysym to check

Tells wether the keysym is valid or not.

Return value: 1 if valid, 0 if not

Function: lw6gui_keypress_t * lw6gui_keyboard_pop_keypress (lw6sys_context_t * sys_context, lw6gui_keyboard_t * keyboard)

sys_context: global system context

keyboard: the keyboard structure which stores keyboard state

Pops (in FIFO mode) a keypress stored in the keyboard buffer. You must free the obtained keypress object after you’re done with it.

Return value: a newly allocated pointer, or NULL if no keypress pending.

Function: int lw6gui_keyboard_is_pressed (lw6sys_context_t * sys_context, const lw6gui_keyboard_t * keyboard, int keysym)

sys_context: global system context

keyboard: the keyboard structure which stores keyboard state

Tells wether a key is pressed or not. The function will test out of bound values.

Return value: 1 if pressed, 0 if not.

Function: int lw6gui_keyboard_register_key_down (lw6sys_context_t * sys_context, lw6gui_keyboard_t * keyboard, int keysym, int unicode, char * label, int64_t timestamp)

sys_context: global system context

keyboard: the keyboard structure which will store the keypress

keysym: the keysym for the keypress

unicode: the ASCII/unicode code for the keypress

label: the label for the keypress

timestamp: the current ticks (timestamp in ms)

Registers a keypress event, that is, puts it in the event queue. This function does not take an lw6gui_keypress_t structure but separated args, this is because it will construct the object internally. You may free label after calling this, an internal copy will be done. This function will also maintain the array of key states up to date.

Return value: 1 if success, O if failure.

Function: int lw6gui_keyboard_register_key_up (lw6sys_context_t * sys_context, lw6gui_keyboard_t * keyboard, int keysym)

sys_context: global system context

keyboard: the keyboard structure which will store the keypress

keysym: the keysym for the keypress

Registers a key release event.

Return value: 1 if success, O if failure.

Function: void lw6gui_keyboard_update_repeat (lw6sys_context_t * sys_context, lw6gui_keyboard_t * keyboard, lw6gui_repeat_settings_t * repeat_settings, int64_t timestamp)

sys_context: global system context

keyboard: the keyboard to update

repeat_settings: the repeat settings (delay + interval)

timestamp: the current ticks (milliseconds)

Updates the repeat informations for a keyboard, must be called regularly, as often as possible.

Return value: none.

Function: int lw6gui_keyboard_sync (lw6sys_context_t * sys_context, lw6gui_keyboard_t * dst, lw6gui_keyboard_t * src)

sys_context: global system context

dst: the target keyboard object

src: the source keyboard object

Synchronizes two keyboard objects. This is typically used to pass data from one thread to another. Will pop the src queue to fill the dst queue.

Return value: 1 if success, O if failure.

Function: void lw6gui_keyboard_get_move_pad (lw6sys_context_t * sys_context, const lw6gui_keyboard_t * keyboard, lw6gui_move_pad_t * move_pad)

sys_context: global system context

keyboard: the keyboard to query

move_pad: the structure which will contain the results

Returns the state of the keyboard in a uniform, non-device specific structure containing only the up/down/left/right information.

Return value: none, the value are stored in move_pad.

Function: lw6gui_keypress_t * lw6gui_keypress_new (lw6sys_context_t * sys_context, int keysym, int unicode, const char * label)

sys_context: global system context

keysym: the keysym to use

unicode: the unicode value for this keysym

label: the label (optional, might be NULL)

Creates a keypress structure, the only reason for needing a contructor is that the label field needs be duplicated.

Return value: a pointer to the newly allocated object.

Function: void lw6gui_keypress_free (lw6sys_context_t * sys_context, lw6gui_keypress_t * keypress)

sys_context: global system context

keypress: the keypress object to free.

Deletes a keypress structure.

Return value: none.

Function: char * lw6gui_keypress_repr (lw6sys_context_t * sys_context, const lw6gui_keypress_t * keypress)

sys_context: global system context

keypress: the keypress to work on

Returns a human-readable representation of the keypress.

Return value: a newly allocated string

Function: lw6gui_look_t * lw6gui_look_new (lw6sys_context_t * sys_context, const lw6map_style_t * map_style)

sys_context: global system context

map_style: map_style to use as a base

Create a new look object, a look is basically a style plus some dynamic parameters.

Return value: newly created object.

Function: void lw6gui_look_free (lw6sys_context_t * sys_context, lw6gui_look_t * look)

sys_context: global system context

look: look object to free

Frees a look and all its members.

Return value: none.

Function: int lw6gui_look_memory_footprint (lw6sys_context_t * sys_context, const lw6gui_look_t * look)

sys_context: global system context

look: look object to query

Gives the memory taken by this object in memory.

Return value: number of bytes.

Function: char * lw6gui_look_repr (lw6sys_context_t * sys_context, const lw6gui_look_t * look)

sys_context: global system context

look: look object to describe

Returns a readable description of the object.

Return value: newly allocated string.

Function: int lw6gui_look_set (lw6sys_context_t * sys_context, lw6gui_look_t * look, char * key, char * value)

sys_context: global system context

look: look object to modify

key: the key to change

value: the new value for the key

Sets a new value for a given key in the look. The value is always a string, it will be converted/casted to the right type if needed.

Return value: 1 on success, 0 on failure.

Function: char * lw6gui_look_get (lw6sys_context_t * sys_context, const lw6gui_look_t * look, char * key)

sys_context: global system context

look: look object to query

key: the key to get

Gets a new value for a given key in the look. The value is always a string, it will be converted/casted from the right type if needed.

Return value: dynamically allocated string.

Function: int lw6gui_look_is_same (lw6sys_context_t * sys_context, const lw6gui_look_t * look_a, const lw6gui_look_t * look_b)

sys_context: global system context

look_a: first object to compare

look_b: second object to compare

Compares two look objects, doing recursive comparisons. This can be very usefull if, for instance, a graphics renderer is using some contextual objects that depend on the look (colors?) and need to be updated/regenerated on a look change

Return value: 1 if they are the same, 0 if not.

Function: lw6gui_look_t * lw6gui_look_dup (lw6sys_context_t * sys_context, const lw6gui_look_t * look)

sys_context: global system context

look: object to duplicate

Duplicates a look object, performing recursive copies.

Return value: newly allocated object.

Function: void lw6gui_look_fix (lw6sys_context_t * sys_context, lw6gui_look_t * look)

sys_context: global system context

look: look object to modify

Peforms sanity checks and modifies the look if needed, to make all values fit within acceptable ranges, among other things.

Return value: none.

Function: int lw6gui_look_zoom_in (lw6sys_context_t * sys_context, lw6gui_look_t * look, float zoom_step)

sys_context: global system context

look: look object to act upon

zoom_step: how much we should zoom, 2.0 means 2 times bigger

Zooms in, the function does not only multiplicates the current zoom, it also performs sanity checks.

Return value: 1 if zoom was changed, 0 if not.

Function: int lw6gui_look_zoom_out (lw6sys_context_t * sys_context, lw6gui_look_t * look, float zoom_step)

sys_context: global system context

look: look object to act upon

zoom_step: how much we should zoom, 2.0 means 2 times smaller

Zooms out, the function does not only divides the current zoom, it also performs sanity checks.

Return value: 1 if zoom was changed, 0 if not.

Function: lw6gui_menu_t * lw6gui_menu_new (lw6sys_context_t * sys_context, const char * title, const char * help, const char * popup, const char * esc, int enable_esc)

sys_context: global system context

title: the string to be displayed, what the user sees. Can be freed after the call is done, function will make a copy internally.

help: a string introducing the menu, describing what it does, giving hints on how to use it.

popup: a string to be displayed in popup mode when menu is displayed for the first time.

esc: the label to be displayed in the ESC button

enable_esc: wether to enable the escape button.

Constructs a new menu object. Note that you can always call other functions to modify it afterwards.

Return value: a pointer to the newly allocated object.

Function: void lw6gui_menu_free (lw6sys_context_t * sys_context, lw6gui_menu_t * menu)

sys_context: global system context

menu: a pointer to the menu.

Frees the menu, checking if things are OK before doing so.

Return value: none.

Function: int lw6gui_menu_memory_footprint (lw6sys_context_t * sys_context, lw6gui_menu_t * menu)

sys_context: global system context

menu: a pointer to the menu.

Gets the memory occupied by the menu. Could be usefull to help a garbage collector taking decisions or reporting erros, for instance.

Return value: the number of bytes used.

Function: char * lw6gui_menu_repr (lw6sys_context_t * sys_context, const lw6gui_menu_t * menu)

sys_context: global system context

menu: a pointer to the menu.

Constructs a readable description of the object. Usefull for debugging, or to introspect things using scripts, at run-time. Does not necessarly describe all the informations about the object, but helps knowing what it is.

Return value: a string describing the object, must be freed.

Function: void lw6gui_menu_set_title (lw6sys_context_t * sys_context, lw6gui_menu_t * menu, const char * title)

sys_context: global system context

menu: a pointer to the menu.

title: the new title, you can free it after calling the function, an internal copy will be made.

Change the title of the menu. Use this function to change the title, don’t try to access the struct directly. The idea is to have safe memory management.

Return value: none

Function: void lw6gui_menu_set_help (lw6sys_context_t * sys_context, lw6gui_menu_t * menu, const char * help)

sys_context: global system context

menu: a pointer to the menu.

help: the new help, you can free it after calling the function, an internal copy will be made.

Change the help of the menu. Use this function to change the help, don’t try to access the struct directly. The idea is to have safe memory management.

Return value: none

Function: void lw6gui_menu_set_popup (lw6sys_context_t * sys_context, lw6gui_menu_t * menu, const char * popup)

sys_context: global system context

menu: a pointer to the menu.

popup: the new popup, you can free it after calling the function, an internal copy will be made.

Change the popup of the menu. That is to say, its popup. Use this function to change the popup, don’t try to access the struct directly. The idea is to have safe memory management.

Return value: none

Function: void lw6gui_menu_close_popup (lw6sys_context_t * sys_context, lw6gui_menu_t * menu)

sys_context: global system context

menu: a pointer to the menu.

Closes the popup, in practice, this is equivalent to setting the popup string to "" or NULL.

Return value: none

Function: int lw6gui_menu_has_popup (lw6sys_context_t * sys_context, lw6gui_menu_t * menu)

sys_context: global system context

menu: a pointer to the menu.

Tells wether a popup is defined. Behavior is simplistic, at creation (when a non-NULL non-empty popup string has been set) then the popup is displayed. In this state, popup is considered to be defined. Then it can be close, and after this action the popup ain’t here anymore, program continues the way it started.

Return value: 1 if has popup, 0 if does not

Function: lw6gui_menuitem_t * lw6gui_menu_get_item (lw6sys_context_t * sys_context, lw6gui_menu_t * menu, int position)

sys_context: global system context

menu: the menu we want to query

position: the order of the item we want

Gets the menu item at the given position. First item is 0, last is N-1. Returns a pointer on the real object, not a copy.

Return value: a pointer to a menu item, NULL if out of range.

Function: int lw6gui_menu_select (lw6sys_context_t * sys_context, lw6gui_menu_t * menu, int position, int allow_scroll, int64_t now)

sys_context: global system context

menu: the menu we want to modify

position: the position of the item we want to select

allow_scroll: wether scrolling should be allowed when displaying it

now: the current time, as a timestamp.

Selects the item at the given position. Use this function to be sure that only one item is selected, and all other states are consistent. Timestamp is needed for the sake of eye-candy.

Return value: 1 if success, 0 if failure (out of range).

Function: void lw6gui_menu_select_esc (lw6sys_context_t * sys_context, lw6gui_menu_t * menu, int state, int64_t now)

sys_context: global system context

menu: the menu we want to modify

state: 1 to select, 0 to unselect

now: the current time, as a timestamp.

Selects the escape item, this does not affect other items, it’s mostly. to handle eye candy.

Return value: none.

Function: void lw6gui_menu_enable_esc (lw6sys_context_t * sys_context, lw6gui_menu_t * menu, int state, int64_t now)

sys_context: global system context

menu: the menu we want to modify

state: 1 to enable, 0 to disable

now: the current time, as a timestamp.

Enables the escape item, this does not affect other items, it’s mostly. to handle eye candy.

Return value: none.

Function: int lw6gui_menu_scroll_up (lw6sys_context_t * sys_context, lw6gui_menu_t * menu)

sys_context: global system context

menu: the menu to scroll

Scrolls a menu up, used as a callback for mouse wheel up for instance. The idea is just to decrement the first displayed item index.

Return value: 1 if OK, 0 if failed (out of range).

Function: int lw6gui_menu_scroll_down (lw6sys_context_t * sys_context, lw6gui_menu_t * menu)

sys_context: global system context

menu: the menu to scroll

Scrolls a menu down, used as a callback for mouse wheel down for instance. The idea is just to increment the first displayed item index.

Return value: 1 if OK, 0 if failed (out of range).

Function: int lw6gui_menu_set_breadcrumbs (lw6sys_context_t * sys_context, lw6gui_menu_t * menu, lw6sys_list_t * breadcrumbs)

sys_context: global system context

menu: the menu to scroll

breadcrumbs: list of strings containing breadcrumbs

Set the breadcrumbs, that’s to say the readable, logical path to get to a given menu. This is just eye candy, not linked to any logic at this level.

Return value: 1 if OK, 0 if failed.

Function: void lw6gui_menu_center (lw6sys_context_t * sys_context, lw6gui_menu_t * menu, int position, int max_displayed_items)

sys_context: global system context

menu: the menu to center

position: the position of the menuitem to be put in the center

max_displayed_items: the maximum number of items displayed

Centers the menu on a given menuitem. Typically used when pushing a menu with a menuitem selected ’anywhere’ in the list.

Return value: none.

Function: int lw6gui_menu_insert (lw6sys_context_t * sys_context, lw6gui_menu_t * menu, lw6gui_menuitem_t * menuitem, int position, int64_t now)

sys_context: global system context

menu: the menu we want to modify

menuitem: the item to insert

position: the position the new item will occupy ("insert before" mode)

now: the current time, as a timestamp.

Inserts the given item in the menu. All items starting at the insert position will be "pushed" (that is, their position incremented by 1). Once the menuitem is inserted, the menu object will take care of memory management and automatically free it when needed.

Return value: 1 if success, 0 if failure (memory problem, out of range).

Function: int lw6gui_menu_append (lw6sys_context_t * sys_context, lw6gui_menu_t * menu, lw6gui_menuitem_t * menuitem, int64_t now)

sys_context: global system context

menu: the menu we want to modify

menuitem: the item to insert

now: the current time, as a timestamp.

Appends the given item to the menu. Once the menuitem is appended, the menu object will take care of memory management and automatically free it when needed.

Return value: 1 if success, 0 if failure (memory problem).

Function: int lw6gui_menu_remove (lw6sys_context_t * sys_context, lw6gui_menu_t * menu, int position, int64_t now)

sys_context: global system context

menu: the menu we want to modify

position: the item to insert

now: the current time, as a timestamp.

Removes an item from the menu. It will automatically be freed.

Return value: 1 if success, 0 if failure (out of range).

Function: int lw6gui_menu_remove_all (lw6sys_context_t * sys_context, lw6gui_menu_t * menu, int64_t now)

sys_context: global system context

menu: the menu we want to modify

now: the current time, as a timestamp.

Removes all items from the menu, usefull when one wants to repopulate the items completely, from scratch.

Return value: 1 if success, 0 if failure.

Function: void lw6gui_menu_update_display_range (lw6sys_context_t * sys_context, lw6gui_menu_t * menu, int max_displayed_items)

sys_context: global system context

menu: the menu concerned

max_displayed_items: the maximum number of items to display at once

Updates the display range. The reason for having this is that the first item, that is, how far we scroll in a very long menu, depends on the previous position. Plus you have to handle limit cases (begin/end). Thus, this function, which will automatically pick-up a suitable position. Of course, first_item_displayed is not necessarly equal to selected_item.

Return value: none.

Function: int lw6gui_menu_insert_for_id_use (lw6sys_context_t * sys_context, lw6gui_menu_t * menu, char * label, char * tooltip, int value, int enabled, int selected, int colored, int position, int64_t now)

sys_context: global system context

menu: the menu to work on

label: the label of the menuitem to append

tooltip: the tooltip of the menuitem to append

value: the value of the menuitem to append

enabled: wether the inserted menuitem should be enabled

selected: wether the inserted menuitem should be selected

colored: wether the inserted menuitem should use value as its color

now: current time (timestamp)

Inserts a menu item at the given position. The idea is that the menu item object is automatically constructed on the fly, and an id is returned, which can be passed to ’_using_id’ menu-related functions. This is typically for using in scripts. The idea is that the script just keeps a copy of the id returned, and can this way operate directly on the menuitem without keeping a pointer, a smob or anything internally. From the C point of view, having a real C structure enables persistent data from one display to the other, and this is nice and conveninent. I acknowledge the prototype is scary.

Return value: 0 if error, or else an id which will later be used with ’_using_id’ functions.

Function: int lw6gui_menu_append_for_id_use (lw6sys_context_t * sys_context, lw6gui_menu_t * menu, char * label, char * tooltip, int value, int enabled, int selected, int colored, int64_t now)

sys_context: global system context

menu: the menu to work on

label: the label of the menuitem to append

tooltip: the tooltip of the menuitem to append

value: the value of the menuitem to append

enabled: wether the appended menuitem should be enabled

selected: wether the appended menuitem should be selected

colored: wether the appended menuitem should use value as its color

now: current time (timestamp)

Appends a menuitem using the same logic as lw6gui_menu_insert_for_id_use that is to say a parameter is returned which can later be used to directly operate on a given menuitem, without having its pointer, and even if its position changes.

Return value: 0 if error, or else an id which will later be used with ’_using_id’ functions.

Function: int lw6gui_menu_remove_using_id (lw6sys_context_t * sys_context, lw6gui_menu_t * menu, int menuitem_id, int64_t now)

sys_context: global system context

menu: the menu to work on

menuitem_id: the id of the menuitem to remove

now: current time (timestamp)

Deletes the menuitem with the given id. Very important: the id is not the position. Id are arbitrary numbers that stick to menuitems, but they are not directly linked with the position. This function is practical to use if, for some reason, you don’t have the pointer on the menuitem.

Return value: 1 if success, 0 if failure (out of range).

Function: void lw6gui_menu_sync_using_id (lw6sys_context_t * sys_context, lw6gui_menu_t * menu, int menuitem_id, char * label, char * tooltip, int value, int enabled, int selected, int colored, int64_t now)

sys_context: global system context

menu: the menu to work on

menuitem_id: the id of the menuitem to synchronize

label: menu label

tooltip: menu tooltip

value: value

enabled: wether it’s usable or not

selected: 1 if the menuite is current item

colored: wether to use color

now: current time (timestamp)

Updates the menuitem with the given id. Very important: the id is not the position. Id are arbitrary numbers that stick to menuitems, but they are not directly linked with the position. This function is practical to use if, for some reason, you don’t have the pointer on the menuitem. In practice, it’s heavily used in the game to transmit informations from the scripts to the core C engine. Additionnaly, this function will automatically synchronize the selected_item field of the menu struct.

Return value: 1 if success, 0 if failure (out of range).

Function: int lw6gui_menu_is_same (lw6sys_context_t * sys_context, const lw6gui_menu_t * menu_a, const lw6gui_menu_t * menu_b)

sys_context: global system context

menu_a: first item to compare

menu_b: second item to compare

Compares two menus.

Return value: 1 if they are the same, 0 if not

Function: lw6gui_menu_t * lw6gui_menu_dup (lw6sys_context_t * sys_context, const lw6gui_menu_t * menu)

sys_context: global system context

menu: the menu to duplicate

Duplicates a menu structure.

Return value: a pointer to the new menu.

Function: int lw6gui_menu_sync (lw6sys_context_t * sys_context, lw6gui_menu_t * dst, lw6gui_menu_t * src)

sys_context: global system context

dst: the target menu

src: the source menu

Synchronizes two menus, this supposes that they represent the same menu, but simply in a different state. This function does not really copy src to dst, it has a special behavior, indeed everything is copied from src to dst, except the first_item_displayed and nb_items_displayed which are taken from dst and copied to src. This is because in practise, those values are updated in the display loop/thread, which is the one which uses the target. This is not very orthodox, but should work.

Return value: 1 if success, 0 if failure

Function: lw6gui_menuitem_t * lw6gui_menuitem_new (lw6sys_context_t * sys_context, const char * label, const char * tooltip, int value, int enabled, int selected, int colored)

sys_context: global system context

label: the string to be displayed, what the user sees. Can be freed after the call is done, function will make a copy internally.

tooltip: the string to be displayed as a tooltip, describing the menu item in detail. Can be NULL if you don’t want to use this feature.

value: the value. No GUI function uses this, this is the "real" value associated to the item.

enabled: wether the menu item can be selected, used, and so on

selected: wether the menu item is the item selected among all menu items.

colored: wetherr the menu item must, when drawn, be colored according to its value.

Constructs a new menuitem object. Note that you can always call other functions to modify these values afterwards, this might change rendering since lw6gui_menuitem_set_value or lw6gui_menuitem_set_label will, for instance, modify the "when was that item last modified" information.

Return value: a pointer to the newly allocated object.

Function: void lw6gui_menuitem_free (lw6sys_context_t * sys_context, lw6gui_menuitem_t * menuitem)

sys_context: global system context

menuitem: a pointer to the menuitem.

Frees the menuitem, checking if things are OK before doing so.

Return value: none.

Function: int lw6gui_menuitem_memory_footprint (lw6sys_context_t * sys_context, lw6gui_menuitem_t * menuitem)

sys_context: global system context

menuitem: a pointer to the menuitem.

Gets the memory occupied by the menuitem. Could be usefull to help a garbage collector taking decisions or reporting erros, for instance.

Return value: the number of bytes used.

Function: char * lw6gui_menuitem_repr (lw6sys_context_t * sys_context, const lw6gui_menuitem_t * menuitem)

sys_context: global system context

menuitem: a pointer to the menuitem.

Constructs a readable description of the object. Usefull for debugging, or to introspect things using scripts, at run-time. Does not necessarly describe all the informations about the object, but helps knowing what it is.

Return value: a string describing the object, must be freed.

Function: void lw6gui_menuitem_set_label (lw6sys_context_t * sys_context, lw6gui_menuitem_t * menuitem, const char * label, int64_t now)

sys_context: global system context

menuitem: a pointer to the menuitem.

label: the new label, you can free it after calling the function, an internal copy will be made.

now: the current time, as a timestamp.

Change the label of the menu item. That is to say, what the user sees. Use this function to change the menuitem value, don’t try to access the struct directly. The idea is 1) to have safe memory management and 2) to keep the last_change member up to date. It can be later used for eye-candy effects.

Return value: none

Function: void lw6gui_menuitem_set_tooltip (lw6sys_context_t * sys_context, lw6gui_menuitem_t * menuitem, const char * tooltip, int64_t now)

sys_context: global system context

menuitem: a pointer to the menuitem.

tooltip: the new tooltip, you can free it after calling the function, an internal copy will be made.

now: the current time, as a timestamp.

Change the tooltip of the menu item (the explanation of what the item is about) Use this function to change the menuitem value, don’t try to access the struct directly. The idea is 1) to have safe memory management and 2) to keep the last_change member up to date. It can be later used for eye-candy effects.

Return value: none

Function: void lw6gui_menuitem_set_value (lw6sys_context_t * sys_context, lw6gui_menuitem_t * menuitem, int value, int64_t now)

sys_context: global system context

menuitem: a pointer to the menuitem.

value: the new value.

now: the current time, as a timestamp.

Changes the value of a menuitem. This is the internal value, not what the user sees. Use this function to change the menuitem value, don’t try to access the struct directly. The idea is to keep the last_change member up to date. It can be later used for eye-candy effects.

Return value: none

Function: void lw6gui_menuitem_select (lw6sys_context_t * sys_context, lw6gui_menuitem_t * menuitem, int state, int64_t now)

sys_context: global system context

menuitem: a pointer to the menuitem.

state: 1 to select, 0 to unselect

now: the current time, as a timestamp.

Switches the menuitem to (un)selected state. Use this function, don’t try to modify the struct members directly. The idea is to have the last_select parameter up to date. It can be later used for eye-candy effects.

Return value: none

Function: void lw6gui_menuitem_enable (lw6sys_context_t * sys_context, lw6gui_menuitem_t * menuitem, int state, int64_t now)

sys_context: global system context

menuitem: a pointer to the menuitem.

state: 1 to enable, 0 to disable

now: the current time, as a timestamp.

Switches the menuitem to enabled/disabled state. Use this function, don’t try to modify the struct members directly. The idea is to have the last_select parameter up to date. It can be later used for eye-candy effects.

Return value: none

Function: u_int32_t lw6gui_menuitem_checksum (lw6sys_context_t * sys_context, lw6gui_menuitem_t * menuitem, lw6gui_look_t * look)

sys_context: global system context

menuitem: the menuitem we want to identify

Returns a checksum which can be used to know, for instance, wether the menuitem has changed or not, and if we should redraw it.

Return value: a checksum.

Function: int lw6gui_menuitem_is_same (lw6sys_context_t * sys_context, const lw6gui_menuitem_t * menuitem_a, const lw6gui_menuitem_t * menuitem_b)

sys_context: global system context

menuitem_a: first item to compare

menuitem_b: second item to compare

Compares two menuitems.

Return value: 1 if they are the same, 0 if not

Function: lw6gui_menuitem_t * lw6gui_menuitem_dup (lw6sys_context_t * sys_context, const lw6gui_menuitem_t * menuitem)

sys_context: global system context

menuitem: the menuitem to duplicate

The menuitem to duplicate.

Return value: a pointer to the duplicted menuitem.

Function: int lw6gui_menuitem_sync (lw6sys_context_t * sys_context, lw6gui_menuitem_t * dst, lw6gui_menuitem_t * src)

sys_context: global system context

dst: the target menuitem

src: the source menuitem

Synchronizes two menuitems, this supposes that they represent the same item, but simply in a different state.

Return value: 1 if success, 0 if failure

Function: void lw6gui_mouse_register_move (lw6sys_context_t * sys_context, lw6gui_mouse_t * mouse, int screen_pos_x, int screen_pos_y, int64_t timestamp)

sys_context: global system context

mouse: the mouse object to work on

screen_pos_x: the x position on screen

screen_pos_y: the y position on screen

timestamp: current timestamp

Registers a mouse move event.

Return value: note.

Function: int lw6gui_mouse_poll_move (lw6sys_context_t * sys_context, lw6gui_mouse_t * mouse, int * screen_pos_x, int * screen_pos_y)

sys_context: global system context

mouse: the mouse object to poll

screen_pos_x: pointer to the x position (can be NULL), will be updated even if no move

screen_pos_y: pointer to the y position (can be NULL), will be updated even if no move

Asks wether the mouse has moved or not.

Return value: 1 if mouse was moved since last call, 0 if not.

Function: void lw6gui_mouse_update_repeat (lw6sys_context_t * sys_context, lw6gui_mouse_t * mouse, lw6gui_repeat_settings_t * repeat_settings, int64_t timestamp)

mouse: the mouse to update

repeat_settings: the repeat settings (delay + interval)

timestamp: the current ticks (milliseconds)

Updates the repeat informations for a mouse, must be called regularly, as often as possible.

Return value: none.

Function: int lw6gui_mouse_sync (lw6sys_context_t * sys_context, lw6gui_mouse_t * dst, lw6gui_mouse_t * src)

sys_context: global system context

dst: the target mouse object

src: the source mouse object

Synchronizes two mouse objects. This is typically used to pass data from one thread to another. Will handle "mouse move" attribute and clear it in src if needed while setting it in dst.

Return value: 1 if success, O if failure.

Function: void lw6gui_mouse_drag_begin (lw6sys_context_t * sys_context, lw6gui_mouse_t * mouse)

sys_context: global system context

mouse: mouse struct to update

To be called when one wants to start recording a drag session, typically when left button is pressed.

Return value: none.

Function: void lw6gui_mouse_drag_end (lw6sys_context_t * sys_context, lw6gui_mouse_t * mouse)

sys_context: global system context

mouse: mouse struct to update

To be called when one wants to stop recording a drag session, typically when left button is released.

Return value: none.

Function: int lw6gui_mouse_drag_pop (lw6sys_context_t * sys_context, lw6gui_mouse_t * mouse, int * delta_x, int * delta_y, int * pos_x, int * pos_y, int * speed_x, int * speed_y)

sys_context: global system context

mouse: mouse struct to query

delta_x: x movement (on screen, out param can be NULL)

delta_y: y movement (on screen, out param can be NULL)

pos_x: x pos (on screen, out param can be NULL)

pos_y: y pos (on screen, out param can be NULL)

speed_x: x speed (on screen, out param can be NULL)

speed_y: y speed (on screen, out param can be NULL)

To be called when one wants to stop recording a drag session, typically when left button is released.

Return value: none.

Function: int lw6gui_point_is_inside_rect (lw6sys_context_t * sys_context, lw6gui_point_t point, const lw6gui_rect_t * rect)

sys_context: global system context

point: point to test

rect: rectangle in which point is supposed to be

Tests wether a point is inside a rectangle, this is typically used to know if a point is inside the right texture or if we’re outside.

Return value: 1 if OK, 0 if outside

Function: int lw6gui_power_of_two_ge (lw6sys_context_t * sys_context, int input)

sys_context: global system context

input: the value to approach

Finds the closest power of two, which is at least greater or equal to input. Typically used to size textures.

Return value: a power of two.

Function: int lw6gui_power_of_two_le (lw6sys_context_t * sys_context, int input)

sys_context: global system context

input: the value to approach

Finds the closest power of two, which is equal of inferior to input. Typically used to size textures.

Return value: a power of two.

Function: int lw6gui_quad_is_inside_rect (lw6sys_context_t * sys_context, const lw6gui_quad_t * quad, const lw6gui_rect_t * rect)

sys_context: global system context

quad: quad to test

rect: rectangle in which quad is supposed to be

Tests wether a quad is inside a rectangle, this is typically used to know if a quad is inside the right texture or if we’re outside.

Return value: 1 if OK, 0 if outside

Function: int lw6gui_rect_array_init (lw6sys_context_t * sys_context, lw6gui_rect_array_t * rect_array, int w, int h, int tile_size, int border_size)

sys_context: global system context

rect_array: the rectangle array to initializae

w: width of the zone to initialize

h: height of the zone to initialize

tile_size: tile size, that is, width and height of sub rectangles

border_size: border to add so that sub rectangles overlap

Initializes a rect array structure, this is usefull for texture handling, it builds an array of sub-rectangle which slightly overlap each other.

Return value: 1 on success, 0 on failure.

Function: int lw6gui_rect_array_get_tile_by_source_xy (lw6sys_context_t * sys_context, const lw6gui_rect_array_t * rect_array, lw6gui_rect_t * rect, int * i, int source_x, int source_y)

sys_context: global system context

rect_array: the rectangle array to initializae

rect: the sub-rectangle (out param)

i: the index of the sub-rectangle (out param)

source_x: the x position on the global rect array

source_y: the y position on the global rect array

Finds out which sub-rectangle is the right one, given a source position. The output values are a correctly initialized sub-rectangle with relative position set plus its index within the container rectangle array.

Return value: 1 on success, 0 on failure.

Function: int lw6gui_rect_array_get_tile_by_i (lw6sys_context_t * sys_context, const lw6gui_rect_array_t * rect_array, lw6gui_rect_t * rect, int i)

sys_context: global system context

rect_array: the rectangle array to initializae

rect: the sub-rectangle (out param)

i: the index of the sub-rectangle

Finds out which sub-rectangle is the right one, given a source position. The output value is a correctly initialized sub-rectangle with relative position set.

Return value: 1 on success, 0 on failure.

Function: int lw6gui_rect_array_get_tile_and_quad (lw6sys_context_t * sys_context, const lw6gui_rect_array_t * rect_array, lw6gui_rect_t * rect, int * i, lw6gui_quad_t * quad, const lw6gui_quad_t * source_quad, int x_polarity, int y_polarity)

sys_context: global system context

rect_array: the rectangle array to initializae

rect: the sub-rectangle (out param)

i: the index of the sub-rectangle (out param)

quad: the 4 corresponding points within the sub-rectangle (out param)

source_quad: 4 points within the container rectangle array

x_polarity: polarity along the X axis

y_polarity: polarity along the Y axis

Finds out which sub-rectangle is the right one, given 4 points as an input, and places these 4 points on the sub-rectangle, taking in account the polarity. This is typically used for texture mapping. Note that a rectangle array can’t handle all requests, it need have the good size, granularity.

Return value: 1 on success, 0 on failure.

Function: void lw6gui_rect_init_x1y1x2y2 (lw6sys_context_t * sys_context, lw6gui_rect_t * rect, int x1, int y1, int x2, int y2)

sys_context: global system context

rect: the structure to initialize

x1: x for top left corner

y1: y for top left corner

x2: x for bottom right corner

y2: y for bottom right corner

Initializes a rect structure, will calculate w & h.

Return value: none.

Function: void lw6gui_rect_init_xywh (lw6sys_context_t * sys_context, lw6gui_rect_t * rect, int x, int y, int w, int h)

sys_context: global system context

rect: the structure to initialize

x: x for top left corner

y: y for top left corner

w: width

h: height

Initializes a rect structure, will calculate x2 & y2.

Return value: none.

Function: void lw6gui_rect_clip (lw6sys_context_t * sys_context, lw6gui_rect_t * dst, const lw6gui_rect_t * src, const lw6gui_rect_t * clip)

sys_context: global system context

dst: the structure which will contain the result

src: the source rect

clip: the clipping rect (boundaries)

Clips a rect (think of rectangle clips).

Return value: none.

Function: int lw6gui_segment_is_inside_rect (lw6sys_context_t * sys_context, const lw6gui_segment_t * segment, const lw6gui_rect_t * rect)

sys_context: global system context

segment: segment to test

rect: rectangle in which segment is supposed to be

Tests wether a segment is inside a rectangle, this is typically used to know if a segment is inside the right texture or if we’re outside.

Return value: 1 if OK, 0 if outside

Function: void lw6gui_smoother_init (lw6sys_context_t * sys_context, lw6gui_smoother_t * smoother, float value, int duration)

sys_context: global system context

smoother: the structure to initialize

value: the value to use for now

duration: the duration of a standard move, in ticks (msec)

Initializes a smoother object, with a default value. The important point is the duration which will condition all the behavior of the object.

Return value: none.

Function: void lw6gui_smoother_immediate_force (lw6sys_context_t * sys_context, lw6gui_smoother_t * smoother, float value)

sys_context: global system context

smoother: the structure to use

value: the target value

Forces a smoother object to immediately point on a value.

Return value: none.

Function: void lw6gui_smoother_set_target (lw6sys_context_t * sys_context, lw6gui_smoother_t * smoother, float value, int64_t now)

sys_context: global system context

smoother: the structure to use

value: the target value

now: the current timestamp

Sets a new target, will automatically calculate current speed to smooth the next returned values.

Return value: none.

Function: float lw6gui_smoother_get_value (lw6sys_context_t * sys_context, const lw6gui_smoother_t * smoother, int64_t now)

sys_context: global system context

smoother: the structure to use

now: the current timestamp

Returns the current value of the smoother.

Return value: a float.

Function: void lw6gui_smoother_fix_overflow (lw6sys_context_t * sys_context, lw6gui_smoother_t * smoother, int step)

sys_context: global system context

smoother: object to modify

step: step size, typically twice the map size

Companion function of lw6pil_coords_fix_x10, this one will fix a smoother target to avoid crazy scrolls when cursor is on a map edge.

Return value: none.

Function: int lw6gui_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libgui module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6gui_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the gui module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6gui_triangle_is_inside_rect (lw6sys_context_t * sys_context, const lw6gui_triangle_t * triangle, const lw6gui_rect_t * rect)

sys_context: global system context

triangle: triangle to test

rect: rectangle in which triangle is supposed to be

Tests wether a triangle is inside a rectangle, this is typically used to know if a triangle is inside the right texture or if we’re outside.

Return value: 1 if OK, 0 if outside

Function: int lw6gui_video_mode_find_closest (lw6sys_context_t * sys_context, lw6gui_video_mode_t * closest, const lw6gui_video_mode_t * wished, lw6sys_list_t * available)

sys_context: global system context

closest: the closest video_mode found

wished: the wished video_mode

available: a list of available video_modes (list of lw6gui_video_mode_t *)

Finds the closest video_mode available, this is just a small utility to cope with different screen shapes and avoid requesting 640x480 when it’s just not available but there’s a 640x400 instead.

Return value: 1 if the wished video_mode exists in available list and was found, else 0 if the wished video_mode doesn’t exist and an approximative match was picked.

Function: int lw6gui_video_mode_is_same (lw6sys_context_t * sys_context, const lw6gui_video_mode_t * mode_a, const lw6gui_video_mode_t * mode_b)

sys_context: global system context

mode_a: first mode to compare

mode_b: second mode to compare

Compares two video modes, to know if they’re the same.

Return value: 1 if equal, 0 if not.

Function: int lw6gui_video_mode_sync_ratio (lw6sys_context_t * sys_context, lw6gui_video_mode_t * dst, const lw6gui_video_mode_t * src)

sys_context: global system context

dst: the target video mode

src: the source video mode

Applies the ratio of src to dst, for instance if src is 16/9, then dst will be made 16/9 too, trying to keep the same surface.

Return value: 1 on success, 0 on failure

Function: int lw6gui_viewport_init (lw6sys_context_t * sys_context, lw6gui_viewport_t * viewport, int screen_w, int screen_h, float drawable_x1, float drawable_y1, float drawable_x2, float drawable_y2, float center_x, float center_y, int map_w, int map_h, int x_polarity, int y_polarity, int x_wrap, int y_wrap, int keep_ratio, float global_zoom, float scroll_limit, int use_old_center)

sys_context: global system context

viewport: the viewport to initalize

screen_w: screen width

screen_h: screen height

drawable_x1: viewport min x

drawable_y1: viewport min y

drawable_x2: viewport max x

drawable_y2: viewport max y

center_x: center of display (in map coordinates)

center_y: center of display (in map coordinates)

map_w: map width (shape)

map_h: map height (shape)

x_polarity: x polarity

y_polarity: y polarity

x_wrap: wether to wrap horizontally

y_wrap: wether to wrap vertically

keep_ratio: wether to adapt to viewport shape or keep original

global_zoom: global zoom is style_zoom * dynamic_zoom

scroll_limit: inside this zone, don’t scroll

use_old_center: wether to take previous center in account

Initializes all the (jumbo?) viewport structure which will contain valuable informations for a simple "flat" display. Special renderers might not find usefull some fields and handle wrapping and zooming their own way, but this offers a basic skeleton.

Return value: 1 if ok, 0 on failure

Function: void lw6gui_viewport_map_to_screen (lw6sys_context_t * sys_context, lw6gui_viewport_t * viewport, float * screen_x, float * screen_y, float map_x, float map_y, int clip)

sys_context: global system context

viewport: the viewport to use

screen_x: the x coord on the screen

screen_y: the y coord on the screen

map_x: the x coord in map coordinates

map_y: the y coord in map coordinates

clip: wether to clip returned values

Translates from map coords to screen coords. Returned values might be outside screen boundaries if clip is 0. If screen coords are outside drawable area anc clip is 1, then they will be clipped.

Return value: NULL

Function: void lw6gui_viewport_screen_to_map (lw6sys_context_t * sys_context, lw6gui_viewport_t * viewport, float * map_x, float * map_y, float screen_x, float screen_y, int wrap)

sys_context: global system context

viewport: the viewport to use

map_x: the x coord in map coordinates

map_y: the y coord in map coordinates

screen_x: the x coord on the screen

screen_y: the y coord on the screen

wrap: wether to use polarity informations to wrap coords.

Translates from screen coords to map coords. If wrap is set, it will interpret coords the way lw6map_coords_fix_xy would, only it can still be formally outside map boundaries for it can return a value exactly equal to w,h while in interger mode it would be w-1,h-1.

Return value: NULL

Function: void lw6gui_viewport_calc_drag (lw6sys_context_t * sys_context, lw6gui_viewport_t * viewport, float * map_dst_x, float * map_dst_y, float map_src_x, float map_src_y, int screen_dx, int screen_dy)

sys_context: global system context

viewport: viewport to work on

map_dst_x: map det x coord (out param)

map_dst_y: map dst y coord (out param)

map_src_x: map src x coord

map_src_y: map src y coord

screen_dx: drag x (on screen)

screen_dy: drag y (on screen)

Used to calculate the new "center" when in drag mode.

Return value: none.

Function: void lw6gui_zone_init_x1y1x2y2 (lw6sys_context_t * sys_context, lw6gui_zone_t * zone, float x1, float y1, float x2, float y2)

sys_context: global system context

zone: the structure to initialize

x1: x for top left corner

y1: y for top left corner

x2: x for bottom right corner

y2: y for bottom right corner

Initializes a zone structure, will calculate w & h.

Return value: none.

Function: void lw6gui_zone_init_xywh (lw6sys_context_t * sys_context, lw6gui_zone_t * zone, float x, float y, float w, float h)

sys_context: global system context

zone: the structure to initialize

x: x for top left corner

y: y for top left corner

w: width

h: height

Initializes a zone structure, will calculate x2 & y2.

Return value: none.

Function: void lw6gui_zone_clip (lw6sys_context_t * sys_context, lw6gui_zone_t * dst, lw6gui_zone_t * src, lw6gui_zone_t * clip)

sys_context: global system context

dst: the structure which will contain the result

src: the source zone

clip: the clipping zone (boundaries)

Clips a zone (think of rectangle clips).

Return value: none.

Struct: lw6gui_button_s

Used to store a complete button state, along with repeat informations, queues. It might be overkill for basic cases, having different types of buttons (union?) for different cases might be a good idea.

Member of lw6gui_button_s: is_pressed

Type: int

Definition: int lw6gui_button_s::is_pressed

Wether button is pressed, 1 means pressed, 0 unpressed.

Member of lw6gui_button_s: press_queue

Type: int

Definition: int lw6gui_button_s::press_queue

Each time the button is pressed, this increases, each times one "pops" a press from it, it’s decreased. This allows for button buffering, as events might take some time to go through the pipeline given the heavily multithreaded nature of the dsp/gfx couple.

Member of lw6gui_button_s: simple_click_queue

Type: int

Definition: int lw6gui_button_s::simple_click_queue

Simple-click counter, as opposed to double-click. A "simple-click" is validated when one has pressed the button, and then waiting long enough to discard the possibility to double-click. This is not really buffered, queue will ignore simple-clicks if one is already buffered.

Member of lw6gui_button_s: double_click_queue

Type: int

Definition: int lw6gui_button_s::double_click_queue

Double-click counter. This is not really buffered, queue will ignore double-clicks if one is already buffered.

Member of lw6gui_button_s: triple_click_queue

Type: int

Definition: int lw6gui_button_s::triple_click_queue

Triple-click counter. This is not really buffered, queue will ignore triple-clicks if one is already buffered.

Member of lw6gui_button_s: last_press

Type: int64_t

Definition: int64_t lw6gui_button_s::last_press

Timestamp of last key press.

Member of lw6gui_button_s: last_repeat

Type: int64_t

Definition: int64_t lw6gui_button_s::last_repeat

Timestamp of last key repeat.

Member of lw6gui_button_s: double_click_t1

Type: int64_t

Definition: int64_t lw6gui_button_s::double_click_t1

Used to handle multiple-clicks, this is the timestamp of the click "2 clicks ago".

Member of lw6gui_button_s: double_click_t2

Type: int64_t

Definition: int64_t lw6gui_button_s::double_click_t2

Used to handle multiple-clicks, this is the timestamp of the click just before the last click.

Member of lw6gui_button_s: double_click_t3

Type: int64_t

Definition: int64_t lw6gui_button_s::double_click_t3

Used to handle multiple-clicks, this is the timestamp of the last click.

Struct: lw6gui_fullscreen_modes_s

Contains information about available fullscreen modes.

Member of lw6gui_fullscreen_modes_s: low

Type: lw6gui_video_mode_t

Definition: lw6gui_video_mode_t lw6gui_fullscreen_modes_s::low

Low resolution mode.

Member of lw6gui_fullscreen_modes_s: standard

Type: lw6gui_video_mode_t

Definition: lw6gui_video_mode_t lw6gui_fullscreen_modes_s::standard

Standard resolution mode.

Member of lw6gui_fullscreen_modes_s: high

Type: lw6gui_video_mode_t

Definition: lw6gui_video_mode_t lw6gui_fullscreen_modes_s::high

High resolution mode.

Struct: lw6gui_input_s

Global input state, contains informations about the keyboard, mouse and joystick. This is the macro object used to exchange data and transmit input information from the rendering thread which gathers it to the logical thread which computes the game state.

Member of lw6gui_input_s: need_sync

Type: int

Definition: int lw6gui_input_s::need_sync

Wether this input struct has changed and needs to be synchronized.

Member of lw6gui_input_s: keyboard

Type: lw6gui_keyboard_t

Definition: lw6gui_keyboard_t lw6gui_input_s::keyboard

Keyboard information.

Member of lw6gui_input_s: mouse

Type: lw6gui_mouse_t

Definition: lw6gui_mouse_t lw6gui_input_s::mouse

Mouse information.

Member of lw6gui_input_s: joysticks

Type: lw6gui_joystick_t

Definition: lw6gui_joystick_t lw6gui_input_s::joysticks[LW6GUI_NB_JOYSTICKS]

Joysticks information.

Struct: lw6gui_joystick_s

Joystick information, contains detailed joystick state. This structure uses a pad-like interface, there’s no knowledge of analog interfaces, it transforms everything to a binary "up or down" and "left or right". This interface only knows about 6 buttons, this is done on purpose, the logic behind it is that more than 6 buttons makes the control way too complicated. Actually, most common functions are and should be available through the 4 first (a,b,c,d) buttons. The e and f are here for additionnal not-so-important features.

Member of lw6gui_joystick_s: pad_up

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_joystick_s::pad_up

Joystick up button state.

Member of lw6gui_joystick_s: pad_down

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_joystick_s::pad_down

Joystick down button state.

Member of lw6gui_joystick_s: pad_left

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_joystick_s::pad_left

Joystick left button state.

Member of lw6gui_joystick_s: pad_right

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_joystick_s::pad_right

Joystick right button state.

Member of lw6gui_joystick_s: button_a

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_joystick_s::button_a

Joystick a button state.

Member of lw6gui_joystick_s: button_b

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_joystick_s::button_b

Joystick b button state.

Member of lw6gui_joystick_s: button_c

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_joystick_s::button_c

Joystick c button state.

Member of lw6gui_joystick_s: button_d

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_joystick_s::button_d

Joystick d button state.

Member of lw6gui_joystick_s: button_e

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_joystick_s::button_e

Joystick e button state.

Member of lw6gui_joystick_s: button_f

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_joystick_s::button_f

Joystick f button state.

Struct: lw6gui_keyboard_s

Stores a complete keyboard state.

Member of lw6gui_keyboard_s: auto_release_enabled

Type: int

Definition: int lw6gui_keyboard_s::auto_release_enabled

Wether auto_release mode is set.

Member of lw6gui_keyboard_s: arrow_up

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_keyboard_s::arrow_up

State of keyboard up arrow. This can be the combination of several keys, for instance the numeric pad up arrow, and the corresponding arrow pad key.

Member of lw6gui_keyboard_s: arrow_down

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_keyboard_s::arrow_down

State of keyboard down arrow. This can be the combination of several keys, for instance the numeric pad down arrow, and the corresponding arrow pad key.

Member of lw6gui_keyboard_s: arrow_left

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_keyboard_s::arrow_left

State of keyboard left arrow. This can be the combination of several keys, for instance the numeric pad left arrow, and the corresponding arrow pad key.

Member of lw6gui_keyboard_s: arrow_right

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_keyboard_s::arrow_right

State of keyboard right arrow. This can be the combination of several keys, for instance the numeric pad right arrow, and the corresponding arrow pad key.

Member of lw6gui_keyboard_s: key_enter

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_keyboard_s::key_enter

State of keyboard ENTER key. This can be the combination of several keys, for instance both the numeric pad ENTER and the standard, default one.

Member of lw6gui_keyboard_s: key_esc

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_keyboard_s::key_esc

State of keyboard ESC key. This can be the combination of several keys, for instance both the standard ESC key and another key.

Member of lw6gui_keyboard_s: key_ctrl

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_keyboard_s::key_ctrl

State of keyboard ESC key. This can be the combination of several keys, for instance both left and right CTRL keys.

Member of lw6gui_keyboard_s: key_alt

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_keyboard_s::key_alt

State of keyboard ESC key. This can be the combination of several keys, for instance both left and right ALT keys.

Member of lw6gui_keyboard_s: key_pgup

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_keyboard_s::key_pgup

State of keyboard PAGE UP key. This can be the combination of several keys.

Member of lw6gui_keyboard_s: key_pgdown

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_keyboard_s::key_pgdown

State of keyboard PAGE UP key. This can be the combination of several keys.

Member of lw6gui_keyboard_s: queue

Type: lw6sys_list_t *

Definition: lw6sys_list_t* lw6gui_keyboard_s::queue

List of events, contains keypress objects.

Member of lw6gui_keyboard_s: keys_state

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_keyboard_s::keys_state[LW6GUI_NB_KEYS]

Array of button states, indexed by keycodes.

Struct: lw6gui_keypress_s

Keypress information, contains more than just a keycode but also meta/readable informations about it.

Member of lw6gui_keypress_s: keysym

Type: int

Definition: int lw6gui_keypress_s::keysym

The keysym, note that this is implementation specific. In practice, SDL uniformizes this, but there’s no garantee all graphics engine are SDL based, so don’t rely on this too much outside the graphics backend.

Member of lw6gui_keypress_s: unicode

Type: int

Definition: int lw6gui_keypress_s::unicode

Unicode code for this letter/key.

Member of lw6gui_keypress_s: label

Type: char *

Definition: char* lw6gui_keypress_s::label

Readable label for the key, typically usable in a "choose keyboard settings" interface.

Struct: lw6gui_look_s

The look structure contains everything the renderer needs to skin the display. This is where one specifies the color set, dynamic zoom effect, and possibly other things.

Member of lw6gui_look_s: id

Type: u_int32_t

Definition: u_int32_t lw6gui_look_s::id

The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Member of lw6gui_look_s: dynamic_zoom

Type: float

Definition: float lw6gui_look_s::dynamic_zoom

Dynamic zoom, this is multiplicated by the map zoom, and gives the global zoom, the one finally used.

Member of lw6gui_look_s: gfx_quality

Type: int

Definition: int lw6gui_look_s::gfx_quality

Overall graphics quality, the higher the better, will trigger various parameters, depending on the renderer.

Member of lw6gui_look_s: style

Type: lw6map_style_t

Definition: lw6map_style_t lw6gui_look_s::style

A style structure which will override the one from the map, depending on the local options (config file, environnement, command-line options).

Struct: lw6gui_menuitem_s

Menu item object. Basically, a menu is an array of these items, it’s up to the gfx backend to render this as accurately as possible. The most important field is probably the label.

Member of lw6gui_menuitem_s: id

Type: u_int32_t

Definition: u_int32_t lw6gui_menuitem_s::id

The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Member of lw6gui_menuitem_s: label

Type: char *

Definition: char* lw6gui_menuitem_s::label

What is displayed in the menu item.

Member of lw6gui_menuitem_s: tooltip

Type: char *

Definition: char* lw6gui_menuitem_s::tooltip

An additionnal tooltip explaining what the item is about.

Member of lw6gui_menuitem_s: value

Type: int

Definition: int lw6gui_menuitem_s::value

The value for this item, can typically be used for booleans and integer values, in addition to the information conveyed by the label. One special case is colored items, in that case the value will be used as a color index.

Member of lw6gui_menuitem_s: enabled

Type: int

Definition: int lw6gui_menuitem_s::enabled

Wether the item is valid and can be used.

Member of lw6gui_menuitem_s: selected

Type: int

Definition: int lw6gui_menuitem_s::selected

Wether the item is the current selection.

Member of lw6gui_menuitem_s: colored

Type: int

Definition: int lw6gui_menuitem_s::colored

Wether to colorize the item, and in that case, use the value field to know which color to use.

Member of lw6gui_menuitem_s: last_change

Type: int

Definition: int lw6gui_menuitem_s::last_change

Timestamp of last time the menu item was updated and changed.

Member of lw6gui_menuitem_s: last_select

Type: int

Definition: int lw6gui_menuitem_s::last_select

Timestamp of last time the menu was selected.

Member of lw6gui_menuitem_s: last_unselect

Type: int

Definition: int lw6gui_menuitem_s::last_unselect

Timestamp of last time the menu was unselected.

Struct: lw6gui_menu_s

Menu item object. Basically, a menu is an array of menu items, it’s up to the gfx backend to render this as accurately as possible. The most important field is probably the items labels. The menu object also stores state information such as what was the first item displayed lately.

Member of lw6gui_menu_s: id

Type: u_int32_t

Definition: u_int32_t lw6gui_menu_s::id

The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Member of lw6gui_menu_s: title

Type: char *

Definition: char* lw6gui_menu_s::title

Title of the menu, used for breadcrumbs.

Member of lw6gui_menu_s: help

Type: char *

Definition: char* lw6gui_menu_s::help

Additionnal help text, explaining what the menu is about.

Member of lw6gui_menu_s: popup

Type: char *

Definition: char* lw6gui_menu_s::popup

Popup text, will be displayed when the menu is first displayed, and then disappear.

Member of lw6gui_menu_s: nb_items

Type: int

Definition: int lw6gui_menu_s::nb_items

Number of items.

Member of lw6gui_menu_s: esc_item

Type: lw6gui_menuitem_t *

Definition: lw6gui_menuitem_t* lw6gui_menu_s::esc_item

Special item describing the ESC button.

Member of lw6gui_menu_s: items

Type: lw6gui_menuitem_t **

Definition: lw6gui_menuitem_t** lw6gui_menu_s::items

Array of items, containing all the menu items.

Member of lw6gui_menu_s: selected_item

Type: int

Definition: int lw6gui_menu_s::selected_item

The current selection.

Member of lw6gui_menu_s: first_item_displayed

Type: int

Definition: int lw6gui_menu_s::first_item_displayed

The first item displayed, this is mandatory if we want the menus to be displayable in different states, for instance with first item being 2 and items displayed from 2 to 10 or with first item being 5 and items displayed from 2 to 10. In the first case the 1st item is selected, in the second case it’s the 4th.

Member of lw6gui_menu_s: nb_items_displayed

Type: int

Definition: int lw6gui_menu_s::nb_items_displayed

Number of items displayed.

Member of lw6gui_menu_s: order_of_selected_on_display

Type: int

Definition: int lw6gui_menu_s::order_of_selected_on_display

Index, display-based (that is, 0 here means first displayed and not necessarly first in the items array), of the selected item.

Member of lw6gui_menu_s: allow_scroll

Type: int

Definition: int lw6gui_menu_s::allow_scroll

Wether scrolling is allowed.

Member of lw6gui_menu_s: breadcrumbs

Type: lw6sys_list_t *

Definition: lw6sys_list_t* lw6gui_menu_s::breadcrumbs

List of strings containing the breadcrumbs, that is to say all the menu titles that one must use to get here.

Struct: lw6gui_mouse_pointer_s

Use to store mouse pointer information.

Member of lw6gui_mouse_pointer_s: pos_x

Type: int

Definition: int lw6gui_mouse_pointer_s::pos_x

Mouse X position (pixels).

Member of lw6gui_mouse_pointer_s: pos_y

Type: int

Definition: int lw6gui_mouse_pointer_s::pos_y

Mouse Y position (pixels).

Member of lw6gui_mouse_pointer_s: speed_x

Type: int

Definition: int lw6gui_mouse_pointer_s::speed_x

Mouse X speed. The unit is pixels per second. This is based on the last move, for instance if between two moves 100 msec have elapsed, and mouse moved 13 pixels, then speed is 130.

Member of lw6gui_mouse_pointer_s: speed_y

Type: int

Definition: int lw6gui_mouse_pointer_s::speed_y

Mouse Y speed. The unit is pixels per second. This is based on the last move, for instance if between two moves 100 msec have elapsed, and mouse moved 13 pixels, then speed is 130.

Struct: lw6gui_mouse_s

Mouse information, contains detailed mouse state, including mouse position and button states but also keeps track of mouse speed as well as its corresponding map coordinates. That is, given the current screen position, what does it mean on the logical map/battlefield.

Member of lw6gui_mouse_s: moved

Type: int

Definition: int lw6gui_mouse_s::moved

Wether mouse was moved lately. 1 means yes, 0 no.

Member of lw6gui_mouse_s: last_moved

Type: int64_t

Definition: int64_t lw6gui_mouse_s::last_moved

Timestamp of last move.

Member of lw6gui_mouse_s: screen_pointer

Type: lw6gui_mouse_pointer_t

Definition: lw6gui_mouse_pointer_t lw6gui_mouse_s::screen_pointer

Information about the mouse pointer, using screen coordinates, the unit being pixels.

Member of lw6gui_mouse_s: map_pointer

Type: lw6gui_mouse_pointer_t

Definition: lw6gui_mouse_pointer_t lw6gui_mouse_s::map_pointer

Information about the mouse pointer, using map coordinates, the unit being the map slot. This is possibly very different from screen coordinates, they can be inverted, have a different scale, and globally it’s just something else, even if it refers to the same physical move.

Member of lw6gui_mouse_s: screen_drag_start

Type: lw6gui_mouse_pointer_t

Definition: lw6gui_mouse_pointer_t lw6gui_mouse_s::screen_drag_start

Information about the mouse pointer when drag mode was entered. The unit is screen pixels.

Member of lw6gui_mouse_s: drag_mode

Type: lw6gui_drag_mode_t

Definition: lw6gui_drag_mode_t lw6gui_mouse_s::drag_mode

The current drag state.

Member of lw6gui_mouse_s: menu_position

Type: int

Definition: int lw6gui_mouse_s::menu_position

The index of the menu item the mouse is on. This is the only was to know when to select an item, one should not use mouse coords outside the gfx renderer code for this purpose, it’s the renderer which has knowledge about where menu items are.

Member of lw6gui_mouse_s: menu_scroll

Type: int

Definition: int lw6gui_mouse_s::menu_scroll

Set to -1 if one needs to scroll up (decrease menu index) to +1 if one needs to scroll down (increase menu index) and 0 if one needs to do nothing as far as scrolling is concerned.

Member of lw6gui_mouse_s: menu_esc

Type: int

Definition: int lw6gui_mouse_s::menu_esc

Wether mouse pointer is over the ESC button.

Member of lw6gui_mouse_s: button_left

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_mouse_s::button_left

Mouse left button state.

Member of lw6gui_mouse_s: button_right

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_mouse_s::button_right

Mouse right button state.

Member of lw6gui_mouse_s: button_middle

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_mouse_s::button_middle

Mouse middle button state.

Member of lw6gui_mouse_s: wheel_up

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_mouse_s::wheel_up

Mouse wheel up state.

Member of lw6gui_mouse_s: wheel_down

Type: lw6gui_button_t

Definition: lw6gui_button_t lw6gui_mouse_s::wheel_down

Mouse wheel down state.

Struct: lw6gui_move_pad_s

Standard interface for joypad-like interfaces, can also be used to map keyboard arrows.

Member of lw6gui_move_pad_s: up

Type: int

Definition: int lw6gui_move_pad_s::up

Up button (boolean).

Member of lw6gui_move_pad_s: down

Type: int

Definition: int lw6gui_move_pad_s::down

Down button (boolean).

Member of lw6gui_move_pad_s: left

Type: int

Definition: int lw6gui_move_pad_s::left

Left button (boolean).

Member of lw6gui_move_pad_s: right

Type: int

Definition: int lw6gui_move_pad_s::right

Right button (boolean).

Struct: lw6gui_point_s

Basic point type, 3 floating point coords.

Member of lw6gui_point_s: x

Type: float

Definition: float lw6gui_point_s::x

X position.

Member of lw6gui_point_s: y

Type: float

Definition: float lw6gui_point_s::y

Y position.

Member of lw6gui_point_s: z

Type: float

Definition: float lw6gui_point_s::z

Z position.

Struct: lw6gui_quad_s

Basic quad type, composed of 4 points (floating point values).

Member of lw6gui_quad_s: p1

Type: lw6gui_point_t

Definition: lw6gui_point_t lw6gui_quad_s::p1

1st point.

Member of lw6gui_quad_s: p2

Type: lw6gui_point_t

Definition: lw6gui_point_t lw6gui_quad_s::p2

2nd point.

Member of lw6gui_quad_s: p3

Type: lw6gui_point_t

Definition: lw6gui_point_t lw6gui_quad_s::p3

3rd point.

Member of lw6gui_quad_s: p4

Type: lw6gui_point_t

Definition: lw6gui_point_t lw6gui_quad_s::p4

4th point.

Struct: lw6gui_rect_array_s

Array of rectangles. This is typically used to make tiles that overlap. It’s mostly used to display fighters/maps using multiple textures when the whole stuff does not fit in one single OpenGL texture and needs to be splitted. Technically, when one needs to split textures, performance is poor, but still better than relying on software renderer only.

Member of lw6gui_rect_array_s: source

Type: lw6sys_whd_t

Definition: lw6sys_whd_t lw6gui_rect_array_s::source

Size of original source data.

Member of lw6gui_rect_array_s: limits

Type: lw6gui_rect_t

Definition: lw6gui_rect_t lw6gui_rect_array_s::limits

Boundary limits of the rect array, this is typically bigger that source size, it starts at negative values and finishes outside the source. It’s interesting to cover that big an area to enable both the water effect and proper wrapping/clamping.

Member of lw6gui_rect_array_s: tile_size

Type: int

Definition: int lw6gui_rect_array_s::tile_size

Width and height of the tiles, this is typically a power of two, as it’s designed to match an OpenGL low-level texture object.

Member of lw6gui_rect_array_s: border_size

Type: int

Definition: int lw6gui_rect_array_s::border_size

The border size one needs to cut from the tile_size (on both sides, up and down or left and right) to get the real usable size of the tile.

Member of lw6gui_rect_array_s: tile_spacing

Type: int

Definition: int lw6gui_rect_array_s::tile_spacing

The tile spacing, difference of X or Y between two tiles, this is typically smaller that tile_size.

Member of lw6gui_rect_array_s: nb_tiles_w

Type: int

Definition: int lw6gui_rect_array_s::nb_tiles_w

Number of tiles on the X axis (width).

Member of lw6gui_rect_array_s: nb_tiles_h

Type: int

Definition: int lw6gui_rect_array_s::nb_tiles_h

Number of tiles on the Y axis (height).

Member of lw6gui_rect_array_s: nb_tiles

Type: int

Definition: int lw6gui_rect_array_s::nb_tiles

Overall number of tiles.

Struct: lw6gui_rect_s

A basic rectangle data. The idea is to store both corner positions and width and height to cache the values and avoid always recalculating them. Values are integer based, for a floating point equivalent, see the zone struct.

Member of lw6gui_rect_s: x1

Type: int

Definition: int lw6gui_rect_s::x1

Top-left corner X position.

Member of lw6gui_rect_s: y1

Type: int

Definition: int lw6gui_rect_s::y1

Top-left corner Y position.

Member of lw6gui_rect_s: x2

Type: int

Definition: int lw6gui_rect_s::x2

Bottom-right corner X position.

Member of lw6gui_rect_s: y2

Type: int

Definition: int lw6gui_rect_s::y2

Bottom-right corner Y position.

Member of lw6gui_rect_s: w

Type: int

Definition: int lw6gui_rect_s::w

Width.

Member of lw6gui_rect_s: h

Type: int

Definition: int lw6gui_rect_s::h

Height.

Struct: lw6gui_repeat_settings_s

Parameters used to handle repeat. This is used both by keys and buttons (joystick buttons and mouse buttons).

Member of lw6gui_repeat_settings_s: delay

Type: int

Definition: int lw6gui_repeat_settings_s::delay

Delay, in milliseconds, after which a given key/button enters repeat mode.

Member of lw6gui_repeat_settings_s: interval

Type: int

Definition: int lw6gui_repeat_settings_s::interval

Interval, in milliseconds, between two key/button press events in repeat mode.

Member of lw6gui_repeat_settings_s: double_click_delay

Type: int

Definition: int lw6gui_repeat_settings_s::double_click_delay

If pressed twice within this delay (in milliseconds) then a double-click event is generated.

Member of lw6gui_repeat_settings_s: auto_release_delay

Type: int

Definition: int lw6gui_repeat_settings_s::auto_release_delay

After this delay (milliseconds) any key will be considered be unpressed, that is, it will be released automatically. This is usefull when the input library (depends on the gfx backend) does not send proper "key up" events. The workarround is to automatically consider the key is released after some time. Usually, this would typically be set just below the repeat delay.

Struct: lw6gui_segment_s

Basic segment type, composed of 2 points (floating point values).

Member of lw6gui_segment_s: p1

Type: lw6gui_point_t

Definition: lw6gui_point_t lw6gui_segment_s::p1

1st point.

Member of lw6gui_segment_s: p2

Type: lw6gui_point_t

Definition: lw6gui_point_t lw6gui_segment_s::p2

2nd point.

Struct: lw6gui_smoother_s

Statefull object used to make transitions between 2 floats. Basically, one needs to choose a target, which is y2, and give a start, which is defined by s1 and y1 (speed and y value). Then with t1 (start timestamp) and duration the object has functions which enables interpolation between those two values, knowing at the end the value will be y2 and the speed 0. To some extent, this is a primitive bezier-like tool.

Member of lw6gui_smoother_s: s1

Type: float

Definition: float lw6gui_smoother_s::s1

Speed at startup.

Member of lw6gui_smoother_s: y1

Type: float

Definition: float lw6gui_smoother_s::y1

Y value at startup.

Member of lw6gui_smoother_s: y2

Type: float

Definition: float lw6gui_smoother_s::y2

Y target value.

Member of lw6gui_smoother_s: t1

Type: int64_t

Definition: int64_t lw6gui_smoother_s::t1

Timestamp at startup.

Member of lw6gui_smoother_s: duration

Type: int

Definition: int lw6gui_smoother_s::duration

Duration (in milliseconds) of the transition.

Struct: lw6gui_triangle_s

Basic triangle type, composed of 3 points (floating point values).

Member of lw6gui_triangle_s: p1

Type: lw6gui_point_t

Definition: lw6gui_point_t lw6gui_triangle_s::p1

1st point.

Member of lw6gui_triangle_s: p2

Type: lw6gui_point_t

Definition: lw6gui_point_t lw6gui_triangle_s::p2

2nd point.

Member of lw6gui_triangle_s: p3

Type: lw6gui_point_t

Definition: lw6gui_point_t lw6gui_triangle_s::p3

3rd point.

Struct: lw6gui_video_mode_s

Contains the parameters for a video mode, regardless of driver used.

Member of lw6gui_video_mode_s: width

Type: int

Definition: int lw6gui_video_mode_s::width

Width, in pixels.

Member of lw6gui_video_mode_s: height

Type: int

Definition: int lw6gui_video_mode_s::height

Height, in pixels.

Member of lw6gui_video_mode_s: fullscreen

Type: int

Definition: int lw6gui_video_mode_s::fullscreen

1 for fullscreen mode, 0 for windowed mode.

Struct: lw6gui_viewport_s

Macro object used to store viewport information. Viewport here means "what part of the map should we display, on which part of the screen, and with which parameters".

Member of lw6gui_viewport_s: map_shape

Type: lw6sys_whd_t

Definition: lw6sys_whd_t lw6gui_viewport_s::map_shape

Shape of the map to display, unit is map slot.

Member of lw6gui_viewport_s: screen_shape

Type: lw6sys_whd_t

Definition: lw6sys_whd_t lw6gui_viewport_s::screen_shape

Shape of the screen, unit is pixels.

Member of lw6gui_viewport_s: center_x

Type: float

Definition: float lw6gui_viewport_s::center_x

X coord of the point we want to display at the center of the screen. This is typically our main cursor if we’re using the keyboard to move it. Unit is map slot.

Member of lw6gui_viewport_s: center_y

Type: float

Definition: float lw6gui_viewport_s::center_y

Y coord of the point we want to display at the center of the screen. This is typically our main cursor if we’re using the keyboard to move it. Unit is map slot.

Member of lw6gui_viewport_s: old_center_x

Type: float

Definition: float lw6gui_viewport_s::old_center_x

Previous X coord of the point we wanted to display at the center of the screen. This is typically our main cursor if we’re using the keyboard to move it. Unit is map slot.

Member of lw6gui_viewport_s: old_center_y

Type: float

Definition: float lw6gui_viewport_s::old_center_y

Previous Y coord of the point we wanted to display at the center of the screen. This is typically our main cursor if we’re using the keyboard to move it. Unit is map slot.

Member of lw6gui_viewport_s: speed_x

Type: float

Definition: float lw6gui_viewport_s::speed_x

Speed at which the viewport is moving on the X axis, unit is map slot per second.

Member of lw6gui_viewport_s: speed_y

Type: float

Definition: float lw6gui_viewport_s::speed_y

Speed at which the viewport is moving on the Y axis, unit is map slot per second.

Member of lw6gui_viewport_s: x_polarity

Type: int

Definition: int lw6gui_viewport_s::x_polarity

X-polarity parameter (1=on, 0=off, -1=invert).

Member of lw6gui_viewport_s: y_polarity

Type: int

Definition: int lw6gui_viewport_s::y_polarity

Y-polarity parameter (1=on, 0=off, -1=invert).

Member of lw6gui_viewport_s: x_wrap

Type: int

Definition: int lw6gui_viewport_s::x_wrap

Wether to wrap map on the X axis.

Member of lw6gui_viewport_s: y_wrap

Type: int

Definition: int lw6gui_viewport_s::y_wrap

Wether to wrap map on the Y axis.

Member of lw6gui_viewport_s: drawable

Type: lw6gui_zone_t

Definition: lw6gui_zone_t lw6gui_viewport_s::drawable

Drawable zone, this is the physical on-screen viewport. Unit is pixels.

Member of lw6gui_viewport_s: map_main

Type: lw6gui_zone_t

Definition: lw6gui_zone_t lw6gui_viewport_s::map_main

Zone corresponding to the map, if it was to be drawn as a whole, regardless of drawable size, wrapping and polarity.

Member of lw6gui_viewport_s: map_main_clipped

Type: lw6gui_zone_t

Definition: lw6gui_zone_t lw6gui_viewport_s::map_main_clipped

Zone corresponding to the map, only the main map, ignoring wrapping and polarity, but clipped with drawable zone.

Member of lw6gui_viewport_s: map_visible

Type: lw6gui_zone_t

Definition: lw6gui_zone_t lw6gui_viewport_s::map_visible

Actual visible zone of the map, including wrapping, polarity, and drawable clip aware.

Struct: lw6gui_zone_s

A basic rectangle data. The idea is to store both corner positions and width and height to cache the values and avoid always recalculating them. Values are float based, for an integer point equivalent, see the rect struct.

Member of lw6gui_zone_s: x1

Type: float

Definition: float lw6gui_zone_s::x1

Top-left corner X position.

Member of lw6gui_zone_s: y1

Type: float

Definition: float lw6gui_zone_s::y1

Top-left corner Y position.

Member of lw6gui_zone_s: x2

Type: float

Definition: float lw6gui_zone_s::x2

Bottom-right corner X position.

Member of lw6gui_zone_s: y2

Type: float

Definition: float lw6gui_zone_s::y2

Bottom-right corner Y position.

Member of lw6gui_zone_s: w

Type: float

Definition: float lw6gui_zone_s::w

Width.

Member of lw6gui_zone_s: h

Type: float

Definition: float lw6gui_zone_s::h

Height.


Next: , Previous: , Up: C API   [Contents][Index]

5.27 libhlp

5.27.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/hlp/index.html.

5.27.2 API

Function: int lw6hlp_is_documented (lw6sys_context_t * sys_context, const char * keyword)

sys_context: global system context

keyword: the keyword we want to check out

Checks wether a given keyword is documented or not.

Return value: 1 if documented, 0 if not.

Function: const char * lw6hlp_about (lw6sys_context_t * sys_context, lw6hlp_type_t * type, const char ** default_value, int * min_value, int * max_value, const char * keyword)

sys_context: global system context

type: the type of the data associated to the keyword, will be written

default_value: the default value for the keyword, will be written

min_value: the min value for the keyword, will be written

max_value: the max value for the keyword, will be written

keyword: the keyword we want help about

Returns the documentation string associated to a keyword. The keyword might be a command-line option, a Guile function, an XML file entry. Raises a warning if the keyword is undocumented, but never returns NULL, you can use the returned value without checking it. String is localized if a translation is available. It’s safe to call this function with type or other parameters being NULL.

Return value: a help string, never NULL, must not be freed. Additionnally, type will be updated.

Function: lw6hlp_type_t lw6hlp_get_type (lw6sys_context_t * sys_context, const char * keyword)

sys_context: global system context

keyword: the keyword we want the type of

Returns the type of a keyword. Calls lw6hlp_about internally.

Return value: the type, might be LW6HLP_TYPE_VOID.

Function: const char * lw6hlp_get_default_value (lw6sys_context_t * sys_context, const char * keyword)

sys_context: global system context

keyword: the keyword we want the default for

Returns the default value for a keyword. Note that it can be NULL! The returned value is always a string, it’s suitable to store in the config file, it’s the value a user would pass on a command line, the one he wants documented.

Return value: a pointer, which can be NULL, must not be freed.

Function: int lw6hlp_get_min_value (lw6sys_context_t * sys_context, const char * keyword)

sys_context: global system context

keyword: the keyword we want the min for

Returns the min value for a keyword. Wether this is relevant for a given keyword does not affect the fact that you can call this function. A min and max of zero means min and max make no sense.

Return value: the value (integer)

Function: int lw6hlp_get_max_value (lw6sys_context_t * sys_context, const char * keyword)

sys_context: global system context

keyword: the keyword we want the max for

Returns the max value for a keyword. Wether this is relevant for a given keyword does not affect the fact that you can call this function. A min and max of zero means min and max make no sense.

Return value: the value (integer)

Function: char * lw6hlp_get_credits (lw6sys_context_t * sys_context, int id)

sys_context: global system context

id: the id of the credits line to return

Returns a "credit line", that is a short sentence, about 30 to 50 chars, saying who developped the game, created graphics, giving important URLs, and so on. One can pass an arbitraty high id, no risk, it will just loop on previous lines.

Return value: the string, must be freed.

Function: int lw6hlp_match (lw6sys_context_t * sys_context, const char * keyword1, const char * keyword2)

sys_context: global system context

keyword1: the 1st keyword

keyword2: the 2nd keyword

Checks wether a keyword matches another. Not only a string comparison, will also try and guess if the error is only about dash "-" replaced by underscode "_", for instance.

Return value: 1 if matches, 0 if different.

Function: lw6sys_list_t * lw6hlp_list_quick (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of keywords concerning quick options.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list_doc (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of keywords concerning self-documentation system.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list_show (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of keywords concerning the show options.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list_path (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of keywords concerning the path options.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list_players (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of keywords concerning the players options.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list_input (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of keywords concerning the input options.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list_graphics (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of keywords concerning the graphics options.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list_sound (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of keywords concerning the sound options.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list_network (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of keywords concerning the network options.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list_map (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of keywords concerning the map options.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list_map_rules (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of keywords concerning the rules options.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list_map_hints (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of keywords concerning the hints options.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list_map_style (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of keywords concerning the style options.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list_map_teams (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of keywords concerning the teams options.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list_funcs (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of C-function exported to Guile.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list_hooks (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of hooks.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list_advanced (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of keywords concerning advanced options.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list_aliases (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of command-line aliases.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list_team_colors (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of team_colors.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list_weapons (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of weapons.

Return value: list of static strings (can’t modify them)

Function: lw6sys_list_t * lw6hlp_list (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of all available keywords.

Return value: list of static strings (can’t modify them)

Function: int lw6hlp_process_non_run_options (lw6sys_context_t * sys_context, int argc, const char * [] argv, int * run_game)

sys_context: global system context

argc: the number of command-line args, as passed to main

argv: an array of strings containing command-line args, as passed to main

run_game: a pointer to a boolean which will contain true (1) if the game must be launched, or false (0) if the option is such that game must be skipped. Example: –copyright, –help, ...

Will interpret the command-line arguments, and trap those who are related to docs, this is usefull when building the game, we want to have an extra binary to do this without being linked to SDL, for instance.

Return value: non-zero if success, 0 if error. The error can be, for instance, the test suite returning "no, tests were not OK".

Function: void lw6hlp_print_keyword (lw6sys_context_t * sys_context, lw6sys_list_t ** list, FILE * f)

sys_context: global system context

list: a pointer to a list of keywords

f: the file to print the content to

Prints all the keywords from the list. One keyword per line.

Return value: none.

Function: void lw6hlp_print_content (lw6sys_context_t * sys_context, lw6sys_list_t ** list, FILE * f)

sys_context: global system context

list: a pointer to a list of keywords

f: the file to print the content to

Prints all the keywords from the list, with the associated keyword help, to the given file. Output is formatted to fit on the standard terminal/console.

Return value: none.

Function: void lw6hlp_print_about (lw6sys_context_t * sys_context, const char * keyword, FILE * f)

sys_context: global system context

keyword: the keyword to print help about

f: the file to print the content to

Displays the help about a keyword, to a file, directly. It’s formatted for the purpose of the –about=<value> option.

Return value: none

Function: void lw6hlp_print_help (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays a short help message.

Return value: none

Function: void lw6hlp_print_version (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the version of the game.

Return value: none

Function: void lw6hlp_print_short_copyright (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the copyright of the game (short version).

Return value: none

Function: void lw6hlp_print_long_copyright (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the copyright of the game (long version).

Return value: none

Function: void lw6hlp_print_bench (lw6sys_context_t * sys_context, float bench_result, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the program bench value.

Return value: none

Function: void lw6hlp_print_pedigree (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the program pedigree, think of this as version on steroids.

Return value: none

Function: void lw6hlp_print_host (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the host on which the program was compiled.

Return value: none

Function: void lw6hlp_print_audit (lw6sys_context_t * sys_context, int argc, const char * [] argv, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays various paths used by the game.

Return value: none

Function: void lw6hlp_print_modules (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of modules compiled with the game.

Return value: none

Function: void lw6hlp_print_credits (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays all credits on f, those should be available elsewhere within the game (typically on splash screen) but it’s good to be able to show them "standalone".

Return value: none

Function: void lw6hlp_print_list_quick (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of ’quick’ options.

Return value: none

Function: void lw6hlp_print_list_doc (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of ’doc’ options.

Return value: none

Function: void lw6hlp_print_list_show (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of ’show’ options.

Return value: none

Function: void lw6hlp_print_list_path (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of ’path’ options.

Return value: none

Function: void lw6hlp_print_list_players (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of ’players’ options.

Return value: none

Function: void lw6hlp_print_list_input (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of ’input’ options.

Return value: none

Function: void lw6hlp_print_list_graphics (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of ’graphics’ options.

Return value: none

Function: void lw6hlp_print_list_sound (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of ’sound’ options.

Return value: none

Function: void lw6hlp_print_list_network (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of ’network’ options.

Return value: none

Function: void lw6hlp_print_list_map (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of ’map’ options.

Return value: none

Function: void lw6hlp_print_list_map_rules (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of ’map rules’ options.

Return value: none

Function: void lw6hlp_print_list_map_hints (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of ’map hints’ options.

Return value: none

Function: void lw6hlp_print_list_map_style (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of ’map style’ options.

Return value: none

Function: void lw6hlp_print_list_map_teams (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of ’map teams’ options.

Return value: none

Function: void lw6hlp_print_list_funcs (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of ’funcs’.

Return value: none

Function: void lw6hlp_print_list_hooks (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of ’hooks’.

Return value: none

Function: void lw6hlp_print_list_advanced (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of ’advanced’ options.

Return value: none

Function: void lw6hlp_print_list_aliases (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of options aliases.

Return value: none

Function: void lw6hlp_print_list_team_colors (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of team colors.

Return value: none

Function: void lw6hlp_print_list_weapons (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of weapons.

Return value: none

Function: void lw6hlp_print_list (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: the file to print the content to

Displays the list of all known options.

Return value: none

Function: void lw6hlp_print_hello (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: number of args as passed to main

argv: array of args as passed to main

Displays ’hello’ at the beginning of the program.

Return value: none

Function: void lw6hlp_print_goodbye (lw6sys_context_t * sys_context)

sys_context: global system context

Displays ’goodbye’, typically use at end of program to know it’s over and everything went fine.

Return value: none

Function: int lw6hlp_reference_init (lw6sys_context_t * sys_context)

sys_context: global system context

Initializes the help reference, this must be called before any call to lw6hlp_about or such help related functions.

Return value: 1 on success, 0 if failed

Function: void lw6hlp_reference_quit (lw6sys_context_t * sys_context)

sys_context: global system context

un-initializes the help reference, this must be called at the end of the program.

Return value: 1 on success, 0 if failed

Function: int lw6hlp_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libhlp module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6hlp_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the hlp module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.


Next: , Previous: , Up: C API   [Contents][Index]

5.28 libimg

5.28.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/img/index.html.

5.28.2 API

Function: char * lw6img_repr (lw6sys_context_t * sys_context, const lw6img_jpeg_t * jpeg)

sys_context: global system context

jpeg: the jpeg to describe

Returns a string describing the jepg. This is a very short description, use it for logs, and to debug stuff. By no means it’s a complete exhaustive description. Still, the string returned should be unique.

Return value: a dynamically allocated string.

Function: lw6img_jpeg_t * lw6img_screenshot_new (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state, char * user_dir, int quality)

sys_context: global system context

game_state: game_state to create a screenshot from

user_dir: user directory

quality: quality, from 0 to 100

Creates a JPEG screenshot from a game state. The user_dir parameter is used to build a file name and then use it to write data on disk, it is then read and kept in memory. Globally it’s not that bad to store it for we do not generate screenshots that often, and it’s nice for debugging to have it so developping a RAM-only writer wouldn’t make it a blast anyway.

Return value: dynamically allocated object.

Function: void lw6img_screenshot_free (lw6sys_context_t * sys_context, lw6img_jpeg_t * screenshot)

sys_context: global system context

Frees a JPEG screenshot.

Return value: none.

Function: int lw6img_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libimg module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6img_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the img module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Struct: lw6img_jpeg_s

Contains informations about a (loaded) JPEG file.

Member of lw6img_jpeg_s: id

Type: u_int32_t

Definition: u_int32_t lw6img_jpeg_s::id

The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Member of lw6img_jpeg_s: shape

Type: lw6sys_whd_t

Definition: lw6sys_whd_t lw6img_jpeg_s::shape

JPEG file shape, only w and h are relevant.

Member of lw6img_jpeg_s: jpeg_size

Type: int

Definition: int lw6img_jpeg_s::jpeg_size

JPEG size (file size, same as data buffer size).

Member of lw6img_jpeg_s: jpeg_data

Type: void *

Definition: void* lw6img_jpeg_s::jpeg_data

JPEG raw data.


Next: , Previous: , Up: C API   [Contents][Index]

5.29 libker

5.29.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/ker/index.html.

5.29.2 API

Function: char * lw6ker_capture_str (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: game state to represent

Gives a string representation, an ASCII capture of the game. This representation is suitable for debugging, typically print it to a VT100 console.

Return value: dynamically allocated string.

Function: void lw6ker_game_state_checksum_log_set_interval (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state, int checksum_log_interval)

sys_context: global system context

game_state: the game_state to track

checksum_log_interval: dump interval, if 0, feature is disabled

Debugging function used to set automatically an interval at which engine will log a checksum automatically. This is typically to track down where and when there starts to be a difference between two game_states that have evolved separately.

Return value: none

Function: void lw6ker_cursor_reset (lw6sys_context_t * sys_context, lw6ker_cursor_t * cursor)

sys_context: global system context

cursor: the cursor to reset

Sets a cursor to defaults (disabled). This function will not touch the node_id and cursor_id fields, so you can call it on an already used cursor, it will stay usable.

Return value: none

Function: lw6ker_game_state_t * lw6ker_game_state_new (lw6sys_context_t * sys_context, const lw6ker_game_struct_t * game_struct, lw6sys_progress_t * progress)

sys_context: global system context

game_struct: game_struct use to construct the object

progress: progress indicator

Creates a game state from a game struct. The game struct must be kept (never freed) while game_state is in use.

Return value: newly created object.

Function: void lw6ker_game_state_free (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the object to free

Frees a game_state object, releases all required objects. At this stage the map_struct must still be available.

Return value: none

Function: void lw6ker_game_state_point_to (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state, const lw6ker_game_struct_t * game_struct)

sys_context: global system context

game_state: the game_state to modify

game_struct: the game_struct to point to

This can be used when one makes a copy (dup) of a game struct and for some reason want the game_state to point on this new copy. Of course you should make the game_state point to a game_struct that is identical to the one that was used to construct the object in the first place. Use at your own risk.

Return value: none

Function: int lw6ker_game_state_memory_footprint (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the game_state to query

Returns the approximative amount of memory taken by the object.

Return value: number of bytes (approximation)

Function: char * lw6ker_game_state_repr (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the game_state to query

Gives a readable representation of the object.

Return value: newly allocated string, must be freed

Function: int lw6ker_game_state_can_sync (lw6sys_context_t * sys_context, lw6ker_game_state_t * dst, const lw6ker_game_state_t * src)

sys_context: global system context

dst: the destination game_state

src: the source game_state

Tells wether src and dst can be synced. This is not a fool proof function but in most cases it will raise the error, use it to avoid blunders. It just compares dst and src and tries to guess if they correspond to the same logical objects.

Return value: 1 if they are syncable, 0 if not.

Function: int lw6ker_game_state_sync (lw6sys_context_t * sys_context, lw6ker_game_state_t * dst, const lw6ker_game_state_t * src)

sys_context: global system context

dst: the destination game_state

src: the source game_state

Fundamental function, used to carbon copy a game state to another, this is intensively used to keep too tracks of the game state, one most-up-to-date but probably wrong, the one we use to display on the screen, and one slightly outdated (or very outdated if network is slow) but that we’re sure of, something 100% bullet proof we can rely on.

Return value: 1 on success, 0 on error

Function: lw6ker_game_state_t * lw6ker_game_state_dup (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, lw6sys_progress_t * progress)

sys_context: global system context

game_state: the game_state to copy

progress: progress indicator

Dups (copy) a game_state object. The newly created object points to the same game_struct but is an independant copy, you can play a whole different game on it. In practice this is often used to create the game_state objects for anticipation in network games.

Return value: newly created object

Function: u_int32_t lw6ker_game_state_checksum (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the game_state to query

Calculates the checksum of a game_state, this can be very usefull to make sure two states are identicall (prevent network errors and/or cheating).

Return value: 32-bit checksum

Function: void lw6ker_game_state_get_shape (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, lw6sys_whd_t * shape)

sys_context: global system context

game_state: the game_state to query

shape: the shape (out param)

Retrieves the shape (w*h*d)of the game_state.

Return value: none.

Function: int lw6ker_game_state_get_w (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the game_state to query

Retrieves the width (shape.w) of the game_state.

Return value: the width.

Function: int lw6ker_game_state_get_h (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the game_state to query

Retrieves the height (shape.h) of the game_state.

Return value: the height.

Function: int lw6ker_game_state_get_d (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the game_state to query

Retrieves the depth (shape.d, AKA number of layers) of the game_state.

Return value: the depth.

Function: int lw6ker_game_state_register_node (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state, u_int64_t node_id)

sys_context: global system context

game_state: the game_state to act on

node_id: the id of the node to register

Registers a node in the game, this must be done, else no action will be allowed (such as adding a cursor or moving it). There’s a limited number of nodes allowed, and ids must be unique.

Return value: 1 on success, 0 on failure.

Function: int lw6ker_game_state_unregister_node (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state, u_int64_t node_id)

sys_context: global system context

game_state: the game_state to act on

node_id: the id of the node to register

Unregisters a node in the game, this must be done when a node leaves the game, it will free ressources and allow others to connect.

Return value: 1 on success, 0 on failure.

Function: int lw6ker_game_state_node_exists (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state, u_int64_t node_id)

sys_context: global system context

game_state: the game_state to query

node_id: the node to test

Tells wether a node is present in a game.

Return value: 1 if node is in game, 0 if not

Function: int lw6ker_game_state_get_node_info (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state, u_int16_t node_id, u_int32_t * last_command_round)

sys_context: global system context

game_state: game_state to query

node_id: the node to get info about

last_command_round: the last round for which a command was issued (out parameter)

Queries information about a given node, mostly, what was the last round we got a command.

Return value: 1 on success, 0 on error.

Function: int lw6ker_game_state_add_cursor (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state, u_int64_t node_id, u_int16_t cursor_id, int team_color)

sys_context: global system context

game_state: the game_state to act upon

node_id: the node issuing the command

cursor_id: the id of the cursor to add

team_color: the color we wish

Adds a cursor in a game. Note that if there’s already a cursor with that id, it will fail, and the color is only the color we wish, we might indeed be attributed another color on a successfull call.

Return value: 1 on success, 0 on error.

Function: int lw6ker_game_state_remove_cursor (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state, u_int64_t node_id, u_int16_t cursor_id)

sys_context: global system context

game_state: the game_state to act upon

node_id: the node issuing the command

cursor_id: the id of the cursor to remove

Removes a cursor from the game, corresponding teams will be removed if needed.

Return value: 1 on success, 0 on failure.

Function: int lw6ker_game_state_cursor_exists (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, u_int16_t cursor_id)

sys_context: global system context

game_state: the game_state to query

cursor_id: the cursor to test

Tells wether a cursor is present in the game.

Return value: 1 if cursor exists, 0 if not.

Function: int lw6ker_game_state_get_cursor (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, lw6ker_cursor_t * cursor, u_int16_t cursor_id)

sys_context: global system context

game_state: the game_state to query

cursor: the cursor data (out param)

cursor_id: the cursor to query

Get a pointer on a given cursor, pointer is read-only.

Return value: 1 on success, 0 on failure.

Function: void lw6ker_game_state_get_cursor_by_index (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, lw6ker_cursor_t * cursor, int i)

sys_context: global system context

game_state: the game state to query

cursor: the cursor (out param)

i: the index

Gets the cursor information, using its index. This is usefull to walk the whole cursor without knowing their ids. Pointer is read-only.

Return value: none.

Function: int lw6ker_game_state_set_cursor (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state, lw6ker_cursor_t * cursor)

sys_context: global system context

game_state: the game_state to act upon

cursor: the cursor

Sets a cursor, that is, changes its position, this is pretty much anything we can do about a cursor except adding or removing it, just because of Liquid War very simple rules. The passed pointer may be freed after the call, only the cursor_id, node_id, x, y and fire fields are used, others are ignored. More precisely, the enabled will be ignored, it’s not a valid way to add/remove teams.

Return value: 1 on success, 0 on failure

Function: int lw6ker_game_state_team_exists (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, int team_color)

sys_context: global system context

game_state: the game_state to query

team_color: the team color to test

Tells wether a team color is present in the game. Note that this is different from cursor ids.

Return value: 1 if team exists, 0 if not.

Function: int lw6ker_game_state_get_team_info (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, int team_color, int32_t * nb_cursors, int32_t * nb_fighters)

sys_context: global system context

game_state: the game_state to query

team_color: the color to get informations about

nb_cursors: number of cursors with this color (out param)

nb_fighters: number of fighters with this color (out param)

Gets informations about a given color. Indeed, a color can have several cursors, and knowing how many fighters there are with a given color is probably the most important things about a color.

Return value: 1 on success, 0 on failure.

Function: int lw6ker_game_state_get_nb_teams (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the game_state to query

Tells how many teams there are in a game. This is different from the cursors number, there can be more cursors than teams, because a team can have several cursors.

Return value: the number of teams.

Function: void lw6ker_game_state_do_spread (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state, u_int32_t team_mask)

sys_context: global system context

game_state: the game_state to act upon

team_mask: a binary mask of which gradients (teams) must be spreaded

Spreads the gradient, that is, calculates the potential of each point on the map, ie the distance to the closest cursor. The binary mask allows gradient to be spread for only some teams, this is usefull in a multithreaded context, as gradients can be calculated separately.

Return value: none

Function: void lw6ker_game_state_do_move (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state, u_int32_t team_mask)

sys_context: global system context

game_state: the game_state to act upon

team_mask: a binary mask of which teams must be moved

Moves the fighters, note that you must calculate the gradient from time to time else they go to the wrong places. The team_mask allows the moving of only some given teams, but moving (for instance) even teams then odd teams isn’t the same as moving odd teams then even teams. Whereas as far as gradient calculation is concerned, this could have been true, you could have multithreaded that.

Return value: none.

Function: void lw6ker_game_state_finish_round (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the game_state to act upon

Finishes a round, that is, vaccums various stuff, checks if some team has lost, and so on. This is complementary to the spread and move steps, it should be called at each round.

Return value: none.

Function: void lw6ker_game_state_do_round (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the game_state to act upon

This is a fundamental function, it’s called at each round, it fires all the complex calculations in the game, the real core algorithm. Every time this function is called, the round is "over" and the game state is ready for the next... round. It’s equivalent to calling the spread, move and finish functions.

Return value: none.

Function: u_int32_t lw6ker_game_state_get_moves (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the game_state to query

Returns the number of moves done on this game.

Return value: number of moves.

Function: u_int32_t lw6ker_game_state_get_spreads (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the game_state to query

Returns the number of spreads done on this game.

Return value: number of spreads.

Function: u_int32_t lw6ker_game_state_get_rounds (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the game_state to query

Returns the number of rounds done on this game.

Return value: number of rounds.

Function: u_int32_t lw6ker_game_state_get_total_rounds (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the game_state to query

Returns the number of playable rounds in the game, that is the number of rounds to be played if game goes up to the time limit. This is a fixed number, if game slows down then time is stretched, but the the exact maximum number of rounds is known at game start, and it is the number returned by this function.

Return value: number of rounds in the game

Function: int lw6ker_game_state_is_over (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the game_state to query

Tells wether the game is over or not. The answer depends on time limit, game rules, and of course what happened on the battlefield.

Return value: 1 if over, 0 if not.

Function: int lw6ker_game_state_did_cursor_win (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, u_int16_t cursor_id)

sys_context: global system context

game_state: game_state to query

cursor_id: the cursor to test

Tells wether a cursor was the winner after a game is over.

Return value: 1 if cursor is in winning team, 0 if not.

Function: int lw6ker_game_state_get_winner (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, int excluded_team)

sys_context: global system context

game_state: the game_state to query

excluded_team: a team to exclude

Returns the winner, if you set excluded_team to something else than a valid team number (for instance -1, but 0 is a valid team) then this team will be excluded from search. This is usefull if you want to find out who’s the best positionned player while excluding yourself, for instance if you’re a bot.

Return value: the winner team number, note that it can be invalid (-1) if there’s no winner (for example, there are no teams on the map).

Function: int lw6ker_game_state_get_looser (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, int excluded_team)

sys_context: global system context

game_state: the game_state to query

excluded_team: a team to exclude

Returns the looser, if you set excluded_team to something else than a valid team number (for instance -1, but 0 is a valid team) then this team will be excluded from search. This is usefull if you want to find out who’s the worst positionned player while excluding yourself, for instance if you’re a bot.

Return value: the looser team number, note that it can be invalid (-1) if there’s no looser (for example, there are no teams on the map).

Function: int32_t lw6ker_game_state_get_nb_active_fighters (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the game_state to query

Gets the number of active fighters, this is relatively constant within the game, it does not change when someone looses, but it can vary when a new team arrives or disappears.

Return value: number of fighters.

Function: int32_t lw6ker_game_state_get_time_elapsed (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the game_state to query

Returns the time elapsed, this is not the real time you’d time with an atomic clock, rather the time that would have elapsed if game had been run at its nominal speed. There can be a difference if your computer is too slow, among other things.

Return value: time elapsed, in seconds.

Function: int32_t lw6ker_game_state_get_time_left (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the game_state to query

Returns the time left, this is not the real time you’d time with an atomic clock, rather the time that would theorically be left is game was to be run at its nominal speed. There can be a difference if your computer is too slow, among other things. You shouldn’t rely on this to know wether a game is over or not, there’s another dedicated function for that.

Return value: time left, in seconds.

Function: int32_t lw6ker_game_state_get_global_history (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, int i, int team_id)

sys_context: global system context

game_state: the game_state to query

i: the index of the history point

team_id: the team to query

Returns the number of fighters at some point in the past (the lower i, the oldest). The history scrolls automatically and erases itself at some point, it’s of constant length. This is the global, long term history, reflects the whole game and could be used for an end-game score screen.

Return value: number of fighters at that time.

Function: int32_t lw6ker_game_state_get_latest_history (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, int i, int team_id)

sys_context: global system context

game_state: the game_state to query

i: the index of the history point

team_id: the team to query

Returns the number of fighters at some point in the past (the lower i, the oldest). The history scrolls automatically and erases itself at some point, it’s of constant length. This is the latest, short term history, reflects the recent game evolutions and could be used to display an in-game monitor.

Return value: number of fighters at that time.

Function: int32_t lw6ker_game_state_get_global_history_max (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: game_state to query

Returns the maximum value, that is, the maximum number of fighters, all teams combined, for this history. This can be used to scale charts. This function for the global long term history.

Return value: max number of fighters.

Function: int32_t lw6ker_game_state_get_latest_history_max (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: game_state to query

Returns the maximum value, that is, the maximum number of fighters, all teams combined, for this history. This can be used to scale charts. This function for the latest short term history.

Return value: max number of fighters.

Function: int32_t lw6ker_game_state_get_fighter_id (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, int32_t x, int32_t y, int32_t z)

sys_context: global system context

game_state: game_state to query

x: x position

y: y position

z: z position

Gets the id of a fighter in a given position. Previous versions of the game used to have this declared inline static for speed, but the price to pay in terms of maintainability was too high: too much stuff from the ker module had to be kept public. This functions is very likely to be called often when one wants to know what’s happening on the battlefield, to draw it, for instance. If there’s no fighter, the id is negative, any id equal or greater than 0 (returned by this function) is valid.

Return value: the id of the fighter at that position.

Function: lw6ker_fighter_t * lw6ker_game_state_get_fighter_rw_by_id (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state, int32_t fighter_id)

sys_context: global system context

game_state: game_state to query

fighter_id: the id of the fighter

Gets a fighter by its id. Internally, all fighters are stored in an array so it could be "safe" to get fighter with id 0 then walk the array. Previous versions of the game used to have this public (the array), it has been hidden since. Pointer is read/write. Pointer is read/write.

Return value: pointer to the fighter with the given id.

Function: lw6ker_fighter_t * lw6ker_game_state_get_fighter_rw_safe (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state, int32_t x, int32_t y, int32_t z)

sys_context: global system context

game_state: game_state to query

x: x position

y: y position

z: z position

Gets a fighter by its position. This function will check for boundaries, if there’s no fighter in this place, it will return NULL, but nothing worse can happen. More precisely, if the place is in a wall, it won’t bug, unlike the non-bullet-proof equivalent of this function. Pointer is read/write.

Return value: pointer to the fighter at this position, or NULL if none.

Function: lw6ker_fighter_t * lw6ker_game_state_get_fighter_rw_unsafe (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state, int32_t x, int32_t y, int32_t z)

sys_context: global system context

game_state: game_state to query

x: x position

y: y position

z: z position

Gets a fighter by its position. This function will not check for boundaries, if there’s no fighter in this place, not only will it probably not return a valid value, but it will also even segfault before that, trying to access non-existing structures in menory. So only call this if you’re sure there’s a fighter here. Pointer is read/write.

Return value: pointer to the fighter at this position, or NULL if none.

Function: const lw6ker_fighter_t * lw6ker_game_state_get_fighter_ro_by_id (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, int32_t fighter_id)

sys_context: global system context

game_state: game_state to query

fighter_id: the id of the fighter

Gets a fighter by its id. Internally, all fighters are stored in an array so it could be "safe" to get fighter with id 0 then walk the array. Previous versions of the game used to have this public (the array), it has been hidden since. Pointer is read-only. Pointer is read-only.

Return value: pointer to the fighter with the given id.

Function: const lw6ker_fighter_t * lw6ker_game_state_get_fighter_ro_safe (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, int32_t x, int32_t y, int32_t z)

sys_context: global system context

game_state: game_state to query

x: x position

y: y position

z: z position

Gets a fighter by its position. This function will check for boundaries, if there’s no fighter in this place, it will return NULL, but nothing worse can happen. More precisely, if the place is in a wall, it won’t bug, unlike the non-bullet-proof equivalent of this function. Pointer is read-only.

Return value: pointer to the fighter at this position, or NULL if none.

Function: const lw6ker_fighter_t * lw6ker_game_state_get_fighter_ro_unsafe (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, int32_t x, int32_t y, int32_t z)

sys_context: global system context

game_state: game_state to query

x: x position

y: y position

z: z position

Gets a fighter by its position. This function will not check for boundaries, if there’s no fighter in this place, not only will it probably not return a valid value, but it will also even segfault before that, trying to access non-existing structures in menory. So only call this if you’re sure there’s a fighter here. Pointer is read-only.

Return value: pointer to the fighter at this position, or NULL if none.

Function: int lw6ker_game_state_get_zone_potential (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, int i, int team_id)

sys_context: global system context

game_state: the game_state to query

team_id: the team id (color)

Gets the potential of a zone. In practice this is not needed to make the game function, you need not call this to know how to move fighters, however the information can be interesting for debugging.

Return value: the potential

Function: int lw6ker_game_state_get_charge_per1000 (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, int team_color)

sys_context: global system context

game_state: game_state to query

team_color: the team color to query

Returns the charge ratio for a given team/color. A value of 100 means fire is enabled, more than 1000 means super-charge, under 100 means you have to wait.

Return value: integer value.

Function: int lw6ker_game_state_get_weapon_per1000_left (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, int team_color)

sys_context: global system context

game_state: game_state to query

team_color: the team color to query

Returns how much of the weapon is yet to be consumed for a given team. More than 1000 means extra time, 1000 is standard time to be elapsed, 0 means it’s over.

Return value: integer value.

Function: int lw6ker_game_state_get_latest_weapon (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, int * team_color, int * weapon_id, int * per1000_left)

sys_context: global system context

game_state: game_state to query

team_color: the team color corresponding to last weapon (out param)

weapon_id: the corresponding weapon_id (out param)

per1000_left: how much of the weapon is yet to be spent (out param)

Returns informations about the latest weapon, this is typically for drawing purposes, just query this and you know if you need to paint everything in red, green, whatever, as far as the default backend is concerned. In case there’s no weapon, well, parameters are untouched. Pointers can be passed as NULL.

Return value: 1 if found, 0 if not.

Function: int lw6ker_game_state_get_nb_colors (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: game state to query

Gives the max number of colors (AKA teams) that are present in the game. This is just a simple utility/wrapper function which is meant to be exported to Guile scripts.

Return value: number of colors

Function: int lw6ker_game_state_get_nb_cursors (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: game state to query

Gives the max number of cursors that are present in the game. This is just a simple utility/wrapper function which is meant to be exported to Guile scripts.

Return value: number of cursors

Function: int lw6ker_game_state_get_nb_nodes (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: game state to query

Gives the max number of nodes that are present in the game. This is just a simple utility/wrapper function which is meant to be exported to Guile scripts.

Return value: number of nodes

Function: lw6ker_game_struct_t * lw6ker_game_struct_new (lw6sys_context_t * sys_context, const lw6map_level_t * level, lw6sys_progress_t * progress)

sys_context: global system context

level: the level on which the game_struct is based

progress: progress indicator

Creates a new game_struct from a level. The game_struct is different from the level in the sense that the game_struct does contain algorithmic specific optimizations, it’s a ready-to-use struct desgined for execution speed, while the plain level just stores information.

Return value: newly allocated object

Function: void lw6ker_game_struct_free (lw6sys_context_t * sys_context, lw6ker_game_struct_t * game_struct)

sys_context: global system context

game_struct: the game_struct to free

Frees a game_struct object, releasing all required stuff. The source level must still be available when freeing this.

Return value: none

Function: void lw6ker_game_struct_point_to (lw6sys_context_t * sys_context, lw6ker_game_struct_t * game_struct, const lw6map_level_t * level)

sys_context: global system context

game_struct: the game_struct to modify

level: the level to point to

This can be used when one makes a copy (dup) of a level and for some reason want the game_struct to point on this new copy. Of course you should make the game_struct point to a level that is identical to the one that was used to construct the object in the first place. Use at your own risk.

Return value: none

Function: int lw6ker_game_struct_memory_footprint (lw6sys_context_t * sys_context, const lw6ker_game_struct_t * game_struct)

sys_context: global system context

game_struct: the game_struct to query

Returns the approximative amount of memory taken by the object.

Return value: number of bytes (approximation)

Function: char * lw6ker_game_struct_repr (lw6sys_context_t * sys_context, const lw6ker_game_struct_t * game_struct)

sys_context: global system context

game_struct: the game_struct to query

Gives a readable representation of the object.

Return value: newly allocated string, must be freed

Function: lw6ker_game_struct_t * lw6ker_game_struct_dup (lw6sys_context_t * sys_context, const lw6ker_game_struct_t * game_struct, lw6sys_progress_t * progress)

sys_context: global system context

game_struct: the game_struct to copy

progress: progress indicator

Dups (copy) a game_struct object. The newly created object points to the same game_struct but is an independant copy, you can play a whole different game on it. In practice this is often used to create the game_struct objects for anticipation in network games.

Return value: newly created object

Function: u_int32_t lw6ker_game_struct_checksum (lw6sys_context_t * sys_context, const lw6ker_game_struct_t * game_struct)

sys_context: global system context

game_struct: the game_struct to query

Calculates the checksum of a game_struct, this can be very usefull to make sure two structs are identicall (prevent network errors and/or cheating).

Return value: 32-bit checksum

Function: void lw6ker_game_struct_get_shape (lw6sys_context_t * sys_context, const lw6ker_game_struct_t * game_struct, lw6sys_whd_t * shape)

sys_context: global system context

game_struct: the game_struct to query

shape: the shape (out param)

Retrieves the shape (w*h*d)of the game_struct.

Return value: none.

Function: int lw6ker_game_struct_get_w (lw6sys_context_t * sys_context, const lw6ker_game_struct_t * game_struct)

sys_context: global system context

game_struct: the game_struct to query

Retrieves the width (shape.w) of the game_struct.

Return value: the width.

Function: int lw6ker_game_struct_get_h (lw6sys_context_t * sys_context, const lw6ker_game_struct_t * game_struct)

sys_context: global system context

game_struct: the game_struct to query

Retrieves the height (shape.h) of the game_struct.

Return value: the height.

Function: int lw6ker_game_struct_get_d (lw6sys_context_t * sys_context, const lw6ker_game_struct_t * game_struct)

sys_context: global system context

game_struct: the game_struct to query

Retrieves the depth (shape.d, AKA number of layers) of the game_struct.

Return value: the depth.

Function: int lw6ker_game_struct_is_fg (lw6sys_context_t * sys_context, const lw6ker_game_struct_t * game_struct, int32_t x, int32_t y, int32_t z)

sys_context: global system context

game_struct: the game_struct to query

x: x position

y: y position

z: z position

Tests wether a given position is foreground, that is, occupied by a wall.

Return value: 1 if foreground (wall, fighters can’t move), 0 if not

Function: int lw6ker_game_struct_is_bg (lw6sys_context_t * sys_context, const lw6ker_game_struct_t * game_struct, int32_t x, int32_t y, int32_t z)

sys_context: global system context

game_struct: the game_struct to query

x: x position

y: y position

z: z position

Tests wether a given position is background, that is, there’s no wall.

Return value: 1 if background (wall, fighters can move), 0 if not

Function: void lw6ker_game_struct_get_zones_info (lw6sys_context_t * sys_context, const lw6ker_game_struct_t * game_struct, int * nb_zones, int * max_zone_size)

sys_context: global system context

game_struct: game_struct to query

nb_zones: the maximum zone size (out param, can be NULL)

max_zone_size: the maximum zone size (out param, can be NULL)

This function gets information about the internal zoning system, can be used for debugging.

Return value: none.

Function: void lw6ker_game_struct_get_zone_info (lw6sys_context_t * sys_context, const lw6ker_game_struct_t * game_struct, int i, lw6sys_xyz_t * zone_pos, int * zone_size)

sys_context: global system context

game_struct: game_struct to query

i: index of the zone to query

zone_pos: coord of the zone, top-left corner (out param, can be NULL)

zone_size: size of the zone (out param, can be NULL)

This function gets information about the internal zoning system, can be used for debugging.

Return value: none

Function: int32_t lw6ker_game_struct_get_zone_id (lw6sys_context_t * sys_context, const lw6ker_game_struct_t * game_struct, int32_t x, int32_t y, int32_t z)

sys_context: global system context

game_struct: the game_struct to query

x: x pos

y: y pos

z: z pos

Gets the zone id for a given position. The id returned can then be used to query for a potential, for instance.

Return value: the zone id

Function: void lw6ker_game_struct_find_free_slot_near (lw6sys_context_t * sys_context, const lw6ker_game_struct_t * game_struct, lw6sys_xyz_t * there, lw6sys_xyz_t here)

sys_context: global system context

game_struct: the game_struct to query

there: the closest free slot (out param)

here: where we’d like to be

Tries to find the closest free slot (there) near a given position (here). This is typically used internally to find out where to apply the cursor when it’s flying over walls.

Return value: none

Function: char * lw6ker_game_struct_to_hexa (lw6sys_context_t * sys_context, const lw6ker_game_struct_t * game_struct)

sys_context: global system context

game_struct: the game struct to convert

Converts a map to something that is later readable by lw6ker_game_struct_from_hexa to reproduce the exact same map. Just a serializer.

Return value: a newly allocated pointer, NULL if conversion failed.

Function: lw6ker_game_struct_t * lw6ker_game_struct_from_hexa (lw6sys_context_t * sys_context, const char * hexa, const lw6map_level_t * level)

sys_context: global system context

hexa: an hexadecimal ASCII string, created by lw6ker_game_struct_to_hexa

level: the level this game_struct is bounded to

Constructs a game struct from an hexadecimal string generated by lw6ker_game_struct_to_hexa. Just an un-serializer.

Return value: a new map, might be NULL if string isn’t correct.

Function: char * lw6ker_game_state_to_hexa (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the game state to convert

Converts a map to something that is later readable by lw6ker_game_state_from_hexa to reproduce the exact same map. Just a serializer.

Return value: a newly allocated pointer, NULL if conversion failed.

Function: lw6ker_game_state_t * lw6ker_game_state_from_hexa (lw6sys_context_t * sys_context, const char * hexa, const lw6ker_game_struct_t * game_struct)

sys_context: global system context

hexa: an hexadecimal ASCII string, created by lw6ker_game_state_to_hexa

game_struct: the game_struct this game_state is bounded to

Constructs a game state from an hexadecimal string generated by lw6ker_game_state_to_hexa. Just an un-serializer.

Return value: a new map, might be NULL if string isn’t correct.

Function: int lw6ker_move_get_best_next_pos (lw6sys_context_t * sys_context, const lw6ker_game_state_t * game_state, lw6sys_xyz_t * next_pos, lw6sys_xyz_t * current_pos, int team_color)

game_state: the game_state to work on

next_pos: the next position (out param)

current_pos: the current position

team_color: the team color

Tries to find the best move given a position and a team. Note that this function does not check for the presence of another fighter, it will only check walls and can even (sometimes) fail when there’s a path. The reason is that it uses the game_state at a given round and does not recalculate gradient while a real fighter has an ever-changing gradient. Whatsoever, this can be used to move cursors like they were fighters, it’s not perfect but gives a good illusion.

Return value: 1 if best place found, 0 if not.

Function: int lw6ker_score_array_update (lw6sys_context_t * sys_context, lw6ker_score_array_t * score_array, const lw6ker_game_state_t * game_state)

sys_context: global system context

score_array: the score array to modify

game_state: the game_state to get the information from

Updates a score array, that is, calculates all scores, so that they can be displayed, for instance.

Return value: 1 on success, 0 on failure.

Function: void lw6ker_team_mask_get (lw6sys_context_t * sys_context, u_int32_t * even, u_int32_t * odd, int32_t round)

sys_context: global system context

even: even team mask (out param)

odd: odd team mask (out param)

round: round concerned

Returns a default team mask for a given round, even and odd will contain ready to use masks (for spread and move functions for instance).

Return value: none.

Function: void lw6ker_team_mask_best (lw6sys_context_t * sys_context, u_int32_t * even, u_int32_t * odd, lw6ker_game_state_t * game_state)

sys_context: global system context

even: even team mask (out param)

odd: odd team mask (out param)

game_state: the game_state concerned

Returns an optimal team mask for a given round, even and odd will contain ready to use masks (for spread and move functions for instance). The difference with the default team mask is that this one will test for which teams are present and try and manage to find an equilibrated set of odd/even teams.

Return value: none.

Function: int lw6ker_team_mask_is_concerned (lw6sys_context_t * sys_context, int team_color, u_int32_t team_mask)

sys_context: global system context

team_color: color index

team_mask: team mask

Tells wether a given team is concerned by a team mask.

Return value: 1 if concerned, 0 if not.

Function: int lw6ker_team_mask_color2mask (lw6sys_context_t * sys_context, int team_color)

team_color: color index

Gives the mask corresponding to a given color.

Return value: bitwise mask.

Function: int lw6ker_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libker module. Thoses tests Will perform deep checksums and *really* check many things. If this passes, the algorithm is fine. What could make it fail is a serious bug and/or some weird combination of endianess, byte alignment... *

Return value: 1 if test is successfull, 0 on error.

Function: int lw6ker_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the ker module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Struct: lw6ker_cursor_control_s

Contains a cursor controls state, basically a cursor is a position plus a fire and fire2 booleans.

Member of lw6ker_cursor_control_s: pos

Type: lw6sys_xyz_t

Definition: lw6sys_xyz_t lw6ker_cursor_control_s::pos

Cursor position, z isn’t relevant for now.

Member of lw6ker_cursor_control_s: fire

Type: int

Definition: int lw6ker_cursor_control_s::fire

Fire, 1 if primary weapon must be used.

Member of lw6ker_cursor_control_s: fire2

Type: int

Definition: int lw6ker_cursor_control_s::fire2

Fire2, 1 if secondary weapon must be used.

Struct: lw6ker_cursor_s

Data about a given cursor.

Member of lw6ker_cursor_s: node_id

Type: u_int64_t

Definition: u_int64_t lw6ker_cursor_s::node_id

The id of the node this cursor belongs to.

Member of lw6ker_cursor_s: cursor_id

Type: u_int16_t

Definition: u_int16_t lw6ker_cursor_s::cursor_id

The id of this cursor.

Member of lw6ker_cursor_s: letter

Type: char

Definition: char lw6ker_cursor_s::letter

ASCII code of the letter associated to the cursor.

Member of lw6ker_cursor_s: enabled

Type: int

Definition: int lw6ker_cursor_s::enabled

Wether the cursor is enabled/active or not.

Member of lw6ker_cursor_s: team_color

Type: int

Definition: int lw6ker_cursor_s::team_color

Team associated with this cursor.

Member of lw6ker_cursor_s: pos

Type: lw6sys_xyz_t

Definition: lw6sys_xyz_t lw6ker_cursor_s::pos

Cursor position, z isn’t relevant for now.

Member of lw6ker_cursor_s: fire

Type: int

Definition: int lw6ker_cursor_s::fire

Primary fire button state.

Member of lw6ker_cursor_s: fire2

Type: int

Definition: int lw6ker_cursor_s::fire2

Alternate fire button state.

Member of lw6ker_cursor_s: apply_pos

Type: lw6sys_xyz_t

Definition: lw6sys_xyz_t lw6ker_cursor_s::apply_pos

Position to apply cursor on. Problem follows: cursor might be hanging on a wall, somewhere fighters can’t go. In that case an alternate position is find, usually the closest free space. But this can take time to calculate so we cache this value here, as it is convenient to have it at hand.

Member of lw6ker_cursor_s: pot_offset

Type: int32_t

Definition: int32_t lw6ker_cursor_s::pot_offset

Potential offset. Whenever the cursor is applied to some place, one can add a potential to it, this can be used to make some cursor more attractive than others.

Struct: lw6ker_fighter_s

Contains the parameters of a fighter, one of those little squares that are that at the very heart of Liquid War.

Member of lw6ker_fighter_s: team_color

Type: u_int32_t

Definition: u_int32_t lw6ker_fighter_s::team_color

Team color from 0 to 9, -1 if invalid.

Member of lw6ker_fighter_s: last_direction

Type: int32_t

Definition: int32_t lw6ker_fighter_s::last_direction

Last direction this fighter used, this is important for in some cases we want to know where the fighter was heading before, our current choice might rely on previous state.

Member of lw6ker_fighter_s: health

Type: int32_t

Definition: int32_t lw6ker_fighter_s::health

Fighter health from 0 to 10000.

Member of lw6ker_fighter_s: act_counter

Type: int32_t

Definition: int32_t lw6ker_fighter_s::act_counter

This counter is used to handle speed up/slow down. At each round it’s incremented, whenever it reaches 100 then the fighter really acts. Basically, there’s a Bresenham algorithm behind all that.

Member of lw6ker_fighter_s: pad

Type: int32_t

Definition: int32_t lw6ker_fighter_s::pad

Free for later use.

Member of lw6ker_fighter_s: pos

Type: lw6sys_xyz_t

Definition: lw6sys_xyz_t lw6ker_fighter_s::pos

Fighter position.

Struct: lw6ker_game_state_s

Game structure containing all changeable data state, this will hold the fighter positions, their health, the cursors position, the gradient, anything that is dynamic. Note that this structure is a wrapper over the internal structure which contains the real members, the first two members need be the same as it is casted internally.

Member of lw6ker_game_state_s: id

Type: u_int32_t

Definition: u_int32_t lw6ker_game_state_s::id

The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Member of lw6ker_game_state_s: game_struct

Type: lw6ker_game_struct_t *

Definition: lw6ker_game_struct_t* lw6ker_game_state_s::game_struct

Pointer on the game non-mutable structure, which holds the data that is never changed within a game.

Struct: lw6ker_game_struct_s

Game struct is very similar to the level struct of the lw6map module. Indeed, it’s immutable and won’t change during the game. The difference with lw6map_level is that game_struct is algorithm aware and has many tricks, special internals, cached data, so that it speeds up the overall algorithm. In fact it contains everything lw6ker_game_state needs to have but need not change during the game. The 3 first members, id, level, rules are the same as the internal _lw6ker_game_struct_t structure. The rest of it is hidden. The program will cast from lw6ker_game_struct_t to _lw6ker_game_struct_t internally.

Member of lw6ker_game_struct_s: id

Type: u_int32_t

Definition: u_int32_t lw6ker_game_struct_s::id

The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Member of lw6ker_game_struct_s: level

Type: lw6map_level_t *

Definition: lw6map_level_t* lw6ker_game_struct_s::level

Pointer on the level source structure. This one might still retain informations we don’t want to duplicate here, for instance the textures, which are of no use for the core algorithm so are pointless to backup here, but are still of interest for high-level functions such as display stuff.

Member of lw6ker_game_struct_s: rules

Type: lw6map_rules_t

Definition: lw6map_rules_t lw6ker_game_struct_s::rules

Game rules, this is just a cached copy to avoid derefencing the level pointer any time we need to query a parameter.

Struct: lw6ker_score_array_s

This is an array which contains all scores for all teams, it’s calculated from game_state and should be used read only by code which is not within lw6ker.

Member of lw6ker_score_array_s: active_fighters

Type: int

Definition: int lw6ker_score_array_s::active_fighters

Number of fighters on the battlefield.

Member of lw6ker_score_array_s: nb_scores

Type: int

Definition: int lw6ker_score_array_s::nb_scores

Number of score items. This can be greater than the number of active teams, since it retains informations about teams which have disappeared.

Member of lw6ker_score_array_s: scores

Type: lw6ker_score_t

Definition: lw6ker_score_t lw6ker_score_array_s::scores[LW6MAP_NB_TEAM_COLORS]

Scores for each team, they are sorted, the first one with index 0 is the current winner, then all other teams follow, the last one being Mr Looser.

Struct: lw6ker_score_s

Stores the score information about a team, this structure is used to get informations from the game, and display them.

Member of lw6ker_score_s: has_been_active

Type: int

Definition: int lw6ker_score_s::has_been_active

Wether this team (this color) has been active at some point during the game. This is important for at score time, many teams might have been disabled, this is typical of dead teams in the LW5 last player wins scheme. It can also happen in network games after a team leaves. Note that this way of counting active teams does not allow fine grain knowledge of who played, for the yellow team might have been played by different nodes through a single game session.

Member of lw6ker_score_s: team_color

Type: int

Definition: int lw6ker_score_s::team_color

The color of the team this score is about.

Member of lw6ker_score_s: fighters_percent

Type: int

Definition: int lw6ker_score_s::fighters_percent

Percentage of fighters for this team. The global score array object will take care of making the sum of fighters_percent be exactly 100, regardless of exactitude, it will round this number to make a nice total and hide rounding errors.

Member of lw6ker_score_s: fighters_absolute

Type: int

Definition: int lw6ker_score_s::fighters_absolute

Absolute number of fighters for this team.

Member of lw6ker_score_s: fighters_ratio

Type: float

Definition: float lw6ker_score_s::fighters_ratio

One of the rare float in lw6ker, only for eye candy, this is the equivalent of fighters_percent but as a float between 0.0f and 1.0f. It gives the possibility of more precise graphical displays, will its integer companion value is usefull for writing down scores.

Member of lw6ker_score_s: frags

Type: int

Definition: int lw6ker_score_s::frags

Number of frags. Note that depending on game rules, this can have very different meanings.

Member of lw6ker_score_s: consolidated_percent

Type: int

Definition: int lw6ker_score_s::consolidated_percent

OK, this is probably the most non-intuitive number but still the most usefull. It will show a percentage that is greater as we estimate the team in a stronger position. For instance, it can be higher if the team has very few fighters on the field but has a great number of frags. The one who has the greatest number here is the winner.


Next: , Previous: , Up: C API   [Contents][Index]

5.30 libldr

5.30.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/ldr/index.html.

5.30.2 API

Function: int lw6ldr_body_read (lw6sys_context_t * sys_context, lw6map_body_t * body, const char * dirname, lw6map_param_t * param, const lw6ldr_hints_t * hints, int display_w, int display_h, float ratio, int bench_value, int magic_number, lw6sys_progress_t * progress)

sys_context: global system context

body: the body to read, must point to allocated memory

dirname: the directory of the map

param: map parameters

hints: map hints

display_w: the display width

display_h: the display height

ratio: wished map ratio

bench_value: the bench value (depends on computer capacity)

magic_number: arbitrary constant

progress: structure to transmit loading progress

Reads the map body, that is, all the layers.

Return value: 1 if OK, 0 if failed.

Function: void lw6ldr_auto_colors (lw6sys_context_t * sys_context, lw6map_style_t * style, const lw6ldr_hints_t * hints)

style: the style structure to process.

hints: additionnal hints to know what to set automatically

Deduces all colors from background color, if needed. The function will check color_auto parameters and replace all other colors by base and alternate colors if needed. Note that the background color itself is not changed by this function. Background can only be guessed from texture.

Return value: none.

Function: int lw6ldr_cursor_texture_read (lw6sys_context_t * sys_context, lw6map_cursor_texture_t * cursor_texture, const char * dirname)

sys_context: global system context

cursor_texture: the cursor texture (out param)

dirname: the directory we load the data form (map dir)

Reads the cursor texture information, if not available, will use defaults

Return value: 1 on success, 0 on failure.

Function: void lw6ldr_free_entry (lw6sys_context_t * sys_context, lw6ldr_entry_t * entry)

sys_context: global system context

entry: the entry to free

Frees a map entry.

Return value: none.

Function: lw6ldr_entry_t * lw6ldr_dup_entry (lw6sys_context_t * sys_context, const lw6ldr_entry_t * entry)

sys_context: global system context

entry: the entry to dup

Dup a map entry.

Return value: newly allocated object.

Function: lw6sys_list_t * lw6ldr_get_entries (lw6sys_context_t * sys_context, const char * map_path, const char * relative_path, const char * user_dir)

sys_context: global system context

map_path: the map_path environment config variable, delimited path list

relative_path: the relative path to use to find the map directory

user_dir: the user directory

Lists all maps in a given directory. Returns a list of lw6ldr_entry_t which can contain both directories with subdirs and actual maps. Maps are sorted before being returned, first directories, then maps, sorted in alphabetical order.

Return value: a list of dynamically allocated lw6ldr_entry_t.

Function: void lw6ldr_for_all_entries (lw6sys_context_t * sys_context, const char * map_path, const char * relative_path, const char * user_dir, int recursive, lw6sys_list_callback_func_t callback_func, void * func_data)

sys_context: global system context

map_path: the map_path environment config variable, delimited path list

relative_path: the relative path to use to find the map directory

user_dir: the user directory

recursive: if non-zero, map search will recurse in subdirs

callback_func: the function which will be called on each entry

func_data: an extra pointer to pass data to callback_func

Executes a given function on all maps in a given place, typically used in test programs.

Return value: none.

Function: lw6ldr_entry_t * lw6ldr_chain_entry (lw6sys_context_t * sys_context, const char * map_path, const char * relative_path, const char * user_dir)

sys_context: global system context

map_path: the map_path environment config variable, delimited path list

relative_path: the relative path to use to find the map directory

user_dir: the user directory

Gets the next entry used in test programs.

Return value: none.

Function: int lw6ldr_exp_validate (lw6sys_context_t * sys_context, const lw6map_level_t * level, const char * user_dir)

sys_context: global system context

level: the level to validate

user_dir: user directory

Validates a level, acknowledges you’ve won it. Upgrades exp.

Return value: 1 on success, 0 on failure.

Function: int lw6ldr_grease_apply (lw6sys_context_t * sys_context, lw6map_layer_t * layer, const lw6map_rules_t * rules, const lw6ldr_hints_t * hints, lw6sys_progress_t * progress)

sys_context: global system context

layer: the layer on which to apply the grease

rules: map rules

hints: map hints

progress: structure to transmit loading progress

Reads the map body, that is, all the layers.

Return value: 1 if OK, 0 if failed.

Function: void lw6ldr_hints_defaults (lw6sys_context_t * sys_context, lw6ldr_hints_t * hints)

sys_context: global system context

hints: data to initialize

Set the hints struct to its defaults.

Return value: none.

Function: void lw6ldr_hints_zero (lw6sys_context_t * sys_context, lw6ldr_hints_t * hints)

sys_context: global system context

hints: data to initialize

Zeros the hints struct, this is not the same as setting to defaults.

Return value: none.

Function: void lw6ldr_hints_clear (lw6sys_context_t * sys_context, lw6ldr_hints_t * hints)

sys_context: global system context

hints: data to initialize

Clears the hints struct, this is not the same as setting to defaults.

Return value: none.

Function: int lw6ldr_hints_read (lw6sys_context_t * sys_context, lw6ldr_hints_t * hints, const char * dirname)

sys_context: global system context

dirname: the directory of the map

Read the hints (hints.xml) of a map. Pointer to hints must be valid, and values already initialized, either zeroed or filled in with defaults or custom values.

Return value: 1 if success, 0 if failed.

Function: int lw6ldr_hints_set (lw6sys_context_t * sys_context, lw6ldr_hints_t * hints, const char * key, const char * value)

sys_context: global system context

hints: the hints to modify

key: the key to modify

value: the value to affect to the key, as a string

Sets one single parameter in a hints structure. Value must always be passed as a string, will be converted to the right type automatically when storing it in the structure.

Return value: 1 if success, 0 if failed. Note that while 0 really means there’s a problem, some affectations can fail and return 1, needs to be worked on.

Function: char * lw6ldr_hints_get (lw6sys_context_t * sys_context, const lw6ldr_hints_t * hints, const char * key)

sys_context: global system context

hints: the hints to modify

key: the key to modify

Gets one single parameter in a hints structure. Value is converted as a string.

Return value: dynamically allocated string, NULL on error.

Function: char * lw6ldr_hints_get_default (lw6sys_context_t * sys_context, const char * key)

sys_context: global system context

key: the key we want informations about.

Gets the default value for a given hints key.

Return value: dynamically allocated string, NULL on error.

Function: int lw6ldr_hints_update (lw6sys_context_t * sys_context, lw6ldr_hints_t * hints, lw6sys_assoc_t * values)

sys_context: global system context

hints: the hints struct to fill with values (read/write parameter)

values: an assoc containing strings with the new values

Overrides hints with values. Pointer to hints must be valid, and values already initialized, either zeroed or filled in with defaults or custom values. Not all parameters need be defined in values. It can even be NULL. The idea is just that if something is defined in values, it will override the existing hints.

Return value: 1 if success, 0 if failed.

Function: int lw6ldr_layer_read_first (lw6sys_context_t * sys_context, lw6map_layer_t * layer, const char * filename, lw6map_param_t * param, const lw6ldr_hints_t * hints, int display_w, int display_h, float target_ratio, int bench_value, int magic_number, int expected_depth, lw6sys_progress_t * progress)

sys_context: global system context

layer: layer to update (out param)

filename: name of PNG file

param: parameters of the map

hints: hints of the map

display_w: width of display

display_h: height of display

target_ratio: width/height ratio we want

bench_value: bench for this computer

magic_number: arbitrary constant

expected_depth: depth of map according to files available

progress: progress object to provide feedback (in/out)

Reads the first layer, that is map.png. This function has many parameters since it will try and guess the final (real) resolution of the map.

Return value: 1 on success, 0 on failure.

Function: int lw6ldr_layer_read_next (lw6sys_context_t * sys_context, lw6map_layer_t * layer, const char * filename, int target_w, int target_h)

sys_context: global system context

layer: layer to update (out param)

filename: name of PNG file

target_w: width we want

target_h: height we want

Reads a layer, knowing the exact size we want. This is typically to load layer2-7.png once map.png has been loaded.

Return value: 1 on success, 0 on failure.

Function: int lw6ldr_metadata_read (lw6sys_context_t * sys_context, lw6map_metadata_t * metadata, const char * dirname)

sys_context: global system context

metadata: structure containting read data (out param)

dirname: map dirname (absolute path)

Reads the metadata, will first parse metadata.xml, and if not available read README and guess a title from map path. When function returns, all fields in structure are non-NULL.

Return value: 1 on success, 0 on failure.

Function: int lw6ldr_meta_layer_read (lw6sys_context_t * sys_context, lw6map_meta_layer_t * meta_layer, const char * filename, int target_w, int target_h, int analog)

sys_context: global system context

meta_layer: the meta layer to read

filename: the file to open

target_w: the wanted width

target_h: the wanted height

analog: wether to use analog info (0-255) or boolean (0-1)

Reads a meta-layer from the disj, resampling is done according to the given parameters.

Return value: 1 on success, 0 on failure

Function: int lw6ldr_meta_layer_read_if_exists (lw6sys_context_t * sys_context, lw6map_meta_layer_t * meta_layer, const char * dirname, const char * file_only, int target_w, int target_h, int analog)

sys_context: global system context

meta_layer: the meta layer to read

dirname: the map directory

file_only: the meta-layer file name only (without the path)

target_w: the wanted width

target_h: the wanted height

analog: wether to use analog info (0-255) or boolean (0-1)

Reads a meta-layer from the disj, resampling is done according to the given parameters. This function is different from lw6ldr_meta_layer_read for it will 1) concatenate dirname and file_only and 2) return OK (1) if file does not exist.

Return value: 1 on success, 0 on failure

Function: int lw6ldr_process_non_run_options (lw6sys_context_t * sys_context, int argc, const char * [] argv, int * run_game)

sys_context: global system context

argc: the number of command-line args, as passed to main

argv: an array of strings containing command-line args, as passed to main

run_game: a pointer to a boolean which will contain true (1) if the game must be launched, or false (0) if the option is such that game must be skipped. Example: –copyright, –help, ...

Will interpret the command-line arguments, and trap those who are related to xml files, this is usefull when building the game, we want to have an extra binary to do this without being linked to SDL, for instance.

Return value: non-zero if success, 0 if error. The error can be, for instance, the test suite returning "no, tests were not OK".

Function: int lw6ldr_param_read (lw6sys_context_t * sys_context, lw6map_param_t * param, const char * dirname)

sys_context: global system context

param: the parameter struct to fill with values (read/write parameter)

dirname: the directory of the map

Read the parameters associated to a map. Pointer to param must be valid, and values already initialized, either zeroed or filled in with defaults or custom values.

Return value: 1 if success, 0 if failed.

Function: int lw6ldr_param_update (lw6sys_context_t * sys_context, lw6map_param_t * param, lw6sys_assoc_t * values)

sys_context: global system context

param: the parameter struct to fill with values (read/write parameter)

values: an assoc containing strings with the new values

Overrides param with values. Pointer to param must be valid, and values already initialized, either zeroed or filled in with defaults or custom values. Not all parameters need be defined in values. It can even be NULL. The idea is just that if something is defined in values, it will override the existing param.

Return value: 1 if success, 0 if failed.

Function: void lw6ldr_print_example_rules_xml (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: file to output content to

Print to a file a typical map rules.xml file.

Return value: none.

Function: void lw6ldr_print_example_hints_xml (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: file to output content to

Print to a file a typical map hints.xml file.

Return value: none.

Function: void lw6ldr_print_example_style_xml (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: file to output content to

Print to a file a typical map style.xml file.

Return value: none.

Function: void lw6ldr_print_example_teams_xml (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: file to output content to

Print to a file a typical map teams.xml file.

Return value: none.

Function: int lw6ldr_print_examples (lw6sys_context_t * sys_context, char * user_dir)

sys_context: global system context

user_dir: the user directory or at least, a writable one

Writes all example XML files in ’user_dir/example/’, will create the directory if needed.

Return value: 1 if success, 0 if failed.

Function: lw6map_level_t * lw6ldr_read (lw6sys_context_t * sys_context, const char * dirname, lw6sys_assoc_t * default_param, lw6sys_assoc_t * forced_param, int display_w, int display_h, int bench_value, int magic_number, const char * user_dir, lw6sys_progress_t * progress)

sys_context: global system context

dirname: the directory containing the map

default_param: default parameters, as strings

forced_param: forced parameters, as strings

display_w: the width of the display output (resolution)

display_h: the height of the display output (resolution)

bench_value: the bench value (depends on computer capacity)

magic_number: arbitrary constant

user_dir: the user directory

progress: information used to handle the progress bar

Loads a map from dist. The default_param and forced_param can contain values corresponding to rules.xml and style.xml entries. Parameters are read in 4 steps. 1st, a default value is picked by the program. 2nd, any value in default_param replaces previous values. 3rd, any value in rules.xml or style.xml replaces previous values. 4th, any value in forced_param replaces previous values. In practice, the default_param allows the user to set defaults which can still be overwritten by the map, while forced_param is a definitive ’ignore what is is defined in the map’ way of doing things. See also lw6ldr_read_relative.

Return value: 1 if success, 0 if failed.

Function: lw6map_level_t * lw6ldr_read_relative (lw6sys_context_t * sys_context, const char * map_path, const char * relative_path, lw6sys_assoc_t * default_param, lw6sys_assoc_t * forced_param, int display_w, int display_h, int bench_value, int magic_number, const char * user_dir, lw6sys_progress_t * progress)

sys_context: global system context

map_path: a collection of paths where to find maps

relative_path: something which will be appended to a map_path member

default_param: default parameters, as strings

forced_param: forced parameters, as strings

display_w: the width of the display output (resolution)

display_h: the height of the display output (resolution)

bench_value: the bench value (depends on computer capacity)

magic_number: arbitrary constant

user_dir: the user directory

progress: information used to handle the progress bar

Reads a map from disk, using the map-path value, which is a collection of paths defined by the command-line, the environment variables, and the config file. default_param and forced_param work as in the function lw6ldr_read.

Return value: 1 if success, 0 if failure.

Function: void lw6ldr_resampler_init (lw6sys_context_t * sys_context, lw6ldr_resampler_t * resampler, lw6map_param_t * param, const lw6ldr_hints_t * hints, int source_w, int source_h, int display_w, int display_h, float target_ratio, int bench_value, int magic_number, int expected_depth, float gray_level)

sys_context: global system context

resampler: resampler object to init

param: map parameters to use

hints: loading hints

source_w: width of source map

source_h: height of source map

display_w: width of source display

display_h: height of source display

target_ratio: ratio, that is width/height of the target

bench_value: rough estimation of this computer power

magic_number: arbitrary constant, needed to calibrate speed

expected_depth: how thick the map could be (in practice, looks like d in whd)

gray_level: used to estimate capacity, 1.0f is white and means many slots

Initializes a resampler. There is wizardry based on the bench, magic number map size, gray level. This is bot bullet proof, but has been experience driven and is the result of many tries / failures and hopefully successes. Might need tuning as the algorithm evolves. This is the very function that chooses the actual logical map size.

Return value: none.

Function: void lw6ldr_resampler_use_for_gen (lw6sys_context_t * sys_context, int * map_w, int * map_h, int display_w, int display_h, int bench_value, int magic_number)

sys_context: global system context

map_w: target map width (out param)

map_h: target map height (out param)

display_w: screen width (pixels)

display_h: screen height (pixels)

bench_value: rough estimation of this computer power

magic_number: arbitrary constant, needed to calibrate speed

Builds a resampler and does all the calculus so that one gets the correct map width and height for the gen module. The idea is that when generating a pseudo-random map, one can not really know what size to give it, so this function gives a hint, relying on bench and magic values, which are computer/runtime dependant.

Return value: none

Function: void lw6ldr_resampler_force (lw6sys_context_t * sys_context, lw6ldr_resampler_t * resampler, int source_w, int source_h, int target_w, int target_h)

sys_context: global system context

resampler: resampler to set

source_w: source map width

source_h: source map height

target_w: target map width

target_h: target map height

Initializes a resampler with hardcoded values, does not calibrate according to context, simply set it to rescale the size you want.

Return value: none.

Function: void lw6ldr_resampler_source2target (lw6sys_context_t * sys_context, const lw6ldr_resampler_t * resampler, int * target_x, int * target_y, int source_x, int source_y)

sys_context: global system context

target_x: target x coordinate (out param)

target_y: target y coordinate (out param)

source_x: source x coordinate (in param)

source_y: source y coordinate (in param)

Transforms from source coordinate to target coordinates. Does rounding fine-tuning, it’s not a simple integer division.

Return value: none.

Function: void lw6ldr_resampler_target2source (lw6sys_context_t * sys_context, const lw6ldr_resampler_t * resampler, int * source_x, int * source_y, int target_x, int target_y)

sys_context: global system context

source_x: source x coordinate (out param)

source_y: source y coordinate (out param)

target_x: target x coordinate (in param)

target_y: target y coordinate (in param)

Transforms from target coordinate to source coordinates. Yes, target to source. Target is our final logical map, source is what we loaded from disk, here we want to know, given a point in the target, where to fetch its data from source. Does rounding fine-tuning, it’s not a simple integer division.

Return value: none.

Function: int lw6ldr_rules_read (lw6sys_context_t * sys_context, lw6map_rules_t * rules, const char * dirname)

sys_context: global system context

dirname: the directory of the map

Read the rules (rules.xml) of a map. Pointer to rules must be valid, and values already initialized, either zeroed or filled in with defaults or custom values.

Return value: 1 if success, 0 if failed.

Function: int lw6ldr_rules_update (lw6sys_context_t * sys_context, lw6map_rules_t * rules, lw6sys_assoc_t * values)

sys_context: global system context

rules: the rules struct to fill with values (read/write parameter)

values: an assoc containing strings with the new values

Overrides rules with values. Pointer to rules must be valid, and values already initialized, either zeroed or filled in with defaults or custom values. Not all parameters need be defined in values. It can even be NULL. The idea is just that if something is defined in values, it will override the existing rules.

Return value: 1 if success, 0 if failed.

Function: int lw6ldr_style_read (lw6sys_context_t * sys_context, lw6map_style_t * style, const char * dirname)

sys_context: global system context

dirname: the directory of the map

Read the style (style.xml) of a map. Pointer to style must be valid, and values already initialized, either zeroed or filled in with defaults or custom values.

Return value: 1 if success, 0 if failed.

Function: int lw6ldr_style_set (lw6sys_context_t * sys_context, lw6map_style_t * style, const char * key, const char * value)

sys_context: global system context

style: the style to modify

key: the key to modify

value: the value to affect to the key, as a string

Sets one single parameter in a style structure. Value must always be passed as a string, will be converted to the right type automatically when storing it in the structure.

Return value: 1 if success, 0 if failed. Note that while 0 really means there’s a problem, some affectations can fail and return 1, needs to be worked on.

Function: int lw6ldr_style_update (lw6sys_context_t * sys_context, lw6map_style_t * style, lw6sys_assoc_t * values)

sys_context: global system context

style: the style struct to fill with values (read/write parameter)

values: an assoc containing strings with the new values

Overrides style with values. Pointer to style must be valid, and values already initialized, either zeroed or filled in with defaults or custom values. Not all parameters need be defined in values. It can even be NULL. The idea is just that if something is defined in values, it will override the existing style.

Return value: 1 if success, 0 if failed.

Function: int lw6ldr_teams_read (lw6sys_context_t * sys_context, lw6map_teams_t * teams, const char * dirname)

sys_context: global system context

dirname: the directory of the map

Read the teams (teams.xml) of a map. Pointer to teams must be valid, and values already initialized, either zeroed or filled in with defaults or custom values.

Return value: 1 if success, 0 if failed.

Function: int lw6ldr_teams_update (lw6sys_context_t * sys_context, lw6map_teams_t * teams, lw6sys_assoc_t * values)

sys_context: global system context

teams: the teams struct to fill with values (read/write parameter)

values: an assoc containing strings with the new values

Overrides teams with values. Pointer to teams must be valid, and values already initialized, either zeroed or filled in with defaults or custom values. Not all parameters need be defined in values. It can even be NULL. The idea is just that if something is defined in values, it will override the existing teams.

Return value: 1 if success, 0 if failed.

Function: int lw6ldr_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libldr module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6ldr_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the ldr module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6ldr_texture_read (lw6sys_context_t * sys_context, lw6map_texture_t * texture, const char * dirname, const lw6map_param_t * param, const lw6ldr_hints_t * hints, int use_texture, int display_w, int display_h, float * ratio, int * texture_exists, lw6sys_progress_t * progress)

sys_context: global system context

texture: structure to hold read data

dirname: map dirname (absolute path)

param: parameters to use

hints: loading hints to use

use_texture: wether to use texture.png

display_w: display width

display_h: display height

ratio: target width/height factor (out param)

texture_exists: true if texture.png is here (out param)

progress: progress indicator (in/out param)

Read the texture associated to a map. Pointer to texture must be valid, it’s modified in-place. The function will automatically figure out if texture.png exists or if we must use foreground.png/background.png.

Return value: 1 on success, 0 on failure.

Function: void lw6ldr_use_defaults (lw6sys_context_t * sys_context, lw6ldr_use_t * use)

sys_context: global system context

use: struct to initialize

Sets the use structure to its defaults, this structure being used to now wether we should use texture, cursor textures, rules, hints, style, teams and music.

Return value: none.

Function: void lw6ldr_use_clear (lw6sys_context_t * sys_context, lw6ldr_use_t * use)

sys_context: global system context

use: struct to clear

Clears the use structure, set it to the use nothing mode.

Return value: none.

Function: int lw6ldr_use_set (lw6sys_context_t * sys_context, lw6ldr_use_t * use, const char * key, const char * value)

sys_context: global system context

use: struct to modify

key: key to change (as a string)

value: value to set (as a string)

Sets a key to the given value, OK all fields are integer, this is just a convenient function to be called in more general functions which are fed with those string pointers, typically coming from an XML file.

Return value: 1 on success, 0 on failure (key not found).

Function: int lw6ldr_use_update (lw6sys_context_t * sys_context, lw6ldr_use_t * use, lw6sys_assoc_t * values)

sys_context: global system context

use: the use struct to fill with values (read/write parameter)

values: an assoc containing strings with the new values

Overrides use with values. Pointer to use must be valid, and values already initialized, either zeroed or filled in with defaults or custom values. Not all parameters need be defined in values. It can even be NULL. The idea is just that if something is defined in values, it will override the existing use.

Return value: 1 if success, 0 if failed.

Struct: lw6ldr_entry_s

Contains informations about a map, but just the minimum to, for instance, display it in a menu entry.

Member of lw6ldr_entry_s: metadata

Type: lw6map_metadata_t

Definition: lw6map_metadata_t lw6ldr_entry_s::metadata

The map metadata.

Member of lw6ldr_entry_s: absolute_path

Type: char *

Definition: char* lw6ldr_entry_s::absolute_path

The map absolute path, use this to load it.

Member of lw6ldr_entry_s: relative_path

Type: char *

Definition: char* lw6ldr_entry_s::relative_path

The map relative path, store this in config file.

Member of lw6ldr_entry_s: has_subdirs

Type: int

Definition: int lw6ldr_entry_s::has_subdirs

Wether the entry has subdirs (and consequently, isn’t a map)

Member of lw6ldr_entry_s: nb_submaps

Type: int

Definition: int lw6ldr_entry_s::nb_submaps

Number of sub mpas within this map.

Member of lw6ldr_entry_s: forbidden

Type: int

Definition: int lw6ldr_entry_s::forbidden

Wether it is forbidden (eg, not enough exp).

Struct: lw6ldr_hints_s

Content of hints.xml stored into a C struct.

Member of lw6ldr_hints_s: resample

Type: int

Definition: int lw6ldr_hints_s::resample

Wether to resample the map on the fly when loaded.

Member of lw6ldr_hints_s: min_map_width

Type: int

Definition: int lw6ldr_hints_s::min_map_width

Minimum map width.

Member of lw6ldr_hints_s: max_map_width

Type: int

Definition: int lw6ldr_hints_s::max_map_width

Maximum map width.

Member of lw6ldr_hints_s: min_map_height

Type: int

Definition: int lw6ldr_hints_s::min_map_height

Minimum map height.

Member of lw6ldr_hints_s: max_map_height

Type: int

Definition: int lw6ldr_hints_s::max_map_height

Maximum map height.

Member of lw6ldr_hints_s: min_map_surface

Type: int

Definition: int lw6ldr_hints_s::min_map_surface

Minimum map surface.

Member of lw6ldr_hints_s: max_map_surface

Type: int

Definition: int lw6ldr_hints_s::max_map_surface

Maximum map surface.

Member of lw6ldr_hints_s: fighter_scale

Type: float

Definition: float lw6ldr_hints_s::fighter_scale

Use greater or smaller fighters.

Member of lw6ldr_hints_s: downsize_using_fighter_scale

Type: int

Definition: int lw6ldr_hints_s::downsize_using_fighter_scale

Wether to downsize the map, if needed, using fighter scale.

Member of lw6ldr_hints_s: upsize_using_fighter_scale

Type: int

Definition: int lw6ldr_hints_s::upsize_using_fighter_scale

Wether to upsize the map, if needed, using fighter scale.

Member of lw6ldr_hints_s: downsize_using_bench_value

Type: int

Definition: int lw6ldr_hints_s::downsize_using_bench_value

Wether to downsize the map, if needed, using bench value.

Member of lw6ldr_hints_s: upsize_using_bench_value

Type: int

Definition: int lw6ldr_hints_s::upsize_using_bench_value

Wether to upsize the map, if needed, using bench value.

Member of lw6ldr_hints_s: guess_colors

Type: int

Definition: int lw6ldr_hints_s::guess_colors

Wether to guess colors from the map.

Member of lw6ldr_hints_s: background_color_auto

Type: int

Definition: int lw6ldr_hints_s::background_color_auto

Wether to set up background colors automatically.

Member of lw6ldr_hints_s: hud_color_auto

Type: int

Definition: int lw6ldr_hints_s::hud_color_auto

Wether to set up hud colors automatically.

Member of lw6ldr_hints_s: menu_color_auto

Type: int

Definition: int lw6ldr_hints_s::menu_color_auto

Wether to set up menu colors automatically.

Member of lw6ldr_hints_s: view_color_auto

Type: int

Definition: int lw6ldr_hints_s::view_color_auto

Wether to set up view colors automatically.

Member of lw6ldr_hints_s: system_color_auto

Type: int

Definition: int lw6ldr_hints_s::system_color_auto

Wether to set up system colors automatically.

Member of lw6ldr_hints_s: wall_grease

Type: int

Definition: int lw6ldr_hints_s::wall_grease

Wall grease used when rescaling.

Member of lw6ldr_hints_s: guess_moves_per_sec

Type: int

Definition: int lw6ldr_hints_s::guess_moves_per_sec

Guess the moves per sec value automatically.

Member of lw6ldr_hints_s: speed

Type: float

Definition: float lw6ldr_hints_s::speed

Global speed.

Struct: lw6ldr_resampler_s

Almost internal struct use to handler the resampling process. It has informations about the source, the target, and the ratio between them. It basically contains informations about how to scale.

Member of lw6ldr_resampler_s: target_w

Type: int

Definition: int lw6ldr_resampler_s::target_w

Target width.

Member of lw6ldr_resampler_s: target_h

Type: int

Definition: int lw6ldr_resampler_s::target_h

Target height.

Member of lw6ldr_resampler_s: source_w

Type: int

Definition: int lw6ldr_resampler_s::source_w

Source width.

Member of lw6ldr_resampler_s: source_h

Type: int

Definition: int lw6ldr_resampler_s::source_h

Source height.

Member of lw6ldr_resampler_s: scale_x

Type: float

Definition: float lw6ldr_resampler_s::scale_x

Ratio for the X axis (target_w/source_w).

Member of lw6ldr_resampler_s: scale_y

Type: float

Definition: float lw6ldr_resampler_s::scale_y

Ratio for the Y axis (target_h/source_h).

Struct: lw6ldr_use_s

What files to use when loading a map.

Member of lw6ldr_use_s: use_texture

Type: int

Definition: int lw6ldr_use_s::use_texture

Wether to use texture.jpeg.

Member of lw6ldr_use_s: use_cursor_texture

Type: int

Definition: int lw6ldr_use_s::use_cursor_texture

Wether to use cursor-texture.jpeg.

Member of lw6ldr_use_s: use_rules_xml

Type: int

Definition: int lw6ldr_use_s::use_rules_xml

Wether to use rules.xml.

Member of lw6ldr_use_s: use_hints_xml

Type: int

Definition: int lw6ldr_use_s::use_hints_xml

Wether to use hints.xml.

Member of lw6ldr_use_s: use_style_xml

Type: int

Definition: int lw6ldr_use_s::use_style_xml

Wether to use style.xml.

Member of lw6ldr_use_s: use_teams_xml

Type: int

Definition: int lw6ldr_use_s::use_teams_xml

Wether to use teams.xml.

Member of lw6ldr_use_s: use_music_file

Type: int

Definition: int lw6ldr_use_s::use_music_file

Wether to use the map specific music file.


Next: , Previous: , Up: C API   [Contents][Index]

5.31 libmap

5.31.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/map/index.html.

5.31.2 API

Function: void lw6map_body_builtin_custom (lw6sys_context_t * sys_context, lw6map_body_t * body, int w, int h, int d, int noise_percent, const lw6map_rules_t * rules)

sys_context: global system context

body: the body to initialize

w: the width

h: the height

d: the depth

noise_percent: the noise level to fill meta layers with

rules: the map rules

Sets up a default body structure.

Return value: none

Function: void lw6map_body_clear (lw6sys_context_t * sys_context, lw6map_body_t * body)

sys_context: global system context

body: the structure to clear

Clears a body structure.

Return value: none.

Function: void lw6map_body_fix_checksum (lw6sys_context_t * sys_context, lw6map_body_t * body)

sys_context: global system context

body: the structure to update

Updates (calculates) the checksum of a map body structure.

Return value: none.

Function: int lw6map_body_check_and_fix_holes (lw6sys_context_t * sys_context, lw6map_body_t * body, const lw6map_rules_t * rules)

sys_context: global system context

body: the structure to update

rules: the game rules

This (fundamental) function ensures that all playable areas in a map are connected. If isolated zones are found out, then they are marked as walls and not used any more.

Return value: none.

Function: int lw6map_body_coord_from_texture (lw6sys_context_t * sys_context, const lw6map_level_t * level, int * body_x, int * body_y, int texture_x, int texture_y)

sys_context: global system context

level: the level to work on

body_x: the body (logical) x coord

body_y: the body (logical) y coord

texture_x: the texture x coord

texture_y: the texture y coord

Gets body (logical) coords from texture position.

Return value: 1 on success, 0 on failure (out of bounds)

Function: u_int8_t lw6map_body_get_with_texture_coord (lw6sys_context_t * sys_context, const lw6map_level_t * level, int texture_x, int texture_y, int z)

sys_context: global system context

level: the level to work on

texture_x: the texture x coord

texture_y: the texture y coord

z: the z position (depth related)

Tells wether a given map position is free or not, but using texture coords.

Return value: 1 if position is playable, 0 if not (wall)

Function: void lw6map_color_invert (lw6sys_context_t * sys_context, lw6map_color_couple_t * color)

sys_context: global system context

color: the color to invert

Inverts a color couple, that is, replace fg by bg and vice-versa.

Return value: none.

Function: int lw6map_color_is_same (lw6sys_context_t * sys_context, const lw6map_color_couple_t * color1, const lw6map_color_couple_t * color2)

sys_context: global system context

color1: 1st color to compare

color2: 2nd color to compare

Compares two colors.

Return value: 1 if equal, 0 if not.

Function: char * lw6map_team_color_index_to_key (lw6sys_context_t * sys_context, int index)

sys_context: global system context

index: index of the color between 0 & 9

Transforms a team color index into its readable string form, which can be used in config files for instance.

Return value: a string, must *not* be freed.

Function: int lw6map_team_color_key_to_index (lw6sys_context_t * sys_context, const char * key)

sys_context: global system context

key: key of the color, for instance "red"

The index of the color, between 0 & 9

Return value: an integer.

Function: char * lw6map_team_color_index_to_label (lw6sys_context_t * sys_context, int index)

sys_context: global system context

index: index of the color between 0 & 9

Transforms a team color index into its readable string form, which can be used to display information to players.

Return value: a string, must *not* be freed.

Function: void lw6map_coords_fix_xy (const lw6map_rules_t * rules, const lw6sys_whd_t * shape, int * x, int * y)

rules: set of rules to use

shape: shape of the map

x: x coord (in/out param)

y: y coord (in/out param)

Fixes the x and y values so that it’s always inside the map. This function will read the rules and if there’s some polarity enable, will do the right thing, for instance, a fighter too much on the right might reapper on the left side of the map.

Return value: none.

Function: void lw6map_coords_fix_z (const lw6map_rules_t * rules, const lw6sys_whd_t * shape, int * z)

rules: set of rules to use

shape: shape of the map

z: z coord (in/out param)

Fixes the z value so that it’s always inside the map. This function will read the rules and if there’s some polarity enable, will do the right thing, for instance, a fighter too low it might reapper on top.

Return value: none.

Function: void lw6map_cursor_texture_clear (lw6sys_context_t * sys_context, lw6map_cursor_texture_t * cursor_texture)

sys_context: global system context

cursor_texture: the cursor texture to clear

Clears a cursor texture (set it all transparent).

Return value: none

Function: void lw6map_cursor_texture_builtin (lw6sys_context_t * sys_context, lw6map_cursor_texture_t * cursor_texture)

sys_context: global system context

cursor_texture: the cursor texture to clear

Sets a cursor texture to the builtin defauts, that is a circle that is black on the outside and gets white/transparent in the middle.

Return value: none

Function: void lw6map_cursor_texture_layer_set (lw6sys_context_t * sys_context, lw6map_cursor_texture_layer_t * cursor_texture_layer, int x, int y, lw6sys_color_8_t color)

sys_context: global system context

cursor_texture_layer: the cursor texture_layer to change

x: x coord

y: y coord

color: the color

Sets a pixel in the cursor texture_layer.

Return value: none

Function: lw6sys_color_8_t lw6map_cursor_texture_layer_get (lw6sys_context_t * sys_context, const lw6map_cursor_texture_layer_t * cursor_texture_layer, int x, int y)

sys_context: global system context

cursor_texture_layer: the cursor texture_layer to query

x: x coord

y: y coord

Gets a pixel in the cursor texture_layer.

Return value: the color

Function: lw6map_level_t * lw6map_dup (lw6sys_context_t * sys_context, lw6map_level_t * source, lw6sys_progress_t * progress)

sys_context: global system context

source: the map to copy

progress: to show advancement

Performs a deep copy of the map, all elements are newly allocated and source can safely be destroyed after it’s been duplicated.

Return value: a newly allocated map, may be NULL.

Function: int lw6map_exp_get_highest_team_color_allowed (lw6sys_context_t * sys_context, int exp)

sys_context: global system context

exp: the player experience

Gets the highest color available for a given exp.

Return value: a color id

Function: int lw6map_exp_get_highest_weapon_allowed (lw6sys_context_t * sys_context, int exp)

sys_context: global system context

exp: the player experience

Gets the highest weapon available for a given exp.

Return value: a weapon id

Function: int lw6map_exp_is_team_color_allowed (lw6sys_context_t * sys_context, const lw6map_rules_t * rules, int team_color_id)

sys_context: global system context

rules: set of rules to use

team_color_id: color id to test

Tests wether a team color is allowed for a given set of rules.

Return value: 1 if allowed, 0 if not.

Function: int lw6map_exp_is_weapon_allowed (lw6sys_context_t * sys_context, const lw6map_rules_t * rules, int weapon_id)

sys_context: global system context

rules: set of rules to use

weapon_id: weapon id to test

Tests wether a weapon is allowed for a given set of rules.

Return value: 1 if allowed, 0 if not.

Function: int lw6map_exp_get_unlocked_team_color (lw6sys_context_t * sys_context, int exp)

sys_context: global system context

exp: exp to test

Get the unlocked team color for a given exp, if applyable.

Return value: -1 if nothing unlocked, else the team color

Function: int lw6map_exp_get_unlocked_weapon (lw6sys_context_t * sys_context, int exp)

sys_context: global system context

exp: exp to test

Get the unlocked primary weapon for a given exp, if applyable.

Return value: -1 if nothing unlocked, else the weapon id

Function: char * lw6map_to_hexa (lw6sys_context_t * sys_context, const lw6map_level_t * level)

sys_context: global system context

Converts a map to something that is later readable by lw6map_from_hexa to reproduce the exact same map. Just a serializer.

Return value: a newly allocated pointer, NULL if conversion failed.

Function: lw6map_level_t * lw6map_from_hexa (lw6sys_context_t * sys_context, const char * hexa)

sys_context: global system context

hexa: an hexadecimal ASCII string, created by lw6map_to_hexa

Constructs a map from an hexadecimal string generated by lw6map_to_hexa. Just an un-serializer.

Return value: a new map, might be NULL if string isn’t correct.

Function: void lw6map_layer_builtin_custom (lw6sys_context_t * sys_context, lw6map_layer_t * layer, int w, int h)

sys_context: global system context

layer: the layer to init

w: width

h: height

Creates a default layer. This is mostly for testing purposes, the default layer is not empty, it contains a simplified map of the world.

Return value: none

Function: void lw6map_layer_clear (lw6sys_context_t * sys_context, lw6map_layer_t * layer)

sys_context: global system context

layer: the layer to init

Clears a layer struct. This means freeing the pointer if it’s non NULL and setting everything to 0.

Return value: none

Function: lw6map_level_t * lw6map_new (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a new empty map. This object is perfectly unusable as is, since it has a 0x0 size, and many things set to "NULL". Still, it’s used internally and is the canonical way to create the object, it ensures later calls that set up default parameters, for instance, will succeed.

Return value: a newly allocated pointer.

Function: lw6map_level_t * lw6map_builtin_defaults (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a map, set to defaults. This is usefull mostly for testing. This builtin map has walls, paths, it’s playable.

Return value: a newly allocated map.

Function: lw6map_level_t * lw6map_builtin_scale (lw6sys_context_t * sys_context, int percent_factor)

sys_context: global system context

percent_factor: how big the map should be, 100 is defaults 200 is double.

Creates a map, set to defaults. This is usefull mostly for testing. This builtin map has walls, paths, it’s playable, additionnally it’s scalable, that’s to say one can make it bigger if needed, using a percent factor.

Return value: a newly allocated map.

Function: lw6map_level_t * lw6map_builtin_custom (lw6sys_context_t * sys_context, int w, int h, int d, int noise_percent)

sys_context: global system context

w: the width of the map

h: the height of the map

d: the depth (number of layers) of the map

noise_percent: percentage of noise to use for metalayers

Creates a map, set to defaults. This is usefull mostly for testing. This one, unlike lw6map_builtin_defaults will let you give a width, height and a depth.

Return value: a newly allocated map.

Function: void lw6map_free (lw6sys_context_t * sys_context, lw6map_level_t * level)

sys_context: global system context

Frees a map and releases all its internal ressources.

Return value: none.

Function: int lw6map_memory_footprint (lw6sys_context_t * sys_context, const lw6map_level_t * level)

sys_context: global system context

Reports how many bytes the map needs, in memory. Note that this is not contiguous memory, it involves a bunch of pointers, and possibly much more...

Function: char * lw6map_repr (lw6sys_context_t * sys_context, const lw6map_level_t * level)

sys_context: global system context

Returns a string describing the map. This is a very short description, use it for logs, and to debug stuff. By no means it’s a complete exhaustive description. Still, the string returned should be unique.

Return value: a dynamically allocated string.

Function: int lw6map_is_same (lw6sys_context_t * sys_context, const lw6map_level_t * level_a, const lw6map_level_t * level_b)

sys_context: global system context

level_a: the first level to compare

level_b: the other level to compare

Compares two level structs, the idea is to compare the content, not only the pointers and level ids.

Return value: 1 if they’re the same, 0 if not.

Function: const char * lw6map_get_title (lw6sys_context_t * sys_context, const lw6map_level_t * level)

sys_context: global system context

level: level to get informations about

Gives the map name. This is just a simple utility/wrapper function which is meant to be exported to Guile scripts.

Return value: static string, must not be freed, can’t be NULL

Function: int lw6map_get_max_nb_colors (lw6sys_context_t * sys_context, const lw6map_level_t * level)

level: level to get informations about

Gives the max number of colors (AKA teams) that can fit on this map. This is just a simple utility/wrapper function which is meant to be exported to Guile scripts.

Return value: number of colors, taken from rules

Function: int lw6map_get_max_nb_cursors (lw6sys_context_t * sys_context, const lw6map_level_t * level)

sys_context: global system context

level: level to get informations about

Gives the max number of cursors that can fit on this map. This is just a simple utility/wrapper function which is meant to be exported to Guile scripts.

Return value: number of cursors, taken from rules

Function: int lw6map_get_max_nb_nodes (lw6sys_context_t * sys_context, const lw6map_level_t * level)

sys_context: global system context

level: level to get informations about

Gives the max number of nodes that can fit on this map. This is just a simple utility/wrapper function which is meant to be exported to Guile scripts.

Return value: number of nodes, taken from rules

Function: int lw6map_local_info_set_music_dir (lw6sys_context_t * sys_context, lw6map_local_info_t * local_info, const char * music_dir)

sys_context: global system context

local_info: the structure to modify

music_dir: the new music_dir value

Sets the music_dir value, in a ’safe’ manner, freeing any previous value and performing a string duplication.

Return value: 1 on success, 0 on failure.

Function: void lw6map_local_info_clear (lw6sys_context_t * sys_context, lw6map_local_info_t * local_info)

sys_context: global system context

local_info: the structure to clear

Clears the local_info structure, before destroying a level for instance.

Return value: none

Function: void lw6map_metadata_defaults (lw6sys_context_t * sys_context, lw6map_metadata_t * metadata)

sys_context: global system context

metadata: struct to set to defaults

Sets the metadata struct to defaults, this does not set fields to NULL/empty values, but rather fills it with data claiming, for instance, that this is a default map.

Return value: none.

Function: void lw6map_metadata_clear (lw6sys_context_t * sys_context, lw6map_metadata_t * metadata)

sys_context: global system context

metadata: struct to clear

Clears a metadata, will expect it to be in a consistent state, that is either filled with proper values or completely zeroed.

Return value: none.

Function: int lw6map_metadata_is_same (lw6sys_context_t * sys_context, const lw6map_metadata_t * metadata_a, const lw6map_metadata_t * metadata_b)

sys_context: global system context

metadata_a: first item to compare

metadata_b: second item to compare

Tells wether both metadata items contain the same values.

Return value: 1 if same, 0 if different.

Function: void lw6map_meta_layer_set (lw6sys_context_t * sys_context, lw6map_meta_layer_t * meta_layer, int x, int y, u_int8_t value)

sys_context: global system context

meta_layer: the meta_layer structure

x: x coord

y: y coord

value: the value to set at this place

Simple setter for the meta_layer struct.

Return value: none

Function: u_int8_t lw6map_meta_layer_get (lw6sys_context_t * sys_context, const lw6map_meta_layer_t * meta_layer, int x, int y)

sys_context: global system context

meta_layer: the meta_layer structure

x: x coord

y: y coord

Simple getter for the meta_layer struct.

Return value: the value at this place

Function: void lw6map_meta_layer_clear (lw6sys_context_t * sys_context, lw6map_meta_layer_t * meta_layer)

sys_context: global system context

meta_layer: the meta_layer to clear

Clears a meta_layer struct. This means freeing the pointer if it’s non NULL and setting everything to 0.

Return value: none

Function: int lw6map_meta_layer_builtin_custom (lw6sys_context_t * sys_context, lw6map_meta_layer_t * meta_layer, int w, int h, int analog, int noise_percent, int seed)

sys_context: global system context

meta_layer: the object to init

w: width

h: height

analog: wether to use analog mode (0-255) or boolean (0-1)

noise_percent: the quantity of noise to initialise the layer with

seed: a pseudo-random seed to feed the pseudo-random generator

Builds a custom metalyer, suitable for tests or demo, letting the choice of its size and the noise to fill it with. If noise is 100 then metalayer is "full". If noise is 0, then meta layer is empty.

Return value: 1 if OK, 0 on failure.

Function: void lw6map_param_zero (lw6sys_context_t * sys_context, lw6map_param_t * param)

sys_context: global system context

param: struct to initialize

Sets a param struct to zero, simply puts zero everywhere without checking what was here before

Return value: none.

Function: void lw6map_param_defaults (lw6sys_context_t * sys_context, lw6map_param_t * param)

sys_context: global system context

param: the param struct to modify

Sets a param structure to its default value, note that current structured must be zeroed or correctly initialized.

Return value: none

Function: void lw6map_param_clear (lw6sys_context_t * sys_context, lw6map_param_t * param)

sys_context: global system context

param: the param struct to modify

Resets a param structure to nothing. Note that current structured must be zeroed or correctly initialized. The idea is just to free member pointers before calling free.

Return value: none

Function: void lw6map_param_copy (lw6sys_context_t * sys_context, lw6map_param_t * dst, const lw6map_param_t * src)

sys_context: global system context

dst: the destination param struct

src: the source param struct

Copies parameters. Both structures must be zeroed or correctly initialized.

Return value: none

Function: int lw6map_param_set (lw6sys_context_t * sys_context, lw6map_param_t * param, const char * key, const char * value)

sys_context: global system context

param: the param struct to modify

key: the name of the parameter to modify

value: the value of the parameter to modify

Sets an entry in a param struct. All values must be submitted as strings, internally, the function will call atoi to convert to integers if needed, for instance. It will also dispatch automatically between rules, style and teams.

Return value: 1 if parameter successfully set, 0 on error.

Function: char * lw6map_param_get (lw6sys_context_t * sys_context, const lw6map_param_t * param, const char * key)

sys_context: global system context

param: the param struct to query

key: the name of the parameter to get

Gets an entry from a param struct. All values returned as strings, do not use this in performance bottlenecks, this is just to export values to scripts, for instance.

Return value: dynamically allocated string, NULL on error, might return a string containing 0 on bad keys.

Function: int lw6map_param_is_same (lw6sys_context_t * sys_context, const lw6map_param_t * param_a, const lw6map_param_t * param_b)

sys_context: global system context

param_a: one struct to compare

param_b: another struct to compare

Compares the contents of two param structs.

Return value: 1 if they contain the same thing, 0 if not

Function: void lw6map_rules_zero (lw6sys_context_t * sys_context, lw6map_rules_t * rules)

sys_context: global system context

rules: struct to initialize

Sets a rules struct to zero, simply puts zero everywhere without checking what was here before

Return value: none.

Function: void lw6map_rules_defaults (lw6sys_context_t * sys_context, lw6map_rules_t * rules)

sys_context: global system context

rules: struct to set to defaults

Set rules to default values, as these are all integers, you can call this on any rules object.

Return value: none.

Function: void lw6map_rules_copy (lw6sys_context_t * sys_context, lw6map_rules_t * dst, const lw6map_rules_t * src)

sys_context: global system context

dst: destination (out param)

src: source (in param)

Copies the data from source to destination, simple wrapper on memcpy.

Return value: none.

Function: void lw6map_rules_update_checksum (lw6sys_context_t * sys_context, const lw6map_rules_t * rules, u_int32_t * checksum)

sys_context: global system context

rules: rules struct to check

checksum: checksum to update (in/out param)

Updates a checksum with the rules data.

Return value: none.

Function: int32_t lw6map_rules_get_default (lw6sys_context_t * sys_context, const char * key)

sys_context: global system context

key: key to query

Get the default value for a given string key. Of course you could access the member, but this function internally does the conversion between readable string and actual struct offset.

Return value: integer.

Function: int32_t lw6map_rules_get_min (lw6sys_context_t * sys_context, const char * key)

sys_context: global system context

key: key to query

Get the min value for a given string key. Of course you could access the member, but this function internally does the conversion between readable string and actual struct offset.

Return value: integer.

Function: int32_t lw6map_rules_get_max (lw6sys_context_t * sys_context, const char * key)

sys_context: global system context

key: key to query

Get the min value for a given string key. Of course you could access the member, but this function internally does the conversion between readable string and actual struct offset.

Return value: integer.

Function: int32_t lw6map_rules_get_int (lw6sys_context_t * sys_context, const lw6map_rules_t * rules, const char * key)

sys_context: global system context

rules: struct to use

key: key to query

Get the value for a given string key, as an integer. Of course you could access the member, but this function internally does the conversion between readable string and actual struct offset.

Return value: integer.

Function: int lw6map_rules_set_int (lw6sys_context_t * sys_context, lw6map_rules_t * rules, const char * key, int32_t value)

sys_context: global system context

rules: struct to use

key: key to set

value: new integer value for key

Set the value for a given string key, as an integer. Of course you could access the member, but this function internally does the conversion between readable string and actual struct offset.

Return value: 1 on success, 0 on failure (eg key not found)

Function: int lw6map_rules_get_bool (lw6sys_context_t * sys_context, const lw6map_rules_t * rules, const char * key)

sys_context: global system context

rules: struct to use

key: key to query

Get the value for a given string key, as a boolean. Of course you could access the member, but this function internally does the conversion between readable string and actual struct offset.

Return value: boolean.

Function: int lw6map_rules_set_bool (lw6sys_context_t * sys_context, lw6map_rules_t * rules, const char * key, int value)

rules: struct to use

key: key to set

value: new boolean value for key

Set the value for a given string key, as a boolean. Of course you could access the member, but this function internally does the conversion between readable string and actual struct offset.

Return value: 1 on success, 0 on failure (eg key not found)

Function: void lw6map_rules_clear (lw6sys_context_t * sys_context, lw6map_rules_t * rules)

sys_context: global system context

rules: struct to init

Set rules to 0, this is not defaults, this is 0 (probably unusable as a real-world setting).

Return value: none.

Function: int lw6map_rules_is_same (lw6sys_context_t * sys_context, const lw6map_rules_t * rules_a, const lw6map_rules_t * rules_b)

sys_context: global system context

rules_a: first item to compare

rules_b: second item to compare

Compares two rules items. Will tell if they contain the same data.

Return value: 1 if same, 0 if different.

Function: int lw6map_rules_sanity_check (lw6sys_context_t * sys_context, const lw6map_rules_t * rules)

sys_context: global system context

rules: rules to check.

Check wether the rules are within the acceptable range.

Return value: 1 if same, 0 if different.

Function: void lw6map_style_zero (lw6sys_context_t * sys_context, lw6map_style_t * style)

sys_context: global system context

style: struct to initialize

Sets a style struct to zero, simply puts zero everywhere without checking what was here before

Return value: none.

Function: void lw6map_style_defaults (lw6sys_context_t * sys_context, lw6map_style_t * style)

sys_context: global system context

style: struct to modify

Sets a style struct to defaults values, expects the object to be in a consistent style, that’s to say either containing real data or being zeroed.

Return value: none.

Function: void lw6map_style_clear (lw6sys_context_t * sys_context, lw6map_style_t * style)

sys_context: global system context

style: struct to clear

Clears a style struct. This function won’t work on an unitialized structure, structure must be zeroed by some CALLOC or something, else automatic freeing of pointers will fail.

Return value: none.

Function: void lw6map_style_copy (lw6sys_context_t * sys_context, lw6map_style_t * dst, const lw6map_style_t * src)

sys_context: global system context

dst: destination

src: source

Copies style data from source to destination. Like with clear, dst must be either initialized or totally zeroed, else function will fail (core dump)

Return value: none.

Function: int lw6map_style_set (lw6sys_context_t * sys_context, lw6map_style_t * style, const char * key, const char * value)

sys_context: global system context

style: style struct to modify (out param)

key: key to use

value: value to use

Sets a style entry, takes string values and will identify the struct offset and convert the value to whatever C type is needed.

Return value: 1 on success, 0 on failure (key not found)

Function: char * lw6map_style_get (lw6sys_context_t * sys_context, const lw6map_style_t * style, const char * key)

sys_context: global system context

style: style struct to query

key: key to use

Get a style entry, takes a string key and will identify the struct offset. The return value is converted to string, typically the cannonical representation suitable to write in an XML config file.

Return value: dynamically allocated string.

Function: char * lw6map_style_get_default (lw6sys_context_t * sys_context, const char * key)

sys_context: global system context

key: key to query

Get the default value for a style entry. This is quite a cost-expensive function given what it does, indeed it will convert anything to a string, and also perform key lookup to fetch the value.

Return value: dynamically allocated string.

Function: int lw6map_color_set_is_same (lw6sys_context_t * sys_context, const lw6map_color_set_t * color_set_a, const lw6map_color_set_t * color_set_b)

sys_context: global system context

color_set_a: first item to compare

color_set_b: second item to compare

Compares two color sets, telling if they contain the same data.

Return value: 1 if same, 0 if different.

Function: int lw6map_style_is_same (lw6sys_context_t * sys_context, const lw6map_style_t * style_a, const lw6map_style_t * style_b)

sys_context: global system context

style_a: first item to compare

style_b: second item to compare

Compares two style structures, telling if they contain the same data.

Return value: 1 if same, 0 if different.

Function: void lw6map_teams_zero (lw6sys_context_t * sys_context, lw6map_teams_t * teams)

sys_context: global system context

teams: data to initialize

Zeros the teams struct, this is not the same as setting to defaults.

Return value: none.

Function: void lw6map_teams_defaults (lw6sys_context_t * sys_context, lw6map_teams_t * teams)

sys_context: global system context

teams: data to initialize

Set the teams struct to its defaults.

Return value: none.

Function: void lw6map_teams_clear (lw6sys_context_t * sys_context, lw6map_teams_t * teams)

sys_context: global system context

teams: data to initialize

Clears the teams struct, this is not the same as setting to defaults. This one supposes the struct has been properly initialized, at least zeroed before usage, it might contain pointers which should be freed.

Return value: none.

Function: void lw6map_teams_copy (lw6sys_context_t * sys_context, lw6map_teams_t * dst, const lw6map_teams_t * src)

sys_context: global system context

dst: destination

src: source

Copies the contents of the teams struct. It’s a real duplicate, any string is reallocated.

Return value: none.

Function: int lw6map_teams_set (lw6sys_context_t * sys_context, lw6map_teams_t * teams, const char * key, const char * value)

sys_context: global system context

teams: the teams to modify

key: the key to modify

value: the value to affect to the key, as a string

Sets one single parameter in a teams structure. Value must always be passed as a string, will be converted to the right type automatically when storing it in the structure.

Return value: 1 if success, 0 if failed. Note that while 0 really means there’s a problem, some affectations can fail and return 1, needs to be worked on.

Function: char * lw6map_teams_get (lw6sys_context_t * sys_context, const lw6map_teams_t * teams, const char * key)

sys_context: global system context

teams: the teams to modify

key: the key to modify

Gets one single parameter in a teams structure. Value is converted as a string.

Return value: dynamically allocated string, NULL on error.

Function: char * lw6map_teams_get_default (lw6sys_context_t * sys_context, const char * key)

sys_context: global system context

key: the key we want informations about.

Gets the default value for a given teams key.

Return value: dynamically allocated string, NULL on error.

Function: int lw6map_teams_is_same (lw6sys_context_t * sys_context, const lw6map_teams_t * teams_a, const lw6map_teams_t * teams_b)

sys_context: global system context

teams_a: one struct to compare

teams_b: another struct to compare

Compares the contents of two teams structs.

Return value: 1 if they contain the same thing, 0 if not

Function: int lw6map_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libmap module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6map_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the map module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6map_texture_from_body (lw6sys_context_t * sys_context, lw6map_texture_t * texture, const lw6map_body_t * body, const lw6map_color_couple_t * color)

sys_context: global system context

texture: texture to load (out param)

body: body to pick data from

color: colors to use

Will create a default bicolor texture from the body data, this is in case we don’t want to use the texture or there is none. Result is not beautifull but might be very comfortable to play.

Return value: 1 on success, 0 on failure.

Function: void lw6map_texture_clear (lw6sys_context_t * sys_context, lw6map_texture_t * texture)

sys_context: global system context

texture: data to clear

Clears a texture object, expects it to be in a consitent state, either filled with real data of zeroed.

Return value: none.

Function: int lw6map_texture_coord_from_body (lw6sys_context_t * sys_context, const lw6map_level_t * level, int * texture_x, int * texture_y, int body_x, int body_y)

sys_context: global system context

level: map to work on

texture_x: texture x coordinate (out param)

texture_y: texture y coordinate (out param)

body_x: body x coordinate (in param)

body_y: body y coordinate (in param)

Translates from body coordinate space to texture coordinate space.

Return value: 1 on success, 0 if failure.

Function: lw6sys_color_8_t lw6map_texture_get_with_body_coord (lw6sys_context_t * sys_context, const lw6map_level_t * level, int body_x, int body_y)

sys_context: global system context

level: map to use

body_x: x coordinate in body space

body_y: y coordinate in body space

Get the color of a given point in the texture, using the body coordinate space.

Return value: RGBA 8-bit color.

Function: int lw6map_texture_has_alpha (lw6sys_context_t * sys_context, lw6map_texture_t * texture)

sys_context: global system context

texture: texture object to test

Finds out if the texture is fully opaque or not. If it has an alpha layer (typically, PNG file) but this one is filled at 100% everywhere, then it will consider opaque. This is a slow function but the result is cached in the has_alpha member, so as the function is called at map loading, use the cached value instead.

Return value: 1 if has used alpha layer, 0 if opaque.

Function: char * lw6map_weapon_index_to_key (lw6sys_context_t * sys_context, int index)

sys_context: global system context

index: index of the weapon between 0 & 19

Transforms a team weapon index into its readable string form, which can be used in config files for instance.

Return value: a string, must *not* be freed.

Function: int lw6map_weapon_key_to_index (lw6sys_context_t * sys_context, const char * key)

sys_context: global system context

key: key of the weapon, for instance "red"

The index of the weapon, between 0 & 19

Return value: an integer.

Function: char * lw6map_weapon_index_to_label (lw6sys_context_t * sys_context, int index)

sys_context: global system context

index: index of the weapon between 0 & 19

Transforms a team weapon index into its readable string form, which can be used to display information to players.

Return value: a string, must *not* be freed.

Struct: lw6map_body_s

Logical layers for the map. This is the big collection of bytes arrays containing most of the information, anything loaded from images (JPEG, PNG) from disk and having some logical (and not pure eye candy) meaning.

Member of lw6map_body_s: checksum

Type: int

Definition: int lw6map_body_s::checksum

Checksum for this map body, we could recalculate it dynamically but it’s cached here for convenience and speed.

Member of lw6map_body_s: shape

Type: lw6sys_whd_t

Definition: lw6sys_whd_t lw6map_body_s::shape

Shape of the map, all layers need to be compatible with this.

Member of lw6map_body_s: layers

Type: lw6map_layer_t

Definition: lw6map_layer_t lw6map_body_s::layers[LW6MAP_MAX_BODY_DEPTH]

Layers, layer 0 is the top layer, the one stored in map.png, other layers are layerN.png. Not all layers are defined, just depends on body shape.

Member of lw6map_body_s: glue

Type: lw6map_meta_layer_t

Definition: lw6map_meta_layer_t lw6map_body_s::glue

Informations stored in glue.png.

Member of lw6map_body_s: boost

Type: lw6map_meta_layer_t

Definition: lw6map_meta_layer_t lw6map_body_s::boost

Informations stored in boost.png.

Member of lw6map_body_s: danger

Type: lw6map_meta_layer_t

Definition: lw6map_meta_layer_t lw6map_body_s::danger

Informations stored in danger.png.

Member of lw6map_body_s: medicine

Type: lw6map_meta_layer_t

Definition: lw6map_meta_layer_t lw6map_body_s::medicine

Informations stored in medicine.png.

Member of lw6map_body_s: one_way_north

Type: lw6map_meta_layer_t

Definition: lw6map_meta_layer_t lw6map_body_s::one_way_north

Informations stored in one-way-north.png.

Member of lw6map_body_s: one_way_east

Type: lw6map_meta_layer_t

Definition: lw6map_meta_layer_t lw6map_body_s::one_way_east

Informations stored in one-way-east.png.

Member of lw6map_body_s: one_way_south

Type: lw6map_meta_layer_t

Definition: lw6map_meta_layer_t lw6map_body_s::one_way_south

Informations stored in one-way-south.png.

Member of lw6map_body_s: one_way_west

Type: lw6map_meta_layer_t

Definition: lw6map_meta_layer_t lw6map_body_s::one_way_west

Informations stored in one-way-west.png.

Struct: lw6map_bot_info_s

Bot information, contains the relevant generic parameters for a bot.

Member of lw6map_bot_info_s: color

Type: int

Definition: int lw6map_bot_info_s::color

Team/color the bot is associated to.

Member of lw6map_bot_info_s: ai

Type: char *

Definition: char* lw6map_bot_info_s::ai

AI engine used by bot, the name of the backend to load.

Struct: lw6map_color_couple_s

This structure simply binds 2 colors together, one being foreground and the other background. There’s a good reason to bind those together, indeed foreground and background need to be different enough so that text written in fg over bg is readable, and they need to go together well.

Member of lw6map_color_couple_s: fg

Type: lw6sys_color_8_t

Definition: lw6sys_color_8_t lw6map_color_couple_s::fg

Foreground color.

Member of lw6map_color_couple_s: bg

Type: lw6sys_color_8_t

Definition: lw6sys_color_8_t lw6map_color_couple_s::bg

Background color.

Struct: lw6map_color_set_s

Holds the complete color set for the game, including all color couples used for background, hud, menu, view, as well as team colors.

Member of lw6map_color_set_s: color_base

Type: lw6map_color_couple_t

Definition: lw6map_color_couple_t lw6map_color_set_s::color_base

Base color couple.

Member of lw6map_color_set_s: color_alternate

Type: lw6map_color_couple_t

Definition: lw6map_color_couple_t lw6map_color_set_s::color_alternate

Alternate color couple.

Member of lw6map_color_set_s: background_color_root

Type: lw6map_color_couple_t

Definition: lw6map_color_couple_t lw6map_color_set_s::background_color_root

Background color couple for root image.

Member of lw6map_color_set_s: background_color_stuff

Type: lw6map_color_couple_t

Definition: lw6map_color_couple_t lw6map_color_set_s::background_color_stuff

Background color couple for drawn stuff.

Member of lw6map_color_set_s: hud_color_frame

Type: lw6map_color_couple_t

Definition: lw6map_color_couple_t lw6map_color_set_s::hud_color_frame

Hud color couple for frames.

Member of lw6map_color_set_s: hud_color_text

Type: lw6map_color_couple_t

Definition: lw6map_color_couple_t lw6map_color_set_s::hud_color_text

Hud color couple for text.

Member of lw6map_color_set_s: menu_color_default

Type: lw6map_color_couple_t

Definition: lw6map_color_couple_t lw6map_color_set_s::menu_color_default

Menu default color couple.

Member of lw6map_color_set_s: menu_color_selected

Type: lw6map_color_couple_t

Definition: lw6map_color_couple_t lw6map_color_set_s::menu_color_selected

Menu color couple for selected items.

Member of lw6map_color_set_s: menu_color_disabled

Type: lw6map_color_couple_t

Definition: lw6map_color_couple_t lw6map_color_set_s::menu_color_disabled

Menu color couple for disabled items.

Member of lw6map_color_set_s: view_color_cursor

Type: lw6map_color_couple_t

Definition: lw6map_color_couple_t lw6map_color_set_s::view_color_cursor

Map view color couple for cursor.

Member of lw6map_color_set_s: view_color_map

Type: lw6map_color_couple_t

Definition: lw6map_color_couple_t lw6map_color_set_s::view_color_map

Map view color couple for map.

Member of lw6map_color_set_s: system_color

Type: lw6map_color_couple_t

Definition: lw6map_color_couple_t lw6map_color_set_s::system_color

System color couple (log messages).

Member of lw6map_color_set_s: team_color_dead

Type: lw6sys_color_8_t

Definition: lw6sys_color_8_t lw6map_color_set_s::team_color_dead

Color to use for dead fighters.

Member of lw6map_color_set_s: team_colors

Type: lw6sys_color_8_t

Definition: lw6sys_color_8_t lw6map_color_set_s::team_colors[LW6MAP_NB_TEAM_COLORS]

Team colors.

Struct: lw6map_cursor_texture_layer_s

Contains a cursor texture layer, this is basically a fixed (64x64) sized array of colors.

Member of lw6map_cursor_texture_layer_s: data

Type: lw6sys_color_8_t

Definition: lw6sys_color_8_t lw6map_cursor_texture_layer_s::data[LW6MAP_CURSOR_TEXTURE_SIZE][LW6MAP_CURSOR_TEXTURE_SIZE]

Color for each pixel.

Struct: lw6map_cursor_texture_s

A cursor texture. It’s divided between a texture that will be colorized depending on the map and another texture which will be colorized depending on the team playing the cursor.

Member of lw6map_cursor_texture_s: fg_bg_layer

Type: lw6map_cursor_texture_layer_t

Definition: lw6map_cursor_texture_layer_t lw6map_cursor_texture_s::fg_bg_layer

Layer to be colorized using foreground and background colors.

Member of lw6map_cursor_texture_s: color_layer

Type: lw6map_cursor_texture_layer_t

Definition: lw6map_cursor_texture_layer_t lw6map_cursor_texture_s::color_layer

Layer to be colorized using team colors.

Struct: lw6map_layer_s

A layer contains the actual data for a layer.

Member of lw6map_layer_s: shape

Type: lw6sys_whd_t

Definition: lw6sys_whd_t lw6map_layer_s::shape

Shape of the layer. Z should be 1, logically.

Member of lw6map_layer_s: data

Type: u_int8_t *

Definition: u_int8_t* lw6map_layer_s::data

Raw (byte) data.

Struct: lw6map_level_s

This structure contains everything about a level, once it’s loaded from disk. It’s immutable, it cannot be changed once it’s loaded, and does not have any algorithm aware struct, this is just plain raw data, file data transformed into C struct.

Member of lw6map_level_s: id

Type: u_int32_t

Definition: u_int32_t lw6map_level_s::id

The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Member of lw6map_level_s: metadata

Type: lw6map_metadata_t

Definition: lw6map_metadata_t lw6map_level_s::metadata

Metadata (title, copyright, description, ...)

Member of lw6map_level_s: local_info

Type: lw6map_local_info_t

Definition: lw6map_local_info_t lw6map_level_s::local_info

Informations that depend on the host loading the map.

Member of lw6map_level_s: body

Type: lw6map_body_t

Definition: lw6map_body_t lw6map_level_s::body

All layers (bytes array) forming the map.

Member of lw6map_level_s: texture

Type: lw6map_texture_t

Definition: lw6map_texture_t lw6map_level_s::texture

Texture used by the map.

Member of lw6map_level_s: cursor_texture

Type: lw6map_cursor_texture_t

Definition: lw6map_cursor_texture_t lw6map_level_s::cursor_texture

Cursor texture.

Member of lw6map_level_s: param

Type: lw6map_param_t

Definition: lw6map_param_t lw6map_level_s::param

All map parameters.

Struct: lw6map_local_info_s

Local info is for fields which can be exploited locally, but make no sense if transfered to another computer, over the network for instance. This is typically something which will be updated by the ldr module or some other external code, but it’s not directly linked to the content of the map itself.

Member of lw6map_local_info_s: music_dir

Type: char *

Definition: char* lw6map_local_info_s::music_dir

Directory where music files can be loaded.

Struct: lw6map_metadata_s

Content of metadata.xml stored into a C struct.

Member of lw6map_metadata_s: title

Type: char *

Definition: char* lw6map_metadata_s::title

Title of the map.

Member of lw6map_metadata_s: author

Type: char *

Definition: char* lw6map_metadata_s::author

Author of the map.

Member of lw6map_metadata_s: description

Type: char *

Definition: char* lw6map_metadata_s::description

Description of the map.

Member of lw6map_metadata_s: license

Type: char *

Definition: char* lw6map_metadata_s::license

License of the map (short, like GPLv2+ or GPLv3+).

Member of lw6map_metadata_s: vanilla_exp

Type: int

Definition: int lw6map_metadata_s::vanilla_exp

Exp as stored in the XML file of the map.

Struct: lw6map_meta_layer_s

A meta layer is a special layer which contains, for instance, informations such as where there’s a special trick like glue.

Member of lw6map_meta_layer_s: shape

Type: lw6sys_whd_t

Definition: lw6sys_whd_t lw6map_meta_layer_s::shape

Shape of the metalayer.

Member of lw6map_meta_layer_s: data

Type: u_int8_t *

Definition: u_int8_t* lw6map_meta_layer_s::data

Raw (byte) data.

Struct: lw6map_param_s

All parameters in a map, indludes rules, style and teams.

Member of lw6map_param_s: rules

Type: lw6map_rules_t

Definition: lw6map_rules_t lw6map_param_s::rules

Content of rules.xml.

Member of lw6map_param_s: style

Type: lw6map_style_t

Definition: lw6map_style_t lw6map_param_s::style

Content of style.xml.

Member of lw6map_param_s: teams

Type: lw6map_teams_t

Definition: lw6map_teams_t lw6map_param_s::teams

Content of teams.xml.

Struct: lw6map_rules_s

Content of rules.xml stored into a C struct. This structure is used a lot, it needs to be like this for we don’t want to parse (even a hash) each time we want a param so we need it in a real C struct. In this structure, it’s important, fundamental, that floats are never ever used in map rules. In fact, we need maps to be 100,00 (lots of zeroes) predictable, given some identical user actions. Using floats could lead us to very slight differences (floats are never accurate, especially when you run calculus on different hardwares) which could, with time, become very important. Sort of a "butterfly effect". So well, we use int. Int32 to be exact.

Member of lw6map_rules_s: total_time

Type: int32_t

Definition: int32_t lw6map_rules_s::total_time

total_time parameter, stored as an integer.

Member of lw6map_rules_s: respawn_team

Type: int32_t

Definition: int32_t lw6map_rules_s::respawn_team

respawn_team parameter, stored as an integer.

Member of lw6map_rules_s: respawn_position_mode

Type: int32_t

Definition: int32_t lw6map_rules_s::respawn_position_mode

respawn_position_mode parameter, stored as an integer.

Member of lw6map_rules_s: respawn_delay

Type: int32_t

Definition: int32_t lw6map_rules_s::respawn_delay

respawn_delay parameter, stored as an integer.

Member of lw6map_rules_s: moves_per_round

Type: int32_t

Definition: int32_t lw6map_rules_s::moves_per_round

moves_per_round parameter, stored as an integer.

Member of lw6map_rules_s: spreads_per_round

Type: int32_t

Definition: int32_t lw6map_rules_s::spreads_per_round

spreads_per_round parameter, stored as an integer.

Member of lw6map_rules_s: rounds_per_sec

Type: int32_t

Definition: int32_t lw6map_rules_s::rounds_per_sec

rounds_per_sec parameter, stored as an integer.

Member of lw6map_rules_s: fighter_attack

Type: int32_t

Definition: int32_t lw6map_rules_s::fighter_attack

fighter_attack parameter, stored as an integer.

Member of lw6map_rules_s: fighter_defense

Type: int32_t

Definition: int32_t lw6map_rules_s::fighter_defense

fighter_defense parameter, stored as an integer.

Member of lw6map_rules_s: fighter_new_health

Type: int32_t

Definition: int32_t lw6map_rules_s::fighter_new_health

fighter_new_health parameter, stored as an integer.

Member of lw6map_rules_s: fighter_regenerate

Type: int32_t

Definition: int32_t lw6map_rules_s::fighter_regenerate

fighter_regenerate parameter, stored as an integer.

Member of lw6map_rules_s: side_attack_factor

Type: int32_t

Definition: int32_t lw6map_rules_s::side_attack_factor

side_attack_factor parameter, stored as an integer.

Member of lw6map_rules_s: side_defense_factor

Type: int32_t

Definition: int32_t lw6map_rules_s::side_defense_factor

side_defense_factor parameter, stored as an integer.

Member of lw6map_rules_s: nb_move_tries

Type: int32_t

Definition: int32_t lw6map_rules_s::nb_move_tries

nb_move_tries parameter, stored as an integer.

Member of lw6map_rules_s: nb_attack_tries

Type: int32_t

Definition: int32_t lw6map_rules_s::nb_attack_tries

nb_attack_tries parameter, stored as an integer.

Member of lw6map_rules_s: nb_defense_tries

Type: int32_t

Definition: int32_t lw6map_rules_s::nb_defense_tries

nb_defense_tries parameter, stored as an integer.

Member of lw6map_rules_s: vertical_move

Type: int32_t

Definition: int32_t lw6map_rules_s::vertical_move

vertical_move parameter, stored as an integer.

Member of lw6map_rules_s: spread_mode

Type: int32_t

Definition: int32_t lw6map_rules_s::spread_mode

spread_mode parameter, stored as an integer.

Member of lw6map_rules_s: single_army_size

Type: int32_t

Definition: int32_t lw6map_rules_s::single_army_size

single_army_size parameter, stored as an integer.

Member of lw6map_rules_s: total_armies_size

Type: int32_t

Definition: int32_t lw6map_rules_s::total_armies_size

total_armies_size parameter, stored as an integer.

Member of lw6map_rules_s: max_nb_teams

Type: int32_t

Definition: int32_t lw6map_rules_s::max_nb_teams

max_nb_teams parameter, stored as an integer.

Member of lw6map_rules_s: max_nb_cursors

Type: int32_t

Definition: int32_t lw6map_rules_s::max_nb_cursors

max_nb_cursors parameter, stored as an integer.

Member of lw6map_rules_s: max_nb_nodes

Type: int32_t

Definition: int32_t lw6map_rules_s::max_nb_nodes

max_nb_nodes parameter, stored as an integer.

Member of lw6map_rules_s: exp

Type: int32_t

Definition: int32_t lw6map_rules_s::exp

exp parameter, stored as an integer.

Member of lw6map_rules_s: highest_team_color_allowed

Type: int32_t

Definition: int32_t lw6map_rules_s::highest_team_color_allowed

highest_team_color_allowed parameter, stored as an integer.

Member of lw6map_rules_s: highest_weapon_allowed

Type: int32_t

Definition: int32_t lw6map_rules_s::highest_weapon_allowed

highest_weapon_allowed parameter, stored as an integer.

Member of lw6map_rules_s: x_polarity

Type: int32_t

Definition: int32_t lw6map_rules_s::x_polarity

x_polarity parameter, stored as an integer.

Member of lw6map_rules_s: y_polarity

Type: int32_t

Definition: int32_t lw6map_rules_s::y_polarity

y_polarity parameter, stored as an integer.

Member of lw6map_rules_s: z_polarity

Type: int32_t

Definition: int32_t lw6map_rules_s::z_polarity

z_polarity parameter, stored as an integer.

Member of lw6map_rules_s: max_zone_size

Type: int32_t

Definition: int32_t lw6map_rules_s::max_zone_size

max_zone_size parameter, stored as an integer.

Member of lw6map_rules_s: round_delta

Type: int32_t

Definition: int32_t lw6map_rules_s::round_delta

round_delta parameter, stored as an integer.

Member of lw6map_rules_s: max_round_delta

Type: int32_t

Definition: int32_t lw6map_rules_s::max_round_delta

max_round_delta parameter, stored as an integer.

Member of lw6map_rules_s: max_cursor_pot

Type: int32_t

Definition: int32_t lw6map_rules_s::max_cursor_pot

max_cursor_pot parameter, stored as an integer.

Member of lw6map_rules_s: cursor_pot_init

Type: int32_t

Definition: int32_t lw6map_rules_s::cursor_pot_init

cursor_pot_init parameter, stored as an integer.

Member of lw6map_rules_s: max_cursor_pot_offset

Type: int32_t

Definition: int32_t lw6map_rules_s::max_cursor_pot_offset

max_cursor_pot_offset parameter, stored as an integer.

Member of lw6map_rules_s: start_x

Type: int32_t

Definition: int32_t lw6map_rules_s::start_x[LW6MAP_MAX_NB_TEAMS]

start_x parameters, stored as a per team integer.

Member of lw6map_rules_s: start_y

Type: int32_t

Definition: int32_t lw6map_rules_s::start_y[LW6MAP_MAX_NB_TEAMS]

start_y parameters, stored as a per team integer.

Member of lw6map_rules_s: start_position_mode

Type: int32_t

Definition: int32_t lw6map_rules_s::start_position_mode

start_position_mode parameter, stored as an integer.

Member of lw6map_rules_s: color_conflict_mode

Type: int32_t

Definition: int32_t lw6map_rules_s::color_conflict_mode

color_conflict_mode parameter, stored as an integer.

Member of lw6map_rules_s: spread_thread

Type: int32_t

Definition: int32_t lw6map_rules_s::spread_thread

spread_thread parameter, stored as an integer.

Member of lw6map_rules_s: glue_power

Type: int32_t

Definition: int32_t lw6map_rules_s::glue_power

glue_power parameter, stored as an integer.

Member of lw6map_rules_s: boost_power

Type: int32_t

Definition: int32_t lw6map_rules_s::boost_power

boost_power parameter, stored as an integer.

Member of lw6map_rules_s: danger_power

Type: int32_t

Definition: int32_t lw6map_rules_s::danger_power

danger_power parameter, stored as an integer.

Member of lw6map_rules_s: medicine_power

Type: int32_t

Definition: int32_t lw6map_rules_s::medicine_power

medicine_power parameter, stored as an integer.

Member of lw6map_rules_s: frags_mode

Type: int32_t

Definition: int32_t lw6map_rules_s::frags_mode

frags_mode parameter, stored as an integer.

Member of lw6map_rules_s: frags_to_distribute

Type: int32_t

Definition: int32_t lw6map_rules_s::frags_to_distribute

frags_to_distribute parameter, stored as an integer.

Member of lw6map_rules_s: frags_fade_out

Type: int32_t

Definition: int32_t lw6map_rules_s::frags_fade_out

frags_fade_out parameter, stored as an integer.

Member of lw6map_rules_s: use_team_profiles

Type: int32_t

Definition: int32_t lw6map_rules_s::use_team_profiles

use_team_profiles parameter, stored as an integer.

Member of lw6map_rules_s: team_profile_aggressive

Type: int32_t

Definition: int32_t lw6map_rules_s::team_profile_aggressive[LW6MAP_MAX_NB_TEAMS]

team_profile_aggressive parameters, stored as a per team integer.

Member of lw6map_rules_s: team_profile_vulnerable

Type: int32_t

Definition: int32_t lw6map_rules_s::team_profile_vulnerable[LW6MAP_MAX_NB_TEAMS]

team_profile_vulnerable parameters, stored as a per team integer.

Member of lw6map_rules_s: team_profile_mobile

Type: int32_t

Definition: int32_t lw6map_rules_s::team_profile_mobile[LW6MAP_MAX_NB_TEAMS]

team_profile_mobile parameters, stored as a per team integer.

Member of lw6map_rules_s: team_profile_fast

Type: int32_t

Definition: int32_t lw6map_rules_s::team_profile_fast[LW6MAP_MAX_NB_TEAMS]

team_profile_fast parameters, stored as a per team integer.

Member of lw6map_rules_s: team_profile_handicap

Type: int32_t

Definition: int32_t lw6map_rules_s::team_profile_handicap[LW6MAP_MAX_NB_TEAMS]

team_profile_handicap parameters, stored as a per team integer.

Member of lw6map_rules_s: team_profile_weapon_id

Type: int32_t

Definition: int32_t lw6map_rules_s::team_profile_weapon_id[LW6MAP_MAX_NB_TEAMS]

team_profile_weapon_id parameters, stored as a per team integer.

Member of lw6map_rules_s: team_profile_weapon_alternate_id

Type: int32_t

Definition: int32_t lw6map_rules_s::team_profile_weapon_alternate_id[LW6MAP_MAX_NB_TEAMS]

team_profile_weapon_alternate_id parameters, stored as a per team integer.

Member of lw6map_rules_s: team_profile_weapon_mode

Type: int32_t

Definition: int32_t lw6map_rules_s::team_profile_weapon_mode[LW6MAP_MAX_NB_TEAMS]

team_profile_weapon_mode parameters, stored as a per team integer.

Member of lw6map_rules_s: weapon_duration

Type: int32_t

Definition: int32_t lw6map_rules_s::weapon_duration

weapon_duration parameter, stored as an integer.

Member of lw6map_rules_s: weapon_charge_delay

Type: int32_t

Definition: int32_t lw6map_rules_s::weapon_charge_delay

weapon_charge_delay parameter, stored as an integer.

Member of lw6map_rules_s: weapon_charge_max

Type: int32_t

Definition: int32_t lw6map_rules_s::weapon_charge_max

weapon_charge_max parameter, stored as an integer.

Member of lw6map_rules_s: weapon_tune_berzerk_power

Type: int32_t

Definition: int32_t lw6map_rules_s::weapon_tune_berzerk_power

weapon_tune_berzerk_power parameter, stored as an integer.

Member of lw6map_rules_s: weapon_tune_turbo_power

Type: int32_t

Definition: int32_t lw6map_rules_s::weapon_tune_turbo_power

weapon_tune_turbo_power parameter, stored as an integer.

Struct: lw6map_style_s

Content of style.xml stored into a C struct.

Member of lw6map_style_s: keep_ratio

Type: int

Definition: int lw6map_style_s::keep_ratio

Boolean, wether to keep the map ratio or not.

Member of lw6map_style_s: zoom

Type: float

Definition: float lw6map_style_s::zoom

Default zoom.

Member of lw6map_style_s: zoom_min

Type: float

Definition: float lw6map_style_s::zoom_min

Min zoom.

Member of lw6map_style_s: zoom_max

Type: float

Definition: float lw6map_style_s::zoom_max

Max zoom.

Member of lw6map_style_s: x_wrap

Type: int

Definition: int lw6map_style_s::x_wrap

Wether to wrap on X axis.

Member of lw6map_style_s: y_wrap

Type: int

Definition: int lw6map_style_s::y_wrap

Wether to wrap on Y axis.

Member of lw6map_style_s: background_style

Type: char *

Definition: char* lw6map_style_s::background_style

Background style to use (for instance, bubbles).

Member of lw6map_style_s: hud_style

Type: char *

Definition: char* lw6map_style_s::hud_style

Hud style to use (for instance, floating).

Member of lw6map_style_s: menu_style

Type: char *

Definition: char* lw6map_style_s::menu_style

Menu style to use (for instance, cylinder).

Member of lw6map_style_s: view_style

Type: char *

Definition: char* lw6map_style_s::view_style

View style to use (for instance, flat).

Member of lw6map_style_s: animation_density

Type: float

Definition: float lw6map_style_s::animation_density

How dense animations should be (many or few sprites).

Member of lw6map_style_s: animation_speed

Type: float

Definition: float lw6map_style_s::animation_speed

How fast animations should be (sprites speed).

Member of lw6map_style_s: cursor_size

Type: float

Definition: float lw6map_style_s::cursor_size

Cursor size.

Member of lw6map_style_s: colorize_cursor

Type: int

Definition: int lw6map_style_s::colorize_cursor

Wether to colorize cursors or not.

Member of lw6map_style_s: blink_cursor

Type: int

Definition: int lw6map_style_s::blink_cursor

Wether to make cursors blink or not.

Member of lw6map_style_s: hidden_layer_alpha

Type: float

Definition: float lw6map_style_s::hidden_layer_alpha

Alpha value used to represent fighters hidden behind a layer.

Member of lw6map_style_s: colorize

Type: int

Definition: int lw6map_style_s::colorize

Wether to use colorization or not.

Member of lw6map_style_s: pixelize

Type: int

Definition: int lw6map_style_s::pixelize

Wether to pixelize the map and fighters or not.

Member of lw6map_style_s: color_set

Type: lw6map_color_set_t

Definition: lw6map_color_set_t lw6map_style_s::color_set

All colors used by the game.

Member of lw6map_style_s: music_file

Type: char *

Definition: char* lw6map_style_s::music_file

Music file to play.

Member of lw6map_style_s: music_filter

Type: char *

Definition: char* lw6map_style_s::music_filter

Music files to keep.

Member of lw6map_style_s: music_exclude

Type: char *

Definition: char* lw6map_style_s::music_exclude

Music files to exclude.

Member of lw6map_style_s: waves

Type: int

Definition: int lw6map_style_s::waves

Wether to turn on the wave effect or not.

Struct: lw6map_teams_s

Content of teams.xml stored into a C struct.

Member of lw6map_teams_s: player_color

Type: int

Definition: int lw6map_teams_s::player_color[LW6MAP_TEAMS_NB_PLAYERS]

Players colors.

Member of lw6map_teams_s: nb_bots

Type: int

Definition: int lw6map_teams_s::nb_bots

Number of bots.

Member of lw6map_teams_s: bot_speed

Type: float

Definition: float lw6map_teams_s::bot_speed

Bots speed.

Member of lw6map_teams_s: bot_iq

Type: int

Definition: int lw6map_teams_s::bot_iq

Bots IQ (how strong they are)

Member of lw6map_teams_s: bot

Type: lw6map_bot_info_t

Definition: lw6map_bot_info_t lw6map_teams_s::bot[LW6MAP_TEAMS_MAX_NB_BOTS]

Per-bot parameters, including their color and the ai engine they use.

Struct: lw6map_texture_s

Texture information, this is a bit different from a layer, since this is RGBA data, plus some meta-informations such as guessed colors.

Member of lw6map_texture_s: w

Type: int

Definition: int lw6map_texture_s::w

Texture width.

Member of lw6map_texture_s: h

Type: int

Definition: int lw6map_texture_s::h

Texture height.

Member of lw6map_texture_s: has_alpha

Type: int

Definition: int lw6map_texture_s::has_alpha

True if texture has an alpha channel. If it has an alpha channel on disk (for instance, it’s a PNG) and if in practice it has nothing else than full opaque 255 alpha values, then this will be set to 0 anyway, the idea is to detect textures that really need the engine to handle transparency.

Member of lw6map_texture_s: data

Type: lw6sys_color_8_t *

Definition: lw6sys_color_8_t* lw6map_texture_s::data

Color for each pixel.

Member of lw6map_texture_s: guessed_color_base

Type: lw6map_color_couple_t

Definition: lw6map_color_couple_t lw6map_texture_s::guessed_color_base

Base guessed color couple. This is typically the best or more representative color couple (fg and bg) the program was able to automatically extract from the map.

Member of lw6map_texture_s: guessed_color_alternate

Type: lw6map_color_couple_t

Definition: lw6map_color_couple_t lw6map_texture_s::guessed_color_alternate

An alternate color couple which still comes from the map but is a bit different from the base one.


Next: , Previous: , Up: C API   [Contents][Index]

5.32 libmat

5.32.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/mat/index.html.

5.32.2 API

Function: void lw6mat_dmat2_zero (lw6mat_dmat2_t * dmat2)

dmat2: the matrix to initialize.

Fills the matrix with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: void lw6mat_dmat2_identity (lw6mat_dmat2_t * dmat2)

dmat2: the matrix to initialize.

Loads the matrix with the identity matrix, that is, zero everywhere but one on the main diag.

Return value: none.

Function: void lw6mat_dmat2_translation (lw6mat_dmat2_t * dmat2, double d)

dmat2: the matrix to initialize.

d: value which defines the translation.

Loads the matrix with a translation transformation matrix. By multiplicating by this matrix, a translation is done.

Return value: none.

Function: void lw6mat_dmat2_scale (lw6mat_dmat2_t * dmat2, double d)

dmat2: the matrix to initialize.

d: value used to scale matrix.

Loads the matrix with a scale matrix. By multiplicating by this matrix, a scaling is done.

Return value: none.

Function: int lw6mat_dmat2_is_same (const lw6mat_dmat2_t * dmat2_a, const lw6mat_dmat2_t * dmat2_b)

dmat2_a: 1st matrix to compare

dmat2_b: 2nd matrix to compare

Compares two matrix, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: void lw6mat_dmat2_transpose (lw6mat_dmat2_t * dmat2)

dmat2: the matrix to transpose

Transposes the matrix, that is, inverts rows and columns.

Return value: none.

Function: double lw6mat_dmat2_det (const lw6mat_dmat2_t * dmat2)

dmat2: the matrix used to calculate the determinant

Calulates the determinant of the matrix.

Return value: the determinant.

Function: void lw6mat_dmat2_mul_scale (lw6mat_dmat2_t * dmat2, double f)

dmat2: matrix to modify

f: scale factor

Scales the matrix by multiplying all its members by a scalar value.

Return value: none

Function: int lw6mat_dmat2_inv (lw6sys_context_t * sys_context, lw6mat_dmat2_t * dmat2_dst, const lw6mat_dmat2_t * dmat2_src)

sys_context: global system context

dmat2_dst: the matrix inverted

dmat2_src: the matrix to invert

Inverts a matrix. Probably not the fastest implementation, but should work in all cases. Use hardware accelerated API such as OpenGL on dedicated hardware if you want power.

Return value: 1 if inverted, 0 if error, typically if determinant was 0, matrix can not be inverted.

Function: void lw6mat_dmat2_mul_dmat2 (lw6mat_dmat2_t * dmat2, const lw6mat_dmat2_t * dmat2_a, const lw6mat_dmat2_t * dmat2_b)

dmat2: the result matrix

dmat2_a: the 1st matrix to multiply, on the left

dmat2_b: the 2nd matrix to multiply, on the right

Classic matrix multiplication.

Return value: none.

Function: void lw6mat_dmat2_mul_dvec2 (lw6mat_dvec2_t * dvec2_dst, const lw6mat_dmat2_t * dmat2, const lw6mat_dvec2_t * dvec2_src)

dvec2_dst: the result vector

dvec2_src: the source vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish.

Return value: none.

Function: char * lw6mat_dmat2_repr (lw6sys_context_t * sys_context, const lw6mat_dmat2_t * dmat2)

sys_context: global system context

Gives a readable version of the matrix, the representation uses newlines, with a different line for each row

Return value: newly allocated string

Function: void lw6mat_dmat3_zero (lw6mat_dmat3_t * dmat3)

dmat3: the matrix to initialize.

Fills the matrix with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: void lw6mat_dmat3_identity (lw6mat_dmat3_t * dmat3)

dmat3: the matrix to initialize.

Loads the matrix with the identity matrix, that is, zero everywhere but one on the main diag.

Return value: none.

Function: void lw6mat_dmat3_translation (lw6mat_dmat3_t * dmat3, const lw6mat_dvec2_t * dvec2)

dmat3: the matrix to initialize.

dvec2: vector which defines the translation.

Loads the matrix with a translation transformation matrix. By multiplicating by this matrix, a translation is done.

Return value: none.

Function: void lw6mat_dmat3_scale (lw6mat_dmat3_t * dmat3, const lw6mat_dvec2_t * dvec2)

dmat3: the matrix to initialize.

dvec2: value used to scale matrix.

Loads the matrix with a scale matrix. By multiplicating by this matrix, a scaling is done.

Return value: none.

Function: void lw6mat_dmat3_rot (lw6mat_dmat3_t * dmat3, double r)

dmat3: the matrix to initialize.

r: value used to for the rotation, angle in radians.

Loads the matrix with a rotation matrix. By multiplicating by this matrix, a rotation is done, over a virtual Z axis such as Z is the cross product of X and Y.

Return value: none.

Function: int lw6mat_dmat3_is_same (const lw6mat_dmat3_t * dmat3_a, const lw6mat_dmat3_t * dmat3_b)

dmat3_a: 1st matrix to compare

dmat3_b: 2nd matrix to compare

Compares two matrix, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: void lw6mat_dmat3_transpose (lw6mat_dmat3_t * dmat3)

dmat3: the matrix to transpose

Transposes the matrix, that is, inverts rows and columns.

Return value: none.

Function: double lw6mat_dmat3_det (const lw6mat_dmat3_t * dmat3)

dmat3: the matrix used to calculate the determinant

Calulates the determinant of the matrix.

Return value: the determinant.

Function: void lw6mat_dmat3_mul_scale (lw6mat_dmat3_t * dmat3, double f)

dmat3: matrix to modify

f: scale factor

Scales the matrix by multiplying all its members by a scalar value.

Return value: none

Function: int lw6mat_dmat3_inv (lw6sys_context_t * sys_context, lw6mat_dmat3_t * dmat3_dst, const lw6mat_dmat3_t * dmat3_src)

sys_context: global system context

dmat3_dst: the matrix inverted

dmat3_src: the matrix to invert

Inverts a matrix. Probably not the fastest implementation, but should work in all cases. Use hardware accelerated API such as OpenGL on dedicated hardware if you want power.

Return value: 1 if inverted, 0 if error, typically if determinant was 0, matrix can not be inverted.

Function: void lw6mat_dmat3_mul_dmat3 (lw6mat_dmat3_t * dmat3, const lw6mat_dmat3_t * dmat3_a, const lw6mat_dmat3_t * dmat3_b)

dmat3: the result matrix

dmat3_a: the 1st matrix to multiply, on the left

dmat3_b: the 2nd matrix to multiply, on the right

Classic matrix multiplication.

Return value: none.

Function: void lw6mat_dmat3_mul_dvec3 (lw6mat_dvec3_t * dvec3_dst, const lw6mat_dmat3_t * dmat3, const lw6mat_dvec3_t * dvec3_src)

dvec3_dst: the result vector

dvec3_src: the source vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish.

Return value: none.

Function: void lw6mat_dmat3_mul_dvec2 (lw6mat_dvec2_t * dvec2_dst, const lw6mat_dmat3_t * dmat3, const lw6mat_dvec2_t * dvec2_src)

dvec2_dst: the result vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish. The vector, here, is smaller than the matrix, the last element is supposed to be 1, this is how one implements translation through multiplication.

Return value: none.

Function: char * lw6mat_dmat3_repr (lw6sys_context_t * sys_context, const lw6mat_dmat3_t * dmat3)

sys_context: global system context

Gives a readable version of the matrix, the representation uses newlines, with a different line for each row

Return value: newly allocated string

Function: void lw6mat_dmat4_zero (lw6mat_dmat4_t * dmat4)

dmat4: the matrix to initialize.

Fills the matrix with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: void lw6mat_dmat4_identity (lw6mat_dmat4_t * dmat4)

dmat4: the matrix to initialize.

Loads the matrix with the identity matrix, that is, zero everywhere but one on the main diag.

Return value: none.

Function: void lw6mat_dmat4_translation (lw6mat_dmat4_t * dmat4, const lw6mat_dvec3_t * dvec3)

dmat4: the matrix to initialize.

dvec3: vector which defines the translation.

Loads the matrix with a translation transformation matrix. By multiplicating by this matrix, a translation is done.

Return value: none.

Function: void lw6mat_dmat4_scale (lw6mat_dmat4_t * dmat4, const lw6mat_dvec3_t * dvec3)

dmat4: the matrix to initialize.

dvec3: value used to scale matrix.

Loads the matrix with a scale matrix. By multiplicating by this matrix, a scaling is done.

Return value: none.

Function: void lw6mat_dmat4_rot_x (lw6mat_dmat4_t * dmat4, double r)

dmat4: the matrix to initialize.

r: value used to for the rotation, angle in radians.

Loads the matrix with a rotation matrix. By multiplicating by this matrix, a rotation is done, over the X axis.

Return value: none.

Function: void lw6mat_dmat4_rot_y (lw6mat_dmat4_t * dmat4, double r)

dmat4: the matrix to initialize.

r: value used to for the rotation, angle in radians.

Loads the matrix with a rotation matrix. By multiplicating by this matrix, a rotation is done, over the Y axis.

Return value: none.

Function: void lw6mat_dmat4_rot_z (lw6mat_dmat4_t * dmat4, double r)

dmat4: the matrix to initialize.

r: value used to for the rotation, angle in radians.

Loads the matrix with a rotation matrix. By multiplicating by this matrix, a rotation is done, over the Z axis.

Return value: none.

Function: void lw6mat_dmat4_ortho (lw6mat_dmat4_t * dmat4, double left, double right, double bottom, double top, double nearval, double farval)

dmat4: the matrix to initialize.

left: left plane coordinate

right: right plane coordinate

bottom: bottom plane coordinate

top: top plane coordinate

nearval: near plane coordinate

farval: far plane coordinate

Loads the matrix with an orthogonal projection matrix. Does it the way glOrtho would, see https://www.opengl.org/sdk/docs/man2/xhtml/glOrtho.xml for details.

Note: use -nearVal and -farVal to initialize. It’s a little akward, if you expect to pass vectors with positions ranging from nearVal to farVal then you need to pass -nearVal and -farVal to this function. This is probably due to the fact that with a right-handed basis and X,Y set up "as usual", then Z is negative when going farther and farther. This tweak allows farVal to yield +1 and nearVal -1. We keep this function as is here, as this is the way OpenGL functions seem to work.

Return value: none.

Function: void lw6mat_dmat4_perspective (lw6mat_dmat4_t * dmat4, double fovy, double aspect, double znear, double zfar)

dmat4: the matrix to initialize.

fovy: vertical field of view (degrees, not radians)

aspect: x/y ratio

znear: near plane coordinate (use -znear to initialize)

zfar: far plane coordinate (use -zfar to initialize)

Loads the matrix with a projection matrix. Does it the way gluPerspective would, see https://www.opengl.org/sdk/docs/man2/xhtml/gluPerspective.xml for details.

Return value: none.

Function: int lw6mat_dmat4_is_same (const lw6mat_dmat4_t * dmat4_a, const lw6mat_dmat4_t * dmat4_b)

dmat4_a: 1st matrix to compare

dmat4_b: 2nd matrix to compare

Compares two matrix, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: void lw6mat_dmat4_transpose (lw6mat_dmat4_t * dmat4)

dmat4: the matrix to transpose

Transposes the matrix, that is, inverts rows and columns.

Return value: none.

Function: double lw6mat_dmat4_det (const lw6mat_dmat4_t * dmat4)

dmat4: the matrix used to calculate the determinant

Calulates the determinant of the matrix.

Return value: the determinant.

Function: void lw6mat_dmat4_mul_scale (lw6mat_dmat4_t * dmat4, double f)

dmat4: matrix to modify

f: scale factor

Scales the matrix by multiplying all its members by a scalar value.

Return value: none

Function: int lw6mat_dmat4_inv (lw6sys_context_t * sys_context, lw6mat_dmat4_t * dmat4_dst, const lw6mat_dmat4_t * dmat4_src)

sys_context: global system context

dmat4_dst: the matrix inverted

dmat4_src: the matrix to invert

Inverts a matrix. Probably not the fastest implementation, but should work in all cases. Use hardware accelerated API such as OpenGL on dedicated hardware if you want power.

Return value: 1 if inverted, 0 if error, typically if determinant was 0, matrix can not be inverted.

Function: void lw6mat_dmat4_mul_dmat4 (lw6mat_dmat4_t * dmat4, const lw6mat_dmat4_t * dmat4_a, const lw6mat_dmat4_t * dmat4_b)

dmat4: the result matrix

dmat4_a: the 1st matrix to multiply, on the left

dmat4_b: the 2nd matrix to multiply, on the right

Classic matrix multiplication.

Return value: none.

Function: void lw6mat_dmat4_mul_dvec4 (lw6mat_dvec4_t * dvec4_dst, const lw6mat_dmat4_t * dmat4, const lw6mat_dvec4_t * dvec4_src)

dvec4_dst: the result vector

dmat4: the matrix to use

dvec4_src: the source vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish.

Return value: none.

Function: void lw6mat_dmat4_mul_dvec3 (lw6mat_dvec3_t * dvec3_dst, const lw6mat_dmat4_t * dmat4, const lw6mat_dvec3_t * dvec3_src)

dvec3_dst: the result vector

dmat4: the matrix to use

dvec3_src: the source vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish. The vector, here, is smaller than the matrix, the last element is supposed to be 1, this is how one implements translation through multiplication.

Return value: none.

Function: char * lw6mat_dmat4_repr (lw6sys_context_t * sys_context, const lw6mat_dmat4_t * dmat4)

sys_context: global system context

Gives a readable version of the matrix, the representation uses newlines, with a different line for each row

Return value: newly allocated string

Function: void lw6mat_dvec2_zero (lw6mat_dvec2_t * dvec2)

dvec2: the vector to initialize.

Fills the vector with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: int lw6mat_dvec2_is_same (const lw6mat_dvec2_t * dvec2_a, const lw6mat_dvec2_t * dvec2_b)

dvec2_a: 1st vector to compare

dvec2_b: 2nd vector to compare

Compares two vectors, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: double lw6mat_dvec2_len_sq (const lw6mat_dvec2_t * dvec2)

dvec2: the vector to query.

Returns the square of a vector length. To get the real length one should then apply a square root but at this stage one has at least an idea about vector length, and this information is enough to compare them.

Return value: sigma(coord*coord)

Function: double lw6mat_dvec2_len (const lw6mat_dvec2_t * dvec2)

dvec2: the vector to query.

Returns the size/length of a vector, this is the distance of the point from origin, not the number of elements.

Return value: the length of the vector.

Function: int lw6mat_dvec2_normalize (lw6sys_context_t * sys_context, lw6mat_dvec2_t * dvec2)

sys_context: global system context

dvec2: the vector to normalize.

Normalizes a vector, that is, make its length be 1.

Return value: 1 if OK, 0 if error, such as trying to normalize vector zero.

Function: int lw6mat_dvec2_homogeneous (lw6sys_context_t * sys_context, lw6mat_dvec2_t * dvec2)

sys_context: global system context

dvec2: the vector to homogeneous.

Transforms a vector into homegeneous coords, that is, scales it so that its last member is 1.

Return value: 1 if OK, 0 if error, such as trying to operate on vector zero.

Function: void lw6mat_dvec2_neg (lw6mat_dvec2_t * dvec2)

dvec2: vector to modify

Calcs the opposite vector, by making a negation on all its members

Return value: none

Function: void lw6mat_dvec2_add (lw6mat_dvec2_t * dvec2, const lw6mat_dvec2_t * dvec2_a, const lw6mat_dvec2_t * dvec2_b)

dvec2: result vector

dvec2_a: 1st vector to add

dvec2_b: 2nd vector to add

Adds two vectors.

Return value: none

Function: void lw6mat_dvec2_sub (lw6mat_dvec2_t * dvec2, const lw6mat_dvec2_t * dvec2_a, const lw6mat_dvec2_t * dvec2_b)

dvec2: result vector

dvec2_a: 1st vector

dvec2_b: 2nd vector, will be substracted to 1st vector

Substracts vector b from vector a.

Return value: none

Function: double lw6mat_dvec2_dot (const lw6mat_dvec2_t * dvec2_a, const lw6mat_dvec2_t * dvec2_b)

dvec2_a: 1st vector

dvec2_b: 2nd vector

Calculates the dot AKA scalar product of the two vectors.

Return value: none

Function: void lw6mat_dvec2_cross (lw6mat_dvec3_t * dvec3, const lw6mat_dvec2_t * dvec2_a, const lw6mat_dvec2_t * dvec2_b)

dvec3: result vector

dvec2_a: 1st vector

dvec2_b: 2nd vector

Calculates the cross AKA vectorial product of the two vectors. Since cross product only really makes sense in 3D, this function will interpret the 2D vectors as 3D vectors with z set t zero, that is, a vector in the xy plane.

Return value: none

Function: void lw6mat_dvec2_mul_scale (lw6mat_dvec2_t * dvec2, double f)

dvec2: vector to modify

f: scale factor

Scales the vector by multiplying all its members by a scalar value.

Return value: none

Function: void lw6mat_dvec2_mul_dvec2 (lw6mat_dmat2_t * dmat2, const lw6mat_dvec2_t * dvec2_a, const lw6mat_dvec2_t * dvec2_b)

dmat2: result matrix

dvec2_a: 1st row vector

dvec2_b: 2nd column vector

Multiplication of a row vector by a column vector to give a matrix.

Return value: none

Function: char * lw6mat_dvec2_repr (lw6sys_context_t * sys_context, const lw6mat_dvec2_t * dvec2)

sys_context: global system context

Gives a readable version of the vector

Return value: newly allocated string

Function: void lw6mat_dvec3_zero (lw6mat_dvec3_t * dvec3)

dvec3: the vector to initialize.

Fills the vector with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: int lw6mat_dvec3_is_same (const lw6mat_dvec3_t * dvec3_a, const lw6mat_dvec3_t * dvec3_b)

dvec3_a: 1st vector to compare

dvec3_b: 2nd vector to compare

Compares two vectors, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: double lw6mat_dvec3_len_sq (const lw6mat_dvec3_t * dvec3)

dvec3: the vector to query.

Returns the square of a vector length. To get the real length one should then apply a square root but at this stage one has at least an idea about vector length, and this information is enough to compare them.

Return value: sigma(coord*coord)

Function: double lw6mat_dvec3_len (const lw6mat_dvec3_t * dvec3)

dvec3: the vector to query.

Returns the size/length of a vector, this is the distance of the point from origin, not the number of elements.

Return value: the length of the vector.

Function: int lw6mat_dvec3_normalize (lw6sys_context_t * sys_context, lw6mat_dvec3_t * dvec3)

sys_context: global system context

dvec3: the vector to normalize.

Normalizes a vector, that is, make its length be 1.

Return value: 1 if OK, 0 if error, such as trying to normalize vector zero.

Function: int lw6mat_dvec3_homogeneous (lw6sys_context_t * sys_context, lw6mat_dvec3_t * dvec3)

sys_context: global system context

dvec3: the vector to homogeneous.

Transforms a vector into homegeneous coords, that is, scales it so that its last member is 1.

Return value: 1 if OK, 0 if error, such as trying to operate on vector zero.

Function: void lw6mat_dvec3_neg (lw6mat_dvec3_t * dvec3)

dvec3: vector to modify

Calcs the opposite vector, by making a negation on all its members

Return value: none

Function: void lw6mat_dvec3_add (lw6mat_dvec3_t * dvec3, const lw6mat_dvec3_t * dvec3_a, const lw6mat_dvec3_t * dvec3_b)

dvec3: result vector

dvec3_a: 1st vector to add

dvec3_b: 2nd vector to add

Adds two vectors.

Return value: none

Function: void lw6mat_dvec3_sub (lw6mat_dvec3_t * dvec3, const lw6mat_dvec3_t * dvec3_a, const lw6mat_dvec3_t * dvec3_b)

dvec3: result vector

dvec3_a: 1st vector

dvec3_b: 2nd vector, will be substracted to 1st vector

Substracts vector b from vector a.

Return value: none

Function: double lw6mat_dvec3_dot (const lw6mat_dvec3_t * dvec3_a, const lw6mat_dvec3_t * dvec3_b)

dvec3_a: 1st vector

dvec3_b: 2nd vector

Calculates the dot AKA scalar product of the two vectors.

Return value: none

Function: void lw6mat_dvec3_cross (lw6mat_dvec3_t * dvec3, const lw6mat_dvec3_t * dvec3_a, const lw6mat_dvec3_t * dvec3_b)

dvec3: result vector

dvec3_a: 1st vector

dvec3_b: 2nd vector

Calculates the cross AKA vectorial product of the two vectors.

Return value: none

Function: void lw6mat_dvec3_mul_scale (lw6mat_dvec3_t * dvec3, double f)

dvec3: vector to modify

f: scale factor

Scales the vector by multiplying all its members by a scalar value.

Return value: none

Function: void lw6mat_dvec3_mul_dvec3 (lw6mat_dmat3_t * dmat3, const lw6mat_dvec3_t * dvec3_a, const lw6mat_dvec3_t * dvec3_b)

dmat3: result matrix

dvec3_a: 1st row vector

dvec3_b: 3nd column vector

Multiplication of a row vector by a column vector to give a matrix.

Return value: none

Function: char * lw6mat_dvec3_repr (lw6sys_context_t * sys_context, const lw6mat_dvec3_t * dvec3)

sys_context: global system context

Gives a readable version of the vector

Return value: newly allocated string

Function: void lw6mat_dvec4_zero (lw6mat_dvec4_t * dvec4)

dvec4: the vector to initialize.

Fills the vector with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: int lw6mat_dvec4_is_same (const lw6mat_dvec4_t * dvec4_a, const lw6mat_dvec4_t * dvec4_b)

dvec4_a: 1st vector to compare

dvec4_b: 2nd vector to compare

Compares two vectors, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: double lw6mat_dvec4_len_sq (const lw6mat_dvec4_t * dvec4)

dvec4: the vector to query.

Returns the square of a vector length. To get the real length one should then apply a square root but at this stage one has at least an idea about vector length, and this information is enough to compare them.

Return value: sigma(coord*coord)

Function: double lw6mat_dvec4_len (const lw6mat_dvec4_t * dvec4)

dvec4: the vector to query.

Returns the size/length of a vector, this is the distance of the point from origin, not the number of elements.

Return value: the length of the vector.

Function: int lw6mat_dvec4_normalize (lw6sys_context_t * sys_context, lw6mat_dvec4_t * dvec4)

sys_context: global system context

dvec4: the vector to normalize.

Normalizes a vector, that is, make its length be 1.

Return value: 1 if OK, 0 if error, such as trying to normalize vector zero.

Function: int lw6mat_dvec4_homogeneous (lw6sys_context_t * sys_context, lw6mat_dvec4_t * dvec4)

sys_context: global system context

dvec4: the vector to homogeneous.

Transforms a vector into homegeneous coords, that is, scales it so that its last member is 1.

Return value: 1 if OK, 0 if error, such as trying to operate on vector zero.

Function: void lw6mat_dvec4_neg (lw6mat_dvec4_t * dvec4)

dvec4: vector to modify

Calcs the opposite vector, by making a negation on all its members

Return value: none

Function: void lw6mat_dvec4_add (lw6mat_dvec4_t * dvec4, const lw6mat_dvec4_t * dvec4_a, const lw6mat_dvec4_t * dvec4_b)

dvec4: result vector

dvec4_a: 1st vector to add

dvec4_b: 2nd vector to add

Adds two vectors.

Return value: none

Function: void lw6mat_dvec4_sub (lw6mat_dvec4_t * dvec4, const lw6mat_dvec4_t * dvec4_a, const lw6mat_dvec4_t * dvec4_b)

dvec4: result vector

dvec4_a: 1st vector

dvec4_b: 2nd vector, will be substracted to 1st vector

Substracts vector b from vector a.

Return value: none

Function: double lw6mat_dvec4_dot (const lw6mat_dvec4_t * dvec4_a, const lw6mat_dvec4_t * dvec4_b)

dvec4_a: 1st vector

dvec4_b: 2nd vector

Calculates the dot AKA scalar product of the two vectors.

Return value: none

Function: void lw6mat_dvec4_cross (lw6mat_dvec3_t * dvec3, const lw6mat_dvec4_t * dvec4_a, const lw6mat_dvec4_t * dvec4_b)

dvec3: result vector

dvec4_a: 1st vector

dvec4_b: 2nd vector

Calculates the cross AKA vectorial product of the two vectors. Since cross product only really makes sense in 3D, this function will interpret the 4D vectors as 3D vectors only, ignoring the last value.

Return value: none

Function: void lw6mat_dvec4_mul_scale (lw6mat_dvec4_t * dvec4, double f)

dvec4: vector to modify

f: scale factor

Scales the vector by multiplying all its members by a scalar value.

Return value: none

Function: void lw6mat_dvec4_mul_dvec4 (lw6mat_dmat4_t * dmat4, const lw6mat_dvec4_t * dvec4_a, const lw6mat_dvec4_t * dvec4_b)

dmat4: result matrix

dvec4_a: 1st row vector

dvec4_b: 4nd column vector

Multiplication of a row vector by a column vector to give a matrix.

Return value: none

Function: char * lw6mat_dvec4_repr (lw6sys_context_t * sys_context, const lw6mat_dvec4_t * dvec4)

sys_context: global system context

Gives a readable version of the vector

Return value: newly allocated string

Function: void lw6mat_fmat2_zero (lw6mat_fmat2_t * fmat2)

fmat2: the matrix to initialize.

Fills the matrix with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: void lw6mat_fmat2_identity (lw6mat_fmat2_t * fmat2)

fmat2: the matrix to initialize.

Loads the matrix with the identity matrix, that is, zero everywhere but one on the main diag.

Return value: none.

Function: void lw6mat_fmat2_translation (lw6mat_fmat2_t * fmat2, float f)

fmat2: the matrix to initialize.

f: value which defines the translation.

Loads the matrix with a translation transformation matrix. By multiplicating by this matrix, a translation is done.

Return value: none.

Function: void lw6mat_fmat2_scale (lw6mat_fmat2_t * fmat2, float f)

fmat2: the matrix to initialize.

f: value used to scale matrix.

Loads the matrix with a scale matrix. By multiplicating by this matrix, a scaling is done.

Return value: none.

Function: int lw6mat_fmat2_is_same (const lw6mat_fmat2_t * fmat2_a, const lw6mat_fmat2_t * fmat2_b)

fmat2_a: 1st matrix to compare

fmat2_b: 2nd matrix to compare

Compares two matrix, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: void lw6mat_fmat2_transpose (lw6mat_fmat2_t * fmat2)

fmat2: the matrix to transpose

Transposes the matrix, that is, inverts rows and columns.

Return value: none.

Function: float lw6mat_fmat2_det (const lw6mat_fmat2_t * fmat2)

fmat2: the matrix used to calculate the determinant

Calulates the determinant of the matrix.

Return value: the determinant.

Function: void lw6mat_fmat2_mul_scale (lw6mat_fmat2_t * fmat2, float f)

fmat2: matrix to modify

f: scale factor

Scales the matrix by multiplying all its members by a scalar value.

Return value: none

Function: int lw6mat_fmat2_inv (lw6sys_context_t * sys_context, lw6mat_fmat2_t * fmat2_dst, const lw6mat_fmat2_t * fmat2_src)

sys_context: global system context

fmat2_dst: the matrix inverted

fmat2_src: the matrix to invert

Inverts a matrix. Probably not the fastest implementation, but should work in all cases. Use hardware accelerated API such as OpenGL on dedicated hardware if you want power.

Return value: 1 if inverted, 0 if error, typically if determinant was 0, matrix can not be inverted.

Function: void lw6mat_fmat2_mul_fmat2 (lw6mat_fmat2_t * fmat2, const lw6mat_fmat2_t * fmat2_a, const lw6mat_fmat2_t * fmat2_b)

fmat2: the result matrix

fmat2_a: the 1st matrix to multiply, on the left

fmat2_b: the 2nd matrix to multiply, on the right

Classic matrix multiplication.

Return value: none.

Function: void lw6mat_fmat2_mul_fvec2 (lw6mat_fvec2_t * fvec2_dst, const lw6mat_fmat2_t * fmat2, const lw6mat_fvec2_t * fvec2_src)

fvec2_dst: the result vector

fvec2_src: the source vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish.

Return value: none.

Function: char * lw6mat_fmat2_repr (lw6sys_context_t * sys_context, const lw6mat_fmat2_t * fmat2)

sys_context: global system context

Gives a readable version of the matrix, the representation uses newlines, with a different line for each row

Return value: newly allocated string

Function: void lw6mat_fmat3_zero (lw6mat_fmat3_t * fmat3)

fmat3: the matrix to initialize.

Fills the matrix with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: void lw6mat_fmat3_identity (lw6mat_fmat3_t * fmat3)

fmat3: the matrix to initialize.

Loads the matrix with the identity matrix, that is, zero everywhere but one on the main diag.

Return value: none.

Function: void lw6mat_fmat3_translation (lw6mat_fmat3_t * fmat3, const lw6mat_fvec2_t * fvec2)

fmat3: the matrix to initialize.

fvec2: vector which defines the translation.

Loads the matrix with a translation transformation matrix. By multiplicating by this matrix, a translation is done.

Return value: none.

Function: void lw6mat_fmat3_scale (lw6mat_fmat3_t * fmat3, const lw6mat_fvec2_t * fvec2)

fmat3: the matrix to initialize.

fvec2: value used to scale matrix.

Loads the matrix with a scale matrix. By multiplicating by this matrix, a scaling is done.

Return value: none.

Function: void lw6mat_fmat3_rot (lw6mat_fmat3_t * fmat3, float r)

fmat3: the matrix to initialize.

r: value used to for the rotation, angle in radians.

Loads the matrix with a rotation matrix. By multiplicating by this matrix, a rotation is done, over a virtual Z axis such as Z is the cross product of X and Y.

Return value: none.

Function: int lw6mat_fmat3_is_same (const lw6mat_fmat3_t * fmat3_a, const lw6mat_fmat3_t * fmat3_b)

fmat3_a: 1st matrix to compare

fmat3_b: 2nd matrix to compare

Compares two matrix, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: void lw6mat_fmat3_transpose (lw6mat_fmat3_t * fmat3)

fmat3: the matrix to transpose

Transposes the matrix, that is, inverts rows and columns.

Return value: none.

Function: float lw6mat_fmat3_det (const lw6mat_fmat3_t * fmat3)

fmat3: the matrix used to calculate the determinant

Calulates the determinant of the matrix.

Return value: the determinant.

Function: void lw6mat_fmat3_mul_scale (lw6mat_fmat3_t * fmat3, float f)

fmat3: matrix to modify

f: scale factor

Scales the matrix by multiplying all its members by a scalar value.

Return value: none

Function: int lw6mat_fmat3_inv (lw6sys_context_t * sys_context, lw6mat_fmat3_t * fmat3_dst, const lw6mat_fmat3_t * fmat3_src)

sys_context: global system context

fmat3_dst: the matrix inverted

fmat3_src: the matrix to invert

Inverts a matrix. Probably not the fastest implementation, but should work in all cases. Use hardware accelerated API such as OpenGL on dedicated hardware if you want power.

Return value: 1 if inverted, 0 if error, typically if determinant was 0, matrix can not be inverted.

Function: void lw6mat_fmat3_mul_fmat3 (lw6mat_fmat3_t * fmat3, const lw6mat_fmat3_t * fmat3_a, const lw6mat_fmat3_t * fmat3_b)

fmat3: the result matrix

fmat3_a: the 1st matrix to multiply, on the left

fmat3_b: the 2nd matrix to multiply, on the right

Classic matrix multiplication.

Return value: none.

Function: void lw6mat_fmat3_mul_fvec3 (lw6mat_fvec3_t * fvec3_dst, const lw6mat_fmat3_t * fmat3, const lw6mat_fvec3_t * fvec3_src)

fvec3_dst: the result vector

fvec3_src: the source vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish.

Return value: none.

Function: void lw6mat_fmat3_mul_fvec2 (lw6mat_fvec2_t * fvec2_dst, const lw6mat_fmat3_t * fmat3, const lw6mat_fvec2_t * fvec2_src)

fvec2_dst: the result vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish. The vector, here, is smaller than the matrix, the last element is supposed to be 1, this is how one implements translation through multiplication.

Return value: none.

Function: char * lw6mat_fmat3_repr (lw6sys_context_t * sys_context, const lw6mat_fmat3_t * fmat3)

sys_context: global system context

Gives a readable version of the matrix, the representation uses newlines, with a different line for each row

Return value: newly allocated string

Function: void lw6mat_fmat4_zero (lw6mat_fmat4_t * fmat4)

fmat4: the matrix to initialize.

Fills the matrix with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: void lw6mat_fmat4_identity (lw6mat_fmat4_t * fmat4)

fmat4: the matrix to initialize.

Loads the matrix with the identity matrix, that is, zero everywhere but one on the main diag.

Return value: none.

Function: void lw6mat_fmat4_translation (lw6mat_fmat4_t * fmat4, const lw6mat_fvec3_t * fvec3)

fmat4: the matrix to initialize.

fvec3: vector which defines the translation.

Loads the matrix with a translation transformation matrix. By multiplicating by this matrix, a translation is done.

Return value: none.

Function: void lw6mat_fmat4_scale (lw6mat_fmat4_t * fmat4, const lw6mat_fvec3_t * fvec3)

fmat4: the matrix to initialize.

fvec3: value used to scale matrix.

Loads the matrix with a scale matrix. By multiplicating by this matrix, a scaling is done.

Return value: none.

Function: void lw6mat_fmat4_rot_x (lw6mat_fmat4_t * fmat4, float r)

fmat4: the matrix to initialize.

r: value used to for the rotation, angle in radians.

Loads the matrix with a rotation matrix. By multiplicating by this matrix, a rotation is done, over the X axis.

Return value: none.

Function: void lw6mat_fmat4_rot_y (lw6mat_fmat4_t * fmat4, float r)

fmat4: the matrix to initialize.

r: value used to for the rotation, angle in radians.

Loads the matrix with a rotation matrix. By multiplicating by this matrix, a rotation is done, over the Y axis.

Return value: none.

Function: void lw6mat_fmat4_rot_z (lw6mat_fmat4_t * fmat4, float r)

fmat4: the matrix to initialize.

r: value used to for the rotation, angle in radians.

Loads the matrix with a rotation matrix. By multiplicating by this matrix, a rotation is done, over the Z axis.

Return value: none.

Function: void lw6mat_fmat4_ortho (lw6mat_fmat4_t * fmat4, float left, float right, float bottom, float top, float nearval, float farval)

fmat4: the matrix to initialize.

left: left plane coordinate

right: right plane coordinate

bottom: bottom plane coordinate

top: top plane coordinate

nearval: near plane coordinate

farval: far plane coordinate

Loads the matrix with an orthogonal projection matrix. Does it the way glOrtho would, see https://www.opengl.org/sdk/docs/man2/xhtml/glOrtho.xml for details.

Note: use -nearVal and -farVal to initialize. It’s a little akward, if you expect to pass vectors with positions ranging from nearVal to farVal then you need to pass -nearVal and -farVal to this function. This is probably due to the fact that with a right-handed basis and X,Y set up "as usual", then Z is negative when going farther and farther. This tweak allows farVal to yield +1 and nearVal -1. We keep this function as is here, as this is the way OpenGL functions seem to work.

Return value: none.

Function: void lw6mat_fmat4_perspective (lw6mat_fmat4_t * fmat4, float fovy, float aspect, float znear, float zfar)

fmat4: the matrix to initialize.

fovy: vertical field of view (degrees, not radians)

aspect: x/y ratio

znear: near plane coordinate (use -znear to initialize)

zfar: far plane coordinate (use -zfar to initialize)

Loads the matrix with a projection matrix. Does it the way gluPerspective would, see https://www.opengl.org/sdk/docs/man2/xhtml/gluPerspective.xml for details.

Return value: none.

Function: int lw6mat_fmat4_is_same (const lw6mat_fmat4_t * fmat4_a, const lw6mat_fmat4_t * fmat4_b)

fmat4_a: 1st matrix to compare

fmat4_b: 2nd matrix to compare

Compares two matrix, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: void lw6mat_fmat4_transpose (lw6mat_fmat4_t * fmat4)

fmat4: the matrix to transpose

Transposes the matrix, that is, inverts rows and columns.

Return value: none.

Function: float lw6mat_fmat4_det (const lw6mat_fmat4_t * fmat4)

fmat4: the matrix used to calculate the determinant

Calulates the determinant of the matrix.

Return value: the determinant.

Function: void lw6mat_fmat4_mul_scale (lw6mat_fmat4_t * fmat4, float f)

fmat4: matrix to modify

f: scale factor

Scales the matrix by multiplying all its members by a scalar value.

Return value: none

Function: int lw6mat_fmat4_inv (lw6sys_context_t * sys_context, lw6mat_fmat4_t * fmat4_dst, const lw6mat_fmat4_t * fmat4_src)

sys_context: global system context

fmat4_dst: the matrix inverted

fmat4_src: the matrix to invert

Inverts a matrix. Probably not the fastest implementation, but should work in all cases. Use hardware accelerated API such as OpenGL on dedicated hardware if you want power.

Return value: 1 if inverted, 0 if error, typically if determinant was 0, matrix can not be inverted.

Function: void lw6mat_fmat4_mul_fmat4 (lw6mat_fmat4_t * fmat4, const lw6mat_fmat4_t * fmat4_a, const lw6mat_fmat4_t * fmat4_b)

fmat4: the result matrix

fmat4_a: the 1st matrix to multiply, on the left

fmat4_b: the 2nd matrix to multiply, on the right

Classic matrix multiplication.

Return value: none.

Function: void lw6mat_fmat4_mul_fvec4 (lw6mat_fvec4_t * fvec4_dst, const lw6mat_fmat4_t * fmat4, const lw6mat_fvec4_t * fvec4_src)

fvec4_dst: the result vector

fmat4: the matrix to use

fvec4_src: the source vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish.

Return value: none.

Function: void lw6mat_fmat4_mul_fvec3 (lw6mat_fvec3_t * fvec3_dst, const lw6mat_fmat4_t * fmat4, const lw6mat_fvec3_t * fvec3_src)

fvec3_dst: the result vector

fmat4: the matrix to use

fvec3_src: the source vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish. The vector, here, is smaller than the matrix, the last element is supposed to be 1, this is how one implements translation through multiplication.

Return value: none.

Function: char * lw6mat_fmat4_repr (lw6sys_context_t * sys_context, const lw6mat_fmat4_t * fmat4)

sys_context: global system context

Gives a readable version of the matrix, the representation uses newlines, with a different line for each row

Return value: newly allocated string

Function: void lw6mat_fvec2_zero (lw6mat_fvec2_t * fvec2)

fvec2: the vector to initialize.

Fills the vector with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: int lw6mat_fvec2_is_same (const lw6mat_fvec2_t * fvec2_a, const lw6mat_fvec2_t * fvec2_b)

fvec2_a: 1st vector to compare

fvec2_b: 2nd vector to compare

Compares two vectors, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: float lw6mat_fvec2_len_sq (const lw6mat_fvec2_t * fvec2)

fvec2: the vector to query.

Returns the square of a vector length. To get the real length one should then apply a square root but at this stage one has at least an idea about vector length, and this information is enough to compare them.

Return value: sigma(coord*coord)

Function: float lw6mat_fvec2_len (const lw6mat_fvec2_t * fvec2)

fvec2: the vector to query.

Returns the size/length of a vector, this is the distance of the point from origin, not the number of elements.

Return value: the length of the vector.

Function: int lw6mat_fvec2_normalize (lw6sys_context_t * sys_context, lw6mat_fvec2_t * fvec2)

sys_context: global system context

fvec2: the vector to normalize.

Normalizes a vector, that is, make its length be 1.

Return value: 1 if OK, 0 if error, such as trying to normalize vector zero.

Function: int lw6mat_fvec2_homogeneous (lw6sys_context_t * sys_context, lw6mat_fvec2_t * fvec2)

sys_context: global system context

fvec2: the vector to homogeneous.

Transforms a vector into homegeneous coords, that is, scales it so that its last member is 1.

Return value: 1 if OK, 0 if error, such as trying to operate on vector zero.

Function: void lw6mat_fvec2_neg (lw6mat_fvec2_t * fvec2)

fvec2: vector to modify

Calcs the opposite vector, by making a negation on all its members

Return value: none

Function: void lw6mat_fvec2_add (lw6mat_fvec2_t * fvec2, const lw6mat_fvec2_t * fvec2_a, const lw6mat_fvec2_t * fvec2_b)

fvec2: result vector

fvec2_a: 1st vector to add

fvec2_b: 2nd vector to add

Adds two vectors.

Return value: none

Function: void lw6mat_fvec2_sub (lw6mat_fvec2_t * fvec2, const lw6mat_fvec2_t * fvec2_a, const lw6mat_fvec2_t * fvec2_b)

fvec2: result vector

fvec2_a: 1st vector

fvec2_b: 2nd vector, will be substracted to 1st vector

Substracts vector b from vector a.

Return value: none

Function: float lw6mat_fvec2_dot (const lw6mat_fvec2_t * fvec2_a, const lw6mat_fvec2_t * fvec2_b)

fvec2_a: 1st vector

fvec2_b: 2nd vector

Calculates the dot AKA scalar product of the two vectors.

Return value: none

Function: void lw6mat_fvec2_cross (lw6mat_fvec3_t * fvec3, const lw6mat_fvec2_t * fvec2_a, const lw6mat_fvec2_t * fvec2_b)

fvec3: result vector

fvec2_a: 1st vector

fvec2_b: 2nd vector

Calculates the cross AKA vectorial product of the two vectors. Since cross product only really makes sense in 3D, this function will interpret the 2D vectors as 3D vectors with z set t zero, that is, a vector in the xy plane.

Return value: none

Function: void lw6mat_fvec2_mul_scale (lw6mat_fvec2_t * fvec2, float f)

fvec2: vector to modify

f: scale factor

Scales the vector by multiplying all its members by a scalar value.

Return value: none

Function: void lw6mat_fvec2_mul_fvec2 (lw6mat_fmat2_t * fmat2, const lw6mat_fvec2_t * fvec2_a, const lw6mat_fvec2_t * fvec2_b)

fmat2: result matrix

fvec2_a: 1st row vector

fvec2_b: 2nd column vector

Multiplication of a row vector by a column vector to give a matrix.

Return value: none

Function: char * lw6mat_fvec2_repr (lw6sys_context_t * sys_context, const lw6mat_fvec2_t * fvec2)

sys_context: global system context

Gives a readable version of the vector

Return value: newly allocated string

Function: void lw6mat_fvec3_zero (lw6mat_fvec3_t * fvec3)

fvec3: the vector to initialize.

Fills the vector with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: int lw6mat_fvec3_is_same (const lw6mat_fvec3_t * fvec3_a, const lw6mat_fvec3_t * fvec3_b)

fvec3_a: 1st vector to compare

fvec3_b: 2nd vector to compare

Compares two vectors, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: float lw6mat_fvec3_len_sq (const lw6mat_fvec3_t * fvec3)

fvec3: the vector to query.

Returns the square of a vector length. To get the real length one should then apply a square root but at this stage one has at least an idea about vector length, and this information is enough to compare them.

Return value: sigma(coord*coord)

Function: float lw6mat_fvec3_len (const lw6mat_fvec3_t * fvec3)

fvec3: the vector to query.

Returns the size/length of a vector, this is the distance of the point from origin, not the number of elements.

Return value: the length of the vector.

Function: int lw6mat_fvec3_normalize (lw6sys_context_t * sys_context, lw6mat_fvec3_t * fvec3)

sys_context: global system context

fvec3: the vector to normalize.

Normalizes a vector, that is, make its length be 1.

Return value: 1 if OK, 0 if error, such as trying to normalize vector zero.

Function: int lw6mat_fvec3_homogeneous (lw6sys_context_t * sys_context, lw6mat_fvec3_t * fvec3)

sys_context: global system context

fvec3: the vector to homogeneous.

Transforms a vector into homegeneous coords, that is, scales it so that its last member is 1.

Return value: 1 if OK, 0 if error, such as trying to operate on vector zero.

Function: void lw6mat_fvec3_neg (lw6mat_fvec3_t * fvec3)

fvec3: vector to modify

Calcs the opposite vector, by making a negation on all its members

Return value: none

Function: void lw6mat_fvec3_add (lw6mat_fvec3_t * fvec3, const lw6mat_fvec3_t * fvec3_a, const lw6mat_fvec3_t * fvec3_b)

fvec3: result vector

fvec3_a: 1st vector to add

fvec3_b: 2nd vector to add

Adds two vectors.

Return value: none

Function: void lw6mat_fvec3_sub (lw6mat_fvec3_t * fvec3, const lw6mat_fvec3_t * fvec3_a, const lw6mat_fvec3_t * fvec3_b)

fvec3: result vector

fvec3_a: 1st vector

fvec3_b: 2nd vector, will be substracted to 1st vector

Substracts vector b from vector a.

Return value: none

Function: float lw6mat_fvec3_dot (const lw6mat_fvec3_t * fvec3_a, const lw6mat_fvec3_t * fvec3_b)

fvec3_a: 1st vector

fvec3_b: 2nd vector

Calculates the dot AKA scalar product of the two vectors.

Return value: none

Function: void lw6mat_fvec3_cross (lw6mat_fvec3_t * fvec3, const lw6mat_fvec3_t * fvec3_a, const lw6mat_fvec3_t * fvec3_b)

fvec3: result vector

fvec3_a: 1st vector

fvec3_b: 2nd vector

Calculates the cross AKA vectorial product of the two vectors.

Return value: none

Function: void lw6mat_fvec3_mul_scale (lw6mat_fvec3_t * fvec3, float f)

fvec3: vector to modify

f: scale factor

Scales the vector by multiplying all its members by a scalar value.

Return value: none

Function: void lw6mat_fvec3_mul_fvec3 (lw6mat_fmat3_t * fmat3, const lw6mat_fvec3_t * fvec3_a, const lw6mat_fvec3_t * fvec3_b)

fmat3: result matrix

fvec3_a: 1st row vector

fvec3_b: 3nd column vector

Multiplication of a row vector by a column vector to give a matrix.

Return value: none

Function: char * lw6mat_fvec3_repr (lw6sys_context_t * sys_context, const lw6mat_fvec3_t * fvec3)

sys_context: global system context

Gives a readable version of the vector

Return value: newly allocated string

Function: void lw6mat_fvec4_zero (lw6mat_fvec4_t * fvec4)

fvec4: the vector to initialize.

Fills the vector with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: int lw6mat_fvec4_is_same (const lw6mat_fvec4_t * fvec4_a, const lw6mat_fvec4_t * fvec4_b)

fvec4_a: 1st vector to compare

fvec4_b: 2nd vector to compare

Compares two vectors, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: float lw6mat_fvec4_len_sq (const lw6mat_fvec4_t * fvec4)

fvec4: the vector to query.

Returns the square of a vector length. To get the real length one should then apply a square root but at this stage one has at least an idea about vector length, and this information is enough to compare them.

Return value: sigma(coord*coord)

Function: float lw6mat_fvec4_len (const lw6mat_fvec4_t * fvec4)

fvec4: the vector to query.

Returns the size/length of a vector, this is the distance of the point from origin, not the number of elements.

Return value: the length of the vector.

Function: int lw6mat_fvec4_normalize (lw6sys_context_t * sys_context, lw6mat_fvec4_t * fvec4)

sys_context: global system context

fvec4: the vector to normalize.

Normalizes a vector, that is, make its length be 1.

Return value: 1 if OK, 0 if error, such as trying to normalize vector zero.

Function: int lw6mat_fvec4_homogeneous (lw6sys_context_t * sys_context, lw6mat_fvec4_t * fvec4)

sys_context: global system context

fvec4: the vector to homogeneous.

Transforms a vector into homegeneous coords, that is, scales it so that its last member is 1.

Return value: 1 if OK, 0 if error, such as trying to operate on vector zero.

Function: void lw6mat_fvec4_neg (lw6mat_fvec4_t * fvec4)

fvec4: vector to modify

Calcs the opposite vector, by making a negation on all its members

Return value: none

Function: void lw6mat_fvec4_add (lw6mat_fvec4_t * fvec4, const lw6mat_fvec4_t * fvec4_a, const lw6mat_fvec4_t * fvec4_b)

fvec4: result vector

fvec4_a: 1st vector to add

fvec4_b: 2nd vector to add

Adds two vectors.

Return value: none

Function: void lw6mat_fvec4_sub (lw6mat_fvec4_t * fvec4, const lw6mat_fvec4_t * fvec4_a, const lw6mat_fvec4_t * fvec4_b)

fvec4: result vector

fvec4_a: 1st vector

fvec4_b: 2nd vector, will be substracted to 1st vector

Substracts vector b from vector a.

Return value: none

Function: float lw6mat_fvec4_dot (const lw6mat_fvec4_t * fvec4_a, const lw6mat_fvec4_t * fvec4_b)

fvec4_a: 1st vector

fvec4_b: 2nd vector

Calculates the dot AKA scalar product of the two vectors.

Return value: none

Function: void lw6mat_fvec4_cross (lw6mat_fvec3_t * fvec3, const lw6mat_fvec4_t * fvec4_a, const lw6mat_fvec4_t * fvec4_b)

fvec3: result vector

fvec4_a: 1st vector

fvec4_b: 2nd vector

Calculates the cross AKA vectorial product of the two vectors. Since cross product only really makes sense in 3D, this function will interpret the 4D vectors as 3D vectors only, ignoring the last value.

Return value: none

Function: void lw6mat_fvec4_mul_scale (lw6mat_fvec4_t * fvec4, float f)

fvec4: vector to modify

f: scale factor

Scales the vector by multiplying all its members by a scalar value.

Return value: none

Function: void lw6mat_fvec4_mul_fvec4 (lw6mat_fmat4_t * fmat4, const lw6mat_fvec4_t * fvec4_a, const lw6mat_fvec4_t * fvec4_b)

fmat4: result matrix

fvec4_a: 1st row vector

fvec4_b: 4nd column vector

Multiplication of a row vector by a column vector to give a matrix.

Return value: none

Function: char * lw6mat_fvec4_repr (lw6sys_context_t * sys_context, const lw6mat_fvec4_t * fvec4)

sys_context: global system context

Gives a readable version of the vector

Return value: newly allocated string

Function: int lw6mat_is_similar_f (float f_a, float f_b)

f_a: 1st value to compare

f_b: 2nd value to compare

Compares two value, and returns true if they look the same. This similarity is based on a percentage of difference for big enough values, and for very small values, they are just considered equal whatever happens. This is far from perfect but the purpose is usually just to track blunders in matrix code.

Return value: 1 if similar, 0 if not.

Function: int lw6mat_is_similar_i (int32_t i_a, int32_t i_b)

i_a: 1st value to compare

i_b: 2nd value to compare

Compares two value, and returns true if they look the same. This similarity is based on a percentage of difference for big enough values, and for very small values, they are just considered equal whatever happens. This is far from perfect but the purpose is usually just to track blunders in matrix code.

Return value: 1 if similar, 0 if not.

Function: int lw6mat_is_similar_d (double d_a, double d_b)

d_a: 1st value to compare

d_b: 2nd value to compare

Compares two value, and returns true if they look the same. This similarity is based on a percentage of difference for big enough values, and for very small values, they are just considered equal whatever happens. This is far from perfect but the purpose is usually just to track blunders in matrix code.

Return value: 1 if similar, 0 if not.

Function: int lw6mat_is_similar_x (int32_t x_a, int32_t x_b)

x_a: 1st value to compare

x_b: 2nd value to compare

Compares two value, and returns true if they look the same. This similarity is based on a percentage of difference for big enough values, and for very small values, they are just considered equal whatever happens. This is far from perfect but the purpose is usually just to track blunders in matrix code.

Return value: 1 if similar, 0 if not.

Function: int lw6mat_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libmat module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6mat_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the mat module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Struct: lw6mat_dmat2_t

Double 2x2 matrix (AKA 2D rectangle).

Member of lw6mat_dmat2_t: m

Type: double

Definition: double lw6mat_dmat2_t::m[LW6MAT_MAT2_M_SIZE][LW6MAT_MAT2_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_dmat2_t: v

Type: double

Definition: double lw6mat_dmat2_t::v[LW6MAT_MAT2_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*2+j.

Struct: lw6mat_dmat3_t

Double 3x3 matrix (AKA 3D triangle).

Member of lw6mat_dmat3_t: m

Type: double

Definition: double lw6mat_dmat3_t::m[LW6MAT_MAT3_M_SIZE][LW6MAT_MAT3_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_dmat3_t: v

Type: double

Definition: double lw6mat_dmat3_t::v[LW6MAT_MAT3_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*3+j.

Struct: lw6mat_dmat4_t

Double 4x4 matrix (AKA 3D transformation/composition matrix).

Member of lw6mat_dmat4_t: m

Type: double

Definition: double lw6mat_dmat4_t::m[LW6MAT_MAT4_M_SIZE][LW6MAT_MAT4_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_dmat4_t: v

Type: double

Definition: double lw6mat_dmat4_t::v[LW6MAT_MAT4_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*4+j.

Struct: lw6mat_dvec2_t

Double vector with 2 elements (AKA 2D point).

Member of lw6mat_dvec2_t: x

Type: double

Definition: double lw6mat_dvec2_t::x

Member of lw6mat_dvec2_t: y

Type: double

Definition: double lw6mat_dvec2_t::y

Member of lw6mat_dvec2_t: p

Type: struct lw6mat_dvec2_t::16

Definition: struct lw6mat_dvec2_t::16 lw6mat_dvec2_t::p

Accessor with named/point coords.

Member of lw6mat_dvec2_t: s

Type: double

Definition: double lw6mat_dvec2_t::s

Member of lw6mat_dvec2_t: t

Type: double

Definition: double lw6mat_dvec2_t::t

Member of lw6mat_dvec2_t: t

Type: struct lw6mat_dvec2_t::17

Definition: struct lw6mat_dvec2_t::17 lw6mat_dvec2_t::t

Accessor with texture-like name.

Member of lw6mat_dvec2_t: v

Type: double

Definition: double lw6mat_dvec2_t::v[LW6MAT_VEC2_V_SIZE]

Accessor with array index.

Struct: lw6mat_dvec3_t

Double vector with 3 elements (AKA 3D point).

Member of lw6mat_dvec3_t: x

Type: double

Definition: double lw6mat_dvec3_t::x

Member of lw6mat_dvec3_t: y

Type: double

Definition: double lw6mat_dvec3_t::y

Member of lw6mat_dvec3_t: z

Type: double

Definition: double lw6mat_dvec3_t::z

Member of lw6mat_dvec3_t: p

Type: struct lw6mat_dvec3_t::18

Definition: struct lw6mat_dvec3_t::18 lw6mat_dvec3_t::p

Accessor with named/point coords.

Member of lw6mat_dvec3_t: r

Type: double

Definition: double lw6mat_dvec3_t::r

Member of lw6mat_dvec3_t: g

Type: double

Definition: double lw6mat_dvec3_t::g

Member of lw6mat_dvec3_t: b

Type: double

Definition: double lw6mat_dvec3_t::b

Member of lw6mat_dvec3_t: c

Type: struct lw6mat_dvec3_t::19

Definition: struct lw6mat_dvec3_t::19 lw6mat_dvec3_t::c

Accessor with color-like name.

Member of lw6mat_dvec3_t: s

Type: double

Definition: double lw6mat_dvec3_t::s

Member of lw6mat_dvec3_t: t

Type: double

Definition: double lw6mat_dvec3_t::t

Member of lw6mat_dvec3_t: p

Type: double

Definition: double lw6mat_dvec3_t::p

Member of lw6mat_dvec3_t: t

Type: struct lw6mat_dvec3_t::20

Definition: struct lw6mat_dvec3_t::20 lw6mat_dvec3_t::t

Accessor with texture-like name.

Member of lw6mat_dvec3_t: v

Type: double

Definition: double lw6mat_dvec3_t::v[LW6MAT_VEC3_V_SIZE]

Accessor with array index.

Member of lw6mat_dvec3_t: v2

Type: lw6mat_dvec2_t

Definition: lw6mat_dvec2_t lw6mat_dvec3_t::v2

Accessor with smaller-sized vector, only 2 dimensions.

Struct: lw6mat_dvec4_t

Double vector with 4 elements (AKA quaternion).

Member of lw6mat_dvec4_t: x

Type: double

Definition: double lw6mat_dvec4_t::x

Member of lw6mat_dvec4_t: y

Type: double

Definition: double lw6mat_dvec4_t::y

Member of lw6mat_dvec4_t: z

Type: double

Definition: double lw6mat_dvec4_t::z

Member of lw6mat_dvec4_t: w

Type: double

Definition: double lw6mat_dvec4_t::w

Member of lw6mat_dvec4_t: p

Type: struct lw6mat_dvec4_t::21

Definition: struct lw6mat_dvec4_t::21 lw6mat_dvec4_t::p

Accessor with named/point coords.

Member of lw6mat_dvec4_t: r

Type: double

Definition: double lw6mat_dvec4_t::r

Member of lw6mat_dvec4_t: g

Type: double

Definition: double lw6mat_dvec4_t::g

Member of lw6mat_dvec4_t: b

Type: double

Definition: double lw6mat_dvec4_t::b

Member of lw6mat_dvec4_t: a

Type: double

Definition: double lw6mat_dvec4_t::a

Member of lw6mat_dvec4_t: c

Type: struct lw6mat_dvec4_t::22

Definition: struct lw6mat_dvec4_t::22 lw6mat_dvec4_t::c

Accessor with color-like name.

Member of lw6mat_dvec4_t: s

Type: double

Definition: double lw6mat_dvec4_t::s

Member of lw6mat_dvec4_t: t

Type: double

Definition: double lw6mat_dvec4_t::t

Member of lw6mat_dvec4_t: p

Type: double

Definition: double lw6mat_dvec4_t::p

Member of lw6mat_dvec4_t: q

Type: double

Definition: double lw6mat_dvec4_t::q

Member of lw6mat_dvec4_t: t

Type: struct lw6mat_dvec4_t::23

Definition: struct lw6mat_dvec4_t::23 lw6mat_dvec4_t::t

Accessor with texture-like name.

Member of lw6mat_dvec4_t: v

Type: double

Definition: double lw6mat_dvec4_t::v[LW6MAT_VEC4_V_SIZE]

Accessor with array index.

Member of lw6mat_dvec4_t: v2

Type: lw6mat_dvec2_t

Definition: lw6mat_dvec2_t lw6mat_dvec4_t::v2

Accessor with smaller-sized vector, only 2 dimensions.

Member of lw6mat_dvec4_t: v3

Type: lw6mat_dvec3_t

Definition: lw6mat_dvec3_t lw6mat_dvec4_t::v3

Accessor with smaller-sized vector, only 3 dimensions.

Struct: lw6mat_fmat2_t

Float 2x2 matrix (AKA 2D rectangle).

Member of lw6mat_fmat2_t: m

Type: float

Definition: float lw6mat_fmat2_t::m[LW6MAT_MAT2_M_SIZE][LW6MAT_MAT2_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_fmat2_t: v

Type: float

Definition: float lw6mat_fmat2_t::v[LW6MAT_MAT2_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*4+j.

Struct: lw6mat_fmat3_t

Float 3x3 matrix (AKA 3D triangle).

Member of lw6mat_fmat3_t: m

Type: float

Definition: float lw6mat_fmat3_t::m[LW6MAT_MAT3_M_SIZE][LW6MAT_MAT3_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_fmat3_t: v

Type: float

Definition: float lw6mat_fmat3_t::v[LW6MAT_MAT3_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*3+j.

Struct: lw6mat_fmat4_t

Float 4x4 matrix (AKA 3D transformation/composition matrix).

Member of lw6mat_fmat4_t: m

Type: float

Definition: float lw6mat_fmat4_t::m[LW6MAT_MAT4_M_SIZE][LW6MAT_MAT4_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_fmat4_t: v

Type: float

Definition: float lw6mat_fmat4_t::v[LW6MAT_MAT4_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*4+j.

Struct: lw6mat_fvec2_t

Float vector with 2 elements (AKA 2D point).

Member of lw6mat_fvec2_t: x

Type: float

Definition: float lw6mat_fvec2_t::x

Member of lw6mat_fvec2_t: y

Type: float

Definition: float lw6mat_fvec2_t::y

Member of lw6mat_fvec2_t: p

Type: struct lw6mat_fvec2_t::0

Definition: struct lw6mat_fvec2_t::0 lw6mat_fvec2_t::p

Accessor with named/point coords.

Member of lw6mat_fvec2_t: s

Type: float

Definition: float lw6mat_fvec2_t::s

Member of lw6mat_fvec2_t: t

Type: float

Definition: float lw6mat_fvec2_t::t

Member of lw6mat_fvec2_t: t

Type: struct lw6mat_fvec2_t::1

Definition: struct lw6mat_fvec2_t::1 lw6mat_fvec2_t::t

Accessor with texture-like name.

Member of lw6mat_fvec2_t: v

Type: float

Definition: float lw6mat_fvec2_t::v[LW6MAT_VEC2_V_SIZE]

Accessor with array index.

Struct: lw6mat_fvec3_t

Float vector with 3 elements (AKA 3D point).

Member of lw6mat_fvec3_t: x

Type: float

Definition: float lw6mat_fvec3_t::x

Member of lw6mat_fvec3_t: y

Type: float

Definition: float lw6mat_fvec3_t::y

Member of lw6mat_fvec3_t: z

Type: float

Definition: float lw6mat_fvec3_t::z

Member of lw6mat_fvec3_t: p

Type: struct lw6mat_fvec3_t::2

Definition: struct lw6mat_fvec3_t::2 lw6mat_fvec3_t::p

Accessor with named/point coords.

Member of lw6mat_fvec3_t: r

Type: float

Definition: float lw6mat_fvec3_t::r

Member of lw6mat_fvec3_t: g

Type: float

Definition: float lw6mat_fvec3_t::g

Member of lw6mat_fvec3_t: b

Type: float

Definition: float lw6mat_fvec3_t::b

Member of lw6mat_fvec3_t: c

Type: struct lw6mat_fvec3_t::3

Definition: struct lw6mat_fvec3_t::3 lw6mat_fvec3_t::c

Accessor with color-like name.

Member of lw6mat_fvec3_t: s

Type: float

Definition: float lw6mat_fvec3_t::s

Member of lw6mat_fvec3_t: t

Type: float

Definition: float lw6mat_fvec3_t::t

Member of lw6mat_fvec3_t: p

Type: float

Definition: float lw6mat_fvec3_t::p

Member of lw6mat_fvec3_t: t

Type: struct lw6mat_fvec3_t::4

Definition: struct lw6mat_fvec3_t::4 lw6mat_fvec3_t::t

Accessor with texture-like name.

Member of lw6mat_fvec3_t: v

Type: float

Definition: float lw6mat_fvec3_t::v[LW6MAT_VEC3_V_SIZE]

Accessor with array index.

Member of lw6mat_fvec3_t: v2

Type: lw6mat_fvec2_t

Definition: lw6mat_fvec2_t lw6mat_fvec3_t::v2

Accessor with smaller-sized vector, only 2 dimensions.

Struct: lw6mat_fvec4_t

Float vector with 4 elements (AKA quaternion).

Member of lw6mat_fvec4_t: x

Type: float

Definition: float lw6mat_fvec4_t::x

Member of lw6mat_fvec4_t: y

Type: float

Definition: float lw6mat_fvec4_t::y

Member of lw6mat_fvec4_t: z

Type: float

Definition: float lw6mat_fvec4_t::z

Member of lw6mat_fvec4_t: w

Type: float

Definition: float lw6mat_fvec4_t::w

Member of lw6mat_fvec4_t: p

Type: struct lw6mat_fvec4_t::5

Definition: struct lw6mat_fvec4_t::5 lw6mat_fvec4_t::p

Accessor with named/point coords.

Member of lw6mat_fvec4_t: r

Type: float

Definition: float lw6mat_fvec4_t::r

Member of lw6mat_fvec4_t: g

Type: float

Definition: float lw6mat_fvec4_t::g

Member of lw6mat_fvec4_t: b

Type: float

Definition: float lw6mat_fvec4_t::b

Member of lw6mat_fvec4_t: a

Type: float

Definition: float lw6mat_fvec4_t::a

Member of lw6mat_fvec4_t: c

Type: struct lw6mat_fvec4_t::6

Definition: struct lw6mat_fvec4_t::6 lw6mat_fvec4_t::c

Accessor with color-like name.

Member of lw6mat_fvec4_t: s

Type: float

Definition: float lw6mat_fvec4_t::s

Member of lw6mat_fvec4_t: t

Type: float

Definition: float lw6mat_fvec4_t::t

Member of lw6mat_fvec4_t: p

Type: float

Definition: float lw6mat_fvec4_t::p

Member of lw6mat_fvec4_t: q

Type: float

Definition: float lw6mat_fvec4_t::q

Member of lw6mat_fvec4_t: t

Type: struct lw6mat_fvec4_t::7

Definition: struct lw6mat_fvec4_t::7 lw6mat_fvec4_t::t

Accessor with texture-like name.

Member of lw6mat_fvec4_t: v

Type: float

Definition: float lw6mat_fvec4_t::v[LW6MAT_VEC4_V_SIZE]

Accessor with array index.

Member of lw6mat_fvec4_t: v2

Type: lw6mat_fvec2_t

Definition: lw6mat_fvec2_t lw6mat_fvec4_t::v2

Accessor with smaller-sized vector, only 2 dimensions.

Member of lw6mat_fvec4_t: v3

Type: lw6mat_fvec3_t

Definition: lw6mat_fvec3_t lw6mat_fvec4_t::v3

Accessor with smaller-sized vector, only 3 dimensions.

Struct: lw6mat_imat2_t

Integer 2x2 matrix (AKA 2D rectangle).

Member of lw6mat_imat2_t: m

Type: int32_t

Definition: int32_t lw6mat_imat2_t::m[LW6MAT_MAT2_M_SIZE][LW6MAT_MAT2_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_imat2_t: v

Type: int32_t

Definition: int32_t lw6mat_imat2_t::v[LW6MAT_MAT2_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*2+j.

Struct: lw6mat_imat3_t

Integer 3x3 matrix (AKA 3D triangle).

Member of lw6mat_imat3_t: m

Type: int32_t

Definition: int32_t lw6mat_imat3_t::m[LW6MAT_MAT3_M_SIZE][LW6MAT_MAT3_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_imat3_t: v

Type: int32_t

Definition: int32_t lw6mat_imat3_t::v[LW6MAT_MAT3_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*3+j.

Struct: lw6mat_imat4_t

Integer 4x4 matrix (AKA 3D transformation/composition matrix).

Member of lw6mat_imat4_t: m

Type: int32_t

Definition: int32_t lw6mat_imat4_t::m[LW6MAT_MAT4_M_SIZE][LW6MAT_MAT4_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_imat4_t: v

Type: int32_t

Definition: int32_t lw6mat_imat4_t::v[LW6MAT_MAT4_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*4+j.

Struct: lw6mat_ivec2_t

Integer vector with 2 elements (AKA 2D point).

Member of lw6mat_ivec2_t: x

Type: int32_t

Definition: int32_t lw6mat_ivec2_t::x

Member of lw6mat_ivec2_t: y

Type: int32_t

Definition: int32_t lw6mat_ivec2_t::y

Member of lw6mat_ivec2_t: p

Type: struct lw6mat_ivec2_t::8

Definition: struct lw6mat_ivec2_t::8 lw6mat_ivec2_t::p

Accessor with named/point coords.

Member of lw6mat_ivec2_t: s

Type: int32_t

Definition: int32_t lw6mat_ivec2_t::s

Member of lw6mat_ivec2_t: t

Type: int32_t

Definition: int32_t lw6mat_ivec2_t::t

Member of lw6mat_ivec2_t: t

Type: struct lw6mat_ivec2_t::9

Definition: struct lw6mat_ivec2_t::9 lw6mat_ivec2_t::t

Accessor with texture-like name.

Member of lw6mat_ivec2_t: v

Type: int32_t

Definition: int32_t lw6mat_ivec2_t::v[LW6MAT_VEC2_V_SIZE]

Accessor with array index.

Struct: lw6mat_ivec3_t

Integer vector with 3 elements (AKA 3D point).

Member of lw6mat_ivec3_t: x

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::x

Member of lw6mat_ivec3_t: y

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::y

Member of lw6mat_ivec3_t: z

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::z

Member of lw6mat_ivec3_t: p

Type: struct lw6mat_ivec3_t::10

Definition: struct lw6mat_ivec3_t::10 lw6mat_ivec3_t::p

Accessor with named/point coords.

Member of lw6mat_ivec3_t: r

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::r

Member of lw6mat_ivec3_t: g

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::g

Member of lw6mat_ivec3_t: b

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::b

Member of lw6mat_ivec3_t: c

Type: struct lw6mat_ivec3_t::11

Definition: struct lw6mat_ivec3_t::11 lw6mat_ivec3_t::c

Accessor with color-like name.

Member of lw6mat_ivec3_t: s

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::s

Member of lw6mat_ivec3_t: t

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::t

Member of lw6mat_ivec3_t: p

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::p

Member of lw6mat_ivec3_t: t

Type: struct lw6mat_ivec3_t::12

Definition: struct lw6mat_ivec3_t::12 lw6mat_ivec3_t::t

Accessor with texture-like name.

Member of lw6mat_ivec3_t: v

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::v[LW6MAT_VEC3_V_SIZE]

Accessor with array index.

Struct: lw6mat_ivec4_t

Integer vector with 4 elements (AKA quaternion).

Member of lw6mat_ivec4_t: x

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::x

Member of lw6mat_ivec4_t: y

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::y

Member of lw6mat_ivec4_t: z

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::z

Member of lw6mat_ivec4_t: w

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::w

Member of lw6mat_ivec4_t: p

Type: struct lw6mat_ivec4_t::13

Definition: struct lw6mat_ivec4_t::13 lw6mat_ivec4_t::p

Accessor with named/point coords.

Member of lw6mat_ivec4_t: r

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::r

Member of lw6mat_ivec4_t: g

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::g

Member of lw6mat_ivec4_t: b

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::b

Member of lw6mat_ivec4_t: a

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::a

Member of lw6mat_ivec4_t: c

Type: struct lw6mat_ivec4_t::14

Definition: struct lw6mat_ivec4_t::14 lw6mat_ivec4_t::c

Accessor with color-like name.

Member of lw6mat_ivec4_t: s

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::s

Member of lw6mat_ivec4_t: t

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::t

Member of lw6mat_ivec4_t: p

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::p

Member of lw6mat_ivec4_t: q

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::q

Member of lw6mat_ivec4_t: t

Type: struct lw6mat_ivec4_t::15

Definition: struct lw6mat_ivec4_t::15 lw6mat_ivec4_t::t

Accessor with texture-like name.

Member of lw6mat_ivec4_t: v

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::v[LW6MAT_VEC4_V_SIZE]

Accessor with array index.

Struct: lw6mat_xmat2_t

Fixed Point 2x2 matrix (AKA 2D rectangle).

Member of lw6mat_xmat2_t: m

Type: int32_t

Definition: int32_t lw6mat_xmat2_t::m[LW6MAT_MAT2_M_SIZE][LW6MAT_MAT2_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_xmat2_t: v

Type: int32_t

Definition: int32_t lw6mat_xmat2_t::v[LW6MAT_MAT2_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*3+j.

Struct: lw6mat_xmat3_t

Fixed Point 3x3 matrix (AKA 3D triangle).

Member of lw6mat_xmat3_t: m

Type: int32_t

Definition: int32_t lw6mat_xmat3_t::m[LW6MAT_MAT3_M_SIZE][LW6MAT_MAT3_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_xmat3_t: v

Type: int32_t

Definition: int32_t lw6mat_xmat3_t::v[LW6MAT_MAT3_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*3+j.

Struct: lw6mat_xmat4_t

Fixed Point 4x4 matrix (AKA 3D transformation/composition matrix).

Member of lw6mat_xmat4_t: m

Type: int32_t

Definition: int32_t lw6mat_xmat4_t::m[LW6MAT_MAT4_M_SIZE][LW6MAT_MAT4_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_xmat4_t: v

Type: int32_t

Definition: int32_t lw6mat_xmat4_t::v[LW6MAT_MAT4_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*4+j.

Struct: lw6mat_xvec2_t

Fixed Point vector with 2 elements (AKA 2D point).

Member of lw6mat_xvec2_t: x

Type: int32_t

Definition: int32_t lw6mat_xvec2_t::x

Member of lw6mat_xvec2_t: y

Type: int32_t

Definition: int32_t lw6mat_xvec2_t::y

Member of lw6mat_xvec2_t: p

Type: struct lw6mat_xvec2_t::24

Definition: struct lw6mat_xvec2_t::24 lw6mat_xvec2_t::p

Accessor with named/point coords.

Member of lw6mat_xvec2_t: s

Type: int32_t

Definition: int32_t lw6mat_xvec2_t::s

Member of lw6mat_xvec2_t: t

Type: int32_t

Definition: int32_t lw6mat_xvec2_t::t

Member of lw6mat_xvec2_t: t

Type: struct lw6mat_xvec2_t::25

Definition: struct lw6mat_xvec2_t::25 lw6mat_xvec2_t::t

Accessor with texture-like name.

Member of lw6mat_xvec2_t: v

Type: int32_t

Definition: int32_t lw6mat_xvec2_t::v[LW6MAT_VEC2_V_SIZE]

Accessor with array index.

Struct: lw6mat_xvec3_t

Fixed Point vector with 3 elements (AKA 3D point).

Member of lw6mat_xvec3_t: x

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::x

Member of lw6mat_xvec3_t: y

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::y

Member of lw6mat_xvec3_t: z

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::z

Member of lw6mat_xvec3_t: p

Type: struct lw6mat_xvec3_t::26

Definition: struct lw6mat_xvec3_t::26 lw6mat_xvec3_t::p

Accessor with named/point coords.

Member of lw6mat_xvec3_t: r

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::r

Member of lw6mat_xvec3_t: g

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::g

Member of lw6mat_xvec3_t: b

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::b

Member of lw6mat_xvec3_t: c

Type: struct lw6mat_xvec3_t::27

Definition: struct lw6mat_xvec3_t::27 lw6mat_xvec3_t::c

Accessor with color-like name.

Member of lw6mat_xvec3_t: s

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::s

Member of lw6mat_xvec3_t: t

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::t

Member of lw6mat_xvec3_t: p

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::p

Member of lw6mat_xvec3_t: t

Type: struct lw6mat_xvec3_t::28

Definition: struct lw6mat_xvec3_t::28 lw6mat_xvec3_t::t

Accessor with texture-like name.

Member of lw6mat_xvec3_t: v

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::v[LW6MAT_VEC3_V_SIZE]

Accessor with array index.

Struct: lw6mat_xvec4_t

Fixed Point vector with 4 elements (AKA quaternion).

Member of lw6mat_xvec4_t: x

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::x

Member of lw6mat_xvec4_t: y

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::y

Member of lw6mat_xvec4_t: z

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::z

Member of lw6mat_xvec4_t: w

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::w

Member of lw6mat_xvec4_t: p

Type: struct lw6mat_xvec4_t::29

Definition: struct lw6mat_xvec4_t::29 lw6mat_xvec4_t::p

Accessor with named/point coords.

Member of lw6mat_xvec4_t: r

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::r

Member of lw6mat_xvec4_t: g

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::g

Member of lw6mat_xvec4_t: b

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::b

Member of lw6mat_xvec4_t: a

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::a

Member of lw6mat_xvec4_t: c

Type: struct lw6mat_xvec4_t::30

Definition: struct lw6mat_xvec4_t::30 lw6mat_xvec4_t::c

Accessor with color-like name.

Member of lw6mat_xvec4_t: s

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::s

Member of lw6mat_xvec4_t: t

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::t

Member of lw6mat_xvec4_t: p

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::p

Member of lw6mat_xvec4_t: q

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::q

Member of lw6mat_xvec4_t: t

Type: struct lw6mat_xvec4_t::31

Definition: struct lw6mat_xvec4_t::31 lw6mat_xvec4_t::t

Accessor with texture-like name.

Member of lw6mat_xvec4_t: v

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::v[LW6MAT_VEC4_V_SIZE]

Accessor with array index.


Next: , Previous: , Up: C API   [Contents][Index]

5.33 libmsg

5.33.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/msg/index.html.

5.33.2 API

Function: char * lw6msg_cmd_generate_hello (lw6sys_context_t * sys_context, lw6nod_info_t * info)

sys_context: global system context

info: the node info to use

Generate a HELLO command.

Return value: newly allocated string.

Function: char * lw6msg_cmd_generate_ticket (lw6sys_context_t * sys_context, lw6nod_info_t * info, u_int64_t ticket)

sys_context: global system context

info: the node info to use

ticket: the ticket to send

Generate a TICKET command.

Return value: newly allocated string.

Function: char * lw6msg_cmd_generate_foo (lw6sys_context_t * sys_context, lw6nod_info_t * info, u_int32_t key, int serial)

sys_context: global system context

info: the node info to use

key: the key to identify the message

serial: serial number of latest data message

Generate a FOO command.

Return value: newly allocated string.

Function: char * lw6msg_cmd_generate_bar (lw6sys_context_t * sys_context, lw6nod_info_t * info, u_int32_t key, int serial)

sys_context: global system context

info: the node info to use

key: the key to identify the message

serial: serial number of latest data message

Generate a BAR command.

Return value: newly allocated string.

Function: char * lw6msg_cmd_generate_join (lw6sys_context_t * sys_context, lw6nod_info_t * info, int64_t seq, int serial)

sys_context: global system context

info: the node info to use

seq: the current seq

serial: the serial message number to start with

Generate a JOIN command. The seq parameter, if 0, means we want to request to join to a server. Wether this is a real server or a physical client acting as a server is out of consideration, 0 means request to join, period. If greater than 0, means we are accepting a client, and then the value is our current seq, which the client must use to calibrate its own data. The serial number is here to avoid querying messages before the join and keep the serie complete.

Return value: newly allocated string.

Function: char * lw6msg_cmd_generate_goodbye (lw6sys_context_t * sys_context, lw6nod_info_t * info)

sys_context: global system context

info: the node info to use

Generate a GOODBYE command.

Return value: newly allocated string.

Function: char * lw6msg_cmd_generate_data (lw6sys_context_t * sys_context, int serial, int i, int n, int64_t seq, const char * ker_msg)

sys_context: global system context

serial: the message serial number

i: the message index in the group

n: the number of messages in the group

seq: the message seq (round + an offset)

ker_msg: the actual content of the message (passed to core algo)

Generate a DATA command. Serial is an ever increasing number, i and n are most of the time 1 and 1, they are usefull only in long multipart messages.

Return value: newly allocated string.

Function: char * lw6msg_cmd_generate_meta (lw6sys_context_t * sys_context, int serial, int i, int n, int64_t seq, const lw6msg_meta_array_t * meta_array)

sys_context: global system context

serial: the message serial number

i: the message index in the group

n: the number of messages in the group

seq: the message seq (round + an offset)

meta_array: the content to send

Generate a META command. Serial is an ever increasing number, i and n are most of the time 1 and 1, they are usefull only in long multipart messages.

Return value: newly allocated string.

Function: char * lw6msg_cmd_generate_miss (lw6sys_context_t * sys_context, u_int64_t id_from, u_int64_t id_to, int serial_min, int serial_max)

sys_context: global system context

id_from: id of the node which didn’t send data correctly

id_to: id of the node which didn’t receive data correctly

serial_min: minimum serial number of unsent/unreceived messages

serial_max: maximum serial number of unsent/unreceived messages

Generate a MISS command. This will request anyone who has the messages mentionned in stock to resent them to the one who’s asking for them.

Return value: newly allocated string.

Function: int lw6msg_cmd_analyse_hello (lw6sys_context_t * sys_context, lw6nod_info_t ** info, const char * msg)

sys_context: global system context

info: will contain (remote) node info on success

msg: the message to analyse

Analyzes a HELLO message.

Return value: 1 on success, 0 on failure

Function: int lw6msg_cmd_analyse_ticket (lw6sys_context_t * sys_context, lw6nod_info_t ** info, u_int64_t * ticket, const char * msg)

sys_context: global system context

info: will contain (remote) node info on success

ticket: if not NULL, will contain the ticket value on success

msg: the message to analyse

Analyzes a TICKET message.

Return value: 1 on success, 0 on failure

Function: int lw6msg_cmd_analyse_foo (lw6sys_context_t * sys_context, lw6nod_info_t ** info, u_int32_t * key, int * serial, const char * msg)

sys_context: global system context

info: will contain (remote) node info on success

key: if not NULL, will contain the foo/bar key on success

serial: if not NULL, will contain the latest serial number of peer

msg: the message to analyse

Analyzes a FOO message.

Return value: 1 on success, 0 on failure

Function: int lw6msg_cmd_analyse_bar (lw6sys_context_t * sys_context, lw6nod_info_t ** info, u_int32_t * key, int * serial, const char * msg)

sys_context: global system context

info: will contain (remote) node info on success

key: if not NULL, will contain the foo/bar key on success

serial: if not NULL, will contain the latest serial number of peer

msg: the message to analyse

Analyzes a BAR message.

Return value: 1 on success, 0 on failure

Function: int lw6msg_cmd_analyse_join (lw6sys_context_t * sys_context, lw6nod_info_t ** info, lw6nod_info_t * local_info, int64_t * seq, int * serial, const char * msg)

sys_context: global system context

info: will contain (remote) node info on success

local_info: local node info to be updated (peer_id list), can be NULL

seq: sequence used to initialize communication

serial: serial used to initialize communication

msg: the message to analyse

Analyzes a JOIN message.

Return value: 1 on success, 0 on failure

Function: int lw6msg_cmd_analyse_goodbye (lw6sys_context_t * sys_context, lw6nod_info_t ** info, const char * msg)

sys_context: global system context

info: will contain (remote) node info on success

msg: the message to analyse

Analyzes a GOODBYE message.

Return value: 1 on success, 0 on failure

Function: int lw6msg_cmd_analyse_data (lw6sys_context_t * sys_context, int * serial, int * i, int * n, int64_t * seq, char ** ker_msg, const char * msg)

sys_context: global system context

serial: will contain serial number on success

i: will contain group index on success

n: will contain group size on success

seq: will contain seq on success (round + an offset)

ker_msg: will contain actual message on success

msg: the message to analyze

Analyzes a DATA message.

Return value: 1 on success, 0 on failure

Function: int lw6msg_cmd_analyse_meta (lw6sys_context_t * sys_context, int * serial, int * i, int * n, int64_t * seq, lw6msg_meta_array_t * meta_array, const char * msg)

sys_context: global system context

serial: will contain serial number on success

i: will contain group index on success

n: will contain group size on success

seq: will contain seq on success (round + an offset)

meta_array: will contain the content on success

msg: the message to analyze

Analyzes a META message.

Return value: 1 on success, 0 on failure

Function: int lw6msg_cmd_analyse_miss (lw6sys_context_t * sys_context, u_int64_t * id_from, u_int64_t * id_to, int * serial_min, int * serial_max, const char * msg)

sys_context: global system context

id_from: will contain the id of the node which didn’t send data correctly

id_to: will contain the id of the node which didn’t receive data correctly

serial_min: will contain the minimum serial number of unsent/unreceived messages

serial_max: will contain the maximum serial number of unsent/unreceived messages

msg: the message to analyze

Analyzes a MISS message.

Return value: 1 on success, 0 on failure

Function: char * lw6msg_cmd_guess_from_url (lw6sys_context_t * sys_context, const char * msg)

sys_context: global system context

msg: the message to analyse

Analyzes a GOODBYE message.

Return value: the from url, if found (dynamically allocated)

Function: char * lw6msg_envelope_generate (lw6sys_context_t * sys_context, lw6msg_envelope_mode_t mode, const char * version, const char * password_checksum, u_int32_t physical_ticket_sig, u_int32_t logical_ticket_sig, u_int64_t physical_from_id, u_int64_t physical_to_id, u_int64_t logical_from_id, u_int64_t logical_to_id, const char * msg)

sys_context: global system context

mode: mode to use (a la TELNET or URL compatible)

version: the program version to use (note: can be changed when testing)

password_checksum: the password string to send

physical_ticket_sig: the signature of the message, calculated with ticket + physical from/to

logical_ticket_sig: the signature of the message, calculated with ticket + logical from/to

physical_from_id: the sender id

physical_to_id: the receiver id

logical_from_id: the message creator id

logical_to_id: the message final destination id

msg: the body of the message

Generate an envelope, that is, the complete message sendable on the network.

Return value: newly allocated string.

Function: int lw6msg_envelope_analyse (lw6sys_context_t * sys_context, const char * envelope, lw6msg_envelope_mode_t mode, const char * local_url, const char * password, u_int64_t expected_physical_from_id, u_int64_t expected_physical_to_id, char ** msg, u_int32_t * physical_ticket_sig, u_int32_t * logical_ticket_sig, u_int64_t * physical_from_id, u_int64_t * physical_to_id, u_int64_t * logical_from_id, u_int64_t * logical_to_id, char ** physical_from_url)

sys_context: global system context

envelope: the envelope to analyse

mode: mode to use (a la TELNET or URL compatible)

local_url: the url of local server (usefull for password)

password: the password to check against

expected_physical_from_id: the sender id, if NULL, no check performed

expected_physical_to_id: the receiver id, if NULL, no check performed

msg: if not NULL, will contain body of the message

physical_ticket_sig: if not NULL, will contain signature of message, calculated with ticket

logical_ticket_sig: if not NULL, will contain signature of message, calculated with ticket

physical_from_id: if not NULL, will contain sender id

physical_to_id: if not NULL, will contain receiver id

logical_from_id: if not NULL, will contain message creator id

logical_to_id: if not NULL, will contain message final destination id

physical_from_url: if not NULL and if message allows, will contain sender public URL

Generate an envelope, that is, the complete message sendable on the network.

Return value: newly allocated string.

Function: void lw6msg_meta_array_zero (lw6sys_context_t * sys_context, lw6msg_meta_array_t * meta_array)

sys_context: global system context

meta_array: meta meta_array (list of nodes) to modify

Fills the meta meta_array with zeroes, emptying all nodes.

Return value: none

Function: int lw6msg_meta_array_find (lw6sys_context_t * sys_context, const lw6msg_meta_array_t * meta_array, u_int64_t node_id)

sys_context: global system context

meta_array: meta meta_array (list of nodes) to modify

node_id: the ID (64-bit) of the node to seartch

Registers a node in the meta_array.

Return value: 1 if registered, 0 if not (possible error: no place left)

Function: int lw6msg_meta_array_exists (lw6sys_context_t * sys_context, const lw6msg_meta_array_t * meta_array, u_int64_t node_id)

sys_context: global system context

meta_array: meta meta_array (list of nodes) to modify

node_id: the ID (64-bit) of the node to test

Registers a node in the meta_array.

Return value: 1 if registered, 0 if not (possible error: no place left)

Function: int lw6msg_meta_array_set (lw6sys_context_t * sys_context, lw6msg_meta_array_t * meta_array, u_int64_t node_id, int serial_0, int64_t seq_0)

sys_context: global system context

meta_array: meta meta_array (list of nodes) to modify

node_id: the ID (64-bit) of the node to add

serial_0: base serialfor the node to add

seq_0: base seq for for node to add

Registers a node in the meta_array.

Return value: 1 if registered, 0 if not (possible error: no place left)

Function: int lw6msg_meta_array_unset (lw6sys_context_t * sys_context, lw6msg_meta_array_t * meta_array, u_int64_t node_id)

sys_context: global system context

meta_array: meta meta_array (list of nodes) to modify

node_id: the ID (64-bit) of the node to remove

Unregisters a node in the meta_array.

Return value: 1 if node existed, 0 if it was not here

Function: int lw6msg_meta_str2array (lw6sys_context_t * sys_context, lw6msg_meta_array_t * meta_array, const char * str)

sys_context: global system context

meta_array: meta meta_array (list of nodes) to get (out param)

str: meta string (list of nodes) to be put in the meta_array

Transforms a string describing the nodes and their id/serial/seq into a more usable C structure.

Return value: 1 if parseable and success, 0 if not.

Function: char * lw6msg_meta_array2str (lw6sys_context_t * sys_context, const lw6msg_meta_array_t * meta_array)

sys_context: global system context

meta_array: meta meta_array (list of nodes) to transform as a string

Transforms a C struct describing the nodes and their id/serial/seq into a string transmittable on the network.

Return value: dynamically allocated string

Function: char * lw6msg_oob_generate_info (lw6sys_context_t * sys_context, lw6nod_info_t * info)

sys_context: global system context

info: the node to generate info about

Generates a standard response to the INFO question for OOB (out of band) messages. The same message is sent, be it on http or tcp or udp, so it’s factorized here. Function will lock the info object when needed.

Return value: newly allocated string.

Function: char * lw6msg_oob_generate_list (lw6sys_context_t * sys_context, lw6nod_info_t * info)

sys_context: global system context

info: the node to generate info about

Generates a standard response to the LIST question for OOB (out of band) messages. The same message is sent, be it on http or tcp or udp, so it’s factorized here. Function will lock the info object when needed. There’s a max length because we don’t want the udp buffer to be saturated + too long lists do not really mean anything anyway.

Return value: newly allocated string.

Function: char * lw6msg_oob_generate_pong (lw6sys_context_t * sys_context, lw6nod_info_t * info)

sys_context: global system context

info: the node to generate info about

Generates a standard response to the PING question for OOB (out of band) messages. The same message is sent, be it on http or tcp or udp, so it’s factorized here. Function will lock the info object when needed.

Return value: newly allocated string.

Function: char * lw6msg_oob_generate_request (lw6sys_context_t * sys_context, const char * command, const char * remote_url, const char * password, const char * local_url)

sys_context: global system context

command: the command to send (PING, INFO, LIST)

remote_url: the remote URL (used to seed password)

password: the password, can be NULL or ""

local_url: the public URL to send along with the message, can be NULL or ""

Generates a simple clear text OOB request, with a password if needed.

Return value: a newly allocated string

Function: int lw6msg_oob_analyse_request (lw6sys_context_t * sys_context, int * syntax_ok, char ** command, int * password_ok, char ** remote_url, const char * request, const char * local_url, const char * password)

sys_context: global system context

syntax_ok: will contain 1 if syntax is OK, 0 if not

command: the command (out param, needs *not* to be freed)

password_ok: will contain 1 if password is OK, 0 if not

remote_url: the URL detected, if provided (out param, does needs to be freed)

request: the request to analyse

local_url: the local url (used to seed password)

password: the password to check against

Analyses a simple OOB message of the form COMMAND <passwd> <url>.

Return value: 1 if OK, 0 if not. If 0, check the value of password_ok.

Function: char * lw6msg_oob_analyse_pong (lw6sys_context_t * sys_context, const char * text)

sys_context: global system context

text: the text of the message to parse

Analyses a PONG message and gets the public_url from it, if it exists.

Return value: newly allocated string containing public_url if OK, NULL on error.

Function: int lw6msg_sort_str_by_seq_callback (lw6sys_context_t * sys_context, void * func_data, const void * ptr_a, const void * ptr_b)

sys_context: global system context

func_data: function specific data

ptr_a: pointer to a string

ptr_b: pointer to a string

Sort callback for a list containing strings which begin by a seq number, will sort with lower seq number first.

Return value: -1 if ptr_a < ptr_b , 0 if ptr_a == ptr_b, 1 if ptr_a > ptr_b

Function: int lw6msg_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libmsg module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6msg_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the msg module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Function: u_int32_t lw6msg_ticket_calc_sig (lw6sys_context_t * sys_context, u_int64_t ticket, u_int64_t from_id, u_int64_t to_id, const char * msg)

sys_context: global system context

ticket: the (private) ticket to use

from_id: the sender/creator

to_id: the receiver/target

msg: the message to sign

Produces a little signature, which is clearly vulnerable to brute-force attacks but makes it possible to be 100% sure if it’s wrong, someone is trying to do something nasty (or there’s a serious bug!).

Return value: the sig, always non-zero

Function: int lw6msg_ticket_check_sig (lw6sys_context_t * sys_context, u_int64_t ticket, u_int64_t from_id, u_int64_t to_id, const char * msg, u_int32_t ticket_sig)

sys_context: global system context

ticket: the (private) ticket to use

from_id: the sender/creator

to_id: the receiver/target

msg: the message to sign

ticket_sig: the signature to check against

Checks a sig is OK.

Return value: 1 if they are the same, 0 if not.

Function: int lw6msg_utils_parse_key_value_to_ptr (lw6sys_context_t * sys_context, char ** key, char ** value, const char * line)

sys_context: global system context

key: will contain the key detected

value: will contain the value detected

line: the line to analyse

Analyses a trivial "KEY value" line and returns the key and the value in the passed pointers.

Return value: 1 if line OK (and in this case key and value are set), 0 if not.

Function: int lw6msg_utils_parse_key_value_to_assoc (lw6sys_context_t * sys_context, lw6sys_assoc_t ** assoc, const char * line)

sys_context: global system context

assoc: an assoc object which will contain the result

line: the line to analyse

Analyses a trivial "KEY value" line and sets the assoc parameter according to detected values. Note that assoc must be set to contain string, and free them automatically with lw6sys_free_callback for instance.

Return value: 1 if line OK (and in this case assoc is updated), 0 if not.

Function: char * lw6msg_utils_get_assoc_str_with_default (lw6sys_context_t * sys_context, lw6sys_assoc_t * assoc, const char * key, const char * default_value)

sys_context: global system context

assoc: the string assoc to query

key: the key to find in the assoc

default_value: the default value to return

Queries a string assoc for a given value, and if not available, returns default value. Not that default value (nor the assoc value) is copied, so you must take care all remain valid until usage of returned value is over.

Return value: a string, must not be freed.

Function: int lw6msg_utils_get_assoc_int_with_default (lw6sys_context_t * sys_context, lw6sys_assoc_t * assoc, const char * key, int default_value)

sys_context: global system context

assoc: the string assoc to query

key: the key to find in the assoc

default_value: the default value to return

Queries a string assoc for a given value, and if not available, returns default value. Not that default value (nor the assoc value) is copied, so you must take care all remain valid until usage of returned value is over. This one will returned an int converted with lw6sys_atoi.

Return value: a string, must not be freed.

Function: int lw6msg_word_first (lw6sys_context_t * sys_context, lw6msg_word_t * word, char ** next, const char * msg)

sys_context: global system context

word: will contain the parsed word

next: if NOT NULL, will contain a (non freeable) pointer on remaining message

msg: the message to parse

Analyses a message and gets the first word. This word is put in buf member with its length. next is usefull if you want to parse the rest of the message, it points at the beginning of it.

Return value: 1 on success, 0 on failure.

Function: int lw6msg_word_first_x (lw6sys_context_t * sys_context, lw6msg_word_t * word, char ** next, const char * msg)

sys_context: global system context

word: will contain the parsed word

next: if NOT NULL, will contain a (non freeable) pointer on remaining message

msg: the message to parse

Analyses a message and gets the first word. This word is put in buf member with its length. next is usefull if you want to parse the rest of the message, it points at the beginning of it. This special x function will consider slash ("/") as valid separator. It can’t be used all the time but for almost every field but URLs, it’s fine. Internally, this one is used to parse integers, IDs, etc.

Return value: 1 on success, 0 on failure.

Function: int lw6msg_word_first_base64 (lw6sys_context_t * sys_context, lw6msg_word_t * word, char ** next, const char * msg)

sys_context: global system context

word: will contain the parsed word

next: if NOT NULL, will contain a (non freeable) pointer on remaining message

msg: the message to parse

Analyses a message and gets the first word. This word is put in buf member with its length. next is usefull if you want to parse the rest of the message, it points at the beginning of it. The word is expected to be base64 encoded and is decoded on-the-fly.

Return value: 1 on success, 0 on failure.

Function: int lw6msg_word_first_int_32 (lw6sys_context_t * sys_context, int32_t * parsed_value, char ** next, const char * msg)

sys_context: global system context

parsed_value: will contain the parsed value

next: if NOT NULL, will contain a (non freeable) pointer on remaining message

msg: the message to parse

Analyses a message, gets the first word and interpret it as an int.

Return value: 1 on success, 0 on failure.

Function: int lw6msg_word_first_int_32_ge0 (lw6sys_context_t * sys_context, int32_t * parsed_value, char ** next, const char * msg)

sys_context: global system context

parsed_value: will contain the parsed value

next: if NOT NULL, will contain a (non freeable) pointer on remaining message

msg: the message to parse

Analyses a message, gets the first word and interpret it as an int. The value must be strictly greater than 0.

Return value: 1 on success, 0 on failure.

Function: int lw6msg_word_first_int_32_gt0 (lw6sys_context_t * sys_context, int32_t * parsed_value, char ** next, const char * msg)

sys_context: global system context

parsed_value: will contain the parsed value

next: if NOT NULL, will contain a (non freeable) pointer on remaining message

msg: the message to parse

Analyses a message, gets the first word and interpret it as an int. The value must be strictly greater than 0.

Return value: 1 on success, 0 on failure.

Function: int lw6msg_word_first_int_64 (lw6sys_context_t * sys_context, int64_t * parsed_value, char ** next, const char * msg)

sys_context: global system context

parsed_value: will contain the parsed value

next: if NOT NULL, will contain a (non freeable) pointer on remaining message

msg: the message to parse

Analyses a message, gets the first word and interpret it as an int.

Return value: 1 on success, 0 on failure.

Function: int lw6msg_word_first_int_64_ge0 (lw6sys_context_t * sys_context, int64_t * parsed_value, char ** next, const char * msg)

sys_context: global system context

parsed_value: will contain the parsed value

next: if NOT NULL, will contain a (non freeable) pointer on remaining message

msg: the message to parse

Analyses a message, gets the first word and interpret it as an int. The value must be strictly greater than 0.

Return value: 1 on success, 0 on failure.

Function: int lw6msg_word_first_int_64_gt0 (lw6sys_context_t * sys_context, int64_t * parsed_value, char ** next, const char * msg)

sys_context: global system context

parsed_value: will contain the parsed value

next: if NOT NULL, will contain a (non freeable) pointer on remaining message

msg: the message to parse

Analyses a message, gets the first word and interpret it as an int. The value must be strictly greater than 0.

Return value: 1 on success, 0 on failure.

Function: int lw6msg_word_first_id_16 (lw6sys_context_t * sys_context, u_int16_t * parsed_value, char ** next, const char * msg)

sys_context: global system context

parsed_value: will contain the parsed value

next: if NOT NULL, will contain a (non freeable) pointer on remaining message

msg: the message to parse

Analyses a message, gets the first word and interpret it as an 16-bit id.

Return value: 1 on success, 0 on failure.

Function: int lw6msg_word_first_id_32 (lw6sys_context_t * sys_context, u_int32_t * parsed_value, char ** next, const char * msg)

sys_context: global system context

parsed_value: will contain the parsed value

next: if NOT NULL, will contain a (non freeable) pointer on remaining message

msg: the message to parse

Analyses a message, gets the first word and interpret it as an 32-bit id.

Return value: 1 on success, 0 on failure.

Function: int lw6msg_word_first_id_64 (lw6sys_context_t * sys_context, u_int64_t * parsed_value, char ** next, const char * msg)

sys_context: global system context

parsed_value: will contain the parsed value

next: if NOT NULL, will contain a (non freeable) pointer on remaining message

msg: the message to parse

Analyses a message, gets the first word and interpret it as an 64-bit id.

Return value: 1 on success, 0 on failure.

Function: char * lw6msg_z_encode (lw6sys_context_t * sys_context, const char * msg, int limit)

sys_context: global system context

msg: message to encode

limit: if under this limit (length in bytes), do not encode, return as is

Z-encode a message, by "Z-encoding" we mean pass the string through 1) zlib then 2) base64 encoding, this way we get a string without any blank and/or special character, and of reasonnable length. There’s an optional limit *not* to encode anything, just when we know there are no special characters to escape and string is small, it’s useless to fire this big artillery.

Return value: newly allocated string, 0 terminated, NULL on error.

Function: char * lw6msg_z_decode (lw6sys_context_t * sys_context, const char * msg)

sys_context: global system context

msg: message to decode

Z-decode a message, by "Z-encoding" we mean pass the string through 1) zlib then 2) base64 encoding, this way we get a string without any blank and/or special character, and of reasonnable length. This decode string does it the reverse way, un64-encode the string then uncompress it back to a readable string.

Return value: newly allocated string, 0 terminated, NULL on error.

Struct: lw6msg_meta_array_item_s
Member of lw6msg_meta_array_item_s: node_id

Type: u_int64_t

Definition: u_int64_t lw6msg_meta_array_item_s::node_id

Member of lw6msg_meta_array_item_s: serial_0

Type: int

Definition: int lw6msg_meta_array_item_s::serial_0

Member of lw6msg_meta_array_item_s: seq_0

Type: int64_t

Definition: int64_t lw6msg_meta_array_item_s::seq_0

Struct: lw6msg_meta_array_s
Member of lw6msg_meta_array_s: logical_from

Type: u_int64_t

Definition: u_int64_t lw6msg_meta_array_s::logical_from

Member of lw6msg_meta_array_s: items

Type: lw6msg_meta_array_item_t

Definition: lw6msg_meta_array_item_t lw6msg_meta_array_s::items[LW6MSG_NB_META_ARRAY_ITEMS]

Struct: lw6msg_word_s

This structure is used to retrieve words from messages. We use a structure here with a fixed sized buffer and a len member, this is to avoid mallocating too often when parsing.

Member of lw6msg_word_s: len

Type: int

Definition: int lw6msg_word_s::len

Length of word, in bytes.

Member of lw6msg_word_s: buf

Type: char

Definition: char lw6msg_word_s::buf[LW6MSG_MAX_WORD_SIZE+1]

Word data, containing a 0 char at the end, so it is safe to call standard C string functions on it.


Next: , Previous: , Up: C API   [Contents][Index]

5.34 libnet

5.34.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/net/index.html.

5.34.2 API

Function: int lw6net_is_connectable (lw6sys_context_t * sys_context, const char * ip, int port)

sys_context: global system context

ip: IP address

port: IP port

Tells wether we’re likely to be able to connect on a given host and port. This is to save ressources, any call to connect which fails will register an entry that says "OK this is rotten, don’t try it before some time, you’ll waste your ressources trying to do this".

Return value: 1 if connectable, 0 if not.

Function: void lw6net_set_connectable (lw6sys_context_t * sys_context, const char * ip, int port, int status)

sys_context: global system context

ip: IP address

port: IP port

status: status, set to 1 if connectable, 0 if not

Registers a destination ip: port as connectable or not. Connectable means, there are chances that a connect on this might return true. The information will be kept in a cache. This is to avoid too many low-level calls to connect, the information will be kept in cache "for some time", and this way connect will return "can’t connect" right away and not even try to connect, therefore saving ressources.

Return value: none.

Function: int lw6net_dns_is_ip (lw6sys_context_t * sys_context, const char * ip)

ip: the string to check

Tests if a given string is a valid IP (IPV4). Test is only syntaxic, it’s just to know if we’re likely to need to query the DNS, it does not mean the IP is *really* valid.

Return value: 1 if it’s an IP, O if not.

Function: char * lw6net_dns_gethostbyname (lw6sys_context_t * sys_context, const char * name)

name: name of the host

A wrapper over the standard gethostbyname function, will even accept an IP as an input (in this case, will copy it...) and allocate a new string for the result.

Return value: an IP if success, NULL on error.

Function: int lw6net_dns_lock (lw6sys_context_t * sys_context)

sys_context: global system context

Locks access to dns function lw6net_dns_gethostbyname. This is because gethostbyname isn’t reentrant plus, even if we didn’t use it but its multithreadable equivalent (which is however not standard and always available) other libs (such as libcurl not to name it) might use this function too so in a general manner it’s a good idea to use a mutex to protect multiple accesses to this.

Return value: an IP if success, 0 on error.

Function: int lw6net_dns_unlock (lw6sys_context_t * sys_context)

sys_context: global system context

Unlocks access to dns function lw6net_dns_gethostbyname.

Return value: an IP if success, 0 on error.

Function: int lw6net_last_error (lw6sys_context_t * sys_context)

sys_context: global system context

Reports the last network error. This is basically a debug function, designed mostly for Microsoft Winsock API, but can be safely called on any platform.

Return value: the last error code, has no universal meaning, depends on the platform you’re working on.

Function: char * lw6net_if_guess_local (lw6sys_context_t * sys_context)

sys_context: global system context

Guess the local IP address. This is not fool-proof, and it probably cannot be as we can’t handle all user-specific configs involving multiple IP addresses, virtual private networks, and so on. But this is just to provide a default public IP address when starting a network game, saavy users can always specify the right interface/address if needed. Will return NULL if interface can’t be guessed.

Return value: the IP as a string, dynamically allocated

Function: char * lw6net_if_guess_public_url (lw6sys_context_t * sys_context, const char * bind_ip, int bind_port)

sys_context: global system context

bind_ip: the IP address used to bind on

bind_port: the IP port used to bind on

Guess the server public url, based on lw6net_if_guess_local which tries to find a valid local IP address which is not loopback. This is only in case bind_ip is 0.0.0.0 (listen on all addresses) else it will just use bind_ip as you would expect. Function isn’t foolproof, that’s why one can override its default with a user settings.

Return value: the IP as a string, dynamically allocated

Function: char * lw6net_recv_line_tcp (lw6sys_context_t * sys_context, int * sock)

sys_context: global system context

sock: the socket descriptor

Receives a line terminated by LF ("\n", chr(10)) or CR/LF ("\r\n", chr(10)chr(13)) on a TCP socket, that is, stream oriented. If there’s no complete line available, function returns immediately with NULL. Same if socket is closed, broken, whatever. Only if there’s something consistent will the function return non-NULL. Socket descriptor is closed on the fly on connection problem.

Return value: a dynamically allocated string with the content received. The tailing (CR)/LF is stripped.

Function: int lw6net_send_line_tcp (lw6sys_context_t * sys_context, int * sock, const char * line)

sys_context: global system context

sock: the socket descriptor

line: the line to be sent, without the "\n" at the end

Sends a line terminated by LF ("\n", chr(10)) on a TCP socket, that is, stream oriented. The "\n" is automatically added, do not bother sending it. Socket descriptor is closed on the fly on connection problem.

Return value: non-zero if success

Function: char * lw6net_recv_line_udp (lw6sys_context_t * sys_context, int sock, char ** incoming_ip, int * incoming_port)

sys_context: global system context

sock: the socket descriptor

incoming_ip: the IP address of the sender (returned)

incoming_port: the IP port of the sender (returned)

Receives a line terminated by LF ("\n", chr(10)) or CR/LF ("\r\n", chr(10)chr(13)) on a UDP socket, that is, datagram oriented. If there’s no complete line available, function returns immediately with NULL. Same if socket is closed, broken, whatever. Only if there’s something consistent will the function return non-NULL. By-value parameters allow the caller to know where the data come from.

Return value: a dynamically allocated string with the content received. The tailing (CR)/LF is stripped.

Function: lw6sys_list_t * lw6net_recv_lines_udp (lw6sys_context_t * sys_context, int sock, char ** incoming_ip, int * incoming_port)

sys_context: global system context

sock: the socket descriptor

incoming_ip: the IP address of the sender (returned)

incoming_port: the IP port of the sender (returned)

Receives several lines terminated by LF ("\n", chr(10)) or CR/LF ("\r\n", chr(10)chr(13)) on a UDP socket, that is, datagram oriented. If there’s no complete line available, function returns immediately with NULL. Same if socket is closed, broken, whatever. Only if there’s something consistent will the function return non-NULL. By-value parameters allow the caller to know where the data come from. This variant of lw6net_recv_line_tcp will return a list of lines, this is mandatory since in UDP we can’t call recv several times.

Return value: a list of dynamically allocated strings. The tailing (CR)/LF is stripped from strings.

Function: int lw6net_send_line_udp (lw6sys_context_t * sys_context, int sock, const char * line, const char * ip, int port)

sys_context: global system context

sock: the socket descriptor

line: the line to be sent, without the "\n" at the end

ip: the IP address of the target

port: the IP port of the target

Sends a line terminated by LF ("\n", chr(10)) on a UDP socket, that is, datagram oriented. The "\n" is automatically added, do not bother sending it.

Return value: the number of bytes sent, 0 if failure

Function: int lw6net_init (lw6sys_context_t * sys_context, int argc, const char * [] argv, int net_log)

sys_context: global system context

argc: argc as passed to main

argv: argv as passed to main

net_log: 1 if you want to enable net log, 0 if not

Initializes the low-level network API, you must call this before calling any other network related function, for it allocates a dynamic context which is in turn used by every function.

Return value: non-zero if success

Function: void lw6net_quit (lw6sys_context_t * sys_context)

sys_context: global system context

Frees memory, joins active threads, and releases everything set up by network code.

Return value: void

Function: int lw6net_socket_set_blocking_mode (lw6sys_context_t * sys_context, int sock, int mode)

sys_context: global system context

sock: the socket to modify

mode: the mode to use (1 -> blocking mode, 0 -> non-blocking)

Sets the blocking mode of a socket, the reason we use this is that ioctl isn’t portable (ioctlsocket on MS-Windows).

Return value: 1 on success, 0 on failure.

Function: int lw6net_socket_is_valid (lw6sys_context_t * sys_context, int sock)

sys_context: global system context

sock: the socket to test

Tells if a socket is valid or not. This does not mean the socket is opened/connected and/or the peer is reachable, it just checks the socket is a valid descriptor. In practice it’s just to avoid copy/pasting if (sock>=0)" everywhere.

Return value: 1 if valid, 0 if not

Function: void lw6net_socket_close (lw6sys_context_t * sys_context, int * sock)

sys_context: global system context

sock: the socket to close

Closes a socket, that is, stop activity and free its descriptor. This function will take a pointer on the socket, this is done on purpose, the idea is to make sure once the socket is closed it’s never used again within the code, so we modify the pointed value in place.

Return value: none.

Function: int lw6net_tcp_listen (lw6sys_context_t * sys_context, const char * ip, int port)

sys_context: global system context

ip: IP address to bind to

port: IP port to listen on

Listens in TCP on a given port.

Return value: >=0 on success, -1 on failure.

Function: int lw6net_tcp_accept (lw6sys_context_t * sys_context, char ** incoming_ip, int * incoming_port, int listening_sock, int delay_msec)

sys_context: global system context

incoming_ip: address of remote peer (out param, dynamically allocated)

incoming_port: port of remote peer (out param)

listening_sock: socket to listen on

delay_msec: delay, in msec, after which we stop accepting

Accepts for a connexion on the given socket.

Return value: the new socket (>=0) if accepted, else -1

Function: int lw6net_tcp_connect (lw6sys_context_t * sys_context, const char * ip, int port, int delay_msec)

sys_context: global system context

ip: address to connect to

port: port to connect to

delay_msec: delay before we consider it’s too late

Tries to connect on a given socket.

Return value: socket (>=0) on success, else -1

Function: int lw6net_tcp_send (lw6sys_context_t * sys_context, int * sock, const char * buf, int len, int delay_msec, int loop)

sys_context: global system context

sock: socket to use

buf: data buffer

len: data buffer length

delay_msec: delay after which we give up

loop: accept to do several calls if needed

Will send data, possibly looping until all is send, and waiting for a maximum time of delay_msec. If the send reveals a socket closed by peer or other serious problem, socket is closed and sock set to -1.

Return value: 1 on success, 0 on failure.

Function: int lw6net_tcp_peek (lw6sys_context_t * sys_context, int * sock, char * buf, int len, int delay_msec)

sys_context: global system context

sock: socket to use

buf: data buffer

len: data buffer length

delay_msec: maximum time to wait

Tells wether data is available. Will actually fill the buffer with the data, but not remove it from the fifo list. If the peel reveals a socket closed by peer or other serious problem, socket is closed and sock set to -1.

Return value: number of bytes available, 0 when nothing

Function: int lw6net_tcp_recv (lw6sys_context_t * sys_context, int * sock, char * buf, int len, int delay_msec, int loop)

sys_context: global system context

sock: socket to use

buf: data buffer

len: data buffer length

delay_msec: maximum time to wait

loop: wether to loop or not

If data is available, put it in buffer. If needed, will loop until delay_msec is elapsed. Data is removed from queue. If the peel reveals a socket closed by peer or other serious problem, socket is closed and sock set to -1.

Return value: number of bytes received, 0 when nothing

Function: int lw6net_tcp_is_alive (lw6sys_context_t * sys_context, int * sock)

sys_context: global system context

sock: socket to test

Tells wether a socket is alive and able to send data. This function will attempt a write to test if it’s really usable. If not, will close in on the fly.

Return value: 1 if alive, 0 if not.

Function: int lw6net_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libnet module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6net_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the net module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6net_udp_client (lw6sys_context_t * sys_context)

sys_context: global system context

Creates an UDP client socket, that is, creates it and does not bind it to any address.

Return value: socket (>=0) on success, else -1

Function: int lw6net_udp_server (lw6sys_context_t * sys_context, const char * ip, int port)

sys_context: global system context

ip: IP address to bind to

port: IP port to listen on

Creates an UDP listening socket, that is, creates it and binds it on a given address.

Return value: socket (>=0) on success, else -1

Function: int lw6net_udp_send (lw6sys_context_t * sys_context, int sock, const char * buf, int len, const char * ip, int port)

sys_context: global system context

sock: socket to use

buf: data buffer

len: data buffer length

ip: IP address to send data to

port: IP port to send data to

Sends an UDP datagram. Size can’t be longer than about 1400 bytes, see problems about MTU, in practice all values arround 1000 are quite safe, 500 is pretty much garanteed to work everywhere, and for various reasons 1452 is a good maximum bet.

Return value: number of bytes sent

Function: int lw6net_udp_peek (lw6sys_context_t * sys_context, int sock, char * buf, int len, char ** incoming_ip, int * incoming_port)

sys_context: global system context

sock: socket to use

buf: data buffer

len: data buffer length

Peeks for a UDP datagram. Will not remove the data from queue.

Return value: number of bytes received

Function: int lw6net_udp_recv (lw6sys_context_t * sys_context, int sock, char * buf, int len, char ** incoming_ip, int * incoming_port)

sys_context: global system context

sock: socket to use

buf: data buffer

len: data buffer length

Receives a UDP datagram. Will remove the data from queue.

Return value: number of bytes received


Next: , Previous: , Up: C API   [Contents][Index]

5.35 libnod

5.35.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/nod/index.html.

5.35.2 API

Function: int lw6nod_info_community_add (lw6sys_context_t * sys_context, lw6nod_info_t * info, u_int64_t id, const char * url)

sys_context: global system context

info: node info object to modify

id: ID of the new member

url: URL of the new member, can be NULL

Adds a new member to the community.

Return value: 1 if new member could be added, 0 if not.

Function: int lw6nod_info_community_is_member (lw6sys_context_t * sys_context, lw6nod_info_t * info, u_int64_t id, const char * url)

sys_context: global system context

info: node info object to test

id: ID of the member we want to check

url: URL of the member we want to check

Tells wether a member is already in the community. Note that if there’s a member with the same URL but with a different ID, or a member with the same ID but a different URL, the function will fail, we need URLs and IDs to both be different for the peer to be added. Not respecting this would lead to confusion, while sharing an ID is conceivable over the whole network, it can’t be tolerated within a community. Same for the URL.

Return value: 1 if new member could be added, 0 if not.

Function: int lw6nod_info_community_has_id (lw6sys_context_t * sys_context, lw6nod_info_t * info, u_int64_t id)

sys_context: global system context

info: node info object to test

id: ID of the member we want to check

Tells wether a member exists with this ID. Will test both ourselves and remote peers.

Return value: 1 if ID is already taken, 0 if available.

Function: int lw6nod_info_community_has_id_without_url (lw6sys_context_t * sys_context, lw6nod_info_t * info, u_int64_t id)

sys_context: global system context

info: node info object to test

id: ID of the member we want to check

Tells wether a member exists with this ID, but for which we don’t know the URL, that is, url is NULL.

Return value: 1 if ID is already taken and has NULL url, 0 else.

Function: int lw6nod_info_community_has_url (lw6sys_context_t * sys_context, lw6nod_info_t * info, const char * url)

sys_context: global system context

info: node info object to test

url: URL of the member we want to check

Tells wether a member exists with this URL. Will test both ourselves and remote peers.

Return value: 1 if URL is already taken, 0 if available.

Function: int64_t lw6nod_info_community_get_id_from_url (lw6sys_context_t * sys_context, lw6nod_info_t * info, const char * url)

sys_context: global system context

info: node info object to test

url: URL of the member we want to check

Returns the id of the node with this URL, if it’s known to us.

Return value: id if it’s the community, else 0

Function: char * lw6nod_info_community_get_url_from_id (lw6sys_context_t * sys_context, lw6nod_info_t * info, int64_t id)

sys_context: global system context

info: node info object to test

id: ID of the member we want to check

Returns the id of the node with this URL, if it’s known to us.

Return value: url if it’s the community else NULL, must be freed

Function: int lw6nod_info_community_remove_by_id (lw6sys_context_t * sys_context, lw6nod_info_t * info, u_int64_t id)

sys_context: global system context

info: node info object to modify

id: ID of the member we want to remove

Removes a community member by ID.

Return value: 1 if successfully removed, 0 if was not present.

Function: int lw6nod_info_community_remove_by_url (lw6sys_context_t * sys_context, lw6nod_info_t * info, const char * url)

sys_context: global system context

info: node info object to modify

url: URL of the member we want to remove

Removes a community member by URL.

Return value: 1 if successfully removed, 0 if was not present.

Function: int lw6nod_info_community_count (lw6sys_context_t * sys_context, lw6nod_info_t * info)

sys_context: global system context

info: node info object to modify

Tells how many members there are in a community. This include ourselves so this can never be 0, should at least be 1. Note that this is pretty much the same as the nb_nodes member of dyn_info, but this one is calculated dynamically from peer list, while the other one is updated from time to time from game_state information.

Return value: number of community members, including this node (us).

Function: void lw6nod_info_community_reset (lw6sys_context_t * sys_context, lw6nod_info_t * info)

sys_context: global system context

info: node info object to modify

Resets all peers, set community to only one member, ourselves.

Return value: none.

Function: char * lw6nod_info_community_get_peer_id_list_str (lw6sys_context_t * sys_context, lw6nod_info_t * info)

sys_context: global system context

info: node to query

Builds a string containing all peer ids, separated by a separator.

Return value: newly allocated string

Function: void lw6nod_info_community_set_peer_id_list_str (lw6sys_context_t * sys_context, lw6nod_info_t * info, const char * peer_id_list_str)

sys_context: global system context

info: node to modify

peer_id_list_str: new value

Interprets a peer_id_list_str and puts it into the node data structures. Note that this function won’t really copy the list, instead it will populate the dyn_info struct with the right values.

Return value: none

Function: void lw6nod_info_community_id_without_url_map (lw6sys_context_t * sys_context, lw6nod_info_t * info, lw6nod_id_callback_func_t func, void * func_data)

sys_context: global system context

info: node to process

func: function to use as a callback

func_data: data passed along with the function

Applies function func to all the members of the community which have an id but not an URL...

Return value: none.

Function: void lw6nod_dyn_info_free (lw6sys_context_t * sys_context, lw6nod_dyn_info_t * dyn_info)

sys_context: global system context

dyn_info: the dyn info struct to free

Frees a dyn info object, to be used after a call to lw6nod_info_dup_dyn for instance.

Return value: none

Function: lw6nod_info_t * lw6nod_info_new (lw6sys_context_t * sys_context, const char * program, const char * version, const char * codename, int stamp, u_int64_t id, const char * url, const char * title, const char * description, const char * password, int bench, int open_relay, int uptime, int idle_screenshot_size, void * idle_screenshot_data)

sys_context: global system context

program: the program (normally it’s liquidwar6)

version: the version

codename: the codename

stamp: the stamp

id: the node id

url: the node public url

title: the node title

description: the node description

password: the node password

bench: the node bench

open_relay: open relay or not

uptime: uptime in seconds

idle_screenshot_size: the size (bytes) of the image to display when game is idle

idle_screenshot_data: the data (jpeg) of the image to display when game is idle

Creates a node info object. The arguments correspond to the immutable node attributes, other properties such as how many players are connected or set in other functions like lw6nod_info_update which can be called later.

Return value: newly allocated object, NULL on error.

Function: void lw6nod_info_free (lw6sys_context_t * sys_context, lw6nod_info_t * info)

sys_context: global system context

info: the node info to free

Frees a node info object.

Return value: none

Function: int lw6nod_info_lock (lw6sys_context_t * sys_context, lw6nod_info_t * info)

info: the node info to lock

Locks a node info object, this is usefull for some members, typically list of servers, can be accessed by separated threads, one reading, many writing, and these objects (chained lists) certainly do not want to be modified while being read.

Return value: 1 if ok, 0 if not.

Function: int lw6nod_info_unlock (lw6sys_context_t * sys_context, lw6nod_info_t * info)

sys_context: global system context

info: the node info to unlock

Unlocks a node info object, this is the compation of the lw6nod_info_lock function.

Return value: 1 if ok, 0 if not.

Function: void lw6nod_info_idle (lw6sys_context_t * sys_context, lw6nod_info_t * info)

sys_context: global system context

info: the node info to modify

Clears a node info object and sets all its variable attributes to NULL/default values. This is what we want when the node is idle, not playing.

Return value: none.

Function: int lw6nod_info_update (lw6sys_context_t * sys_context, lw6nod_info_t * info, u_int64_t community_id, int round, const char * level, int required_bench, int nb_colors, int max_nb_colors, int nb_cursors, int max_nb_cursors, int nb_nodes, int max_nb_nodes, const char * peer_id_list, int game_screenshot_size, void * game_screenshot_data)

sys_context: global system context

info: the node info to update

community_id: the id of the community the node belongs to

round: the current round (can have an offset with real round number)

level: the name of the current level (map)

required_bench: the bench required to connect

nb_colors: number of colors playing

max_nb_colors: max number of colors allowed

nb_cursors: number of cursors playing

max_nb_cursors: max number of cursors allowed

nb_nodes: number of nodes playing

max_nb_nodes: max number of nodes allowed

peer_id_list: list of peers ids, can be NULL

game_screenshot_size: size of screenshot (bytes)

game_screenshot_data: screenshot data (byte buffer, contains JPEG)

Set a node info object variable attributes. Call this whenever the node has changed some parameter. Not too often for it’s not needed and some operations such as modying the screenshot, can be time consuming.

Return value: 1 if OK, 0 if error.

Function: lw6nod_dyn_info_t * lw6nod_info_dup_dyn (lw6sys_context_t * sys_context, lw6nod_info_t * info)

sys_context: global system context

info: the node info containing the dyn info to duplicate

Extracts the dynamic part of an info struct and duplicates it, this is to avoid protection fault error when concurrent threads access this info.

Return value: newly allocated object, must be freed.

Function: lw6sys_hash_t * lw6nod_info_new_discovered_nodes (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a new hash, to be used as a discovered nodes list. Using this function has the advantage of setting the hash options to their defaults. We use a hash to avoid having uselessly long lists containing always the same node due to multiple detections.

Return value: an empty hash

Function: int lw6nod_info_add_discovered_node (lw6sys_context_t * sys_context, lw6nod_info_t * info, const char * public_url)

sys_context: global system context

info: the node info to update

public_url: the address of the discovered node

Registers a new server, and queues it as something that should be checked later because it’s interesting. We can’t insert in the database all the servers we suspect to exist so network threads should use this, then main thread will process discovered servers afterwards. This is also a good way to avoid trivial DOS attacks.

Return value: 1 if OK, O if error.

Function: lw6sys_list_t * lw6nod_info_pop_discovered_nodes (lw6sys_context_t * sys_context, lw6nod_info_t * info)

sys_context: global system context

info: the node info to query

Returns a list of all discovered nodes (their public URL) and empties the current queue as well.

Return value: a list of dynamically allocated strings.

Function: lw6sys_list_t * lw6nod_info_new_verified_nodes (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a new list, to be filled with nodes and typically passed to lw6nod_info_set_verified_nodes. Using this function has the advantage of setting the listh options to their defaults.

Return value: an empty list

Function: int lw6nod_info_set_verified_nodes (lw6sys_context_t * sys_context, lw6nod_info_t * info, lw6sys_list_t * list)

sys_context: global system context

info: the node info to modify

list: the list of verified nodes, will be freed by this function

Sets the list of verified nodes, that is, the list of nodes we are sure to exist, this is typically the list we will display later on a web page. We can’t directly display any discovered node, one needs to filter them through main thread. Something very important about this function is that list will be freed by function, that is, if you call this, then you can (you should) forget your object, it will disappear any time soon.

Return value: 1 if OK, 0 on error.

Function: void lw6nod_info_map_verified_nodes (lw6sys_context_t * sys_context, lw6nod_info_t * info, lw6sys_list_callback_func_t func, void * func_data)

sys_context: global system context

info: the node info concerned

func: the function to apply

func_data: arbitrary pointer holding data to pass to function

Calls lw6sys_hash_map with func on every member of the list of verified nodes. The reason there’s a function for this is that it is very important that list object is locked when doing this. This function does perform a lock/unlock so it is safe.

Return value: none.

Function: int lw6nod_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libnod module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6nod_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the nod module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Struct: lw6nod_const_info_s

Constant informations about a node, these are informations that do not vary through the node’s life, so they are set object creation then left unchanged.

Member of lw6nod_const_info_s: program

Type: char *

Definition: char* lw6nod_const_info_s::program

Program, this should be set to liquidwar6.

Member of lw6nod_const_info_s: version

Type: char *

Definition: char* lw6nod_const_info_s::version

The version of the program.

Member of lw6nod_const_info_s: codename

Type: char *

Definition: char* lw6nod_const_info_s::codename

The codename of the program.

Member of lw6nod_const_info_s: stamp

Type: int

Definition: int lw6nod_const_info_s::stamp

The stamp of the program.

Member of lw6nod_const_info_s: ref_info

Type: lw6nod_ref_info_t

Definition: lw6nod_ref_info_t lw6nod_const_info_s::ref_info

Reference information, how to uniquely identify node.

Member of lw6nod_const_info_s: title

Type: char *

Definition: char* lw6nod_const_info_s::title

The title of the node, its readable short name.

Member of lw6nod_const_info_s: description

Type: char *

Definition: char* lw6nod_const_info_s::description

More details about the node.

Member of lw6nod_const_info_s: has_password

Type: int

Definition: int lw6nod_const_info_s::has_password

Wether the node is password protected or not.

Member of lw6nod_const_info_s: password

Type: char *

Definition: char* lw6nod_const_info_s::password

The password used, cleartext.

Member of lw6nod_const_info_s: bench

Type: int

Definition: int lw6nod_const_info_s::bench

The node bench.

Member of lw6nod_const_info_s: open_relay

Type: int

Definition: int lw6nod_const_info_s::open_relay

Wether the node acts as an open relay or not.

Member of lw6nod_const_info_s: creation_timestamp

Type: int64_t

Definition: int64_t lw6nod_const_info_s::creation_timestamp

The node creation timestamp.

Member of lw6nod_const_info_s: idle_screenshot_size

Type: int

Definition: int lw6nod_const_info_s::idle_screenshot_size

Size of the screenshot (in bytes) when in idle mode.

Member of lw6nod_const_info_s: idle_screenshot_data

Type: void *

Definition: void* lw6nod_const_info_s::idle_screenshot_data

Idle mode screenshot data. This is just a plain JPEG buffer, which will be used as a fallback if there’s no real screenshot available.

Struct: lw6nod_dyn_info_s

Dynamic informations about a node, these are informations that vary through the node’s life, so they are unset at object creation and can then be updated from game context.

Member of lw6nod_dyn_info_s: community_id_int

Type: u_int64_t

Definition: u_int64_t lw6nod_dyn_info_s::community_id_int

The ID of the community this node belongs to, as a 64-bit unsigned integer.

Member of lw6nod_dyn_info_s: community_id_str

Type: char *

Definition: char* lw6nod_dyn_info_s::community_id_str

The ID of the community this node belongs to, as a string (64-bit integer converted to hexa).

Member of lw6nod_dyn_info_s: community_peers

Type: lw6nod_ref_info_t

Definition: lw6nod_ref_info_t lw6nod_dyn_info_s::community_peers[LW6NOD_MAX_NB_PEERS]

The list of community members, you need to refer to the nb_nodes member to know quickly how many members they are but actually, in practice, there can be holes in this array, you need to check each slot, for instance 0 can be filled, 2 can be filled too, but 1 be empty. Note that we don’t count ourselves in this list.

Member of lw6nod_dyn_info_s: round

Type: int

Definition: int lw6nod_dyn_info_s::round

The current round.

Member of lw6nod_dyn_info_s: level

Type: char *

Definition: char* lw6nod_dyn_info_s::level

The current level.

Member of lw6nod_dyn_info_s: required_bench

Type: int

Definition: int lw6nod_dyn_info_s::required_bench

The required bench to connect to this node.

Member of lw6nod_dyn_info_s: nb_colors

Type: int

Definition: int lw6nod_dyn_info_s::nb_colors

Number of colors playing.

Member of lw6nod_dyn_info_s: max_nb_colors

Type: int

Definition: int lw6nod_dyn_info_s::max_nb_colors

Maximum number of colors allowed to play.

Member of lw6nod_dyn_info_s: nb_cursors

Type: int

Definition: int lw6nod_dyn_info_s::nb_cursors

Number of cursors playing.

Member of lw6nod_dyn_info_s: max_nb_cursors

Type: int

Definition: int lw6nod_dyn_info_s::max_nb_cursors

Maximum number of cursors allowed to play.

Member of lw6nod_dyn_info_s: nb_nodes

Type: int

Definition: int lw6nod_dyn_info_s::nb_nodes

Number of nodes playing.

Member of lw6nod_dyn_info_s: max_nb_nodes

Type: int

Definition: int lw6nod_dyn_info_s::max_nb_nodes

Maximum number of nodes allowed to play.

Member of lw6nod_dyn_info_s: game_screenshot_size

Type: int

Definition: int lw6nod_dyn_info_s::game_screenshot_size

Size of the screenshot, in bytes.

Member of lw6nod_dyn_info_s: game_screenshot_data

Type: void *

Definition: void* lw6nod_dyn_info_s::game_screenshot_data

Game screenshot data. This is just a plain JPEG buffer, which will be served when peers and/or web clients want to gather informations about the game. This can be NULL, in that the fallback constant data will be used.

Struct: lw6nod_info_s

Informations about a node. Note that in practice this structure is just used to describe our current node, there might be several instances of this if a program instanciates several nodes, but another data structure is used to store information about peers.typedef struct lw6nod_info_s

Member of lw6nod_info_s: mutex

Type: lw6sys_mutex_t *

Definition: lw6sys_mutex_t* lw6nod_info_s::mutex

Mutex used to access dynamic informations.

Member of lw6nod_info_s: const_info

Type: lw6nod_const_info_t

Definition: lw6nod_const_info_t lw6nod_info_s::const_info

Constant informations, never changes.

Member of lw6nod_info_s: dyn_info

Type: lw6nod_dyn_info_t

Definition: lw6nod_dyn_info_t lw6nod_info_s::dyn_info

Dynamic informations, can be updated. Do not modify this directly, instead use appropriate functions which will use mutexes properly.

Member of lw6nod_info_s: discovered_nodes

Type: lw6sys_hash_t *

Definition: lw6sys_hash_t* lw6nod_info_s::discovered_nodes

List of discovered nodes, do not access this directly, instead use proper query functions which, in turn, will use mutexes properly.

Member of lw6nod_info_s: verified_nodes

Type: lw6sys_list_t *

Definition: lw6sys_list_t* lw6nod_info_s::verified_nodes

List of verified nodes, do not access this directly, instead use proper query functions which, in turn, will use mutexes properly.

Struct: lw6nod_ref_info_s

Reference information about a node, this is all you need to uniquely identify a node. In theory, only the ID are only the URL are enough, in practice it’s not that bad to have some redundancy, plus it makes it easier and faster to connect to them and transmit informations.

Member of lw6nod_ref_info_s: id_int

Type: u_int64_t

Definition: u_int64_t lw6nod_ref_info_s::id_int

The id of the node, as an integer (64-bit unsigned).

Member of lw6nod_ref_info_s: id_str

Type: char *

Definition: char* lw6nod_ref_info_s::id_str

The id of the node, as a string (64-bit converted to hexa).

Member of lw6nod_ref_info_s: url

Type: char *

Definition: char* lw6nod_ref_info_s::url

The public URL of the node.


Next: , Previous: , Up: C API   [Contents][Index]

5.36 libp2p

5.36.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/p2p/index.html.

5.36.2 API

Function: lw6p2p_db_t * lw6p2p_db_open (lw6sys_context_t * sys_context, int argc, const char * [] argv, const char * name)

sys_context: global system context

argc: number of args, as passed to main

argv: args array, as passed to main

name: the database name

Creates a new database object. Normally there’s only one object like this at a given time, it can be shared among various nodes. The database name is appended to user directory path, this allows different databases to be created, in theory.

Return value: a pointer on the newly created object.

Function: void lw6p2p_db_close (lw6sys_context_t * sys_context, lw6p2p_db_t * db)

sys_context: global system context

db: the db to close

Closes a db object, memory ressources will be freed.

Return value: none.

Function: char * lw6p2p_db_repr (lw6sys_context_t * sys_context, const lw6p2p_db_t * db)

sys_context: global system context

db: the db to work on

Gives a readable representation of the db

Return value: a dynamically allocated string

Function: int lw6p2p_db_reset (lw6sys_context_t * sys_context, int argc, const char * [] argv, const char * name)

sys_context: global system context

argc: number of args, as passed to main

argv: args array, as passed to main

name: the database name

Clears the database. Simply removes the db file, in fact. Do not call while database is used...

Return value: 1 on success, 0 if failed.

Function: char * lw6p2p_db_default_name (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the default database name, should be p2p.db (this is a relative path, not an absolute path, will be appended to user dir).

Return value: the default database name, need not (must not) be freed.

Function: int _lw6p2p_db_timestamp (lw6sys_context_t * sys_context, _lw6p2p_db_t * db, int64_t timestamp)

sys_context: global system context

db: the db object concerned (used to calculate time origin)

timestamp: the timestamp as returned by lw6sys_get_timestamp

Returns a timestamp suitable for db usage (seconds since object creation), set to the timestamp passed as an argument (milliseconds). The reason we don’t use regular timestamps is that they are 1) too accurate (msec is useless for what’s involved here) and 2) too big and likely to be negative in signed mode even if converted to seconds.

Return value: a timestamp, 0 means "beginning of program" (think of it as uptime)

Function: int _lw6p2p_db_now (lw6sys_context_t * sys_context, _lw6p2p_db_t * db)

sys_context: global system context

db: the db object concerned (used to calculate time origin)

Returns a timestamp suitable for db usage, (seconds since object creation) set to the current moment. The reason we don’t use regular timestamps is that they are 1) too accurate (msec is useless for what’s involved here) and 2) too big and likely to be negative in signed mode even if converted to seconds.

Return value: a timestamp, 0 means "beginning of program" (think of it as uptime)

Function: lw6p2p_entry_t * lw6p2p_entry_new (lw6sys_context_t * sys_context, int creation_timestamp, char * version, char * codename, int stamp, char * id, char * url, char * title, char * description, int has_password, int bench, int open_relay, char * community_id, int round, char * level, int required_bench, int nb_colors, int max_nb_colors, int nb_cursors, int max_nb_cursors, int nb_nodes, int max_nb_nodes, char * ip, int port, int last_ping_timestamp, int ping_delay_msec, int available)

sys_context: global system context

creation_timestamp: when it has been created, UNIX timestamp

version: version of the node

codename: codename of the node

stamp: stamp of the node

id: id of the node (string representation)

url: public url of the node

title: title of the node

description: description of the node

has_password: wether node is password protected or not

bench: node bench

open_relay: wether the node is in open relay mode or not

round: current round

level: current level played

required_bench: current bench

nb_colors: number of colors playing

max_nb_colors: maximum number of colors

nb_cursors: number of cursors playing

max_nb_cursors: maximum number of cursors

nb_nodes: number of nodes playing

max_nb_nodes: maximum number of nodes

ip: node ip (string representation)

port: node port

last_ping_timestamp: UNIX timestamp of last contact with node

ping_delay_msec: ping delay, in milliseconds

available: wether node is available, wether we can connect to it

Creates a new p2p entry. Will accept NULL parameters for strings as well as arbitrary long strings, will simply cut them short if there aren’t already limited to max size.

Return value: newly allocated object

Function: void lw6p2p_entry_free (lw6sys_context_t * sys_context, lw6p2p_entry_t * entry)

sys_context: global system context

entry: entry to free

Frees a p2p entry.

Return value: none.

Function: char * lw6p2p_entry_repr (lw6sys_context_t * sys_context, const lw6p2p_entry_t * entry)

sys_context: global system context

entry: entry to represent

Gives a human-readable representation of the entry

Return value: dynamically allocated string

Function: lw6p2p_node_t * lw6p2p_node_new (lw6sys_context_t * sys_context, int argc, const char * [] argv, lw6p2p_db_t * db, char * client_backends, char * server_backends, char * bind_ip, int bind_port, int broadcast, u_int64_t node_id, char * public_url, char * title, char * description, char * password, int bench, int open_relay, char * known_nodes, int network_reliability, int trojan)

sys_context: global system context

argc: number of args, as passed to main

argv: args array, as passed to main

db: the database to use

client_backends: the list of client backends to use

server_backends: the list of server backends to use

bind_ip: the IP address to bind on

bind_port: the IP port to listen on

broadcast: wether broadcast is allowed on this node

node_id: the node id

public_url: the public URL we want to show

title: the title of the node

description: the description of the node

password: the password to use

bench: the bench of the node (its power)

open_relay: act as an open relay or not

known_nodes: list of already known nodes

network_reliability: drop 1 packet out of X

trojan: act as a stupid trojan to test out automatic kick-off

Creates a new "pear to pear" node. This will fire the server and allow client access, on demand. A lot of stuff can be done in the background once this is called.

Return value: a pointer on the newly created objects.

Function: void lw6p2p_node_free (lw6sys_context_t * sys_context, lw6p2p_node_t * node)

sys_context: global system context

node: the node to free

Frees a node object, all network communications will be shut.

Return value: none.

Function: char * lw6p2p_node_repr (lw6sys_context_t * sys_context, const lw6p2p_node_t * node)

sys_context: global system context

node: the node to work on

Gives a readable representation of the node

Return value: a dynamically allocated string

Function: int lw6p2p_node_poll (lw6sys_context_t * sys_context, lw6p2p_node_t * node, lw6sys_progress_t * progress)

sys_context: global system context

node: the node to poll

progress: progress indicator to show the advancement

Polls a p2p node. This must be called on a regular basis, else network communication is stalled.

Return value: 1 on success, 0 on error.

Function: void lw6p2p_node_close (lw6sys_context_t * sys_context, lw6p2p_node_t * node)

sys_context: global system context

node: the node to close

Closes a p2p node. Closing is necessary in some contexts, for instance scheme/smob instanciation when you want to release the object ressources (sockets, ports, threads...) *before* it is deleted by, for instance, a garbage collector.

Return value: 1 on success, 0 on error.

Function: u_int64_t lw6p2p_node_get_id (lw6sys_context_t * sys_context, lw6p2p_node_t * node)

sys_context: global system context

node: the node to query

Returns the node id, an id which is supposed to uniquely identify the node at run-time.

Return value: numerical id.

Function: lw6sys_list_t * lw6p2p_node_get_entries (lw6sys_context_t * sys_context, lw6p2p_node_t * node, int skip_local)

sys_context: global system context

node: node to query

skip_local: wether to skip local node, 1 to skip, 0 to keep

Returns a list of all known nodes, this is a plain table dump, sorted so that the most likely to be interesting to connect oneself to are listed *last*, this is just a (little) optimization, since we know we’ll need to parse this list to construct a Guile object, we reverse the order.

Return value: list object containing lw6p2p_entry_t objects

Function: int lw6p2p_node_server_start (lw6sys_context_t * sys_context, lw6p2p_node_t * node, int64_t seq_0)

sys_context: global system context

node: node to start

seq_0: seq when starting the server

Starts a node in server mode, if node was previously connected to other nodes, disconnect it from any peer.

Return value: 1 on success, 0 on failure.

Function: int lw6p2p_node_client_join (lw6sys_context_t * sys_context, lw6p2p_node_t * node, u_int64_t remote_id, const char * remote_url, lw6sys_progress_t * progress)

sys_context: global system context

node: node to use

remote_id: id of remote node to join

remote_url: url of remote node to join

progress: progress indicator to show end-user the advancement of process

Starts a node in client mode, joins the given node, if node was previously connected to other nodes, disconnect it from any peer.

Return value: 1 on success, 0 on failure.

Function: int lw6p2p_node_refresh_peer (lw6sys_context_t * sys_context, lw6p2p_node_t * node, u_int64_t remote_id, const char * remote_url)

sys_context: global system context

node: node to use

remote_id: id of remote node to refresh

remote_url: url of remote node to refresh

Forces a refresh of a remote node, that is, try and get more up-to-date informations from it, not waiting for the standard update schedule.

Return value: 1 on success, 0 on failure.

Function: void lw6p2p_node_disconnect (lw6sys_context_t * sys_context, lw6p2p_node_t * node)

sys_context: global system context

node: node to disconnect

Disconnects a node, if node was previously connected to other nodes, disconnect it from any peer. Note that this does not affect out-of-band connections, only real game-related links.

Return value: 1 on success, 0 on failure.

Function: int lw6p2p_node_update_info (lw6sys_context_t * sys_context, lw6p2p_node_t * node, int round, const char * level, int nb_colors, int max_nb_colors, int nb_cursors, int max_nb_cursors, int nb_nodes, int max_nb_nodes, int game_screenshot_size, void * game_screenshot_data)

sys_context: global system context

node: node to update

round: the current round (can have an offset with real round number)

level: the name of the current level (map)

nb_colors: number of colors playing

max_nb_colors: max number of colors allowed

nb_cursors: number of cursors playing

max_nb_cursors: max number of cursors allowed

nb_nodes: number of nodes playing

max_nb_nodes: max number of nodes allowed

game_screenshot_size: size of screenshot (bytes)

game_screenshot_data: screenshot data (byte buffer, contains JPEG)

Updates node info, that is, all the data/metadata which can be displayed to other peers and are, by nature, dynamic.

Return value: 1 on success, 0 on failure.

Function: void lw6p2p_node_calibrate (lw6sys_context_t * sys_context, lw6p2p_node_t * node, int64_t timestamp, int64_t seq)

sys_context: global system context

node: the object to calibrate

timestamp: the current ticks setting (1000 ticks per second)

seq: the round expected to be returned with this ticks value

Calibrates the node, so that sequence numbering is consistent accross nodes.

Return value: none.

Function: int64_t lw6p2p_node_get_local_seq_0 (lw6sys_context_t * sys_context, lw6p2p_node_t * node)

sys_context: global system context

node: the object to query

Gets the reference local seq_0 for this node, the information is taken from the warehouse, even if node->calibrate_seq should probably return the same value.

Return value: the seq.

Function: int64_t lw6p2p_node_get_local_seq_last (lw6sys_context_t * sys_context, lw6p2p_node_t * node)

sys_context: global system context

node: the object to query

Gets the local seq_last for this node, the information is taken from the warehouse, which has parsed the messages and this information can in return be used to avoid maintaining outside of the node the information about what was the last seq used for a local message.

Return value: the seq.

Function: int64_t lw6p2p_node_get_seq_min (lw6sys_context_t * sys_context, lw6p2p_node_t * node)

sys_context: global system context

node: the object to query

Gets the minimum seq registered, not of utmost importance but interesting for debugging purpose, to check what’s in the warehouse.

Return value: the seq.

Function: int64_t lw6p2p_node_get_seq_max (lw6sys_context_t * sys_context, lw6p2p_node_t * node)

sys_context: global system context

node: the object to query

Gets the maximum seq registered, this is typically used for guessing which seq might make sense for this node, but in a real example one should rely on algorithm/ker-side kept values.

Return value: the seq.

Function: int64_t lw6p2p_node_get_seq_draft (lw6sys_context_t * sys_context, lw6p2p_node_t * node)

sys_context: global system context

node: the object to query

Gets the seq of the current draft as the warehouse understands it. Note that it’s the responsibility of the caller to update the pilot according to this, this information is just about what is in the warehouse, not necessarly what is in the pilot / game_state.

Return value: the seq.

Function: int64_t lw6p2p_node_get_seq_reference (lw6sys_context_t * sys_context, lw6p2p_node_t * node)

sys_context: global system context

node: the object to query

Gets the seq of the current reference as the warehouse understands it. Note that it’s the responsibility of the caller to update the pilot according to this, this information is just about what is in the warehouse, not necessarly what is in the pilot / game_state.

Return value: the seq.

Function: int lw6p2p_node_is_peer_connected (lw6sys_context_t * sys_context, lw6p2p_node_t * node, u_int64_t peer_id)

sys_context: global system context

node: the object to query

peer_id: id of the peer we want to check

Tests wether the node is connected to us. This is a different question from being registered, being connected means there’s a tentacle connected to the peer, but it does not necessarly means this peer actively takes part in the game.

Return value: 1 if connected, 0 if not.

Function: int lw6p2p_node_is_peer_registered (lw6sys_context_t * sys_context, lw6p2p_node_t * node, u_int64_t peer_id)

sys_context: global system context

node: the object to query

peer_id: id of the peer we want to check

Tests wether the node is registered within the warehouse. This is a different question from being connected, being registered means we received a message (possibly from another peer) that means "this peer is part of the game" regardless of the fact it’s connected or not. Returns true if test is performed with the local id.

Return value: 1 if registered, 0 if not.

Function: int lw6p2p_node_is_seed_needed (lw6sys_context_t * sys_context, lw6p2p_node_t * node)

sys_context: global system context

node: node to query

Returns true (1) if the local node needs to send a SEED message. A SEED message will basically be sent at the beginning of a session when a client connects to a server. Basically this message is of no use but it’s interesting to have a short message (not DUMP) to start with.

Return value: 1 if SEED must be sent.

Function: int lw6p2p_node_is_dump_needed (lw6sys_context_t * sys_context, lw6p2p_node_t * node)

sys_context: global system context

node: node to query

Returns true (1) if the local node needs to send a DUMP message. A DUMP message will basically reset level, game struct, game state, it’s typically sent when a new player is connected. This function will return true once then always 0 so one should really act and do something whenever it’s called and returns 1.

Return value: 1 if DUMP must be sent.

Function: int lw6p2p_node_put_local_msg (lw6sys_context_t * sys_context, lw6p2p_node_t * node, const char * msg)

sys_context: global system context

node: node object to use

msg: message

Puts a message in the object. The message will be splitted into several atoms if needed, it can be arbitrary long.

Return value: 1 on success, 0 on error

Function: char * lw6p2p_node_get_next_reference_msg (lw6sys_context_t * sys_context, lw6p2p_node_t * node, lw6sys_progress_t * progress)

sys_context: global system context

node: node to query

progress: progress indicator (read/write)

Get the next waiting reference msg. This is used to maintain the stable reference game state we can rely upon. One is supposed to call this until it returns NULL, then switch draft messages.

Return value: newly allocated string, must be freed.

Function: char * lw6p2p_node_get_next_draft_msg (lw6sys_context_t * sys_context, lw6p2p_node_t * node, lw6sys_progress_t * progress)

sys_context: global system context

node: node to query

progress: progress indicator (read/write)

Get the next waiting draft msg. This is used to maintain the anticipated draft game state we use for drawing. One is supposed to call this after all reference messages have been treated.

Return value: newly allocated string, must be freed.

Function: int lw6p2p_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libp2p module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6p2p_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the p2p module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Struct: lw6p2p_db_s

Handler on a database connection, this must be used to pass order to store/retrieve persistent informations about peers.

Member of lw6p2p_db_s: id

Type: u_int32_t

Definition: u_int32_t lw6p2p_db_s::id

The first member, id, is the same as the internal _lw6p2p_db_t structure. The rest of it is hidden. The program will cast from lw6p2p_db_t to _lw6p2p_db_t internally.

Struct: lw6p2p_entry_s

This entry object matches as close as possible the corresponding (node) entry in the database.

Member of lw6p2p_entry_s: creation_timestamp

Type: int

Definition: int lw6p2p_entry_s::creation_timestamp

Node creation timestamp.

Member of lw6p2p_entry_s: version

Type: char

Definition: char lw6p2p_entry_s::version[LW6P2P_VERSION_SIZE+1]

Node version.

Member of lw6p2p_entry_s: codename

Type: char

Definition: char lw6p2p_entry_s::codename[LW6P2P_CODENAME_SIZE+1]

Node codename.

Member of lw6p2p_entry_s: stamp

Type: int

Definition: int lw6p2p_entry_s::stamp

Node stamp.

Member of lw6p2p_entry_s: id

Type: char

Definition: char lw6p2p_entry_s::id[LW6P2P_ID_SIZE+1]

Node id, 64-bit integer as an hexa string.

Member of lw6p2p_entry_s: url

Type: char

Definition: char lw6p2p_entry_s::url[LW6P2P_URL_SIZE+1]

Node URL, the public URL it displays to others.

Member of lw6p2p_entry_s: title

Type: char

Definition: char lw6p2p_entry_s::title[LW6P2P_TITLE_SIZE+1]

Node title, the short readable name for the node.

Member of lw6p2p_entry_s: description

Type: char

Definition: char lw6p2p_entry_s::description[LW6P2P_DESCRIPTION_SIZE+1]

Node description, mode details about this node.

Member of lw6p2p_entry_s: has_password

Type: int

Definition: int lw6p2p_entry_s::has_password

Wether it requires a password or not.

Member of lw6p2p_entry_s: bench

Type: int

Definition: int lw6p2p_entry_s::bench

Node bench, reflects how powerfull it is.

Member of lw6p2p_entry_s: open_relay

Type: int

Definition: int lw6p2p_entry_s::open_relay

Wether this node acts as an open relay or not.

Member of lw6p2p_entry_s: community_id

Type: char

Definition: char lw6p2p_entry_s::community_id[LW6P2P_COMMUNITY_ID_SIZE+1]

Community id, 64-bit integer as an hexa string.

Member of lw6p2p_entry_s: round

Type: int

Definition: int lw6p2p_entry_s::round

Current round.

Member of lw6p2p_entry_s: level

Type: char

Definition: char lw6p2p_entry_s::level[LW6P2P_LEVEL_SIZE+1]

Level used.

Member of lw6p2p_entry_s: required_bench

Type: int

Definition: int lw6p2p_entry_s::required_bench

Required bench to connect to this community.

Member of lw6p2p_entry_s: nb_colors

Type: int

Definition: int lw6p2p_entry_s::nb_colors

Number of colors playing.

Member of lw6p2p_entry_s: max_nb_colors

Type: int

Definition: int lw6p2p_entry_s::max_nb_colors

Maximum number of colors allowed to play.

Member of lw6p2p_entry_s: nb_cursors

Type: int

Definition: int lw6p2p_entry_s::nb_cursors

Number of cursors playing.

Member of lw6p2p_entry_s: max_nb_cursors

Type: int

Definition: int lw6p2p_entry_s::max_nb_cursors

Maximum number of cursors allowed to play.

Member of lw6p2p_entry_s: nb_nodes

Type: int

Definition: int lw6p2p_entry_s::nb_nodes

Number of nodes playing.

Member of lw6p2p_entry_s: max_nb_nodes

Type: int

Definition: int lw6p2p_entry_s::max_nb_nodes

Maximum number of nodes playing.

Member of lw6p2p_entry_s: ip

Type: char

Definition: char lw6p2p_entry_s::ip[LW6P2P_IP_SIZE+1]

IP addess of node.

Member of lw6p2p_entry_s: port

Type: int

Definition: int lw6p2p_entry_s::port

IP port of node.

Member of lw6p2p_entry_s: last_ping_timestamp

Type: int

Definition: int lw6p2p_entry_s::last_ping_timestamp

Last time this node has been pinged.

Member of lw6p2p_entry_s: ping_delay_msec

Type: int

Definition: int lw6p2p_entry_s::ping_delay_msec

Ping delay, in milliseconds.

Member of lw6p2p_entry_s: available

Type: int

Definition: int lw6p2p_entry_s::available

Wether this node is ready to accept connections.

Struct: lw6p2p_node_s

Node object, the main network object, this one will encaspulate everything else, the node can connect to other peers, listen on the network, it’s the high-level interface.

Member of lw6p2p_node_s: id

Type: u_int32_t

Definition: u_int32_t lw6p2p_node_s::id

The first member, id, is the same as the internal _lw6p2p_node_t structure. The rest of it is hidden. The program will cast from lw6p2p_node_t to _lw6p2p_node_t internally.


Next: , Previous: , Up: C API   [Contents][Index]

5.37 libpil

5.37.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/pil/index.html.

5.37.2 API

Function: int lw6pil_bench (lw6sys_context_t * sys_context, int argc, const char * [] argv, float * bench_result, lw6sys_progress_t * progress)

sys_context: global system context

argc: number of args as passed to main

argv: args passed to main

bench_result: pointer to float, will contain the bench result

progress: to inform the caller of the process advancement

Runs a standard, normalized bench on a default map. Results can be interpreted as an estimated speed/power of your computer.

Return value: 1 on success, 0 if failure

Function: lw6pil_command_t * lw6pil_command_new (lw6sys_context_t * sys_context, const char * command_text, int64_t seq_0, int round_0)

sys_context: global system context

command_text: readable text of the command

seq_0: sequence offset reference (to calculate difference between sequence and rounds)

round_0: round offset reference (to calculate difference between sequence and rounds)

Creates a new command from its text representation.

Return value: newly allocated object

Function: lw6pil_command_t * lw6pil_command_dup (lw6sys_context_t * sys_context, lw6pil_command_t * command)

sys_context: global system context

command: object to duplicate

Creates a copy of a command struct.

Return value: newly allocated object.

Function: void lw6pil_command_free (lw6sys_context_t * sys_context, lw6pil_command_t * command)

sys_context: global system context

command: command to free

Frees a command struct, with all its members.

Return value: none.

Function: char * lw6pil_command_repr (lw6sys_context_t * sys_context, const lw6pil_command_t * command)

sys_context: global system context

command: command to represent

Gives a readable representation of a command.

Return value: dynamically allocated string.

Function: int lw6pil_command_execute (lw6sys_context_t * sys_context, lw6pil_dump_t * dump, int64_t timestamp, lw6ker_game_state_t * game_state, lw6pil_command_t * command)

sys_context: global system context

dump: pointer on dump structure (out param, can be NULL)

timestamp: current timestamp (can be 0 if dump is NULL)

game_state: game state to work on, can be NULL (usefull for DUMP)

command: command to process

Interprets a command and runs it against game_state. If dump and timestamp are set, then any DUMP command will fill the dump structure with the right values. If not running from a pilot context, this is useless, use NULL and 0LL.

Return value: 1 if ok, 0 if failed.

Function: int lw6pil_command_execute_text (lw6sys_context_t * sys_context, lw6pil_dump_t * dump, int64_t timestamp, lw6ker_game_state_t * game_state, const char * command_text, int64_t seq_0)

sys_context: global system context

dump: pointer on dump structure (out param, can be NULL)

timestamp: current timestamp (can be 0 if dump is NULL)

game_state: game state to work on, can be NULL (typically for DUMP)

command_text: command text to process

seq_0: reference seq_0, used to genereate consistent dumps if needed

Interprets a command text and runs it against game_state. If dump and timestamp are set, then any DUMP command will fill the dump structure with the right values. If not running from a pilot context, this is useless, use NULL and 0LL.

Return value: 1 if ok, 0 if failed.

Function: int lw6pil_command_execute_local (lw6sys_context_t * sys_context, lw6pil_local_cursors_t * local_cursors, lw6pil_command_t * command)

sys_context: global system context

local_cursors: local cursors information

command: command to execute

Executes a local command, typically a cursor move, on the local_cursor struct, without changing any game state.

Return value: 1 if success, 0 if failure.

Function: int lw6pil_command_execute_local_text (lw6sys_context_t * sys_context, lw6pil_local_cursors_t * local_cursors, const char * command_text)

sys_context: global system context

local_cursors: local cursors information

command_text: command text to execute

Executes a local command text, typically a cursor move, on the local_cursor struct, without changing any game state.

Return value: 1 if success, 0 if failure.

Function: void lw6pil_coords_fix (lw6sys_context_t * sys_context, lw6map_rules_t * rules, lw6sys_whd_t * shape, float * x, float * y, float * z)

sys_context: global system context

rules: the set of rules to use (defines polarity)

shape: the shape of the map (logical part)

x: the x coord to fix

y: the y coord to fix

z: the z coord to fix

Similar to lw6map_coords_fix but using floats, this function can be used to check cursor position boundaries. Any float pointer can be NULL.

Return value: none.

Function: void lw6pil_coords_fix_x10 (lw6sys_context_t * sys_context, lw6map_rules_t * rules, lw6sys_whd_t * shape, float * x, float * y, float * z)

sys_context: global system context

rules: the set of rules to use (defines polarity)

shape: the shape of the map (logical part)

x: the x coord to fix

y: the y coord to fix

z: the z coord to fix

Similar to lw6pil_coords_fix but does use a wider range, say 10 times the actual size of the map, this is not to contain the cursor within the map but just to avoid overflow errors.

Return value: none.

Function: void lw6pil_dump_zero (lw6sys_context_t * sys_context, lw6pil_dump_t * dump)

sys_context: global system context

dump: object to initialize

Fills a dump object with zero, regardless of what was there before.

Return value: none.

Function: void lw6pil_dump_clear (lw6sys_context_t * sys_context, lw6pil_dump_t * dump)

sys_context: global system context

dump: object to clear

Clears a dump object, that is, frees all existing object if they are here, and sets pointers to NULL.

Return value: none.

Function: int lw6pil_dump_exists (lw6sys_context_t * sys_context, const lw6pil_dump_t * dump)

sys_context: global system context

dump: object to test

Tests wether there’s actually a dump in the structure, or if it’s empty.

Return value: 1 if there’s a dump, 0 if all fields set to NULL.

Function: char * lw6pil_dump_command_generate (lw6sys_context_t * sys_context, lw6pil_pilot_t * pilot, u_int64_t server_id, int64_t seq)

sys_context: global system context

pilot: the pilot to transform as a DUMP.

server_id: ID of server issuing the command

seq: seq at which the dump should be generated

Creates the DUMP command for a given pilot, that is, a command that describes the whole data and state. One must give a sequence number since the dump would otherwise typically be *always* late by at least one round (or seq). We give the seq as we would for any message generated, to make it fit well within the standard message queue.

Return value: newly allocated string

Function: int lw6pil_dump_command_execute (lw6sys_context_t * sys_context, lw6pil_dump_t * dump, int64_t timestamp, lw6pil_command_t * command, lw6sys_progress_t * progress)

sys_context: global system context

dump: will contain the dump data, pilot and game state, struct, and level

timestamp: current timestamp

command: the command to execute

progress: progress object to show the advancement of process

Interprets a DUMP command. A new pilot will be returned, along with game state, game struct and level. Old objects won’t be deleted, but you could (should) get rid of them at they are useless now.

Return value: newly allocated string

Function: void lw6pil_local_cursors_reset (lw6sys_context_t * sys_context, lw6pil_local_cursors_t * local_cursors)

sys_context: global system context

local_cursors: the structure to reset

Resets a local cursors struct. Note that this need not be called very often, in fact the local cursors can cope with "dead" cursors easily. In practise, in a local game, there are only 4 of them, great maximum.

Return value: none.

Function: lw6pil_local_cursor_t * lw6pil_local_cursors_get_cursor (lw6sys_context_t * sys_context, lw6pil_local_cursors_t * local_cursors, u_int16_t cursor_id)

sys_context: global system context

local_cursors: the structure to query

cursor_id: the id of the cursor to query

Returns a pointer on the cursor with the given id.

Return value: a pointer (must *not* be freed) which is NULL is cursor does not exist.

Function: int lw6pil_local_cursors_get_info (lw6sys_context_t * sys_context, lw6pil_local_cursors_t * local_cursors, int * x, int * y, int * mouse_controlled, u_int16_t cursor_id)

local_cursors: the structure to query

x: a pointer to the x position, may be NULL

y: a pointer to the y position, may be NULL

mouse_controlled: a pointer to the mouse_controlled flag, may be NULL

cursor_id: the id of the cursor to query

Gets the x,y position of the cursor, and tells if it’s mouse controlled.

Return value: 1 on success (cursor exists), 0 on failure (no such cursor).

Function: int lw6pil_local_cursors_set_xy (lw6sys_context_t * sys_context, lw6pil_local_cursors_t * local_cursors, u_int16_t cursor_id, int x, int y)

sys_context: global system context

local_cursors: the structure to modify

cursor_id: the id of the cursor to modify

x: the x position

y: the y position

Sets the position of a cursor in the local cursors struct. If cursor does not exists, it’s appended to the list.

Return value: 1 on success (cursor exists), 0 on failure (no such cursor).

Function: int lw6pil_local_cursors_set_mouse_controlled (lw6sys_context_t * sys_context, lw6pil_local_cursors_t * local_cursors, u_int16_t cursor_id, int mouse_controlled)

sys_context: global system context

local_cursors: the structure to modify

cursor_id: the id of the cursor to modify

mouse_controlled: the mouse_controlled attribute

Sets which cursor is mouse controlled. If mouse_controlled is 1, the flag is set for this cursor and cleared for all others. If set to 0, only this cursor’s flag is cleared.

Return value: 1 on success (cursor exists), 0 on failure (no such cursor).

Function: int lw6pil_local_cursors_get_main_info (lw6sys_context_t * sys_context, lw6pil_local_cursors_t * local_cursors, u_int16_t * cursor_id, int * x, int * y, int * mouse_controlled)

sys_context: global system context

local_cursors: the structure to query

cursor_id: the id of the main cursor, may be NULL

x: a pointer to the x position, may be NULL

y: a pointer to the y position, may be NULL

mouse_controlled: a pointer to the mouse_controlled flag, may be NULL

Gets the x,y position of the main cursor, and tells if it’s mouse controlled.

Return value: 1 on success (cursor exists), 0 on failure (no such cursor).

Function: int lw6pil_local_cursors_set_main (lw6sys_context_t * sys_context, lw6pil_local_cursors_t * local_cursors, u_int16_t cursor_id)

sys_context: global system context

local_cursors: the structure to modify

cursor_id: the id of the cursor to be labelled as main cursor

Sets the main cursor attribute, the main cursor is later used, for instance, to decide how to display the map (centered on it, for instance).

Return value: 1 on success (cursor exists), 0 on failure (no such cursor).

Function: int lw6pil_nopilot_poll_dump (lw6sys_context_t * sys_context, lw6pil_dump_t * dump, const char * command_text, int64_t timestamp)

sys_context: global system context

dump: will contain the dump information if needed, can be NULL

command_text: the command received from the network.

timestamp: timestamp, used to initialize the pilot

Normally, it’s the commit function of the pilot which will automatically return a dump if needed. But... when a client connects, at first, it has absolutely no pilot/map whatsoever yet, so this is just to bootstrap the process, this function will take network messages, any message, and if it’s about a dump -> it will create the dump.

Return value: 1 on success, 0 on failure.

Function: lw6pil_pilot_t * lw6pil_pilot_new (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state, int64_t seq_0, int64_t timestamp, lw6sys_progress_t * progress)

sys_context: global system context

game_state: the game state we’re going to work on

seq_0: the start sequence to use, that is, the seq at round=0

timestamp: the current ticks (1000 ticks per sec, used to calibrate)

progress: object used to show the advancement of the process

Initializes a ’pilot’ object, this object is responsible for interpreting messages, transform them into low-level ’ker’ module function calls, and handle all the thread-spooky stuff.

Return value: a working pilot object. May be NULL on memory failure.

Function: void lw6pil_pilot_free (lw6sys_context_t * sys_context, lw6pil_pilot_t * pilot)

sys_context: global system context

pilot: the object to free.

Frees a ’pilot’ object, note that this might involve joining some threads, so it can ’take some time’.

Return value: none.

Function: int lw6pil_pilot_send_command (lw6sys_context_t * sys_context, lw6pil_pilot_t * pilot, const char * command_text, int verified)

sys_context: global system context

pilot: the object to send commands to.

command_text: the text of the command, as received form network

verified: wether we’re sure this message is valid.

Sends a command and handles it internally.

Return value: 1 if OK, 0 if not.

Function: int lw6pil_pilot_local_command (lw6sys_context_t * sys_context, lw6pil_pilot_t * pilot, const char * command_text)

sys_context: global system context

pilot: the object to apply the local command on

command_text: the command text

This function is used to fix the annoying fact that by only sending commands a limited number of times per sec to the game state, the display always reflect an outdated position for cursors. But players do not want to see this, they want to see the cursor in the right place. So what we do is that the pilot can process "local" commands which have absolutely no effect on the game but simply update a local cursor state, only used for display. It’s here in the pil module for it’s where the command interpreting code is, and the fact that there’s this lag is directly linked with the pilot way of doing things.

Return value: 1 on success, 0 on failure.

Function: int lw6pil_pilot_commit (lw6sys_context_t * sys_context, lw6pil_dump_t * dump, lw6pil_pilot_t * pilot)

sys_context: global system context

dump: will contain the dump information if needed, can be NULL

pilot: the object to commit.

Commits all commands sent and actually send them to the corresponding threads. This commit system allows better performance by sending, for instance, all the commands for a given round together.

Return value: none.

Function: int lw6pil_pilot_make_backup (lw6sys_context_t * sys_context, lw6pil_pilot_t * pilot)

sys_context: global system context

pilot: the object to perform the backup on

Makes a new backup in the pilot, that is, copy ’reference’ to ’backup’.

Return value: 1 if OK, 0 if not.

Function: int lw6pil_pilot_can_sync (lw6sys_context_t * sys_context, lw6ker_game_state_t * target, lw6pil_pilot_t * pilot)

sys_context: global system context

target: the target game_state we would sync on

pilot: the object to perform the backup on

Tests wether sync functions are callable with a given game state. It verifies if the internal game_state and the target look the same.

Return value: 1 if sync functions can be called, 0 if not.

Function: int lw6pil_pilot_sync_from_backup (lw6sys_context_t * sys_context, lw6ker_game_state_t * target, lw6pil_pilot_t * pilot)

sys_context: global system context

target: the game_state structure which will get the informations.

pilot: the object to get informations from.

Gets the backup from the pilot object. This is the last snapshot taken by make_backup or, by default, the game_state the pilot was constructed with.

Return value: 1 if OK, 0 if not.

Function: int lw6pil_pilot_sync_from_reference (lw6sys_context_t * sys_context, lw6ker_game_state_t * target, lw6pil_pilot_t * pilot)

sys_context: global system context

target: the game_state structure which will get the informations.

pilot: the object to get informations from.

Gets the latest reference game_state, that is, a stable snapshot of the game, with no inconsistency, a game position that exists and that we can rely on. Note that getting this can take time since a global mutex is required, and computations must end before you get the data.

Return value: 1 if OK, 0 if not.

Function: int lw6pil_pilot_sync_from_draft (lw6sys_context_t * sys_context, lw6ker_game_state_t * target, lw6pil_pilot_t * pilot, int dirty_read)

sys_context: global system context

target: the game_state structure which will get the informations.

pilot: the object to get informations from.

dirty_read: wether to allow dirty read or not

Gets the informations from the pilot object, not being worried about game consistency, this one will just return the latest version available. It might even be in an inconsistent state, the position could reflect a position which will never exist. Still, the data returned will not correspond to a half-spread or half-moved game_state if dirty_read is set to 0. In this case the data has at least some basic consistency and getting this does require some mutex lock, however wait time should be fairly small (max. a round). But, in a general manner, this function is only used for display, and we do not care much if there’s a small glitch, we prefer fast & smooth display.

Return value: 1 if OK, 0 if not.

Function: lw6ker_game_state_t * lw6pil_pilot_dirty_read (lw6sys_context_t * sys_context, lw6pil_pilot_t * pilot)

sys_context: global system context

pilot: the object to get informations from.

Returns a direct access to the most up-to-date game_state, without locking anything whatsoever. This is clearly to implement a dirty read mode as the name of the function suggests.

Return value: 1 if OK, 0 if not.

Function: char * lw6pil_pilot_repr (lw6sys_context_t * sys_context, const lw6pil_pilot_t * pilot)

sys_context: global system context

Returns a string describing the pilot. This is a very short description, use it for logs, and to debug stuff. By no means it’s a complete exhaustive description. Still, the string returned should be unique.

Return value: a dynamically allocated string.

Function: void lw6pil_pilot_calibrate (lw6sys_context_t * sys_context, lw6pil_pilot_t * pilot, int64_t timestamp, int64_t seq)

sys_context: global system context

pilot: the object to calibrate

timestamp: the current ticks setting (1000 ticks per second)

seq: the round expected to be returned with this ticks value

Calibrates the pilot, that is, initializes it so that subsequent calls to lw6pil_pilot_get_round return consistent values.

Return value: none.

Function: void lw6pil_pilot_speed_up (lw6sys_context_t * sys_context, lw6pil_pilot_t * pilot, int seq_inc)

sys_context: global system context

pilot: the pilot to speed up

seq_inc: the number of seqs

Re-calibrates the pilot so that it speeds up a bit. This will basically increase next_seq by seq_inc.

Return value: none.

Function: void lw6pil_pilot_slow_down (lw6sys_context_t * sys_context, lw6pil_pilot_t * pilot, int seq_dec)

sys_context: global system context

pilot: the pilot to speed up

seq_dec: the number of seqs

Re-calibrates the pilot so that it slows down a bit. This will basically decrease next_seq by seq_inc.

Return value: none.

Function: int lw6pil_pilot_get_round_0 (lw6sys_context_t * sys_context, const lw6pil_pilot_t * pilot)

sys_context: global system context

pilot: pilot object to query

Get the initial round (the one passed at object construction) which says what the round was at object creation, it’s just an offset.

Return value: 64-bit integer

Function: int64_t lw6pil_pilot_get_seq_0 (lw6sys_context_t * sys_context, const lw6pil_pilot_t * pilot)

sys_context: global system context

pilot: pilot object to query

Get the initial seq (the one passed at object construction) which says what the seq was at round=0, it’s just an offset.

Return value: 64-bit integer

Function: int lw6pil_pilot_seq2round (lw6sys_context_t * sys_context, const lw6pil_pilot_t * pilot, int64_t seq)

sys_context: global system context

pilot: pilot object to work on

seq: the seq to convert

Converts a seq (64-bit) to a round (32-bit). 64-bit seqs are used to avoid out-of-range errors on very long games, OTOH a round is 32-bit to garantee the atomicity of its affection, even on platforms which are not native 64-bit.

Return value: the round (32-bit integer)

Function: int64_t lw6pil_pilot_round2seq (lw6sys_context_t * sys_context, const lw6pil_pilot_t * pilot, int round)

sys_context: global system context

pilot: pilot object to work on

round: the round to convert

Converts a round (32-bit) to a seq (64-bit). 64-bit seqs are used to avoid out-of-range errors on very long games, OTOH a round is 32-bit to garantee the atomicity of its affection, even on platforms which are not native 64-bit.

Return value: the seq (64-bit integer)

Function: int64_t lw6pil_pilot_get_next_seq (lw6sys_context_t * sys_context, const lw6pil_pilot_t * pilot, int64_t timestamp)

sys_context: global system context

pilot: the object to query

timestamp: the current ticks setting (1000 ticks per second)

Returns the seq one should use to generate new events/commands at a given time (given in ticks).

Return value: none.

Function: int64_t lw6pil_pilot_get_last_commit_seq (lw6sys_context_t * sys_context, const lw6pil_pilot_t * pilot)

sys_context: global system context

pilot: the object to query

Returns the seq of the last commit (reference game_state) for this object.

Return value: the commit seq (reference object)

Function: int64_t lw6pil_pilot_get_reference_target_seq (lw6sys_context_t * sys_context, const lw6pil_pilot_t * pilot)

sys_context: global system context

pilot: the object to query

Returns the seq which is targetted in the reference game_state, this is ’how far computation will go in the reference game_state if no new commands are issued’. Note that there can always be some commands which are not yet processed, so you should not rely on this too heavily, however it gives a good idea of how things are going.

Return value: the target seq (reference object)

Function: int64_t lw6pil_pilot_get_reference_current_seq (lw6sys_context_t * sys_context, const lw6pil_pilot_t * pilot)

sys_context: global system context

pilot: the object to query

Returns the current seq in the reference game_state. There’s no lock on this call so don’t rely on this too heavily, it just gives you an idea of wether the pilot is very late on its objectives or just on time.

Return value: the current seq (reference object)

Function: int64_t lw6pil_pilot_get_max_seq (lw6sys_context_t * sys_context, const lw6pil_pilot_t * pilot)

sys_context: global system context

pilot: the object to query

Returns the max current seq in the reference or draft game states. No lock on this call so don’t rely on this too heavily, it just gives you an idea of computation state.

Return value: the current seq (reference object)

Function: int lw6pil_pilot_is_over (lw6sys_context_t * sys_context, const lw6pil_pilot_t * pilot)

sys_context: global system context

pilot: the object to query

Tells wether the game is over or not.

Return value: 1 if over, 0 if not

Function: int lw6pil_pilot_did_cursor_win (lw6sys_context_t * sys_context, const lw6pil_pilot_t * pilot, u_int16_t cursor_id)

sys_context: global system context

pilot: the object to query

cursor_id: the cursor_id concerned

Tells wether a given cursor was winner or not.

Return value: 1 if over, 0 if not

Function: int lw6pil_pilot_get_winner (lw6sys_context_t * sys_context, const lw6pil_pilot_t * pilot)

sys_context: global system context

pilot: the object to query

Gets the winner color.

Return value: a team color, -1 if no winner and/or error.

Function: int lw6pil_pilot_get_looser (lw6sys_context_t * sys_context, const lw6pil_pilot_t * pilot)

sys_context: global system context

pilot: the object to query

Gets the looser color.

Return value: a team color, -1 if no looser and/or error.

Function: lw6pil_local_cursors_t * lw6pil_pilot_get_local_cursors (lw6sys_context_t * sys_context, lw6pil_pilot_t * pilot)

sys_context: global system context

pilot: object to query

Returns a pointer on the local_cursors struct used within the object. Beware, this is the *real* pointer, not a copy...

Return value: pointer on internal object

Function: void lw6pil_pilot_checksum_log_set_interval (lw6sys_context_t * sys_context, lw6pil_pilot_t * pilot, int checksum_log_interval)

sys_context: global system context

pilot: the pilot to track

checksum_log_interval: dump interval, if 0, feature is disabled

Debugging function used to set automatically an interval at which engine will log a checksum automatically. This is typically to track down where and when there starts to be a difference between two game_states that have evolved separately. This function will propagate the parameter to all the game_states handled by the pilot, each will log its informations separately.

Return value: none

Function: char * lw6pil_seed_command_generate (lw6sys_context_t * sys_context, lw6pil_pilot_t * pilot, u_int64_t server_id, int64_t seq)

sys_context: global system context

pilot: the pilot to transform as a SEED.

server_id: ID of server issuing the command

seq: seq at which the dump should be generated

Creates the SEED command for a given pilot, that is, a command that contains macro informations about the game state such as current seq. It should be followed by a dump.

Return value: newly allocated string

Function: int64_t lw6pil_seq_random_0 (lw6sys_context_t * sys_context)

sys_context: global system context

Gets a pseudo-random start seq, why do we use this? Just to make sure even in non-network situations, seq are always very high and random, this way this is one less bug to check in networked context.

Return value: random integer value, always greater than INT_MAX

Function: int lw6pil_suite_init (lw6sys_context_t * sys_context, lw6pil_dump_t * dump, int64_t timestamp)

sys_context: global system context

dump: dump to use as a base to init the suite (out param)

timestamp: timestamp used for pilot creation (should be "now")

Build the objects used by the test suite. The idea is to wrap all this in a single function since it requires to be exactly the same every time as the test suite is very pedantic about checksums.

Return value: 1 on success, 0 on failure.

Function: int64_t lw6pil_suite_get_seq_0 (lw6sys_context_t * sys_context)

sys_context: global system context

Get the base seq_0 for the reference test suite.

Return value: 64-bit integer.

Function: u_int64_t lw6pil_suite_get_node_id (lw6sys_context_t * sys_context, int node_index)

sys_context: global system context

node_index: index of the node we want informations about

Get the node_id associated to an index, typically a 64-bit unique. The index is just a simple integer which is 0 for node A, 1 for node B, etc.

Return value: the node id, as an unsigned 64-bit integer

Function: const char * lw6pil_suite_get_command_by_node_index (lw6sys_context_t * sys_context, int node_index, int stage, int step)

sys_context: global system context

node_index: index of the node (not its id)

stage: major stage of the test suite

step: minor step of the test suite

Get the reference test suite message by node_index, stage and step.

Return value: static string, must not be freed.

Function: const char * lw6pil_suite_get_command_by_stage (lw6sys_context_t * sys_context, int stage, int step)

sys_context: global system context

stage: major stage of the test suite

step: minor step of the test suite

Get the reference test suite message by stage and step. Messages from various nodes are mixed and sorted.

Return value: static string, must not be freed.

Function: const char * lw6pil_suite_get_command_by_step (lw6sys_context_t * sys_context, int step)

sys_context: global system context

step: minor step of the test suite

Get the reference test suite message by step. Messages from various nodes and stages are mixed and sorted.

Return value: static string, must not be freed.

Function: void lw6pil_suite_get_checkpoint (lw6sys_context_t * sys_context, u_int32_t * game_state_checksum, int64_t * seq, int * round, int stage)

sys_context: global system context

game_state_checksum: expected checksum for the given checkpoint (out param)

seq: expected seq for the given checkpoint (out param)

round: expected round for the given checkpoint (out param)

stage: stage to query checksum and other info about

Gives the values which are expected for a given checkpoint. If the right messages have been feeded, then these values are expected.

Return value: none, everything in out params

Function: int lw6pil_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libpil module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6pil_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the pil module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Struct: lw6pil_add_args_s

Arguments passed to the ADD command.

Member of lw6pil_add_args_s: cursor_id

Type: u_int16_t

Definition: u_int16_t lw6pil_add_args_s::cursor_id

Cursor ID (16-bit non-zero unsigned int).

Member of lw6pil_add_args_s: team_color

Type: int

Definition: int lw6pil_add_args_s::team_color

Team color (0 to 9).

Struct: lw6pil_command_s

Command structure, contains both full-text version and parsed information.

Member of lw6pil_command_s: seq

Type: int64_t

Definition: int64_t lw6pil_command_s::seq

The sequence number, a very large 64-bit integer. The sequence is here because the round wouldn’t be able to stand multiple games for long as it is only 32-bit. OTOH making round a 64-bit would cause multithread problems because of non-atomicity of 64-bit affectation on truely 32-bit platforms.

Member of lw6pil_command_s: round

Type: int

Definition: int lw6pil_command_s::round

The game round.

Member of lw6pil_command_s: node_id

Type: u_int64_t

Definition: u_int64_t lw6pil_command_s::node_id

The node ID issuing that command.

Member of lw6pil_command_s: code

Type: lw6pil_command_code_t

Definition: lw6pil_command_code_t lw6pil_command_s::code

The command code.

Member of lw6pil_command_s: args

Type: lw6pil_command_args_t

Definition: lw6pil_command_args_t lw6pil_command_s::args

The command arguments, parsed.

Member of lw6pil_command_s: text

Type: char *

Definition: char* lw6pil_command_s::text

The original full text of the command.

Struct: lw6pil_dump_args_s

Arguments passed to the DUMP command.

Member of lw6pil_dump_args_s: level_hexa

Type: char *

Definition: char* lw6pil_dump_args_s::level_hexa

Hexa dump of level.

Member of lw6pil_dump_args_s: game_struct_hexa

Type: char *

Definition: char* lw6pil_dump_args_s::game_struct_hexa

Hexa dump of game struct.

Member of lw6pil_dump_args_s: game_state_hexa

Type: char *

Definition: char* lw6pil_dump_args_s::game_state_hexa

Hexa dump of game state.

Struct: lw6pil_dump_s

Stores the information contained in a dump, this is just an utility struct used to hold all the data (level, game struct, game state and pilot) together

Member of lw6pil_dump_s: level

Type: lw6map_level_t *

Definition: lw6map_level_t* lw6pil_dump_s::level

Will hold the new level if a dump is received.

Member of lw6pil_dump_s: game_struct

Type: lw6ker_game_struct_t *

Definition: lw6ker_game_struct_t* lw6pil_dump_s::game_struct

Will hold the new game struct if a dump is received.

Member of lw6pil_dump_s: game_state

Type: lw6ker_game_state_t *

Definition: lw6ker_game_state_t* lw6pil_dump_s::game_state

Will hold the new game state if a dump is received.

Member of lw6pil_dump_s: pilot

Type: lw6pil_pilot_p

Definition: lw6pil_pilot_p lw6pil_dump_s::pilot

Will hold the new pilot if a dump is received.

Struct: lw6pil_local_cursors_s

Contains information about all local cursors, which will override information from game state.

Member of lw6pil_local_cursors_s: main_cursor_id

Type: u_int16_t

Definition: u_int16_t lw6pil_local_cursors_s::main_cursor_id

Main cursor ID (16-bit non-zero unsigned int). By main, we usually mean the mouse-driven one but necessarily. But still, this is a cursor which will have a special role, it will be used to center the map if needed, among other things.

Member of lw6pil_local_cursors_s: main_i

Type: int

Definition: int lw6pil_local_cursors_s::main_i

Main cursor index.

Member of lw6pil_local_cursors_s: nb_cursors

Type: int

Definition: int lw6pil_local_cursors_s::nb_cursors

Number of cursors.

Member of lw6pil_local_cursors_s: cursors

Type: lw6pil_local_cursor_t

Definition: lw6pil_local_cursor_t lw6pil_local_cursors_s::cursors[LW6MAP_MAX_NB_CURSORS]

The cursors array.

Struct: lw6pil_local_cursor_s

Stores informations about local cursors. This is usefull for user feedback. Indeed there can be some delay between, for instance, a mouse move or a keyboard press, and the time this information makes it through the whole pipeline. Players wouldn’t understand such a lag so for local cursors we override the information from the game state with that information we get right from the GUI.

Member of lw6pil_local_cursor_s: cursor_id

Type: u_int16_t

Definition: u_int16_t lw6pil_local_cursor_s::cursor_id

Cursor ID (16-bit non-zero unsigned int).

Member of lw6pil_local_cursor_s: x

Type: int

Definition: int lw6pil_local_cursor_s::x

X position (map coords).

Member of lw6pil_local_cursor_s: y

Type: int

Definition: int lw6pil_local_cursor_s::y

Y position (map coords).

Member of lw6pil_local_cursor_s: mouse_controlled

Type: int

Definition: int lw6pil_local_cursor_s::mouse_controlled

Wether this cursor is mouse controlled. If yes, then information will be taken directly from the mouse driver.

Member of lw6pil_local_cursor_s: is_main

Type: int

Definition: int lw6pil_local_cursor_s::is_main

Wether this cursor is the main cursor.

Struct: lw6pil_pilot_s

Pilot is a container for several game states, a reference state which we can rely upon and a draft state which is anticipated to provide interactive feedback but reflects non-validated informations. The first member, id, is the same as the internal _lw6pil_pilot_t structure. The rest of it is hidden. The program will cast from lw6pil_pilot_t to _lw6pil_pilot_t internally.

Member of lw6pil_pilot_s: id

Type: u_int32_t

Definition: u_int32_t lw6pil_pilot_s::id

The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Struct: lw6pil_remove_args_s

Arguments passed to the REMOVE command.

Member of lw6pil_remove_args_s: cursor_id

Type: u_int16_t

Definition: u_int16_t lw6pil_remove_args_s::cursor_id

Cursor ID (16-bit non-zero unsigned int).

Struct: lw6pil_set_args_s

Arguments passed to the SET command.

Member of lw6pil_set_args_s: cursor_id

Type: u_int64_t

Definition: u_int64_t lw6pil_set_args_s::cursor_id

Cursor ID (16-bit non-zero unsigned int).

Member of lw6pil_set_args_s: x

Type: int

Definition: int lw6pil_set_args_s::x

X position (map coords).

Member of lw6pil_set_args_s: y

Type: int

Definition: int lw6pil_set_args_s::y

Y position (map coords).

Member of lw6pil_set_args_s: fire

Type: int

Definition: int lw6pil_set_args_s::fire

Wether to activate primary weapon.

Member of lw6pil_set_args_s: fire2

Type: int

Definition: int lw6pil_set_args_s::fire2

Wether to activate secondary weapon.

Struct: lw6pil_worker_s

Worker thread data, used to calculate stuff in a separate thread. The principle is simple, it tries to keep up with a given target round, whenever this round isn’t reached, it computes more and more rounds.

Member of lw6pil_worker_s: run

Type: int

Definition: volatile int lw6pil_worker_s::run

Wether this thread should run, 0 will stop it.

Member of lw6pil_worker_s: verified

Type: int

Definition: int lw6pil_worker_s::verified

Wether this is running in verified mode or not.

Member of lw6pil_worker_s: current_round

Type: int

Definition: volatile int lw6pil_worker_s::current_round

Current game round.

Member of lw6pil_worker_s: target_round

Type: int

Definition: volatile int lw6pil_worker_s::target_round

Round up to which we should compute stuff.

Member of lw6pil_worker_s: computed_rounds

Type: int

Definition: volatile int lw6pil_worker_s::computed_rounds

How many rounds where computed since object creation.

Member of lw6pil_worker_s: over

Type: int

Definition: volatile int lw6pil_worker_s::over

Wether the game is over or not.

Member of lw6pil_worker_s: compute_thread

Type: lw6sys_thread_handler_t *

Definition: lw6sys_thread_handler_t* lw6pil_worker_s::compute_thread

The thread that does the job.

Member of lw6pil_worker_s: global_mutex

Type: lw6sys_mutex_t *

Definition: lw6sys_mutex_t* lw6pil_worker_s::global_mutex

Global data mutex.

Member of lw6pil_worker_s: compute_mutex

Type: lw6sys_mutex_t *

Definition: lw6sys_mutex_t* lw6pil_worker_s::compute_mutex

Mutex used for the computing thread.

Member of lw6pil_worker_s: game_state

Type: lw6ker_game_state_t *

Definition: lw6ker_game_state_t* lw6pil_worker_s::game_state

Game state the computing thread is working on.

Member of lw6pil_worker_s: commands

Type: lw6sys_list_r_t *

Definition: lw6sys_list_r_t* lw6pil_worker_s::commands

List of commands to be processed.

Member of lw6pil_worker_s: dump

Type: lw6pil_dump_t

Definition: lw6pil_dump_t lw6pil_worker_s::dump

Dump information.

Struct: lw6pil_command_args_u

Arguments passed to various commands.

Member of lw6pil_command_args_u: add

Type: lw6pil_add_args_t

Definition: lw6pil_add_args_t lw6pil_command_args_u::add

Arguments when command is ADD.

Member of lw6pil_command_args_u: remove

Type: lw6pil_remove_args_t

Definition: lw6pil_remove_args_t lw6pil_command_args_u::remove

Arguments when command is REMOVE.

Member of lw6pil_command_args_u: set

Type: lw6pil_set_args_t

Definition: lw6pil_set_args_t lw6pil_command_args_u::set

Arguments when command is SET.

Member of lw6pil_command_args_u: dump

Type: lw6pil_dump_args_t

Definition: lw6pil_dump_args_t lw6pil_command_args_u::dump

Arguments when command is DUMP.


Next: , Previous: , Up: C API   [Contents][Index]

5.38 libscm

5.38.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/scm/index.html.

5.38.2 API

Function: lw6sys_hash_t * lw6scm_coverage_new (lw6sys_context_t * sys_context, lw6sys_list_t * funcs)

sys_context: global system context

funcs: list of functions, used as an input to size the hash correctly

Creates a new coverage hash, this is a simple hash containing pointers to integers. At startup hash is empty, whenever a scheme user function is called, if the entry exists it’s incremented, else it’s created with an initial value of 1 (one call).

Return value: newly allocated hash

Function: void lw6scm_coverage_call (lw6sys_context_t * sys_context, lw6sys_hash_t * coverage, const char * func)

sys_context: global system context

coverage: the hash to use to store the update

func: the name of the function (its callable scheme name)

Registers a call on a given function.

Return value: none.

Function: void lw6scm_coverage_log (lw6sys_context_t * sys_context, lw6sys_hash_t * coverage)

sys_context: global system context

coverage: the hash containing the call data

Logs the information about which function has been called, and how many times. This is only about scheme functions.

Return value: none

Function: int lw6scm_coverage_check (lw6sys_context_t * sys_context, int * percent, lw6sys_hash_t * coverage, lw6sys_list_t * funcs)

sys_context: global system context

percent: if not NULL, will contain the percentage of coverage

coverage: object to query, containing coverage information

funcs: list of functions to check

Checks wether the script code coverage is fine, that is, wether all functions are called at least once. For each function listed (as a string) in funcs, it will look in coverage and check wether the entry exists and was called. Note that this function assumes that in c functions are defined with _scm_my_function (prefixed with _scm_ and using underscore) while in scm functions are defined with c-my-function (prefixed with c- and using minus).

Return value: 1 if OK, 0 if KO.

Function: char * lw6scm_funcname_scm2c (lw6sys_context_t * sys_context, const char * funcname)

sys_context: global system context

funcname: function name to change

Transforms a function name of the form c-my-func to _scm_my_func.

Return value: new allocated string.

Function: char * lw6scm_funcname_c2scm (lw6sys_context_t * sys_context, const char * funcname)

sys_context: global system context

funcname: function name to change

Transforms a function name of the form _scm_my_func to c-my-func.

Return value: new allocated string.

Function: SCM lw6scm_gettext (lw6sys_context_t * sys_context, SCM string)

sys_context: global system context

string: SCM object to convert

For a GNU gettext-like behavior of scheme code, exported with a name such as _ then calling function _ from Guile will just do the same as _ in C.

Return value: SCM value, the translated string

Function: int lw6scm_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libscm module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6scm_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the scm module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Function: char * lw6scm_utils_to_0str (lw6sys_context_t * sys_context, SCM string)

sys_context: global system context

string: SCM object to convert

Helper function, creates a 0 terminated string from a Guile string. A very common task. This function is just a wrapper that performs type checking, memory allocation around standard Guile function.

Return value: newly allocated string, pointer must be freed.

Function: SCM lw6scm_utils_to_scm_str_list (lw6sys_context_t * sys_context, lw6sys_list_t * c_list)

sys_context: global system context

c_list: list object to convert

Transform a C list containing strings to a Guile list containing those strings.

Return value: Guile object, a list of strings

Function: SCM lw6scm_utils_to_scm_str_assoc (lw6sys_context_t * sys_context, lw6sys_assoc_t * c_assoc)

sys_context: global system context

c_assoc: assoc object to convert

Transform a C assoc containing strings to a Guile assoc containing those strings.

Return value: Guile object, an assoc of strings

Function: lw6sys_list_t * lw6scm_utils_to_sys_str_list (lw6sys_context_t * sys_context, SCM list)

sys_context: global system context

list: SCM object to convert

Creates a C list from an SCM list containing strings. Beware of types, function will fail if members are not all strings, it won’t convert them.

Return value: new C list object

Function: lw6sys_assoc_t * lw6scm_utils_to_sys_str_assoc (lw6sys_context_t * sys_context, SCM assoc)

sys_context: global system context

assoc: SCM object to convert

Creates a C assoc from an SCM assoc containing strings. Beware of types, function will fail if members are not all strings, it won’t convert them.

Return value: new C assoc object

Function: int lw6scm_c_define_gsubr (lw6sys_context_t * sys_context, const char * name, int req, int opt, int rst, lw6scm_func_t fcn)

sys_context: global system context

name: name of the function when called from guile

req: required parameters

opt: optional parameters

rst: ? should RTFM to find that out

fcn: the function itself (pointer on the C executable code)

Wrapper on scm_c_define_gsubr, one of the value of this function is that it does check wether it’s documented before registering it. So if you try to register something not documented, it will fire a warning, which is a very nice code-quality tool.

Return value: 1 on success, 0 on failure.

Function: int lw6scm_c_primitive_load (lw6sys_context_t * sys_context, const char * filename)

sys_context: global system context

filename: file to execute

Loads and executes a script. Will add a log message while doing it.

Return value: 1 on success, 0 on failure.

Function: void * lw6scm_with_guile (lw6sys_context_t * sys_context, lw6scm_callback_t func, void * data)

sys_context: global system context

func: callback to use

data: data to pass to callback

Initializes Guile and calls function within it.

Return value: callback return value.


Next: , Previous: , Up: C API   [Contents][Index]

5.39 libsim

5.39.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/sim/index.html.

5.39.2 API

Function: void lw6sim_print (lw6sys_context_t * sys_context, lw6sim_results_t * results, FILE * f)

sys_context: global system context

results: data to print

f: file to print data to

Pretty prints results on standard output.

Return value: none.

Function: void lw6sim_results_zero (lw6sys_context_t * sys_context, lw6sim_results_t * results)

sys_context: global system context

results: out param, will be cleared

Fills the struct with zeroes.

Return value: none.

Function: int lw6sim_results_update_percents (lw6sys_context_t * sys_context, lw6sim_results_t * results)

sys_context: global system context

results: results set to work on (in/out param)

Updates the structure so that the percent members are up to date.

Return value: 1 on success, 0 on failure.

Function: int lw6sim_simulate (lw6sys_context_t * sys_context, int argc, const char * [] argv, lw6sim_results_t * results, int nb_teams, char * bot_backend)

sys_context: global system context

argc: argc as passed to main

argv: argv as passed to main

results: out param, results of the simulation

nb_teams: number of teams

bot_backend: bot backend to use

Runs a simulation of several battle/games on the default map using different team settings. Will test teams up to the given number, for instance if you give 3 as an argument, will run tests with teams 0, 1 and 2 (that’s to say a total of 3 teams).

Return value: 1 on success, 0 on failure.

Function: int lw6sim_simulate_basic (lw6sys_context_t * sys_context, int argc, const char * [] argv, lw6sim_results_t * results)

sys_context: global system context

argc: argc as passed to main

argv: argv as passed to main

results: out param, results of the simulation

Runs a simulation of several battle/games on the default map using different team settings. Will test the most common colors only, with the most popular bot.

Return value: 1 on success, 0 on failure.

Function: int lw6sim_simulate_full (lw6sys_context_t * sys_context, int argc, const char * [] argv, lw6sim_results_t * results)

sys_context: global system context

argc: argc as passed to main

argv: argv as passed to main

results: out param, results of the simulation

Runs a simulation of several battle/games on the default map using different team settings. Will test all colors, with the most popular bot.

Return value: 1 on success, 0 on failure.

Function: int lw6sim_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libsim module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6sim_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the sim module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Struct: lw6sim_results_s

Results for the game simulation, contains basic statistics about who won the games.

Member of lw6sim_results_s: nb_teams

Type: int

Definition: int lw6sim_results_s::nb_teams

Number of teams that were tested.

Member of lw6sim_results_s: absolute

Type: int

Definition: int lw6sim_results_s::absolute[LW6MAP_MAX_NB_TEAMS]

Absolute score. The unit is arbitrary and depends on the game type, the number of games. Well, it means nothing in itself, each team needs to be compared to the other ones.

Member of lw6sim_results_s: percent

Type: float

Definition: float lw6sim_results_s::percent[LW6MAP_MAX_NB_TEAMS]

Score as a percentage. This is based on several games played, the higher it is the stronger the team is.


Next: , Previous: , Up: C API   [Contents][Index]

5.40 libsnd

5.40.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/snd/index.html.

5.40.2 API

Function: int lw6snd_play_fx (lw6sys_context_t * sys_context, lw6snd_backend_t * backend, int fx_id)

sys_context: global system context

backend: sound backend to use

fx_id: sound fx id

Plays a sound fx.

Return value: 1 on success, 0 on error

Function: int lw6snd_is_music_file (lw6sys_context_t * sys_context, lw6snd_backend_t * backend, char * map_dir, char * music_path, char * music_file)

sys_context: global system context

backend: sound backend to use

map_dir: map directory, to search additionnal files

music_path: config entry containing multiple paths

music_file: relative/local name of a music file

Tells wether a file is a valid music file, typicallly based on file existence and extension. Not bullet proof, file might actually not be loadable, but chances are 99%.

Return value: 1 if music file, 0 if not

Function: int lw6snd_play_music_file (lw6sys_context_t * sys_context, lw6snd_backend_t * backend, char * map_dir, char * music_path, char * music_file)

backend: sound backend to use

map_dir: map directory, to search additionnal files

music_path: config entry containing multiple paths

music_file: relative/local name of a music file

Plays a music file.

Return value: 1 if OK, 0 if not.

Function: int lw6snd_play_music_random (lw6sys_context_t * sys_context, lw6snd_backend_t * backend, char * music_path, char * music_filter, char * music_exclude)

sys_context: global system context

backend: sound backend to use

music_path: config entry containing multiple paths

music_filter: string filter, must be present

music_exclude: string filter, must not be present

Plays a random music file. The filter and exclude mecanisms are not complete regex filters, only a quick and dirty feature which should still help in some cases, such as sorting musics for the menus and for the rest.

Return value: 1 if OK, 0 if not.

Function: void lw6snd_stop_music (lw6sys_context_t * sys_context, lw6snd_backend_t * backend)

sys_context: global system context

backend: sound backend to use

Stops the music.

Return value: none.

Function: int lw6snd_init (lw6sys_context_t * sys_context, lw6snd_backend_t * backend, float fx_volume, float water_volume, float music_volume)

sys_context: global system context

backend: the graphical backend to use

fx_volume: sound fx volume

water_volume: water sounds volume

music_volume: music volume

Sets up the sound backend for good, initializing a playback engine ready to play sounds and set to defaults. This call can typically fail if there’s no device available, if the user doesn’t have enough rights to access the hardware, and so on.

Return value: 1 on success, 0 if not

Function: void lw6snd_set_fx_volume (lw6sys_context_t * sys_context, lw6snd_backend_t * backend, float volume)

sys_context: global system context

backend: sound backend to use

volume: sound fx volume

Changes sound fx volume.

Return value: none.

Function: void lw6snd_set_water_volume (lw6sys_context_t * sys_context, lw6snd_backend_t * backend, float volume)

sys_context: global system context

backend: sound backend to use

volume: water sounds volume

Changes water sounds volume.

Return value: none.

Function: void lw6snd_set_music_volume (lw6sys_context_t * sys_context, lw6snd_backend_t * backend, float volume)

sys_context: global system context

backend: sound backend to use

volume: music volume

Changes music volume.

Return value: none.

Function: void lw6snd_poll (lw6sys_context_t * sys_context, lw6snd_backend_t * backend)

sys_context: global system context

backend: sound backend to use

Polling function, must be called on a regular basis.

Return value: none.

Function: void lw6snd_quit (lw6sys_context_t * sys_context, lw6snd_backend_t * backend)

sys_context: global system context

backend: the backend to quit

Uninitializes the backend, that is, releases resources, stops playback.

Return value: none.

Function: char * lw6snd_repr (lw6sys_context_t * sys_context, const lw6snd_backend_t * backend)

sys_context: global system context

backend: the backend to represent

Returns a readable version of the backend object.

Return value: a newly allocated pointer.

Function: lw6sys_assoc_t * lw6snd_get_backends (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc, as passed to main

argv: argv, as passed to main

List available snd backends. The hash contains pairs with id and name for each backend. The id is the technical key you can use to load the backend, the name is something more readable you can display in an interface. The backend objects themselves are not instanciated by this (in fact, they are, but released on the fly) you need to load and initialize them afterwards.

Return value: hash containing id/name pairs.

Function: lw6snd_backend_t * lw6snd_create_backend (lw6sys_context_t * sys_context, int argc, const char * [] argv, const char * name)

sys_context: global system context

argc: argc, as passed to main

argv: argv, as passed to main

name: string containing snd key, typically got from lw6snd_get_backends

Creates a snd backend, this is just about loading the dynamic library if needed, and/or check snd engine is available, and connect to it. It does not perform initialization.

Return value: snd backend.

Function: void lw6snd_destroy_backend (lw6sys_context_t * sys_context, lw6snd_backend_t * backend)

sys_context: global system context

backend: snd backend to destroy

Frees the ressources associated to a snd, which must have been properly uninitialized before.

Return value: none.

Function: int lw6snd_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libsnd module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6snd_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the snd module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Struct: lw6snd_backend_s

The snd backend is the first argument passed to any snd function, it contains reference to all the functions which can be used as well as a pointer on associated data. In OO, this would just be an object, with members and methods, using polymorphism through opaque pointers.

Member of lw6snd_backend_s: dl_handle

Type: lw6dyn_dl_handle_t *

Definition: lw6dyn_dl_handle_t* lw6snd_backend_s::dl_handle

Handle on dynamic library (if it makes sense).

Member of lw6snd_backend_s: snd_context

Type: void *

Definition: void* lw6snd_backend_s::snd_context

Snd specific data, what is behind this pointer really depends on the snd engine.

Member of lw6snd_backend_s: argc

Type: int

Definition: int lw6snd_backend_s::argc

The argc value passed to main.

Member of lw6snd_backend_s: argv

Type: const char **

Definition: const char** lw6snd_backend_s::argv

The argv value passed to main.

Member of lw6snd_backend_s: id

Type: u_int32_t

Definition: u_int32_t lw6snd_backend_s::id

The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Member of lw6snd_backend_s: play_fx

Type: int(*

Definition: int(* lw6snd_backend_s::play_fx)(lw6sys_context_t *sys_context, void *snd_context, int fx_id)

Pointer on lw6snd_play_fx callback code.

Member of lw6snd_backend_s: is_music_file

Type: int(*

Definition: int(* lw6snd_backend_s::is_music_file)(lw6sys_context_t *sys_context, void *snd_context, char *music_file)

Pointer on lw6snd_is_music_file callback code.

Member of lw6snd_backend_s: play_music_file

Type: int(*

Definition: int(* lw6snd_backend_s::play_music_file)(lw6sys_context_t *sys_context, void *snd_context, char *music_file)

Pointer on lw6snd_play_music_file callback code.

Member of lw6snd_backend_s: play_music_random

Type: int(*

Definition: int(* lw6snd_backend_s::play_music_random)(lw6sys_context_t *sys_context, void *snd_context, char *music_path, char *music_filter, char *music_exclude)

Pointer on lw6snd_play_music_randomcallback code.

Member of lw6snd_backend_s: stop_music

Type: void(*

Definition: void(* lw6snd_backend_s::stop_music)(lw6sys_context_t *sys_context, void *snd_context)

Pointer on lw6snd_stop_music callback code.

Member of lw6snd_backend_s: init

Type: void *(*

Definition: void*(* lw6snd_backend_s::init)(lw6sys_context_t *sys_context, int argc, const char *argv[], float fx_volume, float water_volume, float music_volume)

Pointer on lw6snd_init callback code.

Member of lw6snd_backend_s: set_fx_volume

Type: void(*

Definition: void(* lw6snd_backend_s::set_fx_volume)(lw6sys_context_t *sys_context, void *snd_context, float volume)

Pointer on lw6snd_set_fx_volume callback code.

Member of lw6snd_backend_s: set_water_volume

Type: void(*

Definition: void(* lw6snd_backend_s::set_water_volume)(lw6sys_context_t *sys_context, void *snd_context, float volume)

Pointer on lw6snd_set_water_volume callback code.

Member of lw6snd_backend_s: set_music_volume

Type: void(*

Definition: void(* lw6snd_backend_s::set_music_volume)(lw6sys_context_t *sys_context, void *snd_context, float volume)

Pointer on lw6snd_set_music_volume callback code.

Member of lw6snd_backend_s: poll

Type: void(*

Definition: void(* lw6snd_backend_s::poll)(lw6sys_context_t *sys_context, void *snd_context)

Pointer on lw6snd_poll callback code.

Member of lw6snd_backend_s: quit

Type: void(*

Definition: void(* lw6snd_backend_s::quit)(lw6sys_context_t *sys_context, void *snd_context)

Pointer on lw6snd_quit callback code.

Member of lw6snd_backend_s: repr

Type: char *(*

Definition: char*(* lw6snd_backend_s::repr)(lw6sys_context_t *sys_context, void *snd_context, u_int32_t id)

Pointer on lw6snd_repr callback code.


Next: , Previous: , Up: C API   [Contents][Index]

5.41 mod-csound

5.41.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/snd/mod-csound/index.html.

5.41.2 API

Function: void mod_csound_is_GPL_compatible ()

Defined to tell mod_csound is compatible with GNU General Public License Of course it is. This function does nothing, but the fact it’s declared makes its GPL compatibility obvious. Having this declared is required.

Return value: none

Function: void mod_csound_is_dlclose_safe ()

Defined to tell mod_csound has no dlclose issue, once can safely call lt_dlclose on it when done with it, without risking any segfault. Some other LW6 modules/shared libraries do have this problem.

Return value: none

Function: lw6sys_module_pedigree_t * mod_csound_get_pedigree (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the pedigree for mod-csound, giving details about the module, including name, description, licence, date/time of compilation.

Return value: dynamically allocated object.

Function: lw6snd_backend_t * mod_csound_create_backend (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a mod-csound backend.

Return value: backend pointer.


Next: , Previous: , Up: C API   [Contents][Index]

5.42 mod-ogg

5.42.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/snd/mod-ogg/index.html.

5.42.2 API

Function: void mod_ogg_is_GPL_compatible ()

Defined to tell mod_ogg is compatible with GNU General Public License Of course it is. This function does nothing, but the fact it’s declared makes its GPL compatibility obvious. Having this declared is required.

Return value: none

Function: void mod_ogg_is_dlclose_safe ()

Defined to tell mod_ogg has no dlclose issue, once can safely call lt_dlclose on it when done with it, without risking any segfault. Some other LW6 modules/shared libraries do have this problem.

Return value: none

Function: lw6sys_module_pedigree_t * mod_ogg_get_pedigree (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the pedigree for mod-ogg, giving details about the module, including name, description, licence, date/time of compilation.

Return value: dynamically allocated object.

Function: lw6snd_backend_t * mod_ogg_create_backend (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a mod-ogg backend.

Return value: backend pointer.


Next: , Previous: , Up: C API   [Contents][Index]

5.43 libsrv

5.43.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/srv/index.html.

5.43.2 API

Function: int lw6srv_init (lw6sys_context_t * sys_context, lw6srv_backend_t * backend, lw6srv_listener_t * listener)

sys_context: global system context

backend: backend to use

listener: listener object to use when constructing the backend.

Initializes a server backend. Must be performed before any other call.

Return value: 1 on success, 0 on failure

Function: void lw6srv_quit (lw6sys_context_t * sys_context, lw6srv_backend_t * backend)

sys_context: global system context

backend: unitialize a srv backend

Closes a srv, but does not free all ressources.

Function: int lw6srv_analyse_tcp (lw6sys_context_t * sys_context, lw6srv_backend_t * backend, lw6srv_tcp_accepter_t * tcp_accepter, lw6nod_info_t * node_info, u_int64_t * remote_id, char ** remote_url)

sys_context: global system context

backend: server backend to use

tcp_accepter: TCP mode accepter

node_info: this node information

remote_id: remote host id (out param)

remote_url: remote host URL (out param, dynamically allocated)

Analyzes new TCP messages, typically handled within the accepter object. The result is a combination of bitwise flags, namely namely LW6SRV_ANALYSE_DEAD, LW6SRV_ANALYSE_UNDERSTANDABLE, and LW6SRV_ANALYSE_OOB which helps knowing what to do with message.

Return value: bitwise flag.

Function: int lw6srv_analyse_udp (lw6sys_context_t * sys_context, lw6srv_backend_t * backend, lw6srv_udp_buffer_t * udp_buffer, lw6nod_info_t * node_info, u_int64_t * remote_id, char ** remote_url)

sys_context: global system context

backend: server backend to use

udp_buffer: UDP buffer

node_info: this node information

remote_id: remote host id (out param)

remote_url: remote host URL (out param, dynamically allocated)

Analyzes an UDP buffer, received on a socket. The result is a combination of bitwise flags, namely namely LW6SRV_ANALYSE_DEAD, LW6SRV_ANALYSE_UNDERSTANDABLE, and LW6SRV_ANALYSE_OOB which helps knowing what to do with message.

Return value: bitwise flag.

Function: int lw6srv_process_oob (lw6sys_context_t * sys_context, lw6srv_backend_t * backend, lw6nod_info_t * node_info, lw6srv_oob_data_t * oob_data)

sys_context: global system context

backend: server backend to use

node_info: this node information

oob_data: OOB data received

Processes an OOB message sent from a client.

Return value: 1 if OK, 0 if not.

Function: lw6cnx_connection_t * lw6srv_open (lw6sys_context_t * sys_context, lw6srv_backend_t * backend, lw6srv_listener_t * listener, const char * local_url, const char * remote_url, const char * remote_ip, int remote_port, const char * password, u_int64_t local_id, u_int64_t remote_id, int dns_ok, int network_reliability)

sys_context: global system context

backend: server backend to use

local_url: local url to use (to send to peer)

remote_url: remote url to communicate with

remote_ip: remote ip to communicate with

remote_port: remote port to communicate with

password: password to use (the real password, not a hash)

local_id: the local 64-bit id

remote_id: the remove 64-bit id

dns_ok: 1 if no DNS mismatch, 0 if situation is unclear

network_reliability: the greater, the more reliable it is

Opens a server connection. One might wonder, clients open connections, but servers? To some extent, this is the equivalent of accept in the socket API, it will actually create an object one can then use to communicate. Be carefull with the implementation of the callback, keep in mind it can be called any time in multithreaded mode, you need to set up locks when accessing shared objects, including, but not limited to, your own data buffers.

Return value: new connection object.

Function: int lw6srv_feed_with_tcp (lw6sys_context_t * sys_context, lw6srv_backend_t * backend, lw6cnx_connection_t * connection, lw6srv_tcp_accepter_t * tcp_accepter)

sys_context: global system context

backend: server backend to use

connection: connection to use

tcp_accepter: TCP accepter holding data

When data is receivedm feeds the server object with data. Will typically fire the callback receive function if there are actually some data stuff.

Return value: 1 some data processed, else 0

Function: int lw6srv_feed_with_udp (lw6sys_context_t * sys_context, lw6srv_backend_t * backend, lw6cnx_connection_t * connection, lw6srv_udp_buffer_t * udp_buffer)

sys_context: global system context

backend: server backend to use

connection: connection to use

When data is receivedm feeds the server object with data. Will typically fire the callback receive function if there are actually some data stuff.

Return value: 1 some data processed, else 0

Function: void lw6srv_close (lw6sys_context_t * sys_context, lw6srv_backend_t * backend, lw6cnx_connection_t * connection)

sys_context: global system context

backend: server backend to use

connection: connection to close

Closes a connection, will also free it.

Return value: none.

Function: int lw6srv_send (lw6sys_context_t * sys_context, lw6srv_backend_t * backend, lw6cnx_connection_t * connection, int64_t now, u_int32_t physical_ticket_sig, u_int32_t logical_ticket_sig, u_int64_t logical_from_id, u_int64_t logical_to_id, const char * message)

sys_context: global system context

backend: server backend to use

connection: connection to use

now: current timestamp

physical_ticket_sig: physical ticket

logical_ticket_sig: logical ticket

logical_from_id: logical id of sender

logical_to_id: logical id of receiver

message: string with the message to send

Sends a message. The added value with a plain send is that it handles all the special ticket fields.

Return value: 1 on success, 0 if not

Function: int lw6srv_can_send (lw6sys_context_t * sys_context, lw6srv_backend_t * backend, lw6cnx_connection_t * connection)

sys_context: global system context

backend: server backend to use

connection: connection to use

Tells wether a server connection can technically send messages. This does not garantee send will succeed, but if it’s not OK at this stage, it’s not even worth trying.

Return value: 1 if it can be used to send messages, 0 if not ready.

Function: void lw6srv_poll (lw6sys_context_t * sys_context, lw6srv_backend_t * backend, lw6cnx_connection_t * connection)

sys_context: global system context

backend: server backend to use

connection: connection to use

Polling function, to be called on a regular basis.

Return value: none.

Function: char * lw6srv_repr (lw6sys_context_t * sys_context, const lw6srv_backend_t * backend, lw6cnx_connection_t * connection)

sys_context: global system context

backend: backend to use

connection: connection to represent

Gives a human readable representation of the connection.

Return value: dynamically allocated string.

Function: lw6srv_listener_t * lw6srv_start (lw6sys_context_t * sys_context, const char * ip, int port)

sys_context: global system context

ip: ip address to listen on

port: port IP to bind to

Starts a server, binds the socket(s) and returns a listener object which can in turn be used to create connections.

Return value: new listener object.

Function: void lw6srv_stop (lw6sys_context_t * sys_context, lw6srv_listener_t * listener)

sys_context: global system context

listener: listener to stop

Stops a listener object, and frees it.

Return value: none.

Function: lw6srv_oob_t * lw6srv_oob_new (lw6sys_context_t * sys_context, const char * remote_ip, int remote_port, int sock, const char * first_line)

sys_context: global system context

remote_ip: remote IP address

remote_port: remote port

sock: the socket handler (either TCP or UDP)

first_line: the first line of data (can be NULL)

Create a new OOB structure, copying required objects. We need to make copies for this is for usage in a separate thread. The thread member is not set here since the right way to do things is first to set up data then to fire the thread.

Return value: new object

Function: void lw6srv_oob_free (lw6sys_context_t * sys_context, lw6srv_oob_t * oob)

sys_context: global system context

oob: the object to free

Frees an OOB structure.

Return value: none

Function: char * lw6srv_default_backends (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the list of the default srv backends.

Return value: comma separated string, must not be freed.

Function: lw6sys_assoc_t * lw6srv_get_backends (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc, as passed to main

argv: argv, as passed to main

List available srv backends. The hash contains pairs with id and name for each backend. The id is the technical key you can use to load the backend, the name is something more readable you can display in an interface. The backend objects themselves are not instanciated by this (in fact, they are, but released on the fly) you need to load and initialize them afterwards.

Return value: hash containing id/name pairs.

Function: lw6srv_backend_t * lw6srv_create_backend (lw6sys_context_t * sys_context, int argc, const char * [] argv, const char * name)

sys_context: global system context

argc: argc, as passed to main

argv: argv, as passed to main

name: string containing srv key, typically got from lw6srv_get_backends

Creates a srv backend, this is just about loading the dynamic library if needed, and/or check srv engine is available, and connect to it. It does not perform initialization.

Return value: srv backend.

Function: void lw6srv_destroy_backend (lw6sys_context_t * sys_context, lw6srv_backend_t * backend)

sys_context: global system context

backend: backend to destroy

Destroys a srv backend.

Return value: none.

Function: lw6srv_tcp_accepter_t * lw6srv_tcp_accepter_new (lw6sys_context_t * sys_context, char * client_ip, int client_port, int sock)

client_ip: the client ip, will be freed when accepter is freed, do not copy it

client_port: the client port

sock: the socket used

Creates a tcp_accepter object.

Return value: none

Function: void lw6srv_tcp_accepter_free (lw6sys_context_t * sys_context, lw6srv_tcp_accepter_t * tcp_accepter)

tcp_accepter: the object to free

Frees a tcp_accepter object.

Return value: none

Function: int lw6srv_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libsrv module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6srv_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the srv module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Function: lw6srv_udp_buffer_t * lw6srv_udp_buffer_new (lw6sys_context_t * sys_context, char * client_ip, int client_port, char * line)

sys_context: global system context

client_ip: the client ip, will be freed when object is freed, do not free it

client_port: the client port

line: the line received, will be freed when object is freed, do not free it

Creates an udp_buffer object.

Return value: none

Function: void lw6srv_udp_buffer_free (lw6sys_context_t * sys_context, lw6srv_udp_buffer_t * udp_buffer)

sys_context: global system context

udp_buffer: the object to free

Frees a udp_buffer object.

Return value: none

Struct: lw6srv_backend_s

The srv backend is the first argument passed to any srv function, it contains reference to all the functions which can be used as well as a pointer on associated data. In OO, this would just be an object, with members and methods, using polymorphism through opaque pointers.

Member of lw6srv_backend_s: dl_handle

Type: lw6dyn_dl_handle_t *

Definition: lw6dyn_dl_handle_t* lw6srv_backend_s::dl_handle

Handle on dynamic library (if it makes sense).

Member of lw6srv_backend_s: srv_context

Type: void *

Definition: void* lw6srv_backend_s::srv_context

Srv specific data, what is behind this pointer really depends on the srv engine.

Member of lw6srv_backend_s: argc

Type: int

Definition: int lw6srv_backend_s::argc

The argc value passed to main.

Member of lw6srv_backend_s: argv

Type: const char **

Definition: const char** lw6srv_backend_s::argv

The argv value passed to main.

Member of lw6srv_backend_s: id

Type: u_int32_t

Definition: u_int32_t lw6srv_backend_s::id

The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Member of lw6srv_backend_s: name

Type: char *

Definition: char* lw6srv_backend_s::name

Module name.

Member of lw6srv_backend_s: properties

Type: lw6cnx_properties_t

Definition: lw6cnx_properties_t lw6srv_backend_s::properties

General backend properties.

Member of lw6srv_backend_s: info

Type: lw6nod_info_t *

Definition: lw6nod_info_t* lw6srv_backend_s::info

Information about local node.

Member of lw6srv_backend_s: init

Type: void *(*

Definition: void*(* lw6srv_backend_s::init)(lw6sys_context_t *sys_context, int argc, const char *argv[], lw6cnx_properties_t *properties, lw6srv_listener_t *listener)

Pointer on lw6srv_init callback code.

Member of lw6srv_backend_s: quit

Type: void(*

Definition: void(* lw6srv_backend_s::quit)(lw6sys_context_t *sys_context, void *srv_context)

Pointer on lw6srv_quit callback code.

Member of lw6srv_backend_s: analyse_tcp

Type: int(*

Definition: int(* lw6srv_backend_s::analyse_tcp)(lw6sys_context_t *sys_context, void *srv_context, lw6srv_tcp_accepter_t *tcp_accepter, lw6nod_info_t *node_info, u_int64_t *remote_id, char **remote_url)

Pointer on lw6srv_analyse_tcp callback code.

Member of lw6srv_backend_s: analyse_udp

Type: int(*

Definition: int(* lw6srv_backend_s::analyse_udp)(lw6sys_context_t *sys_context, void *srv_context, lw6srv_udp_buffer_t *udp_buffer, lw6nod_info_t *node_info, u_int64_t *remote_id, char **remote_url)

Pointer on lw6srv_analyse_udp callback code.

Member of lw6srv_backend_s: process_oob

Type: int(*

Definition: int(* lw6srv_backend_s::process_oob)(lw6sys_context_t *sys_context, void *srv_context, lw6nod_info_t *node_info, lw6srv_oob_data_t *oob_data)

Pointer on lw6srv_process_oob callback code.

Member of lw6srv_backend_s: open

Type: lw6cnx_connection_t *(*

Definition: lw6cnx_connection_t*(* lw6srv_backend_s::open)(lw6sys_context_t *sys_context, void *srv_context, lw6srv_listener_t *listener, const char *local_url, const char *remote_url, const char *remote_ip, int remote_port, const char *password, u_int64_t local_id, u_int64_t remote_id, int dns_ok, int network_reliability)

Pointer on lw6srv_open callback code.

Member of lw6srv_backend_s: feed_with_tcp

Type: int(*

Definition: int(* lw6srv_backend_s::feed_with_tcp)(lw6sys_context_t *sys_context, void *srv_context, lw6cnx_connection_t *connection, lw6srv_tcp_accepter_t *tcp_accepter)

Pointer on lw6srv_feed_with_tcp callback code.

Member of lw6srv_backend_s: feed_with_udp

Type: int(*

Definition: int(* lw6srv_backend_s::feed_with_udp)(lw6sys_context_t *sys_context, void *srv_context, lw6cnx_connection_t *connection, lw6srv_udp_buffer_t *udp_buffer)

Pointer on lw6srv_feed_with_udp callback code.

Member of lw6srv_backend_s: close

Type: void(*

Definition: void(* lw6srv_backend_s::close)(lw6sys_context_t *sys_context, void *srv_context, lw6cnx_connection_t *connection)

Pointer on lw6srv_close callback code.

Member of lw6srv_backend_s: send

Type: int(*

Definition: int(* lw6srv_backend_s::send)(lw6sys_context_t *sys_context, void *srv_context, lw6cnx_connection_t *connection, int64_t now, u_int32_t physical_ticket_sig, u_int32_t logical_ticket_sig, u_int64_t logical_from_id, u_int64_t logical_to_id, const char *message)

Pointer on lw6srv_send callback code.

Member of lw6srv_backend_s: can_send

Type: int(*

Definition: int(* lw6srv_backend_s::can_send)(lw6sys_context_t *sys_context, void *srv_context, lw6cnx_connection_t *connection)

Pointer on lw6srv_can_send callback code.

Member of lw6srv_backend_s: poll

Type: void(*

Definition: void(* lw6srv_backend_s::poll)(lw6sys_context_t *sys_context, void *srv_context, lw6cnx_connection_t *connection)

Pointer on lw6srv_poll callback code.

Member of lw6srv_backend_s: repr

Type: char *(*

Definition: char*(* lw6srv_backend_s::repr)(lw6sys_context_t *sys_context, void *srv_context, lw6cnx_connection_t *connection)

Pointer on lw6srv_repr callback code.

Struct: lw6srv_client_id_s

Parsed client ID, this is not the numerical 64-bit ID but an IP:port pair which uniquely and physically identifies the peer.

Member of lw6srv_client_id_s: client_ip

Type: char *

Definition: char* lw6srv_client_id_s::client_ip

Client IP address, as a string.

Member of lw6srv_client_id_s: client_port

Type: int

Definition: int lw6srv_client_id_s::client_port

Client IP port.

Struct: lw6srv_listener_s

The listener is the object which listens on the network and can create tcp accepters or udp buffers depending on what is received.

Member of lw6srv_listener_s: ip

Type: char *

Definition: char* lw6srv_listener_s::ip

IP address we are binded to.

Member of lw6srv_listener_s: port

Type: int

Definition: int lw6srv_listener_s::port

IP port we are binded to.

Member of lw6srv_listener_s: tcp_sock

Type: int

Definition: int lw6srv_listener_s::tcp_sock

TCP socket, binded in listening mode.

Member of lw6srv_listener_s: tcp_accepters

Type: lw6sys_list_t *

Definition: lw6sys_list_t* lw6srv_listener_s::tcp_accepters

List of lw6srv_tcp_accepter_t objects, created when data is received.

Member of lw6srv_listener_s: udp_sock

Type: int

Definition: int lw6srv_listener_s::udp_sock

UDP socket, binded.

Member of lw6srv_listener_s: udp_buffers

Type: lw6sys_list_t *

Definition: lw6sys_list_t* lw6srv_listener_s::udp_buffers

List of lw6srv_udp_buffer_t objects, created when data is received.

Struct: lw6srv_oob_data_s

Used to store out of band data. Typically, when data is recognized as out of band, it’s treated in a separate thread, and not mainstream. This is both because out-of-band data is the default (anything not recognized and/or not trusted is OOB) and because this can easily be treated separately as all we need is to server nearly static informations.

Member of lw6srv_oob_data_s: creation_timestamp

Type: int64_t

Definition: int64_t lw6srv_oob_data_s::creation_timestamp

Date of the request.

Member of lw6srv_oob_data_s: do_not_finish

Type: int

Definition: volatile int lw6srv_oob_data_s::do_not_finish

Used to interrupt the OOB process before it’s over.

Member of lw6srv_oob_data_s: remote_ip

Type: char *

Definition: char* lw6srv_oob_data_s::remote_ip

IP address of peer.

Member of lw6srv_oob_data_s: remote_port

Type: int

Definition: int lw6srv_oob_data_s::remote_port

IP port of peer.

Member of lw6srv_oob_data_s: sock

Type: int

Definition: int lw6srv_oob_data_s::sock

Socket used, can either be TCP or UDP, depends on backend.

Member of lw6srv_oob_data_s: first_line

Type: char *

Definition: char* lw6srv_oob_data_s::first_line

First line of data.

Struct: lw6srv_oob_s

Used to handle OOB requests. This is a container over the OOB data and its treatment thread.

Member of lw6srv_oob_s: thread

Type: lw6sys_thread_handler_t *

Definition: lw6sys_thread_handler_t* lw6srv_oob_s::thread

Thread use to handle the data.

Member of lw6srv_oob_s: data

Type: lw6srv_oob_data_t

Definition: lw6srv_oob_data_t lw6srv_oob_s::data

The OOB data, what we received from the network.

Struct: lw6srv_tcp_accepter_s

A TCP accepter is an object which is created after a listening socket received some random information (in TCP mode, hence its name). Itprovides basic support to accept/reject requests and choose the right protocol/backend for the answer.

Member of lw6srv_tcp_accepter_s: client_id

Type: lw6srv_client_id_t

Definition: lw6srv_client_id_t lw6srv_tcp_accepter_s::client_id

Where the data does come from.

Member of lw6srv_tcp_accepter_s: sock

Type: int

Definition: int lw6srv_tcp_accepter_s::sock

Socket returned by the accept POSIX function, this is the one we can use to reply and send data back.

Member of lw6srv_tcp_accepter_s: first_line

Type: char

Definition: char lw6srv_tcp_accepter_s::first_line[LW6SRV_PROTOCOL_BUFFER_SIZE+1]

First line received over the network. This is "peeked" so it’s still available for the actual backend, in fact that’s the very thing we need an object for, with the information "these bytes came from ip:port" one can take a decision on what to do with the request.

Member of lw6srv_tcp_accepter_s: creation_timestamp

Type: int64_t

Definition: int64_t lw6srv_tcp_accepter_s::creation_timestamp

Timestamp of accepter creation. This is more or less the same that the instant we received data on the network. There’s a small lag, but not that bad. This is mostly used for timeout.

Struct: lw6srv_udp_buffer_s

A UDP datagram, this structure contains both the data and information about who sent it.

Member of lw6srv_udp_buffer_s: client_id

Type: lw6srv_client_id_t

Definition: lw6srv_client_id_t lw6srv_udp_buffer_s::client_id

Where the data does come from.

Member of lw6srv_udp_buffer_s: line

Type: char *

Definition: char* lw6srv_udp_buffer_s::line

The data itself. This is typically a C-string with a 0 char at the end, anything else will be rejected anyway.


Next: , Previous: , Up: C API   [Contents][Index]

5.44 mod-httpd

5.44.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/srv/mod-httpd/index.html.

5.44.2 API

Function: void mod_httpd_is_GPL_compatible ()

Defined to tell mod_httpd is compatible with GNU General Public License Of course it is. This function does nothing, but the fact it’s declared makes its GPL compatibility obvious. Having this declared is required.

Return value: none

Function: void mod_httpd_is_dlclose_safe ()

Defined to tell mod_httpd has no dlclose issue, once can safely call lt_dlclose on it when done with it, without risking any segfault. Some other LW6 modules/shared libraries do have this problem.

Return value: none

Function: lw6sys_module_pedigree_t * mod_httpd_get_pedigree (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the pedigree for mod-httpd, giving details about the module, including name, description, licence, date/time of compilation.

Return value: dynamically allocated object.

Function: lw6srv_backend_t * mod_httpd_create_backend (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a mod-httpd backend.

Return value: backend pointer.


Next: , Previous: , Up: C API   [Contents][Index]

5.45 mod-tcpd

5.45.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/srv/mod-tcpd/index.html.

5.45.2 API

Function: void mod_tcpd_is_GPL_compatible ()

Defined to tell mod_tcpd is compatible with GNU General Public License Of course it is. This function does nothing, but the fact it’s declared makes its GPL compatibility obvious. Having this declared is required.

Return value: none

Function: void mod_tcpd_is_dlclose_safe ()

Defined to tell mod_tcpd has no dlclose issue, once can safely call lt_dlclose on it when done with it, without risking any segfault. Some other LW6 modules/shared libraries do have this problem.

Return value: none

Function: lw6sys_module_pedigree_t * mod_tcpd_get_pedigree (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the pedigree for mod-tcpd, giving details about the module, including name, description, licence, date/time of compilation.

Return value: dynamically allocated object.

Function: lw6srv_backend_t * mod_tcpd_create_backend (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a mod-tcpd backend.

Return value: backend pointer.


Next: , Previous: , Up: C API   [Contents][Index]

5.46 mod-udpd

5.46.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/srv/mod-udpd/index.html.

5.46.2 API

Function: void mod_udpd_is_GPL_compatible ()

Defined to tell mod_udpd is compatible with GNU General Public License Of course it is. This function does nothing, but the fact it’s declared makes its GPL compatibility obvious. Having this declared is required.

Return value: none

Function: void mod_udpd_is_dlclose_safe ()

Defined to tell mod_udpd has no dlclose issue, once can safely call lt_dlclose on it when done with it, without risking any segfault. Some other LW6 modules/shared libraries do have this problem.

Return value: none

Function: lw6sys_module_pedigree_t * mod_udpd_get_pedigree (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the pedigree for mod-udpd, giving details about the module, including name, description, licence, date/time of compilation.

Return value: dynamically allocated object.

Function: lw6srv_backend_t * mod_udpd_create_backend (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a mod-udpd backend.

Return value: backend pointer.


Next: , Previous: , Up: C API   [Contents][Index]

5.47 libsys

5.47.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/sys/index.html.

5.47.2 API

Function: int lw6sys_arg_match (lw6sys_context_t * sys_context, const char * keyword, const char * argv_string)

sys_context: global system context

keyword: the option to match, without the prefix "-" or "–"

argv_string: the argv value, for instance argv[1]

This is an utility function which allow the program to handle options in a uniform manner. Key comparison is insensitive, that is, –option and –OPTION are equivalent. Besides, -option and –OPTION are equivalent too. Liquid War 6 documentation mentions options in lowercase with a double dash (–option) by default, but it’s a fact, the program supports variants. This is just for convenience, the philosophy behind this behavior is "be as permissive as possible when interpreting input, and as strict as possible when generating output". In fact, it’s even said that Liquid War 6 will accept the argument without any prefix dash as being valid... This is to say running "liquidwar6 –option" is the same as running "liquidwar6 option". But, this is a secret 8-)

Return value: non zero if it matches, 0 if it doesn’t.

Function: int lw6sys_arg_exists (lw6sys_context_t * sys_context, int argc, const char * [] argv, const char * keyword)

sys_context: global system context

argc: the number of arguments, as passed to main

argv: an array of arguments, as passed to main

keyword: the keyword to match

Parses all command-line arguments, searching for one precise "–key[=...]" entry.

Return value: 1 if key is present, 0 if not.

Function: char * lw6sys_arg_get_value (lw6sys_context_t * sys_context, int argc, const char * [] argv, const char * keyword)

argc: the number of arguments, as passed to main

argv: an array of arguments, as passed to main

keyword: the keyword to match

Parses all command-line arguments, searching for one precise "–key=value" pair, and returns the value.

Return value: a pointer to the value. May be NULL. Must be freed.

Function: char * lw6sys_arg_get_value_with_env (lw6sys_context_t * sys_context, int argc, const char * [] argv, const char * keyword)

sys_context: global system context

argc: the number of arguments, as passed to main

argv: an array of arguments, as passed to main

keyword: the keyword to match

Parses all command-line arguments, searching for one precise "–key=value" pair, and returns the value. If a corresponding environment variable is available, but no command-line parameter was passed, the environment variable is intepreted. Such environment variables are uppercased, prefixed by "LW6_" and "_" replaces "-". The environment variable will be overriden if the command-line parameter is present.

Return value: a pointer to the value. May be NULL. Must be freed.

Function: int lw6sys_arg_test_mode (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc as passed to main

argv: argv as passed to main

Chooses between the two test modes "check" or "test" and also reports wether one should run "batch" or "interactive" tests. This is done by using the bit mask defined in LW6SYS_TEST_MODE_FULL_TEST and LW6SYS_TEST_MODE_INTERACTIVE.

Return value: a bit mask one can pass to test functions

Function: lw6sys_assoc_t * lw6sys_assoc_new (lw6sys_context_t * sys_context, lw6sys_free_func_t free_func)

sys_context: global system context

free_func: optional callback used to free memory when stored date is a pointer. Can be NULL when one stores non dynamically allocated data, such as an integer or a static array.

Creates an empty assoc. There’s a difference between NULL and an empty assoc. The empty assoc would (in Scheme) be ’() whereas NULL corresponds to undefined "is not a assoc and will generate errors if you ever call assoc functions on it". Such created assoc are not performant hash tables but slowish "strcmp me for each key" associative arrays, the key being a "char *" string and the value a "void *" pointer.

Return value: a pointer to the newly allocated associative array. Must be freed with lw6sys_assoc_free.

Function: void lw6sys_assoc_free (lw6sys_context_t * sys_context, lw6sys_assoc_t * assoc)

sys_context: global system context

assoc: the assoc to be freed.

The function will cascade delete all elements, using (if not NULL...) the callback passed when first creating the assoc.

Return value: void

Function: int lw6sys_assoc_has_key (lw6sys_context_t * sys_context, lw6sys_assoc_t * assoc, const char * key)

sys_context: global system context

assoc: the assoc to test

key: the key to search

Not a very fast function, since on a "big" assoc, strcmp will be called internally until the key is found.

Return value: non-zero if there’s an entry with the corresponding key.

Function: void * lw6sys_assoc_get (lw6sys_context_t * sys_context, lw6sys_assoc_t * assoc, const char * key)

sys_context: global system context

assoc: the assoc to query

key: the key of which we want the value

Return value: a void pointer to the data contained in the assoc. Note that the pointer on the actual data is returned, that is, if it’s static data, you must not try to free it... As long as memory management is concerned, destroying the assoc will actually free the data if needed.

Function: void lw6sys_assoc_set (lw6sys_context_t * sys_context, lw6sys_assoc_t ** assoc, const char * key, void * value)

sys_context: global system context

assoc: the assoc to modify

key: the key we want to updated

value: the new value

Sets a value in an associative array. The key pointer need not be persistent, it can be freed after affectation. In fact a new string will be created internally. This is not true for the value, it’s hard to find way to copy "any object". So if you want an associative array of strings, key can disappear after calling this function, but not value. The function passed as free_func when creating the assoc will be used to free stuff whenever needed (unset or free).

Return value: void

Function: void lw6sys_assoc_unset (lw6sys_context_t * sys_context, lw6sys_assoc_t * assoc, const char * key)

sys_context: global system context

assoc: the assoc concerned

key: the key to unset

Clears an entry in an associative array. The callback passed when creating the assoc will be called if needed, to free the data automatically.

Return value: void

Function: lw6sys_list_t * lw6sys_assoc_keys (lw6sys_context_t * sys_context, lw6sys_assoc_t * assoc)

sys_context: global system context

assoc: the assoc to work on

Returns a list containing all the keys of the assoc. The list must be free with lw6sys_list_free by the caller. This list copies all the keys of the assoc, so it is safe to use it once the assoc is deleted. However the keys will of course be of little interest in this case. But the program won’t segfault.

Return value: the list of keys.

Function: void lw6sys_assoc_map (lw6sys_context_t * sys_context, lw6sys_assoc_t * assoc, lw6sys_assoc_callback_func_t func, void * func_data)

sys_context: global system context

assoc: the assoc to work on

func: a callback to call on each entry

func_data: a pointer on some data which will be passed to the callback

Executes a function on all assoc items. The func_data parameter allows you to pass extra values to the function, such as a file handler or any variable which can not be inferred from list item values, and you of course do not want to make global...

Return value: void

Function: void lw6sys_assoc_sort_and_map (lw6sys_context_t * sys_context, lw6sys_assoc_t * assoc, lw6sys_assoc_callback_func_t func, void * func_data)

sys_context: global system context

assoc: the assoc to work on

func: a callback to call on each entry, may be NULL

func_data: a pointer on some data which will be passed to the callback

Executes a function on all assoc items, like lw6sys_assoc_sort_and_map but befor doing so, sorts all entries in alphabetical order.

Return value: void

Function: lw6sys_assoc_t * lw6sys_assoc_dup (lw6sys_context_t * sys_context, lw6sys_assoc_t * assoc, lw6sys_dup_func_t dup_func)

sys_context: global system context

assoc: the assoc to duplicate, can be NULL

dup_func: the function which will be called to duplicate data

Duplicates an assoc. All keys will be copied so that if the first assoc is deleted, the duplicated one is fine. Additionnaly, dup_func will be called with all data fields. If dup_func is NULL, then data values will simply be copied. This is likely to be usefull when data is not dynamically allocated.

Returned value: a newly allocated assoc.

Function: char * lw6sys_backtrace (lw6sys_context_t * sys_context, int skip, int detailed)

sys_context: global system context

skip: number of calls to skip

detailed: 0 for light output, 1 for complete, detailed messages

Returns the current backtrace as a comma separated list. This can typically be used for debugging purposes. Not available on some platforms, including mingw32, it requires backtrace_symbols to be defined. Note that this function calls internal string functions so it makes usage of the sys module in many ways, therefore should be used only in other modules, it can’t be used for debugging of internal memory functions for instance. To debug those, use backtrace_symbols_fd directly (or maybe just gdb...). The skip parameter allows you to skip caller’s stack, 0 will display everything but lw6sys_backtrace itself.

Return value: dynamically allocated string

Function: int lw6sys_default_memory_bazooka (lw6sys_context_t * sys_context)

sys_context: global system context

Will set up a default memory bazooka, a slow yet convenient tool to track down and hopefully kill memory leaks. Named bazooka after a night wasted to track down an unfoundable leak... BAZOOOOOOKA!!!

Return value: 1 if success, 0 if failed.

Function: void lw6sys_clear_memory_bazooka (lw6sys_context_t * sys_context)

sys_context: global system context

Clears the memory bazooka.

Return value: none.

Function: int lw6sys_set_memory_bazooka_size (lw6sys_context_t * sys_context, int size)

sys_context: global system context

size: number of items (calls to malloc) to keep

Resizes, the memory bazooka. What’s this? It’s an inelegant yet efficient tool to track down memory leak. Memory bazooka will keep track of every call to malloc, keeping a trace of what has been malloced, where it has been called (from which file, which line), how much memory was allocated, it will even show you what’s at the address in a 0-terminated string-friendly fashion. Of course this slows down the program, so in production, you might set this to 0, but for debugging, a million bazooka is worth the megabytes and CPU cycles it wastes.

Return value: 1 if success, 0 if failure.

Function: int lw6sys_get_memory_bazooka_size (lw6sys_context_t * sys_context)

sys_context: global system context

The companion of lw6sys_set_memory_bazooka_size. This function will return how many calls to malloc can be traced. A return value of 0 indicates that feature is disabled.

Return value: size of the bazooka array.

Function: int lw6sys_set_memory_bazooka_eraser (lw6sys_context_t * sys_context, int state)

sys_context: global system context

state: the state of the eraser

Sets the memory bazooka eraser state. Note that to really work, it requires the memory bazooka to be "big enough".

Return value: 1 if activated, 0 if not. Note that the main reason for it not to be activated is if the memory bazooka has zero size.

Function: int lw6sys_get_memory_bazooka_malloc_count (lw6sys_context_t * sys_context)

sys_context: global system context

Provided you have always called the LW6SYS_MALLOC an LW6SYS_CALLOC to allocate memory, this function will tell you how many times malloc has been called.

Return value: the number of calls to lw6sys_malloc or lw6sys_calloc since program was started.

Function: int lw6sys_get_memory_bazooka_free_count (lw6sys_context_t * sys_context)

sys_context: global system context

Provided you have always called the LW6SYS_FREE macro to free memory, this function will tell you how many times free has been called.

Return value: the number of calls to lw6sys_free since program was started.

Function: int lw6sys_get_memory_bazooka_malloc_current_count (lw6sys_context_t * sys_context)

sys_context: global system context

Provided you have always called the LW6SYS_MALLOC an LW6SYS_CALLOC to allocate memory, this function will tell you the current number of pointer returned by LW6SYS_MALLOC an LW6SYS_CALLOC, currently alive on the heap.

Return value: the number of calls to lw6sys_malloc or lw6sys_calloc since program was started.

Function: int lw6sys_get_memory_bazooka_malloc_max_count (lw6sys_context_t * sys_context)

sys_context: global system context

Provided you have always called the LW6SYS_MALLOC an LW6SYS_CALLOC to allocate memory, this function will tell you the maximum of pointers returned by malloc that were present at the same time on the heap.

Return value: the number of calls to lw6sys_malloc or lw6sys_calloc since program was started.

Function: int lw6sys_get_memory_bazooka_malloc_megabytes (lw6sys_context_t * sys_context)

sys_context: global system context

Provided you have always called the LW6SYS_MALLOC an LW6SYS_CALLOC to allocate memory, this function will tell you how many bytes malloc has reserved.

Return value: the number of calls to lw6sys_malloc or lw6sys_calloc since program was started.

Function: int lw6sys_get_memory_bazooka_free_megabytes (lw6sys_context_t * sys_context)

sys_context: global system context

Provided you have always called the LW6SYS_FREE macro to free memory, this function will tell you how many bytes free has freed.

Return value: the number of calls to lw6sys_free since program was started.

Function: int lw6sys_get_memory_bazooka_malloc_current_bytes (lw6sys_context_t * sys_context)

sys_context: global system context

Provided you have always called the LW6SYS_MALLOC an LW6SYS_CALLOC to allocate memory, this function will tell you the current number of bytes returned by LW6SYS_MALLOC an LW6SYS_CALLOC, currently alive on the heap.

Return value: the number of calls to lw6sys_malloc or lw6sys_calloc since program was started.

Function: int lw6sys_get_memory_bazooka_malloc_max_bytes (lw6sys_context_t * sys_context)

sys_context: global system context

Provided you have always called the LW6SYS_MALLOC an LW6SYS_CALLOC to allocate memory, this function will tell you the maximum bytes returned by malloc that were present at the same time on the heap.

Return value: the number of calls to lw6sys_malloc or lw6sys_calloc since program was started.

Function: int lw6sys_is_memory_bazooka_trustable (lw6sys_context_t * sys_context)

sys_context: global system context

Returns true if memory bazooka data are perfectly trustable, that is, it has never been resetted or resized.

Return value: 1 if trustable, 0 if not.

Function: int lw6sys_memory_bazooka_report (lw6sys_context_t * sys_context)

sys_context: global system context

Reports memory bazooka diagnostics on the console. Carefull, this one is not reentrant, call at the end of your program when all threads are joined.

Return value: 1 if no allocated stuff left, 0 if there are still malloc’ed stuff

Function: char * lw6sys_build_get_package_tarname ()

Returns the name of the package. This is the PACKAGE_TARNAME constant defined by the GNU Autoconf ./configure script. While it’s always possible to use the defined constant directly, using this function will return the value defined when compiling the binary, not the one you’re using when compiling another program relying on Liquid War as a library.

Return value: a non-NULL string "liquidwar6", must not be freed.

Function: char * lw6sys_build_get_package_name ()

Returns the name of the package, in a user friendly form, which can include spaces, for instance. This is the PACKAGE_NAME constant defined by the GNU Autoconf ./configure script. While it’s always possible to use the defined constant directly, using this function will return the value defined when compiling the binary, not the one you’re using when compiling another program relying on Liquid War as a library.

Return value: a non-NULL string "Liquid War 6", must not be freed.

Function: char * lw6sys_build_get_package_string ()

Returns the description of the package. This is the PACKAGE_STRING constant defined by the GNU Autoconf ./configure script. It’s the concatenation of PACKAGE_NAME and VERSION. While it’s always possible to use the defined constant directly, using this function will return the value defined when compiling the binary, not the one you’re using when compiling another program relying on Liquid War as a library.

Return value: a non-NULL string "Liquid War 6 <version>", must not be freed.

Function: char * lw6sys_build_get_package_id ()

Returns the id of the package. This is not an autotools standard ID, in fact it’s just PACKAGE_TARNAME concatenated with VERSION, that is liquidwar6-<version>.

Return value: a non-NULL string "liquidwar6-<version>", must not be freed.

Function: char * lw6sys_build_get_version ()

Returns the version of the program. This is the VERSION constant defined by the GNU Autoconf ./configure script. Same as PACKAGE_VERSION. Note that while using a function to get PACKAGE_TARNAME might seem useless, having both ways to get the version, that is, a function and a constant, is very usefull. Think, for instance, that a dynamically loaded shared library might need to check its own version against the version of the core program.

Return value: a non-NULL string, which must not be freed.

Function: char * lw6sys_build_get_codename ()

Returns the the program codename. This is the little name of the version. It’s been decided that all LW6 releases would take the name of a famous general, warrior, whatever. For instance, it could be "Napoleon".

Return value: a non-NULL string, traditionnally the name of a famous general, someone which has been involved in war. Must not be freed (I mean, the string, not the general).

Function: char * lw6sys_build_get_version_base ()

Returns the program base version number. If version is X.Y.Z, this is X.Y, think of it as MAJOR.MINOR and globally determines the level of compatibility of the program. Two program exposing the same version should be network compatible and also be able to use the same ressource files (graphics, maps, sounds...) as well as being capable of using the same binary modules (graphics backends, bots and so on).

Return value: a non-NULL string, typically "0.1" (beta release) or "6.0" (stable). Must not be freed.

Function: char * lw6sys_build_get_version_major ()

Returns the program major version number. If version is X.Y.Z, this is X. It’s mainly used to make the difference between alpha/beta releases (with "0" here) and stable releases using "6" as we are talking about LW6, after all.

Return value: a non-NULL string, typically "0" (beta release) or "6" (stable). Must not be freed.

Function: char * lw6sys_build_get_version_minor ()

Returns the program minor version number. If version is X.Y.Z, this is Y. This one should increase manually at each significant/public release of the game.

Return value: a non-NULL string like "42", which must not be freed.

Function: char * lw6sys_build_get_stamp ()

Returns the program stamp. This is like a serial number. It’s is not the same as the version. The version is meant to be set to something readable. This is just a cryptic thing, incremented at each ./configure or each developper’s "I feel like it needs to be incremented". The idea is just to keep (one more...) track of which source code is build. Ideally, this would be plugged to the source revision control system but this has some drawbacks, including that it would require it to modify files before commiting them, which is not safe, and almost impossible if you sign archives. One more point: this is a string. It’s true the return value is actually a string containing the representation of an integer, but because all other build parameters are strings, and because we don’t know what the future reserves, it’s a string. If version is X.Y.Z, this is Z. Also called revision.

Return value: a non-NULL string like "666", which must not be freed.

Function: char * lw6sys_build_get_md5sum ()

Returns an md5 checkum which is caculated from C (.c and .h) source files. This is complementary with the build stamp. By default the stamp will be enough to check what has been compiled, but one can always imagine a case where Bob compiles something a little different than Alice, with the same stamp, incremented by 1 from a common source tree. They apply their own patches, for instance. This md5sum double-checks that two binaries have been built from the same sources. Note that this is not the md5 checksum of the generated binary. Nor does it include any information about scheme scripts and data.

Return value: a non-NULL string, which must not be freed.

Function: char * lw6sys_build_get_copyright ()

Returns a (very) short copyright information about the program.

Return value: a non-NULL string, single line whithout ’\n’ at the end. Must not be freed.

Function: char * lw6sys_build_get_license ()

Returns the license for the program (GNU GPL v3 or later).

Return value: a non-NULL string, single line whithout ’\n’ at the end. Must not be freed.

Function: char * lw6sys_build_get_home_url ()

Returns the URL of the game, its homepage.

Return value: a non-NULL string, single line whithout ’\n’ at the end. Must not be freed.

Function: char * lw6sys_build_get_bugs_url ()

Returns the URL for bugs, the bug reports page.

Return value: a non-NULL string, single line whithout ’\n’ at the end. Must not be freed.

Function: char * lw6sys_build_get_configure_args ()

Returns the arguments passed to the GNU Autoconf ./configure script when buildling the game. Very usefull to know how the binary was generated, that is, what kind of optimizations are peculiar settings it uses.

Return value: a non-NULL string, which, passed to ./configure again, would hopefully generate the same binary. Must not be freed.

Function: char * lw6sys_build_get_gcc_version ()

Returns __VERSION__ GCC preprocessor value, that is, the human readable version of the compiler.

Return value: a non-NULL string, must not be freed.

Function: char * lw6sys_build_get_cflags ()

Returns the arguments which would allow another program to use liquidwar6 as a library. Typically, pass this to gcc when compiling your sources. Basically contains "-I" switches which tell where the headers are.

Return value: a non-NULL string, which must not be freed.

Function: char * lw6sys_build_get_ldflags ()

Returns the arguments which would allow another program to link against liquidwar6. Pass this to gcc or libtool when compiling your program. Basically contains a "-L" option which says where the library is. Note that this will only allow you to link against the main libliquidwar6 library, but not the dynamically loaded modules.

Return value: a non-NULL string, which must not be freed.

Function: char * lw6sys_build_get_hostname ()

Returns the value return by the standard shell hostname command on the machine where the game has been built. Usefull to track binaries and know where do they come from.

Return value: a non-NULL string, must not be freed.

Function: char * lw6sys_build_get_date ()

Returns the compilation date. While this information can easily be obtained with the C __DATE__ macro, having this function is convenient for it returns a value which is the same for the whole program, and does not possibly change in every file.

Return value: a non-NULL string, must not be freed.

Function: char * lw6sys_build_get_time ()

Returns the compilation date. While this information can easily be obtained with the C __TIME__ macro, having this function is convenient for it returns a value which is the same for the whole program, and does not possibly change in every file.

Return value: a non-NULL string, must not be freed.

Function: char * lw6sys_build_get_host_cpu ()

Returns the CPU this program is designed for. Convenient on i386 compatible CPUs to know which flavor (i386, i586...) the binary is made for.

Return value: a non-NULL string, must not be freed.

Function: char * lw6sys_build_get_endianness (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the endianness of the computer.

Return value: ’little’ (x86-like) or ’big’ (ppc-like), as a string. Must not be freed.

Function: int lw6sys_build_get_pointer_size ()

Returns the system pointer size, in bytes.

Return value: 4 for 32-bit, 8 for 64-bit.

Function: int lw6sys_build_is_x86 ()

Tells wether CPU belongs to x86 family or not.

Return value: 1 if x86, 0 if not

Function: int lw6sys_build_is_amd64 ()

Tells wether CPU belongs to amd64 family or not.

Return value: 1 if amd64, 0 if not

Function: char * lw6sys_build_get_host_os ()

Returns the OS this program is designed for. Usefull for bug reports.

Return value: a non-NULL string, must not be freed.

Function: int lw6sys_build_is_gnu ()

Tells wether the program was compiled for a GNU system, or not.

Return value: 1 if compiled on windows, 0 if not

Function: int lw6sys_build_is_unix ()

Tells wether the program was compiled for a UNIX system, or not.

Return value: 1 if compiled on windows, 0 if not

Function: int lw6sys_build_is_ms_windows ()

Tells wether the program was compiled for Microsoft Windows, or not.

Return value: 1 if compiled on windows, 0 if not

Function: int lw6sys_build_is_mac_os_x ()

Tells wether the program was compiled for Mac OS X, or not.

Return value: 1 if compiled on OS X, 0 if not

Function: int lw6sys_build_is_gp2x ()

Tells wether the program was compiled for GP2X, or not.

Return value: 1 if compiled on OS X, 0 if not

Function: char * lw6sys_build_get_top_srcdir (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the top source directory, when the game was built. This can seem useless and non relevant on the end-user’s machine, but... it’s a must-have for developpers and packagers. Without this, binaries would never find their associated data, especially when building outside the source tree. Or, testing the game would be impossible without installing it, given the fact that most of the code is in scripts that are stored in /usr/local by default, this would be painfull. So this function is here to help finding data within the source tree when the game is not installed yet. Note that the function is rather clever, since it will automatically try to remove useless ’../’ sequences at the beginning of a possibly relative path. Note that the equivalent abs_srcdir function is somewhat more reliable.

Return value: a non-NULL string, must not be freed.

Function: char * lw6sys_build_get_abs_srcdir ()

Returns top_srcdir as an absolute path, this is most of the time more usable than the relative path.

Return value: a non-NULL string, must not be freed.

Function: char * lw6sys_build_get_prefix ()

Returns the prefix value as given to the GNU Autoconf ./configure script. Used to deduce the path to other directories and files.

Return value: a non-NULL string, "/usr/local" by default. Must not be freed.

Function: char * lw6sys_build_get_datadir ()

Returns the datadir value defined by the GNU Autoconf ./configure script. This is not the value which can be overriden by the Liquid War 6 specific. "–data-dir" option. datadir is usually something like "/usr/local/share" while the actual Liquid War 6 defined data dir is a more profound path which includes the name of the package, its version, and so on.

Return value: a non-NULL string, "/usr/local/share" by default. Must not be freed.

Function: char * lw6sys_build_get_libdir ()

Returns the libdir value defined by the GNU Autoconf ./configure script. This is not the value which can be overriden by the Liquid War 6 specific. "–mod-dir" option. libdir is usually something like "/usr/local/lib" while the actual Liquid War 6 defined module dir is a more profound path which includes the name of the package, its version, and so on.

Return value: a non-NULL string, "/usr/local/lib" by default. Must not be freed.

Function: char * lw6sys_build_get_includedir ()

Returns the includedir value defined by the GNU Autoconf ./configure script. As for other options, it’s interesting to have this value, this enables the program to inform people who want to hack the game of the place headers are supposed to be installed.

Return value: a non-NULL string, "/usr/local/include" by default. Must not be freed.

Function: char * lw6sys_build_get_localedir ()

Returns the localedir value defined by the GNU Autoconf ./configure script. Used as an argument for gettext / libintl functions.

Return value: a non-NULL string, "/usr/local/share/locale" by default. Must not be freed.

Function: char * lw6sys_build_get_docdir ()

Returns the docdir value defined by the GNU Autoconf ./configure script. Used to write consistent XML file headers.

Return value: a non-NULL string, "/usr/local/share/doc/liquidwar6" by default. Must not be freed.

Function: char * lw6sys_build_get_enable_console ()

Tells wether console is enabled or not.

Return value: "yes" or "no", must no be freed.

Function: char * lw6sys_build_get_enable_gtk ()

Tells wether gtk is enabled or not.

Return value: "yes" or "no", must no be freed.

Function: char * lw6sys_build_get_enable_mod_gl1 ()

Tells wether the graphical mod-gl1 backend was compiled.

Return value: "yes" or "no", must no be freed.

Function: char * lw6sys_build_get_enable_mod_gles2 ()

Tells wether the graphical mod-gles2 backend was compiled.

Return value: "yes" or "no", must no be freed.

Function: char * lw6sys_build_get_enable_mod_soft ()

Tells wether the graphical mod-soft backend was compiled.

Return value: "yes" or "no", must no be freed.

Function: char * lw6sys_build_get_enable_mod_caca ()

Tells wether the graphical mod-caca backend was compiled.

Return value: "yes" or "no", must no be freed.

Function: char * lw6sys_build_get_enable_mod_csound ()

Tells wether the audio mod-csound backend was compiled.

Return value: "yes" or "no", must no be freed.

Function: char * lw6sys_build_get_enable_mod_ogg ()

Tells wether the audio mod-ogg backend was compiled.

Return value: "yes" or "no", must no be freed.

Function: char * lw6sys_build_get_enable_mod_http ()

Tells wether the network mod-http backend was compiled.

Return value: "yes" or "no", must no be freed.

Function: char * lw6sys_build_get_enable_openmp ()

Tells wether the game was compiled with openmp support.

Return value: "yes" or "no", must no be freed.

Function: char * lw6sys_build_get_enable_optimize ()

Tells wether the game was compiled in optimize mode.

Return value: "yes" or "no", must no be freed.

Function: char * lw6sys_build_get_enable_allinone ()

Tells wether the game was compiled in allinone mode.

Return value: "yes" or "no", must no be freed.

Function: char * lw6sys_build_get_enable_fullstatic ()

Tells wether the game was compiled in fullstatic mode.

Return value: "yes" or "no", must no be freed.

Function: char * lw6sys_build_get_enable_paranoid ()

Tells wether the game was compiled with paranoid memory management.

Return value: "yes" or "no", must no be freed.

Function: char * lw6sys_build_get_enable_gprof ()

Tells wether the game was compiled with suitable informations for gprof.

Return value: "yes" or "no", must no be freed.

Function: char * lw6sys_build_get_enable_instrument ()

Tells wether the game was compiled with the ’-finstrument-fonctions’ GCC flag.

Return value: "yes" or "no", must no be freed.

Function: char * lw6sys_build_get_enable_profiler ()

Tells wether the game was compiled for later use with Google Profiler support.

Return value: "yes" or "no", must no be freed.

Function: char * lw6sys_build_get_enable_gcov ()

Tells wether the game was compiled with suitable informations for gcov.

Return value: "yes" or "no", must no be freed.

Function: char * lw6sys_build_get_enable_valgrind ()

Tells wether the game was compiled for later use with valgrind.

Return value: "yes" or "no", must no be freed.

Function: int lw6sys_build_get_bin_id (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the internal bin-id value, which does not mean anything but changes at each build.

Return value: an integer

Function: void lw6sys_build_log_all (lw6sys_context_t * sys_context)

sys_context: global system context

Dumps in the log file the whole program pedigree, host, modules, that is, what are the values of all the build options. Usefull for bug reports.

Return value: none.

Function: lw6sys_cache_t * lw6sys_cache_new (lw6sys_context_t * sys_context, lw6sys_free_func_t free_func, int size, int delay_msec)

sys_context: global system context

free_func: optional callback used to free memory when stored date is a pointer. Can be NULL when one stores non dynamically allocated data, such as an integer or a static array.

size: the estimated size of the cache table. This is required because, internally, the object uses a hash. Note that this is an estimation only. You could theorically fit 1000000 objects in a 3-sized cache. Problem -> this is inefficient, you’d better use an assoc or a bigger cache. If you store 3 elements in a 1000000-sized cache, you’ll waste memory. It might be wise to use a prime number as the estimated size. 421 is prime ;)

Creates an empty cache. There’s a difference between NULL and an empty cache.

Return value: a pointer to the newly allocated cache table. Must be freed with lw6sys_cache_free.

Function: void lw6sys_cache_free (lw6sys_context_t * sys_context, lw6sys_cache_t * cache)

sys_context: global system context

cache: the cache to be freed.

The function will cascade delete all elements, using (if not NULL...) the callback passed when first creating the cache.

Return value: void

Function: void lw6sys_cache_free_callback (lw6sys_context_t * sys_context, void * data)

sys_context: global system context

data: data to free, this is normally an cache item

This is a wrapper, used as the actual free callback for the internal hash. What it does is that it just runs the real free callback (the one given by the user) on the member value. This indirection is required since we use the intermediate item object to store the timestamp along with the key and data.

Return value: none.

Function: int lw6sys_cache_has_key (lw6sys_context_t * sys_context, lw6sys_cache_t * cache, const char * key)

sys_context: global system context

cache: the cache to test

key: the key to search

Tells wether the key is present or not. If key is here but too old (expired) then will return 0 and key will be deleted on the fly.

Return value: non-zero if there’s an entry with the corresponding key.

Function: void * lw6sys_cache_get (lw6sys_context_t * sys_context, lw6sys_cache_t * cache, const char * key)

sys_context: global system context

cache: the cache to query

key: the key of which we want the value

Gets the value corresponding to a given key. Note that the value might be NULL, even if the key exists. If the key has expired, NULL will be returned, and the entry deleted on the fly.

Return value: a void pointer to the data contained in the cache. Note that the pointer on the actual data is returned, that is, if it’s static data, you must not try to free it... As long as memory management is concerned, destroying the cache will actually free the data if needed.

Function: void lw6sys_cache_set (lw6sys_context_t * sys_context, lw6sys_cache_t * cache, const char * key, void * value)

cache: the cache to modify

key: the key we want to updated

value: the new value

Sets a value in a cache table. The key pointer need not be persistent, it can be freed after affectation. In fact a new string will be created internally. This is not true for the value, it’s hard to find way to copy "any object". So if you want a cache of strings, key can disappear after calling this function, but not value. The function passed as free_func when creating the cache will be used to free stuff whenever needed (unset or free).

Return value: void

Function: void lw6sys_cache_unset (lw6sys_context_t * sys_context, lw6sys_cache_t * cache, const char * key)

sys_context: global system context

cache: the cache concerned

key: the key to unset

Clears an entry in a cache table. The callback passed when creating the cache will be called if needed, to free the data automatically.

Return value: void

Function: u_int32_t lw6sys_checksum (lw6sys_context_t * sys_context, unsigned char * data, int len)

sys_context: global system context

data: the data to process

len: the length, in bytes, of the data to process

Creates a checksum from a byte array. This could be mapped on any standard CRC-32 and/or MD5 algorithm, but licence issues for those are such a headache that for the sake of simplicity, it’s wrapped here. In LW6 context, we do not really really fear any attack for these checksums are used internally to track bugs and check, for instance, that two game states are actually the same on two distant computers in a network game. Data encryption and security of network links is another debate. Additionnally, this function returns an integer, easier to handle in standard C than any malloc’ed stuff.

Return value: the checksum, as an integer.

Function: u_int32_t lw6sys_checksum_str (lw6sys_context_t * sys_context, const char * value)

sys_context: global system context

value: the string to process

Creates a checksum from a string. This is a convenience function to save the programmer the hassle of calling strlen before any checksum calculation.

Return value: the checksum, as an integer.

Function: u_int32_t lw6sys_checksum_int32 (lw6sys_context_t * sys_context, u_int32_t value)

sys_context: global system context

value: the integer to process

Creates a checksum from an integer. This is a convenience function to save the programmer the hassle of passing a pointer to the integer with the size of it each time there’s a checksum to do. Additionnally, with this one you can pass an int8 or an int16, and function will work just the same indenpendantly of endianness.

Return value: the checksum, as an integer.

Function: u_int32_t lw6sys_checksum_int64 (lw6sys_context_t * sys_context, u_int64_t value)

value: the integer to process

Creates a checksum from an integer. This is a convenience function to save the programmer the hassle of passing a pointer to the integer with the size of it each time there’s a checksum to do. This function handles 64-bit long long integers..

Return value: the checksum, as an integer.

Function: u_int32_t lw6sys_checksum_whd (lw6sys_context_t * sys_context, lw6sys_whd_t * whd)

sys_context: global system context

whd: a pointer to the wh struct to be processed

Creates a checksum from the given structure. Convenience function to save the hassle of passing a pointer to and the size of the lw6sys_wh_t struct each time, knowing that there are very often checksums calculated on it. Also avoids endianess issues.

Return value: the checksum, as an integer.

Function: u_int32_t lw6sys_checksum_xyz (lw6sys_context_t * sys_context, lw6sys_xyz_t * xyz)

sys_context: global system context

xyz: a pointer to the xy struct to be processed

Creates a checksum from the given structure. Convenience function to save the hassle of passing a pointer to and the size of the lw6sys_xy_t struct each time, knowing that there are very often checksums calculated on it. Also avoids endianess issues.

Return value: the checksum, as an integer.

Function: void lw6sys_checksum_update (lw6sys_context_t * sys_context, u_int32_t * checksum, unsigned char * data, int len)

sys_context: global system context

checksum: a pointer to the previous checksum

data: the data to process

len: the length, in bytes, of the data to process

Creates a checksum from the given data. The difference with lw6sys_checksum is that this one updates an existing checksum, thus enabling the programmer to call it sequentially and get a global checksum on different sources.

Return value: none.

Function: void lw6sys_checksum_update_str (lw6sys_context_t * sys_context, u_int32_t * checksum, const char * value)

sys_context: global system context

checksum: a pointer to the previous checksum

value: the string to process

Creates a checksum from the given string. The difference with lw6sys_checksum_str is that this one updates an existing checksum, thus enabling the programmer to call it sequentially and get a global checksum on different sources.

Return value: none.

Function: void lw6sys_checksum_update_int32 (lw6sys_context_t * sys_context, u_int32_t * checksum, int32_t value)

sys_context: global system context

checksum: a pointer to the previous checksum

value: the integer to process

Creates a checksum from the given integer. The difference with lw6sys_checksum_int32 is that this one updates an existing checksum, thus enabling the programmer to call it sequentially and get a global checksum on different sources.

Return value: none.

Function: void lw6sys_checksum_update_int64 (lw6sys_context_t * sys_context, u_int32_t * checksum, int64_t value)

sys_context: global system context

checksum: a pointer to the previous checksum

value: the integer to process

Creates a checksum from the given integer. The difference with lw6sys_checksum_int64 is that this one updates an existing checksum, thus enabling the programmer to call it sequentially and get a global checksum on different sources.

Return value: none.

Function: void lw6sys_checksum_update_whd (lw6sys_context_t * sys_context, u_int32_t * checksum, const lw6sys_whd_t * whd)

sys_context: global system context

checksum: a pointer to the previous checksum

whd: a pointer to the wh struct to be processed

Creates a checksum from the given structure. The difference with lw6sys_checksum_whd is that this one updates an existing checksum, thus enabling the programmer to call it sequentially and get a global checksum on different sources.

Return value: none.

Function: void lw6sys_checksum_update_xyz (lw6sys_context_t * sys_context, u_int32_t * checksum, const lw6sys_xyz_t * xyz)

sys_context: global system context

checksum: a pointer to the previous checksum

xyz: a pointer to the xy struct to be processed

Creates a checksum from the given structure. The difference with lw6sys_checksum_xyz is that this one updates an existing checksum, thus enabling the programmer to call it sequentially and get a global checksum on different sources.

Return value: none.

Function: u_int8_t lw6sys_color_float2char (float f)

f: the value to convert, from 0.0f to 1.0f

Converts a floating point value between 0.0f and 1.0f to its 8-bit equivalent between 0 and 255. Usefull in color conversion.

Return value: an integer between 0 and 255.

Function: float lw6sys_color_char2float (u_int8_t i)

i: the value to convert, from 0 to 255

Converts an 8-bit value between 0 and 255 to its floating-point equivalent between 0.0f and 1.0f. Usefull in color conversion.

Return value: a float between 0.0f and 1.0f.

Function: lw6sys_color_8_t lw6sys_color_f_to_8 (const lw6sys_color_f_t * color_f)

color_f: the color to convert

Converts a color from floating point format to the integer "0 to 255" common format. All fields (RGBA) are converted.

Return value: the color in 8-bit format.

Function: void lw6sys_color_8_to_f (lw6sys_color_f_t * color_f, lw6sys_color_8_t color_8)

color_f: the converted color (pointer must point to writable memory)

color_8: the color to convert

Converts a color from the integer "0 to 255" common format to floating point format. All fields (RGBA) are converted.

Return value: none.

Function: u_int32_t lw6sys_color_f_to_irgba (const lw6sys_color_f_t * color_f)

color_f: the color to convert

Converts a color from floating point format to a single integer, where all fields (RGBA) are serialized. This serialization is endianess independant. Could be used directly by low-level libraries such as SDL.

Return value: the color serialized in an integer.

Function: u_int32_t lw6sys_color_f_to_ibgra (const lw6sys_color_f_t * color_f)

color_f: the color to convert

Converts a color from floating point format to a single integer, where all fields (BGRA) are serialized. This serialization is endianess independant. Could be used directly by low-level libraries such as SDL.

Return value: the color serialized in an integer.

Function: u_int32_t lw6sys_color_f_to_iargb (const lw6sys_color_f_t * color_f)

color_f: the color to convert

Converts a color from floating point format to a single integer, where all fields (ARGB) are serialized. This serialization is endianess independant. Could be used directly by low-level libraries such as SDL.

Return value: the color serialized in an integer.

Function: u_int32_t lw6sys_color_f_to_iabgr (const lw6sys_color_f_t * color_f)

color_f: the color to convert

Converts a color from floating point format to a single integer, where all fields (ABGR) are serialized. This serialization is endianess independant. Could be used directly by low-level libraries such as SDL.

Return value: the color serialized in an integer.

Function: u_int32_t lw6sys_color_8_to_irgba (lw6sys_color_8_t color_8)

color_8: the color to convert

Converts a color from common "0 to 255" structured format to a single integer, where all fields (RGBA) are serialized. This serialization is endianess independant. Could be used directly by low-level libraries such as SDL.

Return value: the color serialized in an integer.

Function: u_int32_t lw6sys_color_8_to_ibgra (lw6sys_color_8_t color_8)

color_8: the color to convert

Converts a color from common "0 to 255" structured format to a single integer, where all fields (BGRA) are serialized. This serialization is endianess independant. Could be used directly by low-level libraries such as SDL.

Return value: the color serialized in an integer.

Function: u_int32_t lw6sys_color_8_to_iargb (lw6sys_color_8_t color_8)

color_8: the color to convert

Converts a color from common "0 to 255" structured format to a single integer, where all fields (ARGB) are serialized. This serialization is endianess independant. Could be used directly by low-level libraries such as SDL.

Return value: the color serialized in an integer.

Function: u_int32_t lw6sys_color_8_to_iabgr (lw6sys_color_8_t color_8)

color_8: the color to convert

Converts a color from common "0 to 255" structured format to a single integer, where all fields (ABGR) are serialized. This serialization is endianess independant. Could be used directly by low-level libraries such as SDL.

Return value: the color serialized in an integer.

Function: void lw6sys_color_irgba_to_f (lw6sys_color_f_t * color_f, u_int32_t color_i)

color_f: the converted color (point must point to writable memory)

color_i: the color to convert

Converts a color from a serialized integer format (RGBA) to a floating point structure.

Return value: none.

Function: void lw6sys_color_ibgra_to_f (lw6sys_color_f_t * color_f, u_int32_t color_i)

color_f: the converted color (point must point to writable memory)

color_i: the color to convert

Converts a color from a serialized integer format (BGRA) to a floating point structure.

Return value: none.

Function: void lw6sys_color_iargb_to_f (lw6sys_color_f_t * color_f, u_int32_t color_i)

color_f: the converted color (point must point to writable memory)

color_i: the color to convert

Converts a color from a serialized integer format (ARGB) to a floating point structure.

Return value: none.

Function: void lw6sys_color_iabgr_to_f (lw6sys_color_f_t * color_f, u_int32_t color_i)

color_f: the converted color (point must point to writable memory)

color_i: the color to convert

Converts a color from a serialized integer format (ABGR) to a floating point structure.

Return value: none.

Function: lw6sys_color_8_t lw6sys_color_irgba_to_8 (u_int32_t color_i)

color_i: the color to convert

Converts a color from a serialized integer format (RGBA) to a "0 to 255" based structure.

Return value: the converted color (structure).

Function: lw6sys_color_8_t lw6sys_color_ibgra_to_8 (u_int32_t color_i)

color_i: the color to convert

Converts a color from a serialized integer format (BGRA) to a "0 to 255" based structure.

Return value: the converted color (structure).

Function: lw6sys_color_8_t lw6sys_color_iargb_to_8 (u_int32_t color_i)

color_i: the color to convert

Converts a color from a serialized integer format (ARGB) to a "0 to 255" based structure.

Return value: the converted color (structure).

Function: lw6sys_color_8_t lw6sys_color_iabgr_to_8 (u_int32_t color_i)

color_i: the color to convert

Converts a color from a serialized integer format (ABGR) to a "0 to 255" based structure.

Return value: the converted color (structure).

Function: lw6sys_color_8_t lw6sys_color_a_to_8 (lw6sys_context_t * sys_context, const char * ascii)

sys_context: global system context

ascii: the color to convert

Converts a color from a human readable string to a "0 to 255" based structure. The string must be of the form "#RRGGBBAA" or "#RGB", in a general manner any HTML-valid value should work.

Return value: the converted color (structure).

Function: void lw6sys_color_a_to_f (lw6sys_context_t * sys_context, lw6sys_color_f_t * color_f, const char * ascii)

sys_context: global system context

color_f: the converted color (pointer must point to writable memory)

ascii: the color to convert

Converts a color from a human readable string to a float based structure. The string must be of the form "#RRGGBBAA" or "#RGB", in a general manner any HTML-valid value should work.

Return value: none.

Function: char * lw6sys_color_8_to_a (lw6sys_context_t * sys_context, lw6sys_color_8_t color_8)

sys_context: global system context

color_8: the color to convert

Converts a color from a "0 - 255" integer based structure to its readable form "#RRGGBBAA". If alpha is 255 (0xFF), that is, if it’s opaque, then the "AA" part is ommitted.

Return value: a newly allocated string.

Function: void lw6sys_color_rgb_to_hsv (lw6sys_context_t * sys_context, lw6sys_color_hsv_t * color_hsv, lw6sys_color_8_t color_8)

sys_context: global system context

color_hsv: the target color, in HSV format

color_8: the source color, in RGB 256 format

Converts from HSV to RGB. Usefull for color manipulation, since most colors are stored in RGB but HSV is convenient for transformation. Alpha layer is kept as is.

Return value: none.

Function: lw6sys_color_8_t lw6sys_color_hsv_to_rgb (lw6sys_context_t * sys_context, const lw6sys_color_hsv_t * color_hsv)

sys_context: global system context

color_hsv: the source color, in HSV format

Converts from RGB to HSV. Usefull to make colors transformed in HSV format usable again by all display routines, which consume RGB. Alpha layer is kept as is.

Return value: the RGB color.

Function: void lw6sys_color_hsv_invert (lw6sys_context_t * sys_context, lw6sys_color_hsv_t * color_hsv, int invert_h, int invert_s, int invert_v)

sys_context: global system context

color_hsv: the source color, in HSV format

invert_h: wether to invert the hue

invert_s: wether to invert the saturation

invert_v: wether to invert the value

Inverts an HSV color, calling it with 1,0,0 the color will become a color with opposite hue but same saturation and same value.

Return value: none.

Function: int lw6sys_color_is_grey (lw6sys_color_8_t color)

color: the color to test

Tells wether a color is pure grey or not. This is interesting for such colors have no hue and sometimes need special handling.

Return value: 1 if grey, 0 if colored

Function: lw6sys_color_8_t lw6sys_color_average (lw6sys_context_t * sys_context, int size, const lw6sys_color_8_t * colors)

sys_context: global system context

size: number of the color array (number of items)

colors: the colors to compute

Tries to find out the "average" color from an array of colors. The algorithm is far from perfect, but should output a color which reflects the colors passed in.

Return value: the (inexact) average color.

Function: lw6sys_color_8_t lw6sys_color_ponderate (lw6sys_context_t * sys_context, lw6sys_color_8_t color1, lw6sys_color_8_t color2, float coeff)

sys_context: global system context

color1: first color

color2: second color

coeff: the ponderation coefficient

Tries to find a color between the two colors passed as an argument. The coefficient can be used, to set the relative weight of each color. Using 0 will return color1, 1 will return color2 and 0.5 will make an average between the two colors. Any value between 0 and 1 can be used.

Return value: the (inexact) ponderated color.

Function: float lw6sys_color_distance (lw6sys_context_t * sys_context, lw6sys_color_8_t color1, lw6sys_color_8_t color2)

sys_context: global system context

color1: first color

color2: second color

Calculates the distance between two colors. The unit is arbitrary, a big value means "colors are different", 0 means they are the same. A distance of 1 corresponds to colors which have barely anything in common, but the result can still be greater than 1. Alpha layer is not taken in account.

Return value: the distance.

Function: int lw6sys_color_is_same (lw6sys_context_t * sys_context, lw6sys_color_8_t color1, lw6sys_color_8_t color2)

sys_context: global system context

color1: the first color to compare

color2: the second color to compare

Compares two colors.

Return value: 1 if they are the same, 0 if not.

Function: void lw6sys_color_8_solid (lw6sys_color_8_t * color)

color: the color to modify

Make a color "solid" that is make it not transparent at all.

Return value: none.

Function: void lw6sys_color_f_solid (lw6sys_color_f_t * color)

color: the color to modify

Make a color "solid" that is make it not transparent at all.

Return value: none.

Function: lw6sys_context_t * lw6sys_context_new ()

Create a new global system context. This is normally called only once during a program execution and is wrapped in lw6sys_context_init.

Return value: newly allocated context

Function: void lw6sys_context_free (lw6sys_context_t * sys_context)

sys_context: global system context

Frees a global system context. Called only once during a program execution and is wrapped in lw6sys_context_quit.

Return value: none

Function: void lw6sys_context_begin (lw6sys_context_t * sys_context)

sys_context: global system context

Performs all initializations required for lw6sys functions to behave correctly, this includes locale settings, timer initialization, memory management related stuff. This is wrapped into lw6sys_context_init.

Return value: none

Function: int lw6sys_context_end (lw6sys_context_t * sys_context)

sys_context: global system context

Performs all cleanup required after all lw6sys functions have been called. Once this has been called, do not call any function that requires a valid context, except maybe lw6sys_context_free. This is wrapped into lw6sys_context_quit.

Return value: 1 on success, 0 on failure. A failure can reveal a problem that occured way upstream, typically some memory not cleanly freed.

Function: lw6sys_context_t * lw6sys_context_init ()

Create a new global system context, and initalizes it, so that it’s ready for general use.

Return value: newly allocated and valid context

Function: int lw6sys_context_quit (lw6sys_context_t * sys_context)

sys_context: global system context

Performs all cleanup required after all lw6sys functions have been called, and frees the object.

Return value: 1 on success, 0 on failure. A failure can reveal a problem that occured way upstream, typically some memory not cleanly freed.

Function: int lw6sys_atoi (lw6sys_context_t * sys_context, const char * str)

sys_context: global system context

str: string to convert

Just a plain wrapper on atoi, it’s here for API consistency. Will check if str is NULL (and in this case return 0).

Return value: an integer.

Function: int64_t lw6sys_atoll (lw6sys_context_t * sys_context, const char * str)

sys_context: global system context

str: string to convert

Wrapper on atoll, it’s here for API consistency. Will check if str is NULL (and in this case return 0).

Return value: a 64-bit integer.

Function: int lw6sys_atob (lw6sys_context_t * sys_context, const char * str)

sys_context: global system context

str: string to convert

Transform a string into a boolean value. Accepts "0"/"1" in input, but also y/n, yes/no, true/false, on/off. Will check if str is NULL (and in this case return 0).

Return value: an integer, 0 or 1.

Function: float lw6sys_atof (lw6sys_context_t * sys_context, const char * str)

sys_context: global system context

str: string to convert

A wrapper on atof, makes sure the locale used is C (default) and won’t change the decimal separator whatsoever. Usefull for serialization for instance. Will check if str is NULL (and in this case return 0).

Return value: a float.

Function: char * lw6sys_itoa (lw6sys_context_t * sys_context, int value)

sys_context: global system context

value: the integer to convert

Converts an integer to a string, the advantage of this function is it allocates memory, and does the dirty job.

Return value: a newly allocated pointer, must be freed, may be NULL.

Function: char * lw6sys_lltoa (lw6sys_context_t * sys_context, int64_t value)

value: the integer to convert

Converts a 64-bit integer to a string, the advantage of this function is it allocates memory, and does the dirty job.

Return value: a newly allocated pointer, must be freed, may be NULL.

Function: char * lw6sys_btoa (lw6sys_context_t * sys_context, int value)

sys_context: global system context

value: the boolean to convert

Converts a boolean to a string, the advantage of this function is it allocates memory, and does the dirty job.

Return value: a newly allocated pointer, must be freed, may be NULL.

Function: char * lw6sys_ftoa (lw6sys_context_t * sys_context, float value)

sys_context: global system context

value: the float to convert

Converts a float to a string, the advantage of this function is it allocates memory, and does the dirty job.

Return value: a newly allocated pointer, must be freed, may be NULL.

Function: int lw6sys_cunit_run_tests (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: mode passed to program (bit mask)

Run all registered suites and their tests, will interpret mode and call the right CUnit function (Batch, Console, NCurses...).

Return value: 1 if tests or OK, 0 if not.

Function: void lw6sys_cunit_clear (lw6sys_context_t * sys_context)

sys_context: global system context

Clears the global CUnit related lock.

Return value: none.

Function: int lw6sys_cunit_lock (lw6sys_context_t * sys_context)

sys_context: global system context

Locks a global CUnit related lock, this is to allow the use of test macro LW6SYS_TEST_ACK in multithreaded environment, as CUnit does not, by default garantee that concurrent accesses to its API will work. Just to be sure... we lock.

Return value: 1 if locked, 0 on failure.

Function: int lw6sys_cunit_unlock (lw6sys_context_t * sys_context)

sys_context: global system context

Unlocks the global CUnit related lock, this is to allow the use of test macro LW6SYS_TEST_ACK in multithreaded environment, as CUnit does not, by default garantee that concurrent accesses to its API will work. Just to be sure... we lock.

Return value: 1 if unlocked, 0 on failure.

Function: char * lw6sys_daemon_pid_file (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc as passed to main

argv: argv as passed to main

Get the default pid file, used to lock daemon and avoid 2 daemons running at the same time.

Return value: newly allocated string

Function: int lw6sys_daemon_start (lw6sys_context_t * sys_context, char * pid_file)

sys_context: global system context

pid_file: the pid file used for the daemon

Calls fork internally to put the process in the program, make it a daemon. Note this won’t work on all platforms, for instance it won’t work on MS-Windows but this is rarely an issue as MS-Windows users are rarely concerned with detaching a program from a tty. Note that this isn’t a wrapper on fork, the return value is different,

Return value: 1 on success, 0 on failure.

Function: int lw6sys_daemon_stop (lw6sys_context_t * sys_context, char * pid_file)

sys_context: global system context

pid_file: the pid file used for the daemon

Removes the daemon pid file. Can be called safely even if daemon wasn’t started.

Return value: 1 on success, 0 on failure

Function: int lw6sys_debug_get (lw6sys_context_t * sys_context)

sys_context: global system context

Gets the debug mode.

Function: void lw6sys_debug_set (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: the debug mode, 1 if set, 0 if not.

Sets the debug mode.

Function: void lw6sys_dump_clear (lw6sys_context_t * sys_context, char * user_dir)

sys_context: global system context

user_dir: the user directory, where user can write data.

Clears the dump file. That is, resets it to a "0 byte" file.

Return value: none.

Function: int lw6sys_dump (lw6sys_context_t * sys_context, char * user_dir, char * content)

sys_context: global system context

user_dir: the user directory, where user can write data.

content: the content to be written in the dump file.

Writes the dump file onto the disk. The dump is used for special error messages which do not really fit in the standard log, and require a special treatment. In pratice, it’s used to log fatal script (Guile) errors.

Return value: 1 if success, 0 if failure.

Function: char lw6sys_env_separator_char ()

Gets the ENV separator, that is, for instance, the character used to separate paths in environment variables. Typically, this would be ":" on GNU and ";" on Microsft platforms.

Return value: the ascii character code.

Function: char * lw6sys_env_separator_str ()

Gets the ENV separator, that is, for instance, the character used to separate paths in environment variables. Typically, this would be ":" on GNU and ";" on Microsft platforms.

Return value: a pointer to a single 0-terminated character string which contains the character. Must not be freed.

Function: char * lw6sys_env_concat (lw6sys_context_t * sys_context, const char * value1, const char * value2)

sys_context: global system context

value1: the left part to be concatenated

value2: the right part to be concatenated

Concatenates two values and puts the ENV separator, as returned by lw6sys_env_separator_char between them.

Return value: the concatenated string, must be freed.

Function: int lw6sys_env_exists_prefixed (lw6sys_context_t * sys_context, const char * keyword)

sys_context: global system context

keyword: the keyword to be searched in the environment variables.

Searches environment variables for the given keyword. The keyword will be fixed so that all dashes "-" characters are replaced by underscores "_" characters. Characters will be changed to uppercase. Any non alphanumeric character will be replaced by "_". Finally, an "LW6_" prefix will be added. That is to say, calling this function with "my-param" will search for the "LW6_MY_PARAM" environment variable.

Return value: 1 if the environment variable exists, 0 if not.

Function: char * lw6sys_getenv (lw6sys_context_t * sys_context, const char * key)

sys_context: global system context

key: the environment variable to get.

Searches environment variables for the given value. This is a wrapper over the standard C getenv, the difference is it will return a dynamically allocated pointer, and on some platforms will query specific OS functions.

Return value: the value for the given keyword. May be NULL. Must be freed.

Function: char * lw6sys_getenv_prefixed (lw6sys_context_t * sys_context, const char * keyword)

sys_context: global system context

keyword: the keyword to be searched in the environment variables.

Searches environment variables for the given value. The keyword will be fixed so that all dashes "-" characters are replaced by underscores "_" characters. Characters will be changed to uppercase. Any non alphanumeric character will be replaced by "_". Finally, an "LW6_" prefix will be added. That is to say, calling this function with "my-param" will search for the "LW6_MY_PARAM" environment variable.

Return value: the value for the given keyword. May be NULL. Must be freed.

Function: int lw6sys_setenv (lw6sys_context_t * sys_context, const char * keyword, const char * value)

keyword: the environment variable to set

value: the value of the environment variable to set

Sets the environment variable to a given value. If value is NULL, variable is unset. Note that unlike lw6sys_getenv_prefixed, this function does not transform the keyword into "LW6_..." before setting the value, so it’s your responsability to call "lw6sys_keyword_as_env" if needed.

Return value: 1 if success, 0 if failed

Function: int lw6sys_setenv_prefixed (lw6sys_context_t * sys_context, const char * keyword, const char * value)

sys_context: global system context

keyword: the keyword to be searched in the environment variables.

value: the value of the environment variable to set

Sets the environment variable to the given value. The keyword will be fixed so that all dashes "-" characters are replaced by underscores "_" characters. Characters will be changed to uppercase. Any non alphanumeric character will be replaced by "_". Finally, an "LW6_" prefix will be added. That is to say, calling this function with "my-param" will set the "LW6_MY_PARAM" environment variable.

Return value: 1 if success, 0 if failure

Function: lw6sys_list_t * lw6sys_env_split (lw6sys_context_t * sys_context, const char * value)

sys_context: global system context

value: the value, a list of item separated by... the separator

Splits the environment value into a list of strings containing each element. All strings are dynamically allocated, but they will be freed automatically when the list is freed.

Return value: a list of strings.

Function: char * lw6sys_get_home (lw6sys_context_t * sys_context)

sys_context: global system context

Gets the home directory of the user. Used internally to calculate the user-dir value. Note that Liquid War 6, by default, never stores files under ’$HOME’, instead it put things in ’$HOME/.liquidwar6’, that is ’user-dir’. If the environment variable ’HOME’ is not set, will return ’.’.

Return value: a newly allocated pointer, must be freed.

Function: char * lw6sys_get_username (lw6sys_context_t * sys_context)

sys_context: global system context

Gets the name of the current user. Difference with the standard function getlogin is that this function will returned a dynamically allocated pointer, and provide a default value if it’s undefined. Also, if will look at the content of the ’LOGNAME’ environment variable if needed, and will even provide a default value.

Return value: a newly allocated pointer, must be freed.

Function: char * lw6sys_get_hostname (lw6sys_context_t * sys_context)

sys_context: global system context

Gets the name of the current host. The name of the computer. Might not work perfectly, this function is just used to provide default values for player names and such things.

Return value: a newly allocated pointer, must be freed.

Function: char * lw6sys_escape_http_uri (lw6sys_context_t * sys_context, const char * src)

sys_context: global system context

src: the string to escape

Transforms a string so that it does not contain any non-valid URL chars, it will mostly convert chars over 128 into their an hexadecimal code which replaces them in URLs. Note that this function is non really standard compliant for it won’t encode ’%’ but keep it the same. This is to allow using it several times on the same string and avoid double-triple encoding of ’%’. In practice it’s not recommended to have public_url for nodes with ’%’ in them, and the program will never generate such url when guessing urls.

Return value: newly allocated string.

Function: char * lw6sys_escape_html_attribute (lw6sys_context_t * sys_context, const char * src)

sys_context: global system context

src: the string to escape

Transforms a string so that it can fit in a html field, this is typically for alt="" or title="" fields so it will convert a double quote into its equivalent escaped char.

Return value: newly allocated string.

Function: char * lw6sys_escape_sql_value (lw6sys_context_t * sys_context, const char * src)

sys_context: global system context

src: the string to escape

Transforms a string so that it can fit as an SQL parameter, it will get rid URL chars, it will mostly convert chars over 128 into an hexadecimal form which replaces them in URLs.

Return value: newly allocated string.

Function: char * lw6sys_exec_find_myself (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: number of args as passed to main

argv: array of args as passed to main

Finds the path of the program currently run, this is typically to pass it to lw6sys_exec_again and run it again.

Return value: the path (newly allocated string).

Function: int lw6sys_is_executed_again (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: number of args as passed to main

argv: array of args as passed to main

Tells wether the program is already executed by itself by lw6sys_exec_again function. Based on environment and command switches.

Return value: 1 if executed again, 0 if not.

Function: int lw6sys_exec_again (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: number of args as passed to main

argv: array of args as passed to main

Runs the program from itsef, that is fires a new program (the same running) and ends up the current one. This is used to fix some environment variable issues. If LW6_EXECUTED_AGAIN (environment variable) is set, will not run the program so this is not really like exec as in the C standard library, this function will actually return and be successfull even if no other process was started. It’s just designed to bootstrap/launch the process once.

Return value: 1 on success, 0 on failure (always fail)

Function: int lw6sys_exec_restart (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: number of args as passed to main

argv: array of args as passed to main

Restart the program with exactly the same arguments it was given the first time.

Return value: 1 on success, 0 on failure (always fail)

Function: int lw6sys_clear_file (lw6sys_context_t * sys_context, const char * filename)

sys_context: global system context

filename: absolute or relative filename

Clears a file, that is, make it a 0 byte file, empty, ready to be filled if needed. If this function is called successfully, program can reasonnably assume file will be writable during its execution.

Return value: 1 if success, 0 if failure.

Function: char * lw6sys_read_file_content (lw6sys_context_t * sys_context, const char * filename)

sys_context: global system context

filename: absolute or relative filename

Reads the content of a file, and returns it as a string. Note that content might or might not be ascii or binary, the function will however put a tailing 0 character at the end so that low-level standard C functions do not segfault when used with the returned value.

Return value: a newly allocated pointer, must be freed.

Function: void * lw6sys_read_file_content_bin (lw6sys_context_t * sys_context, int * filesize, const char * filename)

sys_context: global system context

filesize: will contain the file size, in bytes

filename: absolute or relative filename

Reads the content of a file, and returns it as a binary buffer. Even if not ascii or binary, the function will however put a tailing 0 character at the end so that low-level standard C functions do not segfault when used with the returned value. This 0 character is not included in filesize so if there are 4 bytes in the file the 5 bytes will be allocated, this is just for string functions not to explode if called by accident. The filesize can be NULL, in that case function is just like the lw6sys_read_file_content function.

Return value: a newly allocated pointer, must be freed.

Function: int lw6sys_write_file_content (lw6sys_context_t * sys_context, const char * filename, const char * content)

sys_context: global system context

filename: absolute or relative filename

content: the content to be written.

Writes the content into the file. Content is assumed to be a string, function will segfault if it’s not correctly 0 terminated as in C string convention. So this function will not allow you to write down arbitrary binary data, however LW6 uses mostly text files to store information, and opaque binary data usage is not recommended.

Function: lw6sys_hash_t * lw6sys_hash_new (lw6sys_context_t * sys_context, lw6sys_free_func_t free_func, int size)

sys_context: global system context

free_func: optional callback used to free memory when stored date is a pointer. Can be NULL when one stores non dynamically allocated data, such as an integer or a static array.

size: the estimated size of the hash table. Note that this is an estimation only. You could theorically fit 1000000 objects in a 3-sized hash. Problem -> this is inefficient, you’d better use an assoc or a bigger hash. If you store 3 elements in a 1000000-sized hash, you’ll waste memory. It might be wise to use a prime number as the estimated size. 421 is prime ;)

Creates an empty hash. There’s a difference between NULL and an empty hash.

Return value: a pointer to the newly allocated hash table. Must be freed with lw6sys_hash_free.

Function: void lw6sys_hash_free (lw6sys_context_t * sys_context, lw6sys_hash_t * hash)

sys_context: global system context

hash: the hash to be freed.

The function will cascade delete all elements, using (if not NULL...) the callback passed when first creating the hash.

Return value: void

Function: int lw6sys_hash_has_key (lw6sys_context_t * sys_context, lw6sys_hash_t * hash, const char * key)

sys_context: global system context

hash: the hash to test

key: the key to search

Tells wether the key is present or not.

Return value: non-zero if there’s an entry with the corresponding key.

Function: void * lw6sys_hash_get (lw6sys_context_t * sys_context, lw6sys_hash_t * hash, const char * key)

sys_context: global system context

hash: the hash to query

key: the key of which we want the value

Gets the value corresponding to a given key. Not that the value can be NULL, even if the key exitsts.

Return value: a void pointer to the data contained in the hash. Note that the pointer on the actual data is returned, that is, if it’s static data, you must not try to free it... As long as memory management is concerned, destroying the hash will actually free the data if needed.

Function: void lw6sys_hash_set (lw6sys_context_t * sys_context, lw6sys_hash_t * hash, const char * key, void * value)

sys_context: global system context

hash: the hash to modify

key: the key we want to updated

value: the new value

Sets a value in a hash table. The key pointer need not be persistent, it can be freed after affectation. In fact a new string will be created internally. This is not true for the value, it’s hard to find way to copy "any object". So if you want a hash table of strings, key can disappear after calling this function, but not value. The function passed as free_func when creating the hash will be used to free stuff whenever needed (unset or free).

Return value: void

Function: void lw6sys_hash_unset (lw6sys_context_t * sys_context, lw6sys_hash_t * hash, const char * key)

sys_context: global system context

hash: the hash concerned

key: the key to unset

Clears an entry in a hash table. The callback passed when creating the hash will be called if needed, to free the data automatically.

Return value: void

Function: lw6sys_list_t * lw6sys_hash_keys (lw6sys_context_t * sys_context, lw6sys_hash_t * hash)

sys_context: global system context

hash: the hash to work on

Returns a list containing all the keys of the hash. The list must be free with lw6sys_list_free by the caller. This list copies all the keys of the hash, so it is safe to use it once the hash is deleted. However the keys will sometimes be of little interest in this case. But the program won’t segfault.

Return value: the list of keys.

Function: void lw6sys_hash_map (lw6sys_context_t * sys_context, lw6sys_hash_t * hash, lw6sys_assoc_callback_func_t func, void * func_data)

sys_context: global system context

hash: the hash to work on

func: a callback to call on each entry

func_data: a pointer on some data which will be passed to the callback

Executes a function on all hash items. The func_data parameter allows you to pass extra values to the function, such as a file handler or any variable which can not be inferred from list item values, and you of course do not want to make global...

Return value: void

Function: void lw6sys_hash_sort_and_map (lw6sys_context_t * sys_context, lw6sys_hash_t * hash, lw6sys_assoc_callback_func_t func, void * func_data)

sys_context: global system context

hash: the hash to work on

func: a callback to call on each entry, may be NULL

func_data: a pointer on some data which will be passed to the callback

Executes a function on all hash items, like lw6sys_hash_sort_and_map but befor doing so, sorts all entries in alphabetical order.

Return value: void

Function: lw6sys_hash_t * lw6sys_hash_dup (lw6sys_context_t * sys_context, lw6sys_hash_t * hash, lw6sys_dup_func_t dup_func)

sys_context: global system context

hash: the hash to duplicate, can be NULL

dup_func: the function which will be called to duplicate data

Duplicates an hash. All keys will be copied so that if the first hash is deleted, the duplicated one is fine. Additionnaly, dup_func will be called with all data fields. If dup_func is NULL, then data values will simply be copied. This is likely to be usefull when data is not dynamically allocated.

Returned value: a newly allocated hash.

Function: lw6sys_hexa_serializer_t * lw6sys_hexa_serializer_new (lw6sys_context_t * sys_context, const char * hexa_string)

sys_context: global system context

hexa_string: an initialization string, can be NULL.

Creates an hexa serializer object. It can be initialized or not, if an initialization string is provided it must of course be valid hexadecimal ascii code, and all serialized content will simply be appended to it.

Return value: a newly allocated object.

Function: void lw6sys_hexa_serializer_free (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer)

sys_context: global system context

hexa_serializer: an hexa serializer object

Frees an hexa serializer object.

Return value: none.

Function: void lw6sys_hexa_serializer_rewind (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer)

sys_context: global system context

hexa_serializer: an hexa serializer object

Rewinds the serializer pointer, that is, make it point to start. Usefull before calling pop functions, when one wants to be sure to get the first object.

Return value: none.

Function: int lw6sys_hexa_serializer_eof (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer)

sys_context: global system context

hexa_serializer: an hexa serializer object

Tests wether we’re at EOF. Usefull when one wants to know if there’s still some data or if all objects have been correctly popped.

Return value: 1 if at end of file, 0 if not.

Function: char * lw6sys_hexa_serializer_as_string (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer)

sys_context: global system context

hexa_serializer: an hexa serializer object

Exports the current content of the serializer as a string. String can then safely be sent on the network, for instance. String is copied from internal value, so it’s safe to use it after serializer has been freed or modified.

Return value: a newly allocated string, must be freed.

Function: int lw6sys_hexa_serializer_push_int64 (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer, int64_t value)

sys_context: global system context

hexa_serializer: an hexa serializer object

value: value to push

Pushes a 64 bit integer in the serializer object.

Return value: 1 if success, 0 if failure

Function: int lw6sys_hexa_serializer_push_int32 (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer, int32_t value)

sys_context: global system context

hexa_serializer: an hexa serializer object

value: value to push

Pushes a 32 bit integer in the serializer object.

Return value: 1 if success, 0 if failure

Function: int lw6sys_hexa_serializer_push_int16 (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer, int16_t value)

sys_context: global system context

hexa_serializer: an hexa serializer object

value: value to push

Pushes a 16 bit integer in the serializer object.

Return value: 1 if success, 0 if failure

Function: int lw6sys_hexa_serializer_push_int8 (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer, int8_t value)

sys_context: global system context

hexa_serializer: an hexa serializer object

value: value to push

Pushes an 8 bit integer in the serializer object.

Return value: 1 if success, 0 if failure

Function: int lw6sys_hexa_serializer_push_float (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer, float value)

sys_context: global system context

hexa_serializer: an hexa serializer object

value: value to push

Pushes a floating point value in the serializer object.

Return value: 1 if success, 0 if failure

Function: int lw6sys_hexa_serializer_push_str (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer, const char * value)

sys_context: global system context

hexa_serializer: an hexa serializer object

value: value to push

Pushes a string in the serializer object. Note that the string is not directly copied in the serializer, instead all its characters are converted to their ASCII equivalent, then appended.

Return value: 1 if success, 0 if failure

Function: int lw6sys_hexa_serializer_push_xyz (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer, lw6sys_xyz_t value)

sys_context: global system context

hexa_serializer: an hexa serializer object

value: value to push

Pushes a lw6sys_xyz_t structure in the serializer object. Calling this avoids calling push for 2 integers separately.

Return value: 1 if success, 0 if failure

Function: int lw6sys_hexa_serializer_push_whd (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer, lw6sys_whd_t value)

sys_context: global system context

hexa_serializer: an hexa serializer object

value: value to push

Pushes a lw6sys_whd_t structure in the serializer object. Calling this avoids calling push for 2 integers separately.

Return value: 1 if success, 0 if failure

Function: int lw6sys_hexa_serializer_push_color (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer, lw6sys_color_8_t value)

sys_context: global system context

hexa_serializer: an hexa serializer object

value: value to push

Pushes a color structure in the serializer object.

Return value: 1 if success, 0 if failure

Function: int lw6sys_hexa_serializer_pop_int64 (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer, int64_t * value)

sys_context: global system context

hexa_serializer: an hexa serializer object

value: value to pop (returned value)

Pops a 64 bit integer from the serializer object.

Return value: 1 if success, 0 if failure

Function: int lw6sys_hexa_serializer_pop_int32 (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer, int32_t * value)

sys_context: global system context

hexa_serializer: an hexa serializer object

value: value to pop (returned value)

Pops a 32 bit integer from the serializer object.

Return value: 1 if success, 0 if failure

Function: int lw6sys_hexa_serializer_pop_int16 (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer, int16_t * value)

sys_context: global system context

hexa_serializer: an hexa serializer object

value: value to pop (returned value)

Pops a 16 bit integer from the serializer object.

Return value: 1 if success, 0 if failure

Function: int lw6sys_hexa_serializer_pop_int8 (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer, int8_t * value)

sys_context: global system context

hexa_serializer: an hexa serializer object

value: value to pop (returned value)

Pops an 8 bit integer from the serializer object.

Return value: 1 if success, 0 if failure

Function: int lw6sys_hexa_serializer_pop_float (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer, float * value)

sys_context: global system context

hexa_serializer: an hexa serializer object

value: value to pop (returned value)

Pops a floating point value from the serializer object.

Return value: 1 if success, 0 if failure

Function: int lw6sys_hexa_serializer_pop_str (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer, char ** value)

sys_context: global system context

hexa_serializer: an hexa serializer object

value: value to pop (returned value)

Pops a string from the serializer object. The returned value is a newly allocated pointer, which must be freed, you don’t need to provide a buffer, just a valid pointer on a NULL pointer.

Return value: 1 if success, 0 if failure

Function: int lw6sys_hexa_serializer_pop_xyz (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer, lw6sys_xyz_t * value)

sys_context: global system context

hexa_serializer: an hexa serializer object

value: value to pop (returned value)

Pops a lw6sys_xyz_t structure from the serializer object. Avoids calling two integer pops.

Return value: 1 if success, 0 if failure

Function: int lw6sys_hexa_serializer_pop_whd (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer, lw6sys_whd_t * value)

hexa_serializer: an hexa serializer object

value: value to pop (returned value)

Pops a lw6sys_whd_t structure from the serializer object. Avoids calling two integer pops.

Return value: 1 if success, 0 if failure

Function: int lw6sys_hexa_serializer_pop_color (lw6sys_context_t * sys_context, lw6sys_hexa_serializer_t * hexa_serializer, lw6sys_color_8_t * value)

sys_context: global system context

hexa_serializer: an hexa serializer object

value: value to pop (returned value)

Pops a color from the serializer object.

Return value: 1 if success, 0 if failure

Function: int lw6sys_hexa_str_to_buf (lw6sys_context_t * sys_context, void * buf, int size, const char * str)

sys_context: global system context

buf: binary buffer to convert

size: binary buffer length

str: the source string

Converts the stringified hexa representation of a string to its source binary buffer. Buffer must be exactly strlen(str)/2

Return value: 1 on success

Function: char * lw6sys_hexa_buf_to_str (lw6sys_context_t * sys_context, void * buf, int size)

sys_context: global system context

buf: the buffer to stringify

size: the length of the buffer

Transforms a binary buffer into its hexa representation.

Return value: newly allocated string.

Function: void * lw6sys_hexa_str_to_ptr (lw6sys_context_t * sys_context, const char * str)

sys_context: global system context

str: the string containing an hexa representation of pointer

Transforms a string into a pointer, this is typically used to store pointers in temporary agnostic storage such as a database. Beware not to use that to exchange data with other computers and/or use it for persistent data. This is a high-risk function as it lets you do real dirty stuff but it really does save time compared to using a key returned by the database engine and then search this key in a user-space hash table. Direct pointer access is definitely faster.

Return value: the pointer, or NULL is str is invalid.

Function: char * lw6sys_hexa_ptr_to_str (lw6sys_context_t * sys_context, void * ptr)

sys_context: global system context

ptr: pointer to convert into string representation

Transforms a pointer into a string, this is typically used to store pointers in temporary agnostic storage such as a database. Beware not to use that to exchange data with other computers and/or use it for persistent data. This is a high-risk function as it lets you do real dirty stuff but it really does save time compared to using a key returned by the database engine and then search this key in a user-space hash table. Direct pointer access is definitely faster.

Return value: the string, can be NULL on errror, must be freed.

Function: void lw6sys_history_init (lw6sys_context_t * sys_context)

sys_context: global system context

Initializes the history system. Not initializing won’t cause any segfault, but data will be inconsistent.

Return value: none.

Function: void lw6sys_history_register (lw6sys_context_t * sys_context, char * msg)

sys_context: global system context

msg: the message to register.

Registers a message in the history log, that is, adds it.

Return value: none.

Function: char_ptr_t * lw6sys_history_get (lw6sys_context_t * sys_context, int64_t timeout)

sys_context: global system context

timeout: the message age limit.

Get all the messages that are younger than timeout (in seconds).

Return value: a pointer on string pointers. May be NULL. Last pointer is NULL too, that’s how you know the array is over.

Function: void lw6sys_history_free (lw6sys_context_t * sys_context, char ** history)

sys_context: global system context

history: the data to free

Frees a pointer returned by lw6sys_history_get.

Return value: none.

Function: char * lw6sys_locale_to_utf8 (lw6sys_context_t * sys_context, const char * string)

sys_context: global system context

string: the string to convert

Used to force strings into UTF-8 mode, this is basically to match the TTF font settings used when displaying stuff on OpenGL. Indeed, in this case, the standard _ gettext function won’t work, we need to force UTF-8 mode. If the locale is UTF-8, then function does nothing, but at least it’s transparent usage won’t hurt.

Returned value: a newly allocated string, always in UTF-8 no matter what the locale is.

Function: u_int16_t lw6sys_generate_id_16 (lw6sys_context_t * sys_context)

sys_context: global system context

Long 16-bit ID generator, calls the random function internally. As usual, those are not perfect random numbers, however the function implementation emphasizes more on ’real randomness’ rather than relying on performance. Generating twice the same number should be fairly rare.

Function: u_int32_t lw6sys_generate_id_32 (lw6sys_context_t * sys_context)

sys_context: global system context

Long 32-bit ID generator, calls the random function internally. As usual, those are not perfect random numbers, however the function implementation emphasizes more on ’real randomness’ rather than relying on performance. Generating twice the same number should be fairly rare.

Function: u_int64_t lw6sys_generate_id_64 (lw6sys_context_t * sys_context)

sys_context: global system context

Long 64-bit ID generator, calls the random function internally. As usual, those are not perfect random numbers, however the function implementation emphasizes more on ’real randomness’ rather than relying on performance. Generating twice the same number should be fairly rare.

Function: int lw6sys_check_id_16 (lw6sys_context_t * sys_context, u_int16_t id_16)

sys_context: global system context

id_16: the id to check

Checks wether the given id is a valid 16-bit id.

Return value: 1 if OK, 0 if not a valid id.

Function: int lw6sys_check_id_32 (lw6sys_context_t * sys_context, u_int32_t id_32)

sys_context: global system context

id_32: the id to check

Checks wether the given id is a valid 32-bit id.

Return value: 1 if OK, 0 if not a valid id.

Function: int lw6sys_check_id_64 (lw6sys_context_t * sys_context, u_int64_t id_64)

sys_context: global system context

id_64: the id to check

Checks wether the given id is a valid 64-bit id.

Return value: 1 if OK, 0 if not a valid id.

Function: int lw6sys_check_id (lw6sys_context_t * sys_context, u_int64_t id)

sys_context: global system context

id: the id to check

Checks wether the given id is a valid id (16, 32 or 64-bit).

Return value: 1 if OK, 0 if not a valid id.

Function: char * lw6sys_id_ltoa (lw6sys_context_t * sys_context, u_int64_t id)

sys_context: global system context

id: the id to convert

Transform an id into its string representation. Error checking is done, if the id is invalid, returned value is NULL. All ids (16, 32 and 64-bit) are handled.

Return value: a newly allocated string, might be NULL.

Function: u_int64_t lw6sys_id_atol (lw6sys_context_t * sys_context, char * id)

sys_context: global system context

id: the id to convert

Transform an id into a long integer. Error checking is done, if the id is invalid, returned value is 0. All ids (16, 32 and 64-bit) are handled.

Return value: the id as a long integer, 0 if incorrect source id.

Function: char * lw6sys_keyword_as_key (lw6sys_context_t * sys_context, const char * keyword)

sys_context: global system context

keyword: the keyword to transform

Transforms a keyword into a "key", that is, removes all heading dashes, switches to lowercase, and other stuff. This is used internally to match options and config file parameters, for instance.

Return value: a newly allocated pointer, must be freed.

Function: char * lw6sys_keyword_as_arg (lw6sys_context_t * sys_context, const char * keyword)

sys_context: global system context

keyword: the keyword to transform

Transforms a keyword into a command-line parameter to be matched. Does the same as lw6sys_keyword_as_key, and adds a "–" prefix.

Return value: a newly allocated pointer, must be freed.

Function: char * lw6sys_keyword_as_env (lw6sys_context_t * sys_context, const char * keyword)

keyword: the keyword to transform

Transforms a keyword into the corresponding environment variable name. It will uppercase the name, replace "-" by "_", and add a "LW6_" prefix. "my-param" will become "LW6_MY_PARAM".

Return value: a newly allocated pointer, must be freed.

Function: char * lw6sys_keyword_as_xml (lw6sys_context_t * sys_context, const char * keyword)

sys_context: global system context

keyword: the keyword to transform

Transforms a keyword into the corresponding config file entry. In practice, just the same as lw6sys_keyword_as_key.

Return value: a newly allocated pointer, must be freed.

Function: lw6sys_list_t * lw6sys_list_new (lw6sys_context_t * sys_context, lw6sys_free_func_t free_func)

sys_context: global system context

free_func: a callback which will be called on data when freeing the list

Creates an empty list. There’s a difference between NULL and an empty list. The empty list would (in Scheme) be ’() whereas NULL corresponds to undefined "is not a list and will generate errors if you ever call list functions on it".

Return value: a pointer to the created object, may be NULL.

Function: void lw6sys_list_free (lw6sys_context_t * sys_context, lw6sys_list_t * list)

sys_context: global system context

list: the list to delete.

Delete a list, this will cascade delete all the following items in the list.

Return value: none.

Function: lw6sys_list_t * lw6sys_list_next (lw6sys_context_t * sys_context, lw6sys_list_t * list)

sys_context: global system context

list: the current position in the list

It’s safer to call this rather than dig right into the internals of the list.

Return value: a new position in the list, may be NULL.

Function: int lw6sys_list_is_empty (lw6sys_context_t * sys_context, const lw6sys_list_t * list)

sys_context: global system context

list: the list we want informations about

Checks wether the list is empty or not. Note that being empty and being NULL is not the same. An empty list is a valid pointer on a list where there’s no item, a NULL pointer is not a list at all. Do *NOT* call this function on NULL.

Return value: 1 if empty, 0 if there is at list one item.

Function: int lw6sys_list_length (lw6sys_context_t * sys_context, const lw6sys_list_t * list)

sys_context: global system context

list: the list we want informations about

Calculates the length of the list. This is a performance killer for lists are inadapted to this. But it can still be usefull.

Return value: the number of elements, 0 is none (empty list).

Function: void lw6sys_list_map (lw6sys_context_t * sys_context, lw6sys_list_t * list, lw6sys_list_callback_func_t func, void * func_data)

sys_context: global system context

list: the list where elements will be taken

func: the function which will be executed

func_data: additionnal data to be passed to func

Executes a function on all list items. The func_data parameter allows you to pass extra values to the function, such as a file handler or any variable which can not be inferred from list item values, and you of course do not want to make global... Not as convenient as a real "for each" construct as can be found in any modern langage, but does the job. No return value, if you really want one, pass a structure in func_data and modify something in it on success, failure, whatever.

Return value: none.

Function: void lw6sys_list_filter (lw6sys_context_t * sys_context, lw6sys_list_t ** list, lw6sys_list_filter_func_t func, void * func_data)

sys_context: global system context

list: the list where elements will be taken

func: the function which will be executed

func_data: additionnal data to be passed to func

Executes a function on all list items and keeps only those for which the function returned non zero (true). The func_data parameter allows you to pass extra values to the function, such as a file handler or any variable which can not be inferred from list item values, and you of course do not want to make global...

Return value: none.

Function: void lw6sys_list_push_front (lw6sys_context_t * sys_context, lw6sys_list_t ** list, void * data)

sys_context: global system context

list: a pointer to the list (pointer on pointer, read/write value)

data: the data to be pushed

Pushes data on the list. The free_func function is copied from the previous element. The pointer on the list is changed "in place" (in/out). Note that if there’s a malloc problem it might end-up being NULL... This should be rare but it *can* happen. You cannot push something else than a pointer, pushing an int is a very bad idea. Push a pointer on the integer, and ensure it’s always there, or malloc it and pass lw6sys_free_callback when creating the list. If you think you can cast an integer into a pointer, think 64-bit machines...

Return value: none.

Function: void * lw6sys_list_pop_front (lw6sys_context_t * sys_context, lw6sys_list_t ** list)

sys_context: global system context

list: a pointer to the list (pointer on pointer, read/write value)

Pops data from the list, the returned value is what was passed to list_push. The pointer on the list is changed "in place" (in/out). When data is popped, that needs some freeing (i.e. free_func was not NULL when creating the list) then it’s the responsibility of the caller to free it when popping it. One popped it’s not freed, but it’s out of the list scope. Of course the lw6sys_list_t is freed, but not the data. If you happen to store non-NULL data in your list, you can call this function without bothering calling lw6sys_list_is_empty and assume that when you get NULL, there’s no data left. At this stage, the list won’t exist anymore BTW, you won’t even need to free it. The idea is: popping a list which has no elements left (empty list) destroys the list and returns NULL.

Return value: a pointer on the popped data, whatever you pushed.

Function: void lw6sys_list_push_back (lw6sys_context_t * sys_context, lw6sys_list_t ** list, void * data)

sys_context: global system context

list: a pointer to the list (pointer on pointer, read/write value)

data: the data to be pushed

Pushes data on the list. The free_func function is copied from the previous element. The pointer on the list is changed "in place" (in/out). Note that if there’s a malloc problem it might end-up being NULL... This should be rare but it *can* happen. You cannot push something else than a pointer, pushing an int is a very bad idea. Push a pointer on the integer, and ensure it’s always there, or malloc it and pass lw6sys_free_callback when creating the list. If you think you can cast an integer into a pointer, think 64-bit machines...

Return value: none.

Function: void * lw6sys_list_pop_back (lw6sys_context_t * sys_context, lw6sys_list_t ** list)

sys_context: global system context

list: a pointer to the list (pointer on pointer, read/write value)

Pops data from the list, the returned value is what was passed to list_push. The pointer on the list is changed "in place" (in/out). When data is popped, that needs some freeing (i.e. free_func was not NULL when creating the list) then it’s the responsibility of the caller to free it when popping it. One popped it’s not freed, but it’s out of the list scope. Of course the lw6sys_list_t is freed, but not the data. If you happen to store non-NULL data in your list, you can call this function without bothering calling lw6sys_list_is_empty and assume that when you get NULL, there’s no data left. At this stage, the list won’t exist anymore BTW, you won’t even need to free it. The idea is: popping a list which has no elements left (empty list) destroys the list and returns NULL.

Return value: a pointer on the popped data, whatever you pushed.

Function: void lw6sys_lifo_push (lw6sys_context_t * sys_context, lw6sys_list_t ** list, void * data)

sys_context: global system context

list: a pointer to the list (pointer on pointer, read/write value)

Pops data to a list, in last-in first-out mode (AKA LIFO). This is equivalent t lw6sys_list_push_front.

Return value: none.

Function: void * lw6sys_lifo_pop (lw6sys_context_t * sys_context, lw6sys_list_t ** list)

sys_context: global system context

list: a pointer to the list (pointer on pointer, read/write value)

Pops the first element of a list, in last-in first-out mode (AKA LIFO). This is equivalent to lw6sys_list_pop_front.

Return value: a pointer on the popped data, whatever you pushed.

Function: void lw6sys_fifo_push (lw6sys_context_t * sys_context, lw6sys_list_t ** list, void * data)

sys_context: global system context

list: a pointer to the list (pointer on pointer, read/write value)

Pops data to a list, in first-in first-out mode (AKA FIFO). This is equivalent t lw6sys_list_push_front.

Return value: none.

Function: void * lw6sys_fifo_pop (lw6sys_context_t * sys_context, lw6sys_list_t ** list)

sys_context: global system context

list: a pointer to the list (pointer on pointer, read/write value)

Pops the first element of a list, in last-in first-out mode (AKA FIFO). This is equivalent to lw6sys_list_pop_back. It can be quite time-consuming on big lists.

Return value: a pointer on the popped data, whatever you pushed.

Function: lw6sys_list_t * lw6sys_list_dup (lw6sys_context_t * sys_context, lw6sys_list_t * list, lw6sys_dup_func_t dup_func)

sys_context: global system context

list: the list to duplicate, can be NULL

dup_func: the function which will be called to duplicate data

Duplicates a list. All data will be copied so that if the first list is deleted, the duplicated one is fine. Addtionnally, dup_func will be called to filter all data, and possibly allocated new pointers if needed, for instance. If dup_func is NULL, then data values will simply be copied. This is likely to be usefull when data is not dynamically allocated.

Returned value: a newly allocated list.

Function: lw6sys_list_r_t * lw6sys_list_r_new (lw6sys_context_t * sys_context, lw6sys_free_func_t free_func)

sys_context: global system context

free_func: a callback which will be called on data when freeing the list

Creates an empty reentrant list. This is different from a regular list in the sense that here the object is a holder with both a mutex and the list itself.

Return value: a pointer to the created object, may be NULL.

Function: void lw6sys_list_r_free (lw6sys_context_t * sys_context, lw6sys_list_r_t * list_r)

sys_context: global system context

list_r: the list to delete.

Delete a reentrant list, this will cascade delete all the items in the list.

Return value: none.

Function: int lw6sys_list_r_is_empty (lw6sys_context_t * sys_context, const lw6sys_list_r_t * list_r)

sys_context: global system context

list_r: the list we want informations about

Checks wether the reentrant list is empty or not. Note there’s a slight difference with basic lists, here it can’t / should not be NULL, as the list_r is really a list container.

Return value: 1 if empty, 0 if there is at list one item.

Function: int lw6sys_list_r_length (lw6sys_context_t * sys_context, const lw6sys_list_r_t * list_r)

sys_context: global system context

list_r: the list we want informations about

Calculates the length of the reentrant list. This is a performance killer for lists are inadapted to this. But it can still be usefull.

Return value: the number of elements, 0 is none (empty list).

Function: void lw6sys_list_r_map (lw6sys_context_t * sys_context, lw6sys_list_r_t * list_r, lw6sys_list_callback_func_t func, void * func_data)

sys_context: global system context

list_r: the list where elements will be taken

func: the function which will be executed

func_data: additionnal data to be passed to func

Executes a function on all reentrant list items. This is a wrapper on lw6sys_list_map.

Return value: none.

Function: void lw6sys_list_r_filter (lw6sys_context_t * sys_context, lw6sys_list_r_t * list_r, lw6sys_list_filter_func_t func, void * func_data)

sys_context: global system context

list_r: the list where elements will be taken

func: the function which will be executed

func_data: additionnal data to be passed to func

Executes a function on all reentrant list items. Ths is a wrapper on lw6sys_list_filter.

Return value: none.

Function: void lw6sys_list_r_push_front (lw6sys_context_t * sys_context, lw6sys_list_r_t * list_r, void * data)

sys_context: global system context

list_r: a pointer to the list (pointer on pointer, read/write value)

data: the data to be pushed

Wapper on lw6sys_list_push_front, reentrant version.

Return value: none.

Function: void * lw6sys_list_r_pop_front (lw6sys_context_t * sys_context, lw6sys_list_r_t * list_r)

sys_context: global system context

Wrapper on lw6sys_list_pop_front, reentrant version.

Return value: a pointer on the popped data, whatever you pushed.

Function: void lw6sys_list_r_push_back (lw6sys_context_t * sys_context, lw6sys_list_r_t * list_r, void * data)

sys_context: global system context

list_r: a pointer to the list (pointer on pointer, read/write value)

data: the data to be pushed

Wapper on lw6sys_list_push_back, reentrant version.

Return value: none.

Function: void * lw6sys_list_r_pop_back (lw6sys_context_t * sys_context, lw6sys_list_r_t * list_r)

sys_context: global system context

Wrapper on lw6sys_list_pop_back, reentrant version.

Return value: a pointer on the popped data, whatever you pushed.

Function: void lw6sys_lifo_r_push (lw6sys_context_t * sys_context, lw6sys_list_r_t * list_r, void * data)

sys_context: global system context

list_r: a pointer to the list (pointer on pointer, read/write value)

data: the data to be pushed

Wapper on lw6sys_lifo_r_push_, reentrant version.

Return value: none.

Function: void * lw6sys_lifo_r_pop (lw6sys_context_t * sys_context, lw6sys_list_r_t * list_r)

sys_context: global system context

Wrapper on lw6sys_lifo_r_pop, reentrant version.

Return value: a pointer on the popped data, whatever you pushed.

Function: void lw6sys_fifo_r_push (lw6sys_context_t * sys_context, lw6sys_list_r_t * list_r, void * data)

sys_context: global system context

list_r: a pointer to the list (pointer on pointer, read/write value)

data: the data to be pushed

Wapper on lw6sys_fifo_r_push, reentrant version.

Return value: none.

Function: void * lw6sys_fifo_r_pop (lw6sys_context_t * sys_context, lw6sys_list_r_t * list_r)

sys_context: global system context

Wrapper on lw6sys_fifo_r_pop, reentrant version.

Return value: a pointer on the popped data, whatever you pushed.

Function: lw6sys_list_r_t * lw6sys_list_r_dup (lw6sys_context_t * sys_context, lw6sys_list_r_t * list_r, lw6sys_dup_func_t dup_func)

sys_context: global system context

list_r: the reentrant list to duplicate

dup_func: the function which will be called to duplicate data

Duplicates a reentrant list. This is a wrapper on lw6sys_list_dup, but is reentrant and works on a list_r type.

Returned value: a newly allocated reentrant list.

Function: lw6sys_list_t * lw6sys_list_r_transfer_to (lw6sys_context_t * sys_context, lw6sys_list_r_t * list_r)

sys_context: global system context

list_r: the reentrant list to transfer

Transfers the contents of a reentrant list to a regular list. Basically, this locks the list, extracts informations from it, then releases the lock and leaves the list_r empty. This is convenient in multithreaded contexts, typical pattern is a thread that pushes items, then another thread does massive transfers and processes each item separately with local pops on the regular list. This limits the amount of locking.

Returned value: a standard list, must be freed.

Function: void lw6sys_list_r_transfer_from (lw6sys_context_t * sys_context, lw6sys_list_r_t * list_r, lw6sys_list_t ** list)

sys_context: global system context

list_r: the reentrant list where to put data

list: the list to get data from

Transfers the contents of a regular list to a reentrant list. Basically, this locks the list, then appends all contents from the source standard list, then releases the lock. The source list pointer is set to an empty list, if it’s NULL it means an error happened. This is convenient in multithreaded contexts, typical pattern is a thread that pushes items in a bulked mode, this has the advantage of less lock/unlock, plus the side effect of having more atomicity, one can indeed garantee that a whole packet of items are sent at once. There’s no garantee on the order, you’d better sort them afterwards if order does matter, by default the function does what is fastest/easiest to do.

Returned value: none, but check if *list is not null.

Function: const char * lw6sys_log_errno_str (lw6sys_context_t * sys_context, int errno_int)

sys_context: global system context

errno_int: the error code, typically errno

Convenience fonction which returns the "macro" corresponding to an errno code. I find it easier to use this than bothering declaring a buffer for strerror_r... Besides LW6b has its own error messages. Wil never return NULL, if error does not exists just returns "?".

Return value: static string, must not be freed

Function: void lw6sys_log_set_file (lw6sys_context_t * sys_context, const char * filename)

sys_context: global system context

filename: the name of the log file.

Sets up the log file. Until you call this function, messages all logged to the default log file, as returned by the lw6sys_get_default_log_file function.

Return value: void

Function: void lw6sys_log_clear (lw6sys_context_t * sys_context, const char * filename)

sys_context: global system context

filename: the name of the log file.

Clears the log file, this function would typically be called at the beginning of the program. If filename is NULL, then the default log file is cleared.

Return value: void

Function: int lw6sys_log_set_dialog_timeout (lw6sys_context_t * sys_context, int timeout_sec)

sys_context: global system context

timeout_sec: number of seconds to wait before alert dialogs disappear

By default, alert boxes will stay out forever unless one clicks on them, however, this parameter will force the dialog shutdown after some time. Mostly used for testing, to allow tests being blocked on a dialog.

Return value: 1 if timeout is supported on platform, 0 if not

Function: void lw6sys_log (lw6sys_context_t * sys_context, int level_id, const char * file, int line, const char * func, const char * fmt, ...)

sys_context: global system context

level_id: the log level to use. Possible values are, by order, LW6SYS_LOG_ERROR_ID (0), LW6SYS_LOG_WARNING_ID (1), LW6SYS_LOG_NOTICE_ID (2), LW6SYS_LOG_INFO_ID (3), LW6SYS_LOG_DEBUG_ID (4) and LW6SYS_LOG_TMP_ID (5).

file: the name of the source file where the function is called, one can use __FILE__

line: the line in the source file where the function is called, one can use __LINE__

func: the name of the function where this log line was called, on can use __FUNCTION__

fmt: a printf-like format string ...: printf-like arguments, corresponding to fmt.

This function is usually called with the first three arguments packed into a single macro. For instance the LW6SYS_LOG_WARNING macro expands and fills the first 3 args, so there’s no need to type __FILE__ and __LINE__ again and again. Note that this function will reset errno. The idea is to call it whenever there’s something to do with errno (if you deal with errno, it’s a good habit to log it) then errno is cleared so that it won’t interfere with next log messages.

Function: void lw6sys_log_critical (lw6sys_context_t * sys_context, const char * fmt, ...)

sys_context: global system context

fmt: a printf-like format string ...: printf-like arguments, corresponding to fmt.

This function is a special log function which will dump informations on the console only, without opening any log file whatsoever. The idea is that it’s a "never fail" function. Additionnally, it will never return but quit the program. This can be used as an ultimate emergency function, use it when the program won’t run for sure, and displaying an immediate error message is the only issue.

Function: int lw6sys_log_get_level (lw6sys_context_t * sys_context)

sys_context: global system context

Get the current log level.

Function: void lw6sys_log_set_level (lw6sys_context_t * sys_context, int level)

sys_context: global system context

level: the log level, integer between 0 & 4. 4 is very verbose (debug), 0 displays errors only.

Set the current log level.

Function: int lw6sys_log_get_backtrace_mode (lw6sys_context_t * sys_context)

sys_context: global system context

Gets the current backtrace mode.

Function: void lw6sys_log_set_backtrace_mode (lw6sys_context_t * sys_context, int backtrace_mode)

sys_context: global system context

backtrace_mode: the backtrace mode, LW6SYS_LOG_BACKTRACE_MODE_FULL or LW6SYS_LOG_BACKTRACE_MODE_FUNC.

Sets the current backtrace mode.

Return value : none

Function: int lw6sys_log_get_console_state (lw6sys_context_t * sys_context)

sys_context: global system context

Get the console output state. This is important, for instance to set the console "back in the state it was" after setting it on or off.

Return value: 1 if enabled, 0 if not.

Function: void lw6sys_log_set_console_state (lw6sys_context_t * sys_context, int state)

sys_context: global system context

state: 1 to activate console output, 0 to disable it.

Enables or disables console output. By console output, we basically mean stderr (and possibly stdout). If console output is enabled (the default) all output is copied to stderr. If it’s disabled, only the log file will contain the information.

Return value: none.

Function: void lw6sys_math_poly_wy1y2s1 (lw6sys_context_t * sys_context, float * y, float * s, float x, float w, float y1, float y2, float s1)

sys_context: global system context

y: the return value (position, may be NULL)

s: the return value (speed, may be NULL)

x: the x parameter, the value to iterate on

w: the width, that is, the x value after which output is constant

y1: the initial value, when v is s1 and x=0

y2: the target value, when v=0 and x>=w

s1: the initial speed, that is dy/dx at x=0

A function which can be used to implement smooth moving. It will extrapolate, for values of x>=0, an y position with a continuous derivate (dy/dx is continuous, function is 2nd order polynom) and which ends up at x=w with a constant value, that is dy/dx=v=0. Typically an item set with an initial speed of v with this function

Function: float lw6sys_math_angle_360 (lw6sys_context_t * sys_context, int x, int y)

sys_context: global system context

x: x coordinate

y: y coordinate

This is a wrapper over the standard atan function which will handle internally the special x == 0 case and the various positive/negative values of x and y.

Return value: the angle, in degrees

Function: float lw6sys_math_heartbeat (lw6sys_context_t * sys_context, int64_t x, int period, float y1, float y2)

sys_context: global system context

x: the parameter (typically a timestamp)

period: the period (typically something like 1000 milliseconds)

y1: the low value (heart at rest)

y2: the high value (when bumping)

A heartbeat function, typically usefull to power up eye-candy, but it could do something else.

Function: int lw6sys_math_blink (lw6sys_context_t * sys_context, int64_t x, int period)

sys_context: global system context

x: the parameter (typically a timestamp)

period: the period (typically something like 1000 milliseconds)

This function will alternatively return 1 or 0, usefull to handle blinking for instance.

Return value: 0 or 1

Function: float lw6sys_math_lin2log (lw6sys_context_t * sys_context, int lin_value, int base)

sys_context: global system context

lin_value: value on a linear scale

base: the base to use, 10 for decibel-like scale

Converts a linar-scale value to a logarithmic one. The scale is done so that base in linear mode is base in scaled mode, and it uses a log-base conversion, so that with a base 10 it behaves the way the decibel sound-volume unit works.

Return value: value on a logarithmic scale.

Function: int lw6sys_math_log2lin (lw6sys_context_t * sys_context, float log_value, int base)

sys_context: global system context

base: the base to use, 10 for decibel-like scale

Converts a linar-scale value to a logarithmic one. The scale is done so that 10 in linear mode is 10 in scaled mode, and it uses a log-base conversion, so that with a base 10 it behaves the way the decibel sound-volume unit works.

Return value: value on a linear scale.

Function: float lw6sys_math_deg2rad (float deg)

deg: angle in degrees

Converts an angle from degrees to radians.

Return value: angle in radians.

Function: float lw6sys_math_rad2deg (float rad)

rad: angle in radians

Converts an angle from radians to degrees.

Return value: angle in degrees.

Function: void * lw6sys_malloc (lw6sys_context_t * sys_context, int size, const char * file, int line, const char * func)

sys_context: global system context

size: number of bytes to allocate.

file: name of the file calling the function, use __FILE__

line: line in the file calling the function, use __LINE__

func: name of the caller function, use __FUNCTION__

This is a wrapper over the standard malloc function. Additionnally it will keep track of the call with an internal program-wide counter, thus enabling memory leak checks. You should not use this function directly but use the macro LW6SYS_MALLOC which has the same syntax, without the last two parameters, which are automatically provided by macro expansion.

Return value: the newly allocated pointer. Data is not initialized.

Function: void * lw6sys_calloc (lw6sys_context_t * sys_context, int size, const char * file, int line, const char * func)

sys_context: global system context

size: number of bytes to allocate.

file: name of the file calling the function, use __FILE__

line: line in the file calling the function, use __LINE__

func: name of the caller function, use __FUNCTION__

This is a wrapper over the standard calloc function. Additionnally it will keep track of the call with an internal program-wide counter, thus enabling memory leak checks. You should not use this function directly but use the macro LW6SYS_CALLOC which has the same syntax, without the last two parameters, which are automatically provided by macro expansion.

Return value: the newly allocated pointer. Data is filled with zeros.

Function: void * lw6sys_realloc (lw6sys_context_t * sys_context, void * ptr, int size, const char * file, int line, const char * func)

sys_context: global system context

ptr: the pointer to reallocate.

size: number of bytes to allocate.

file: name of the file calling the function, use __FILE__

line: line in the file calling the function, use __LINE__

func: name of the caller function, use __FUNCTION__

This is a wrapper over the standard realloc function. You should not use this function directly but use the macro LW6SYS_REALLOC which has the same syntax, without the last two parameters, which are automatically provided by macro expansion.

Return value: the newly allocated pointer.

Function: void lw6sys_free (lw6sys_context_t * sys_context, void * ptr, const char * file, int line, const char * func)

sys_context: global system context

ptr: the pointer to free.

file: name of the file calling the function, use __FILE__

line: line in the file calling the function, use __LINE__

func: name of the caller function, use __FUNCTION__

This is a wrapper over the standard free function. Additionnally it will keep track of the call with an internal program-wide counter, thus enabling memory leak checks. You should not use this function directly but use the macro LW6SYS_FREE which has the same syntax, without the last two parameters, which are automatically provided by macro expansion.

Return value: none.

Function: void lw6sys_free_callback (lw6sys_context_t * sys_context, void * ptr)

sys_context: global system context

ptr: the pointer to free.

This is a callback to be used when the lw6sys_free does not fit. A good example is a list, which, to free its elements, requires you to provide a callback that only takes 1 arg, the pointer to free. Problem, lw6sys_free takes 3 args. And the LW6SYS_FREE macro is not usable in such a context. And you can’t use standard free either for it would mess up the malloc / free automatical count which is so convenient to track memory leaks. So this callback is here, it’s only drawback is that in case of an error, the error will not be reported with the real file and line parameters. It’s still better than nothing.

Return value: none.

Function: int lw6sys_megabytes_available (lw6sys_context_t * sys_context)

sys_context: global system context

Gives a raw approximation of available memory, in megabytes. Value is to be taken with distance, but it can give good hints when system is running short of ressources.

Return value: number of megabytes (physical memory) available.

Function: int lw6sys_is_big_endian (lw6sys_context_t * sys_context)

sys_context: global system context

Checks the endianess of the machine. PPC is big endian, for instance.

Return value: 1 if system is big endian, 0 if little endian.

Function: int lw6sys_is_little_endian (lw6sys_context_t * sys_context)

sys_context: global system context

Checks the endianess of the machine. x86 is little endian, for instance.

Return value: 1 if system is little endian, 0 if big endian.

Function: int lw6sys_check_types_size (lw6sys_context_t * sys_context)

sys_context: global system context

Checks of common types and usefull structures, this is a debugging function which helps finding compiler strange behaviors and programmer’s bad intuitions.

Return value: 1 if everything is OK, 0 if error.

Function: lw6sys_mutex_t * lw6sys_mutex_create (lw6sys_context_t * sys_context, const char * file, int line, const char * func)

sys_context: global system context

file: the name of the source file where the function is called, one can use __FILE__

line: the line in the source file where the function is called, one can use __LINE__

func: the name of the function where this log line was called, on can use __FUNCTION__

Creates a mutex object.

Return value: newly allocated pointer.

Function: void lw6sys_mutex_destroy (lw6sys_context_t * sys_context, lw6sys_mutex_t * mutex, const char * file, int line, const char * func)

sys_context: global system context

mutex: the mutex to destroy.

file: the name of the source file where the function is called, one can use __FILE__

line: the line in the source file where the function is called, one can use __LINE__

func: the name of the function where this log line was called, on can use __FUNCTION__

Destroys a mutex object.

Return value: none.

Function: int lw6sys_mutex_lock (lw6sys_context_t * sys_context, lw6sys_mutex_t * mutex, const char * file, int line, const char * func)

sys_context: global system context

mutex: the mutex to use

file: the name of the source file where the function is called, one can use __FILE__

line: the line in the source file where the function is called, one can use __LINE__

func: the name of the function where this log line was called, on can use __FUNCTION__

Locks the mutex. Note that this should never fail unless there’s a serious initialization problem, instead, function will wait forever until mutex is released.

Return value: 1 if success, 0 if failure.

Function: int lw6sys_mutex_trylock (lw6sys_context_t * sys_context, lw6sys_mutex_t * mutex, const char * file, int line, const char * func)

sys_context: global system context

mutex: the mutex to use

file: the name of the source file where the function is called, one can use __FILE__

line: the line in the source file where the function is called, one can use __LINE__

func: the name of the function where this log line was called, on can use __FUNCTION__

Tries to locks the mutex. That is, tells wether mutex can be locked immediately or not. Note that this does not mean there’s 100% chance next call to lock will terminated immediately, since lock can still be acquired by another thread.

Return value: 1 if mutex unlocked, 0 if locked or error.

Function: int lw6sys_mutex_unlock (lw6sys_context_t * sys_context, lw6sys_mutex_t * mutex, const char * file, int line, const char * func)

sys_context: global system context

mutex: the mutex to use

file: the name of the source file where the function is called, one can use __FILE__

line: the line in the source file where the function is called, one can use __LINE__

func: the name of the function where this log line was called, on can use __FUNCTION__

Unlocks a mutex.

Return value: 1 if sucess, 0 if error.

Function: int lw6sys_get_mutex_lock_count (lw6sys_context_t * sys_context)

sys_context: global system context

Returns how many mutexes have been locked since program start. Usefull for sanity checking when debugging.

Return value: number of calls to lock

Function: int lw6sys_get_mutex_unlock_count (lw6sys_context_t * sys_context)

Returns how many mutexes have been unlocked since program start. Usefull for sanity checking when debugging.

Return value: number of calls to unlock

Function: int lw6sys_check_mutex_count (lw6sys_context_t * sys_context)

sys_context: global system context

Checks wether unlock has been called as many times as lock. Usefull for sanity checking when debugging.

Return value: 1 if OK, 0 if inconsistency.

Function: int lw6sys_true ()

Function which returns always true, that is, something different than 0.

Function: int lw6sys_false ()

Function which returns always false, that is, 0. This can seem totally useless but it does have some utility. It’s used for instance to "fool" the compiler and force it to compile and link functions in binaries, so that, afterwards, dynamically loaded .so files can find in the main binary some functions which would otherwise be stripped during the final link.

Function: int lw6sys_openmp_get_num_procs (lw6sys_context_t * sys_context)

sys_context: global system context

Wrapper on omp_get_num_procs the advantage of this is that it’s always defined, wether OpenMP supported is compiled in or not, will returned 1 if no OpenMP support.

Return value: number of procs

Function: char * lw6sys_get_cwd (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the current working directory (absolute path).

Return value: a newly allocated string.

Function: char * lw6sys_get_default_user_dir (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the default user directory. Note that this value is not static, it can depend, for instance, of the environment variable HOME.

Return value: a newly allocated string.

Function: char * lw6sys_get_default_config_file (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the default config file. Note that this value is not static, it can depend, for instance, of the environment variable HOME.

Return value: a newly allocated string.

Function: char * lw6sys_get_default_log_file (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the default log file. Note that this value is not static, it can depend, for instance, of the environment variable HOME.

Return value: a newly allocated string.

Function: char * lw6sys_get_default_prefix (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the default prefix, could be /usr/local for instance.

Return value: a newly allocated string.

Function: char * lw6sys_get_default_mod_dir (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the default module directory (dynamically loaded libraries).

Return value: a newly allocated string.

Function: char * lw6sys_get_default_data_dir (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the default data directory.

Return value: a newly allocated string.

Function: char * lw6sys_get_default_music_dir (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the default music directory.

Return value: a newly allocated string.

Function: char * lw6sys_get_default_music_path (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the default music path, which can be composed of several directories.

Return value: a newly allocated string.

Function: char * lw6sys_get_default_map_dir (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the default map directory.

Return value: a newly allocated string.

Function: char * lw6sys_get_default_map_path (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the default map path, which can be composed of several directories.

Return value: a newly allocated string.

Function: char * lw6sys_get_default_script_file (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the default script file.

Return value: a newly allocated string.

Function: void lw6sys_options_log_defaults (lw6sys_context_t * sys_context)

sys_context: global system context

Logs all default values to log file. Usefull for debugging, to know where the program is searching for its informations.

Function: char * lw6sys_get_run_dir (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc, number of arguments, as given to main

argv: argv, pointer to arguments, as given to main

Returns the binary directory, that is, the directory the binary is stored in. This is calculated dynamically, by interpreting command-line arguments.

Return value: a newly allocated string.

Function: char * lw6sys_get_user_dir (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc, number of arguments, as given to main

argv: argv, pointer to arguments, as given to main

Returns the user dir, taking in account command-line and environment variables. However config file content has no impact on the result.

Return value: a newly allocated string.

Function: char * lw6sys_get_config_file (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc, number of arguments, as given to main

argv: argv, pointer to arguments, as given to main

Returns the config file, taking in account command-line and environment variables. However config file content has no impact on the result.

Return value: a newly allocated string.

Function: char * lw6sys_get_log_file (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc, number of arguments, as given to main

argv: argv, pointer to arguments, as given to main

Returns the log file, taking in account command-line and environment variables. However config file content has no impact on the result.

Return value: a newly allocated string.

Function: char * lw6sys_get_prefix (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc, number of arguments, as given to main

argv: argv, pointer to arguments, as given to main

Returns the prefix, taking in account command-line and environment variables. However config file content has no impact on the result.

Return value: a newly allocated string.

Function: char * lw6sys_get_mod_dir (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc, number of arguments, as given to main

argv: argv, pointer to arguments, as given to main

Returns the mod dir (modules, shared .so), taking in account command-line and environment variables. However config file content has no impact on the result.

Return value: a newly allocated string.

Function: char * lw6sys_get_data_dir (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc, number of arguments, as given to main

argv: argv, pointer to arguments, as given to main

Returns the data dir, taking in account command-line and environment variables. However config file content has no impact on the result.

Return value: a newly allocated string.

Function: char * lw6sys_get_music_dir (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc, number of arguments, as given to main

argv: argv, pointer to arguments, as given to main

Returns the music dir, taking in account command-line and environment variables. However config file content has no impact on the result.

Return value: a newly allocated string.

Function: char * lw6sys_get_music_path (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc, number of arguments, as given to main

argv: argv, pointer to arguments, as given to main

Returns the music path, taking in account command-line and environment variables. However config file content has no impact on the result. Music path can contain several directories.

Return value: a newly allocated string.

Function: char * lw6sys_get_map_dir (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc, number of arguments, as given to main

argv: argv, pointer to arguments, as given to main

Returns the map dir, taking in account command-line and environment variables. However config file content has no impact on the result.

Return value: a newly allocated string.

Function: char * lw6sys_get_map_path (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc, number of arguments, as given to main

argv: argv, pointer to arguments, as given to main

Returns the map path, taking in account command-line and environment variables. However config file content has no impact on the result. Map path can contain several directories.

Return value: a newly allocated string.

Function: char * lw6sys_get_script_file (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc, number of arguments, as given to main

argv: argv, pointer to arguments, as given to main

Returns the script file, taking in account command-line and environment variables. However config file content has no impact on the result.

Return value: a newly allocated string.

Function: void lw6sys_options_log (lw6sys_context_t * sys_context, int argc, const char * [] argv)

sys_context: global system context

argc: argc, number of arguments, as given to main

argv: argv, pointer to arguments, as given to main

Logs all the main options values which are not config-file dependant but depend on built-in defaults, command-line arguments and environment variables. Usefull to debug and know where the program is searching for things.

Function: int lw6sys_file_exists (lw6sys_context_t * sys_context, const char * filename)

sys_context: global system context

filename: the file to test

Tests the existence of a file on the filesystem. File is considered to exists if it’s at least readable.

Return value: 1 if OK, 0 if file doesn’t exist or can’t be read.

Function: int lw6sys_dir_exists (lw6sys_context_t * sys_context, const char * dirname)

sys_context: global system context

dirname: the directory to test

Tests the existence of a directory on the filesystem.

Return value: 1 if OK, 0 if directory doesn’t exist.

Function: int lw6sys_dir_exists_with_readme (lw6sys_context_t * sys_context, const char * dirname)

sys_context: global system context

dirname: the directory to test

Tests the existence of a directory on the filesystem, will also validate that it contains a README or readme.txt file.

Return value: 1 if OK, 0 if directory doesn’t exist.

Function: int lw6sys_dir_exists_with_readme_containing_text (lw6sys_context_t * sys_context, const char * dirname, const char * needle)

sys_context: global system context

dirname: the directory to test

needle: string to search, can be NULL

Tests the existence of a directory on the filesystem, with a README or readme.txt file, which contains the string needle.

Return value: 1 if OK, 0 if directory doesn’t exist.

Function: int lw6sys_create_dir (lw6sys_context_t * sys_context, const char * dirname)

sys_context: global system context

dirname: the directory to create

Creates a directory, performing sanity checks such as verifying the directory really exists after being created.

Return value: 1 if OK, 0 if error.

Function: int lw6sys_create_dir_silent (lw6sys_context_t * sys_context, const char * dirname)

sys_context: global system context

dirname: the directory to create

Creates a directory like lw6sys_create_dir but this function is silent in the sense that it won’t log any error. Usefull to create the log directory itself, for instance, and avoid infinite loops on error.

Return value: 1 if OK, 0 if error.

Function: char * lw6sys_path_add_slash (lw6sys_context_t * sys_context, const char * path)

sys_context: global system context

path: a path

Adds a slash, or in a general manner, a directory separator, at the end of a path, if needed. So /foo/bar will become /foo/bar/ but /bar/foo/ will remain /bar/foo/.

Return value: a newly allocated string, must be freed.

Function: char * lw6sys_path_strip_slash (lw6sys_context_t * sys_context, const char * path)

sys_context: global system context

path: a path

Strips the slash, or in a general manner, the directory separator, at the end of a path, if needed. So /foo/bar/ will become /foo/bar but /bar/foo will remain /bar/foo.

Return value: a newly allocated string, must be freed.

Function: char * lw6sys_path_concat (lw6sys_context_t * sys_context, const char * path1, const char * path2)

sys_context: global system context

path1: left part of the path

path2: right part of the path

Concatenates 2 parts of a path. Function will try to avoid stupid "double-slash" when concatenating /foo/ with /bar/ and conversely insert a directory separator when concatenating /foo with bar/.

Return value: a newly allocated string, must be freed.

Function: lw6sys_list_t * lw6sys_path_split (lw6sys_context_t * sys_context, const char * path)

sys_context: global system context

path: a path

Splits a path into all its parts. For instance /boo/bar/foo2/bar2 returns a 4 elements list. This is more than a plain split, for heading and tailing slashes will be ignored, and various path separators will be interpreted (depends on platform).

Return value: a list containing 0-terminated strings.

Function: char * lw6sys_path_file_only (lw6sys_context_t * sys_context, const char * path)

sys_context: global system context

path: a path

Returns the file name only, without heading directories.

Return value: file name, must be freed

Function: int lw6sys_path_is_relative (lw6sys_context_t * sys_context, const char * path)

sys_context: global system context

path: a path

Checks wether a path is relative or absolute.

Return value: 1 if relative, 0 if absolute.

Function: int lw6sys_path_is_cwd (lw6sys_context_t * sys_context, const char * path)

sys_context: global system context

path: a path

Checks wether a path is "." or not. Will also trap "" and "./".

Return value: 1 if relative, 0 if absolute.

Function: char * lw6sys_path_parent (lw6sys_context_t * sys_context, const char * path)

sys_context: global system context

path: a path

Returns the parent path. That will return /foo when given /foo/bar in input.

Return value: a newly allocated string, must be freed.

Function: char * lw6sys_path_unparent (lw6sys_context_t * sys_context, const char * path)

sys_context: global system context

path: a path

Given the ../foo/bar path, will return foo/bar. Usefull to get rid of heading ../ when a path is known to start with it.

Return value: a newly allocated string, must be freed.

Function: char * lw6sys_path_unparent_no_malloc (lw6sys_context_t * sys_context, char * path)

sys_context: global system context

path: a path

Given the ../foo/bar path, will return foo/bar. Usefull to get rid of heading ../ when a path is known to start with it. This is different from lw6sys_path_unparent just because the result is not dynamically allocated and copied from source.

Return value: a pointer which points somewhere within the string passed as an argument.

Function: lw6sys_list_t * lw6sys_dir_list (lw6sys_context_t * sys_context, const char * dir, lw6sys_dir_list_filter_func_t filter_func, void * func_data, int * n)

sys_context: global system context

dir: the path of the directory to list

filter_func: a function which will filter entries, can be NULL

func_data: additionnal data passed to filter_func

n: will contain the number of items found

This list a directory. The filter will be passed the file path as an argument. If it returns 1, the file is kept, if it returns 0 it’s suppressed from the list.

Return value: a list containing strings (file paths).

Function: lw6sys_list_t * lw6sys_path_list (lw6sys_context_t * sys_context, const char * path, lw6sys_dir_list_filter_func_t filter_func, void * func_data, int * n)

sys_context: global system context

path: the path of the path to list

filter_func: a function which will filter entries, can be NULL

func_data: additionnal data passed to filter_func

n: will contain the number of items found

This list a directory. By path we mean here a list of separated directories, separated by : for instance. The filter will be passed the file path as an argument. If it returns 1, the file is kept, if it returns 0 it’s suppressed from the list. It’s like performing a call to lw6sys_dir_list on each of the path members.

Return value: a list containing strings (file paths).

Function: char * lw6sys_find_in_dir_and_path (lw6sys_context_t * sys_context, const char * dir, const char * path, const char * file)

sys_context: global system context

dir: a directory, when to search the file first

path: the path to search too, a separated list of dirs

file: the filename to search for

Tries to find a file in the given paths. The function is typically used to find music files. First it tries to find the file in dir, then it tries to find it in each dir of path. file must be only a file name and not contain any directory. The function will use the filename only anyway.

Return value: the full path of the found file.

Function: void lw6sys_print_xml_header (lw6sys_context_t * sys_context, FILE * f, char * comment)

sys_context: global system context

f: file to output content to

Prints a standard Liquid War compliant XML header in the given file.

Return value: none.

Function: void lw6sys_print_xml_footer (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: file to output content to

Prints a standard Liquid War 6 compliant XML footer in the given file.

Return value: none.

Function: int lw6sys_process_is_fully_supported (lw6sys_context_t * sys_context)

sys_context: global system context

Tells wether functions related to fork and pids are likely to work allright or not. Typically, those functions will return false (0) systematically if called on a platform that does not support them fully. In practice this is only for a few tests, so it’s not that bad if it does not really work. Would be better if, but well, it’s OK.

Return value: 1 if supported, 0 if not.

Function: u_int64_t lw6sys_process_fork_and_call (lw6sys_context_t * sys_context, lw6sys_fork_func_t func, void * data)

sys_context: global system context

data: pointer on arbitrary data used by func

This is not a standard fork function, it will return to the caller (parent) with something >0 if a child has been created, or 0 if failed. On the child it will launch the callback func, run it and exit right away.

Return value: a process ID on success, 0 on failure.

Function: int lw6sys_process_kill_1_9 (lw6sys_context_t * sys_context, u_int64_t pid)

sys_context: global system context

pid: pid to kill

Kills a process with the given PID. The kill will first use a signal 1 SIGTERM the a signal 9 SIGKILL. This is mostly for testing, the idea is to be sure to vaccum after we’re done. We use 64-bit for PIDs, yes, they are very likely 32 only, but had to choose (and pid_t is a pain because for logging one would needed to check the length before calling printf like functions...).

Return value: 1 on success, 0 if failed

Function: int lw6sys_profiler_check (lw6sys_context_t * sys_context, int verbose)

sys_context: global system context

verbose: wether to display informations on the console

Checks wether Google Profiler support has been built, and if it’s set, outputs the log file. If CPUPROFILE is defined but binary has no support for it, will display a warning message.

Return value: 1 if google profile enabled and activated, 0 if not

Function: void lw6sys_progress_bind (lw6sys_context_t * sys_context, lw6sys_progress_t * progress, float * value)

sys_context: global system context

progress: the progress struct to initialize

value: the value to point to

Sets a progress struct to default values, that is, ranging from 0.0f to 1.0f, does not touch the value.

Return value: none.

Function: void lw6sys_progress_default (lw6sys_context_t * sys_context, lw6sys_progress_t * progress, float * value)

sys_context: global system context

progress: the progress struct to initialize

value: the value to point to

Sets a progress struct to default values, that is, ranging from 0.0f to 1.0f. This function won’t touch the value, one needs to call begin or update or end to do that.

Return value: none.

Function: void lw6sys_progress_update (lw6sys_context_t * sys_context, lw6sys_progress_t * progress, int min, int max, int value)

sys_context: global system context

progress: the progress struct to update

min: the min value

max: the max value

value: the current value

Updates a progress struct. This is typically the function used by a callback to show the progress of a process. Note that this is note an initializer. Rather, the progress struct was initialized before, and this call is done in a loop with min being 0, max being the last value in the loop, and value the current index in the loop. NULL pointers correctly handled internally, so call this with any parameters, it’s safe.

Return value: none.

Function: void lw6sys_progress_split (lw6sys_context_t * sys_context, lw6sys_progress_t * progress1, lw6sys_progress_t * progress2, lw6sys_progress_t * progress_src)

sys_context: global system context

progress1: the first part of the splitted progress

progress2: the second part of the splitted progress

progress_src: the progress to split

Utility function to split a progress struct, that is, if a progress was ranging from a to b, make 2 progress structs, ranging from a to c and from c to b, c being between a and b.

Return value: none

Function: void lw6sys_progress_split_here (lw6sys_context_t * sys_context, lw6sys_progress_t * progress1, lw6sys_progress_t * progress2, lw6sys_progress_t * progress_src, float here)

sys_context: global system context

progress1: the first part of the splitted progress

progress2: the second part of the splitted progress

progress_src: the progress to split

here: where to split

Utility function to split a progress struct, that is, if a progress was ranging from a to b, make 2 progress structs, ranging from a to c and from c to b, c being between a and b. The here value controls what c is. If here=0, then c=a. If here=1, then c=b.

Return value: none

Function: void lw6sys_progress_split3 (lw6sys_context_t * sys_context, lw6sys_progress_t * progress1, lw6sys_progress_t * progress2, lw6sys_progress_t * progress3, lw6sys_progress_t * progress_src)

sys_context: global system context

progress1: the first part of the splitted progress

progress2: the second part of the splitted progress

progress3: the third part of the splitted progress

progress_src: the progress to split

Utility function to split a progress struct, this one will split it into 3 equal parts.

Return value: none

Function: void lw6sys_progress_split4 (lw6sys_context_t * sys_context, lw6sys_progress_t * progress1, lw6sys_progress_t * progress2, lw6sys_progress_t * progress3, lw6sys_progress_t * progress4, lw6sys_progress_t * progress_src)

sys_context: global system context

progress1: the first part of the splitted progress

progress2: the second part of the splitted progress

progress3: the third part of the splitted progress

progress4: the fourth part of the splitted progress

progress_src: the progress to split

Utility function to split a progress struct, this one will split it into 4 equal parts.

Return value: none

Function: void lw6sys_progress_split5 (lw6sys_context_t * sys_context, lw6sys_progress_t * progress1, lw6sys_progress_t * progress2, lw6sys_progress_t * progress3, lw6sys_progress_t * progress4, lw6sys_progress_t * progress5, lw6sys_progress_t * progress_src)

sys_context: global system context

progress1: the first part of the splitted progress

progress2: the second part of the splitted progress

progress3: the third part of the splitted progress

progress4: the fourth part of the splitted progress

progress5: the fourth part of the splitted progress

progress_src: the progress to split

Utility function to split a progress struct, this one will split it into 5 equal parts.

Return value: none

Function: void lw6sys_progress_begin (lw6sys_context_t * sys_context, lw6sys_progress_t * progress)

sys_context: global system context

progress: the progress to update

Sets the progress to its min value, NULL values correctly handled.

Return value: none

Function: void lw6sys_progress_half (lw6sys_context_t * sys_context, lw6sys_progress_t * progress)

sys_context: global system context

progress: the progress to update

Sets the progress to the average between min and max, NULL values correctly handled.

Return value: none

Function: void lw6sys_progress_end (lw6sys_context_t * sys_context, lw6sys_progress_t * progress)

sys_context: global system context

progress: the progress to update

Sets the progress to its max value, NULL values correctly handled.

Return value: none

Function: u_int32_t lw6sys_random (lw6sys_context_t * sys_context, u_int32_t range)

sys_context: global system context

range: the high limit for random generated numbers. If you want random numbers between 0 and 5, set this to 6.

Wrapper over standard random function. This one is thread safe. This idea is not to provide cryptographic-proof random numbers, rather generate sequences which are random enough to generate unique server ids and such things. The function is initialized on its first call, and results depend on timestamp, host name, user name, and memory available.

Function: float lw6sys_random_float (lw6sys_context_t * sys_context, float min, float max)

sys_context: global system context

min: the min value, as a float

max: the max value, as a float

Returns a random float number between min & max. Can be equal to min or max.

Function: int lw6sys_sdl_register (lw6sys_context_t * sys_context)

sys_context: global system context

Function used to avoid initializing SDL several times in a program. AFAIK Allegro has a was_init function, but SDL doesn’t. With this function - which every LW6 sub-module should use - one can know globally, for the whole program, wether SDL has been initialized or not. Note that this function uses the global system context, and can therefore be buggy when used in multithreaded / reentrant mode. So in some cases, that is, with two different contexts, SDL could be called twice. This is a limitation of current SDL implementations, should it have a per-thread / per-handler context, the problem would be solved. Fundamentally, the idea is that SDL does have a global static state, you’ve been warned.

Function: int lw6sys_sdl_unregister (lw6sys_context_t * sys_context)

sys_context: global system context

Call this whenever you are done with SDL and exit it, so that the lw6sys_sdl_register function works correctly.

Return value: 1 if SDL needs to be unregistered, that is, if it has already been initialized, else 0.

Function: void lw6sys_serialize_int64 (lw6sys_context_t * sys_context, unsigned char * data, int64_t value)

sys_context: global system context

data: pointer to the data, must contain at least 8 bytes of writable space

value: the integer to serialize

Serializes a 64-bit integer in a byte buffer. Result is not dependant on machine endianess. Typically used for checksums or high-level serializations.

Function: int64_t lw6sys_unserialize_int64 (lw6sys_context_t * sys_context, unsigned char * data)

sys_context: global system context

data: pointer to the data, must contain at least 8 bytes

Recovers a 64-bit integer from a byte buffer created, for instance, with lw6sys_serialize_int64.

Function: void lw6sys_serialize_int32 (lw6sys_context_t * sys_context, unsigned char * data, int32_t value)

sys_context: global system context

data: pointer to the data, must contain at least 4 bytes of writable space

value: the integer to serialize

Serializes a 32-bit integer in a byte buffer. Result is not dependant on machine endianess. Typically used for checksums or high-level serializations.

Function: int32_t lw6sys_unserialize_int32 (lw6sys_context_t * sys_context, unsigned char * data)

sys_context: global system context

data: pointer to the data, must contain at least 4 bytes

Recovers a 32-bit integer from a byte buffer created, for instance, with lw6sys_serialize_int32.

Function: void lw6sys_serialize_int16 (lw6sys_context_t * sys_context, unsigned char * data, int16_t value)

sys_context: global system context

data: pointer to the data, must contain at least 2 bytes of writable space

value: the integer to serialize

Serializes a 16-bit integer in a byte buffer. Result is not dependant on machine endianess. Typically used for checksums or high-level serializations.

Function: int16_t lw6sys_unserialize_int16 (lw6sys_context_t * sys_context, unsigned char * data)

sys_context: global system context

data: pointer to the data, must contain at least 2 bytes

Recovers a 16-bit integer from a byte buffer created, for instance, with lw6sys_serialize_int16.

Function: int lw6sys_shape_check_min_max_whd (lw6sys_context_t * sys_context, const lw6sys_whd_t * shape, const lw6sys_whd_t * min, const lw6sys_whd_t * max)

sys_context: global system context

shape: the dimensions to control

min: the minimum shape allowed

max: the maximum shape allowed

Will check wether the given shape respects some basic constraints, being not to small and not too big.

Return value: 1 if OK, 0 if not.

Function: int lw6sys_shape_check_pos (lw6sys_context_t * sys_context, const lw6sys_whd_t * shape, const lw6sys_xyz_t * pos)

sys_context: global system context

shape: the boundary box

pos: the position

Checks wether position is within the given boundary box.

Return value: 1 if OK, 0 if not.

Function: int lw6sys_shape_is_same (lw6sys_context_t * sys_context, const lw6sys_whd_t * shape_a, const lw6sys_whd_t * shape_b)

sys_context: global system context

shape_a: the first shape to compare

shape_b: the other shape to compare

Compares two shapes.

Return value: 1 if same, 0 if not.

Function: int lw6sys_shape_is_same_xy (lw6sys_context_t * sys_context, const lw6sys_whd_t * shape_a, const lw6sys_whd_t * shape_b)

sys_context: global system context

shape_a: the first shape to compare

shape_b: the other shape to compare

Compares two shapes, but ignores the z (d) parameter.

Return value: 1 if same_xy, 0 if not.

Function: int lw6sys_shape_volume_whd (lw6sys_context_t * sys_context, const lw6sys_whd_t * shape)

sys_context: global system context

shape: the shape to query

Gives the volume (w * h * d) for a given shape.

Return value: the volume.

Function: int lw6sys_shape_surface_wh (lw6sys_context_t * sys_context, const lw6sys_whd_t * shape)

sys_context: global system context

shape: the shape to query

Gives the surface (w * h) for a given shape.

Return value: the surface.

Function: void lw6sys_signal_custom (lw6sys_context_t * sys_context, int trap_errors)

sys_context: global system context

trap_errors: set to 1 if you want to trap SIGSEGV and SIGFPE

Set up our signal handlers. This will probably be overrided later by other libs such as libSDL, but at least in pure server mode it gives a way to treat SIGTERM the right way. The callbacks will use the sys_context passed here, ignoring whatever thread and/or whatever value for this context was used when the error was detected. However, one needs at least one context, for instance to log messages.

Return value: none.

Function: void lw6sys_signal_default (lw6sys_context_t * sys_context)

sys_context: global system context

Restore default signal handlers for those modified by lw6sys_signal_custom.

Return value: none.

Function: void lw6sys_signal_term_handler (int signum)

signum: SIGTERM

The own TERM signal handler, will basically call the lw6sys_signal_send_quit function, which will set a flag used later by lw6sys_signal_poll_quit.

Return value: none.

Function: void lw6sys_signal_int_handler (int signum)

signum: SIGINT

The own INT signal handler, will basically call the lw6sys_signal_send_quit function, which will set a flag used later by lw6sys_signal_poll_quit.

Return value: none.

Function: void lw6sys_signal_hup_handler (int signum)

signum: SIGTERM

The own HUP signal handler, will basically do something that shows the program is alive, typically display a NOTICE message.

Return value: none.

Function: void lw6sys_signal_segv_handler (int signum)

signum: SIGTERM

The own SEGV signal handler, will display a backtrace and exit.

Return value: none.

Function: void lw6sys_signal_fpe_handler (int signum)

signum: SIGTERM

The own FPE signal handler, will display a backtrace and exit.

Return value: none.

Function: void lw6sys_signal_send_quit (lw6sys_context_t * sys_context)

sys_context: global system context

Sets the quit flag to 1, so that lw6sys_signal_poll_quit returns true, that is, tells the polling loop to stop.

Return value: none.

Function: int lw6sys_signal_poll_quit (lw6sys_context_t * sys_context)

sys_context: global system context

Tests wether we need to stop right now.

Return value: 1 if we need to stop now, 0 if program can continue.

Function: int lw6sys_sort_int_callback (lw6sys_context_t * sys_context, void * func_data, const void * ptr_a, const void * ptr_b)

sys_context: global system context

func_data: function specific data

ptr_a: pointer to an int item

ptr_b: pointer to an int item

A typicall sort callback function, can be passed to lw6sys_sort to sort a list of integers.

Return value: -1 if ptr_a < ptr_b , 0 if ptr_a == ptr_b, 1 if ptr_a > ptr_b

Function: int lw6sys_sort_int_desc_callback (lw6sys_context_t * sys_context, void * func_data, const void * ptr_a, const void * ptr_b)

sys_context: global system context

func_data: function specific data

ptr_a: pointer to an int item

ptr_b: pointer to an int item

A typicall sort callback function, can be passed to lw6sys_sort to sort a list of integers. This one will sort in reverse mode.

Return value: 1 if ptr_a < ptr_b , 0 if ptr_a == ptr_b, -1 if ptr_a > ptr_b

Function: int lw6sys_sort_float_callback (lw6sys_context_t * sys_context, void * func_data, const void * ptr_a, const void * ptr_b)

sys_context: global system context

func_data: function specific data

ptr_a: pointer to a float item

ptr_b: pointer to a float item

A typicall sort callback function, can be passed to lw6sys_sort to sort a list of floating point numbers.

Return value: -1 if ptr_a < ptr_b , 0 if ptr_a == ptr_b, 1 if ptr_a > ptr_b

Function: int lw6sys_sort_float_desc_callback (lw6sys_context_t * sys_context, void * func_data, const void * ptr_a, const void * ptr_b)

sys_context: global system context

func_data: function specific data

ptr_a: pointer to a float item

ptr_b: pointer to a float item

A typicall sort callback function, can be passed to lw6sys_sort to sort a list of floating point numbers. This one will sort in reverse mode.

Return value: 1 if ptr_a < ptr_b , 0 if ptr_a == ptr_b, -1 if ptr_a > ptr_b

Function: int lw6sys_sort_str_callback (lw6sys_context_t * sys_context, void * func_data, const void * ptr_a, const void * ptr_b)

sys_context: global system context

func_data: function specific data

ptr_a: pointer to a string item

ptr_b: pointer to a string item

A typicall sort callback function, can be passed to lw6sys_sort to sort a list of 0-terminated strings.

Return value: -1 if ptr_a < ptr_b , 0 if ptr_a == ptr_b, 1 if ptr_a > ptr_b

Function: int lw6sys_sort_str_desc_callback (lw6sys_context_t * sys_context, void * func_data, const void * ptr_a, const void * ptr_b)

sys_context: global system context

func_data: function specific data

ptr_a: pointer to a string item

ptr_b: pointer to a string item

A typicall sort callback function, can be passed to lw6sys_sort to sort a list of 0-terminated strings. This one will sort in reverse mode.

Return value: 1 if ptr_a < ptr_b , 0 if ptr_a == ptr_b, -1 if ptr_a > ptr_b

Function: void lw6sys_sort (lw6sys_context_t * sys_context, lw6sys_list_t ** list, lw6sys_sort_callback_func_t sort_func, void * func_data)

sys_context: global system context

list: the list to sort, might be modified by the function

sort_func: the callback function used to sort

func_data: function specific data

A general sorting function. Internally, will use the glibc qsort function, but this one is adapted to the LW6 specific data structures, more exactly, the lw6sys_list structure. Several default sort callbacks are defined, but one is free to use any callback, provided it has the right prototype.

Function: lw6sys_spinlock_t * lw6sys_spinlock_create (lw6sys_context_t * sys_context)

sys_context: global system context

Creates a spinlock object.

Return value: newly allocated pointer.

Function: void lw6sys_spinlock_destroy (lw6sys_context_t * sys_context, lw6sys_spinlock_t * spinlock)

sys_context: global system context

spinlock: the spinlock to destroy.

Destroys a spinlock object.

Return value: none.

Function: int lw6sys_spinlock_lock (lw6sys_context_t * sys_context, lw6sys_spinlock_t * spinlock)

sys_context: global system context

spinlock: the spinlock to use

Locks the spinlock. Note that this should never fail unless there’s a serious initialization problem, instead, function will wait forever until spinlock is released.

Return value: 1 if success, 0 if failure.

Function: int lw6sys_spinlock_trylock (lw6sys_context_t * sys_context, lw6sys_spinlock_t * spinlock)

sys_context: global system context

spinlock: the spinlock to use

Tries to locks the spinlock. That is, tells wether spinlock can be locked immediately or not. Note that this does not mean there’s 100% chance next call to lock will terminated immediately, since lock can still be acquired by another thread.

Return value: 1 if spinlock unlocked, 0 if locked or error.

Function: int lw6sys_spinlock_unlock (lw6sys_context_t * sys_context, lw6sys_spinlock_t * spinlock)

sys_context: global system context

spinlock: the spinlock to use

Unlocks a spinlock.

Return value: 1 if sucess, 0 if error.

Function: char * lw6sys_str_copy (lw6sys_context_t * sys_context, const char * src)

sys_context: global system context

src: the string to copy

Duplicate a string, creating a new pointer on it, which must be freed afterwards. The main difference with strdup is that here we use the LW6SYS_MALLOC macro to track down possible memory leaks.

Return value: a newly allocated pointer, must be freed.

Function: char * lw6sys_str_concat (lw6sys_context_t * sys_context, const char * str1, const char * str2)

sys_context: global system context

str1: the left part to be concatenated

str2: the right part to be concatenated

Concatenate 2 strings, and put the result in a newly allocated string. Unlike strcat which uses the same pointer.

Return value: a newly allocated pointer, must be freed.

Function: char * lw6sys_new_sprintf (lw6sys_context_t * sys_context, const char * fmt, ...)

sys_context: global system context

fmt: a format string, like the one you would pass to printf ...: optional arguments, like the ones you would pass to printf

An sprintf like function, except it allocates a new string automatically, with "enough space". This is not a highly optimized function, it will allocate plenty of memory, possibly several times, and thus consume time and resources. But it has the great advantage of freeing the programmer of the dirty work of guessing "how log will the sprintf’ed string be?" before even generating it. So it’s a time saver for the programmer. Additionnally, helps avoiding memory leaks and buffer overflows.

Return value: a new allocated string, must be freed.

Function: int lw6sys_buf_sprintf (lw6sys_context_t * sys_context, char * buf, int len, const char * fmt, ...)

sys_context: global system context

buf: a buffer of len+1 chars

len: the max length of string

fmt: a format string, like the one you would pass to printf ...: optional arguments, like the ones you would pass to printf

Almost like snprintf except that it will *always* append a char 0 (’\0’) at the end of the string. Therefore buf must be of size len+1.

Return value: 1 if success, 0 if failed.

Function: int lw6sys_str_is_blank (lw6sys_context_t * sys_context, const char * str)

sys_context: global system context

str: the string to test

Tests wether a string is blank, that is, if it’s composed of space, tabs, or carriage returns only.

Return value: 1 if blank, 0 if not.

Function: int lw6sys_str_is_null_or_empty (lw6sys_context_t * sys_context, const char * str)

sys_context: global system context

str: the string to test

Tests wether a string is NULL or empty (string with 0 chars "").

Return value: 1 if NULL or empty, 0 if contains something.

Function: const char * lw6sys_str_empty_if_null (lw6sys_context_t * sys_context, const char * str)

sys_context: global system context

str: the string to test

Returns always a non-NULL string, if string is NULL, returns "" The argument str is not passed as const else this function would equate to a disguised cast from const to non-const.

Return value: source string or "" if it was NULL

Function: int lw6sys_str_is_same (lw6sys_context_t * sys_context, const char * str_a, const char * str_b)

sys_context: global system context

str_a: 1st string to compare, can be NULL

str_b: 2nd string to compare, can be NULL

Compares two strings for equality. Difference with strcmp is that this one won’t check for alphabetical order and return -1 or +1, but will check for NULL args. of space, tabs, or carriage returns only.

Return value: 1 if same, 0 if not.

Function: int lw6sys_str_is_same_no_case (lw6sys_context_t * sys_context, const char * str_a, const char * str_b)

sys_context: global system context

str_a: 1st string to compare, can be NULL

str_b: 2nd string to compare, can be NULL

Compares two strings for equality. Difference with strcmp is that this one won’t check for alphabetical order and return -1 or +1, but will check for NULL args. of space, tabs, or carriage returns only. This function is not case sensitive.

Return value: 1 if same, 0 if not.

Function: int lw6sys_str_starts_with (lw6sys_context_t * sys_context, const char * str, const char * beginning)

sys_context: global system context

str: the string to analyse

beginning: the pattern to search

Tells wether string starts with a given beginning.

Return value: 1 if str starts with beginning, 0 if not

Function: int lw6sys_str_starts_with_no_case (lw6sys_context_t * sys_context, const char * str, const char * beginning)

sys_context: global system context

str: the string to analyse

beginning: the pattern to search

Tells wether string starts with a given beginning. This function is not case sensitive.

Return value: 1 if str starts with beginning, 0 if not

Function: int lw6sys_skip_blanks (lw6sys_context_t * sys_context, char ** str_ptr)

sys_context: global system context

str_ptr: a pointer to a string pointer (read/write parameter).

Skips blanks at the beginning of a string. The passed parameter is modifed in place. Usefull for parsing.

Return value: 1 if blanks were found, else 0.

Function: void lw6sys_str_cleanup (lw6sys_context_t * sys_context, char * str)

str: a pointer to the string, which will be modified in-place.

Used to clean up some strings, for instance if they come from the network, we don’t necessarly want system chars to be displayed on the console. Basically it removes all characters with an ASCII code inferior to 32, that is, all system characters. This way, there won’t be any tab, linefeed, or any of such characters left.

Return value: none.

Function: void lw6sys_str_cleanup_ascii7 (lw6sys_context_t * sys_context, char * str)

sys_context: global system context

str: a pointer to the string, which will be modified in-place.

Used to clean up some strings, for instance if they come from the network, we don’t necessarly want system chars to be displayed on the console. Basically it removes all characters with an ASCII code inferior to 32, that is, all system characters. This way, there won’t be any tab, linefeed, or any of such characters left. This function will even remove any character above ASCII 127.

Return value: none.

Function: char * lw6sys_str_reformat (lw6sys_context_t * sys_context, const char * str, const char * prefix, int nb_columns)

sys_context: global system context

str: a pointer to the string we want to modify

prefix: a prefix to put before each line

Reformats a string, that is, insert newline characters in the right places to that it fits in a given number of columns. A prefix is appended at the beginning of each line. Will not handle strings which already contain newline characters perfectly.

Return value: a newly allocated string, must be freed.

Function: void lw6sys_str_reformat_this (lw6sys_context_t * sys_context, char * str, int nb_columns)

sys_context: global system context

str: a pointer to the string we want to modify

Reformats a string, that is, insert newline characters in the right places to that it fits in a given number of columns. This function will modify the buffer so str must be writeable. Will not handle strings which already contain newline characters perfectly.

Return value: none

Function: char * lw6sys_eol (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the value of EOL, that is, the "end of line" sequence. Will simply return "\n" on UNIX and "\r\n" on Microsoft platforms. Note that while this is convenient to write config and example files, for instance, it’s a bad idea to use this to generate network messages, because this kind of message needs to be platform independant. Thus any network protocol oriented string would use chr(10) and char(13) directly.

Return value: the EOL string, must not be freed.

Function: lw6sys_list_t * lw6sys_str_split (lw6sys_context_t * sys_context, const char * str, char c)

sys_context: global system context

str: a string

c: the delimiter to split with

Splits a string, for instance ’foo,bar’ splited with ’o’ will return ’f’, ” and ’,bar’.

Return value: a list containing 0-terminated strings.

Function: lw6sys_list_t * lw6sys_str_split_no_0 (lw6sys_context_t * sys_context, const char * str, char c)

sys_context: global system context

str: a string

c: the delimiter to split with

Splits a string, ignoring empty ’0-length’ members. For instance ’foo,bar’ splited with ’o’ will return ’f’ and ’,bar’.

Return value: a list containing 0-terminated strings.

Function: lw6sys_list_t * lw6sys_str_split_config_item (lw6sys_context_t * sys_context, const char * str)

sys_context: global system context

str: a string

Splits a string, ignoring empty ’0-length’ members, and using the comma ’,’ as a separator. This is typically usefull for config elements such as backend lists. Only paths need another separator (platform-dependant).

Return value: a list containing 0-terminated strings.

Function: char * lw6sys_str_join (lw6sys_context_t * sys_context, lw6sys_list_t * list, const char * glue)

sys_context: global system context

list: list of strings to join

glue: string to add in-between

Companion function of lw6sys_str_split which will do the contrary and join the string. Here we use a string as the glue/separator, more flexible than a simple char in this case.

Return value: dynamically allocated string

Function: void lw6sys_str_toupper (lw6sys_context_t * sys_context, char * str)

sys_context: global system context

str: the string to modify

Transforms a string to upper case, the pointer must point to modifiable data.

Return value: none, str pointed data modified in-place

Function: void lw6sys_str_tolower (lw6sys_context_t * sys_context, char * str)

sys_context: global system context

str: the string to modify

Transforms a string to lower case, the pointer must point to modifiable data.

Return value: none, str pointed data modified in-place

Function: void lw6sys_str_truncate (lw6sys_context_t * sys_context, char * str, int len)

sys_context: global system context

str: the string to truncate

len: the new length

Truncates a string to the max given length. If truncated to 3, "abcdef" becomes "abc".

Return value: none, str pointed data modified in-place

Function: void lw6sys_str_truncate_middle (lw6sys_context_t * sys_context, char * str, int len, const char * middle)

sys_context: global system context

str: the string to truncate

len: the new length

middle: the string to add in the middle

Truncates a string to the max given length, by truncating the middle of the string, and putting the string middle at this place. Calling it with "abcdefghijk",5,"X" will give "abXjk".

Return value: none, str pointed data modified in-place

Function: char * lw6sys_str_random (lw6sys_context_t * sys_context, int len)

sys_context: global system context

len: the length of the random string to generate.

Generates a random string, this is usefull for testing.

Return value: newly allocated string

Function: char * lw6sys_str_random_words (lw6sys_context_t * sys_context, int len)

sys_context: global system context

len: the length of the random string to generate.

Generates a random string, this is usefull for testing. This version only generates words with alpha-numerical content (letters and digits plus spaces).

Return value: newly allocated string

Function: char * lw6sys_str_random_word (lw6sys_context_t * sys_context, int len)

sys_context: global system context

len: the length of the random string to generate.

Generates a random string, this is usefull for testing. This version generates on single word with alpha-numerical content (letters and digits but no spaces).

Return value: newly allocated string

Function: int lw6sys_str_is_bin (lw6sys_context_t * sys_context, const char * buf, int len)

sys_context: global system context

buf: the buffer to test

len: the length of the buffer

Tests wether a buffer is likely to contain a string. This is not a bulletproof function, just a simple heuristic based estimator.

Return value: 1 if probably binary, 0 if probably text

Function: char * lw6sys_stream_file_to_str (lw6sys_context_t * sys_context, FILE * f)

sys_context: global system context

f: file to get input from, typically stdin

Will read file/stream and return it as a string. This is not for serious stream operation since it will return only when stream is closed, and read all file into memory before doing anything. It’s also limited in size since it uses a fixed length buffer, so this is just for quick testing, typically used by command line switches which are used to test encoding/decoding functions. Do not use it to read a filesystem file, lw6sys_read_file_content is much better.

Return value: newly allocated string.

Function: void lw6sys_stream_str_to_file (lw6sys_context_t * sys_context, FILE * f, char * str)

sys_context: global system context

f: file to receive the string

str: the string to output

Here only for API consistency, will just put string to file (just a simple fprint).

Return value: none.

Function: int32_t lw6sys_test_and_set (volatile int32_t * test_and_set)

test_and_set: pointer to the value used to test and set

Low level function which performs an atomic exchange to implement a spinlock. This one is just a wrapper to help debugging asm calls.

Return value: 1 when lock is acquired.

Function: int64_t lw6sys_test_and_set (volatile int64_t * test_and_set)

test_and_set: pointer to the value used to test and set

Low level function which performs an atomic exchange to implement a spinlock. This one is just a wrapper to help debugging asm calls.

Return value: 1 when lock is acquired.

Function: int lw6sys_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libsys module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6sys_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the sys module test suite, testing most (if not all...) functions. Note that some tests perform file system operations and might therefore fail on a read-only filesystem, or if user permissions are not sufficient.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6sys_test_exec (lw6sys_context_t * sys_context, int argc, const char * [] argv, int mode)

sys_context: global system context

argc: number of args as passed to main

argv: array of args as passed to main

mode: 0 for check only, 1 for full test

Runs the sys module test which is specific to exec functions, these ones require argc and argv to be correctly set so the extra argument justifies putting it outside lw6sys_test. Additionnally, it’s not fool proof... Moreover, it should be run at the beginning of the program, running it afterwards could give unpredictable results. So it’s safer to use it outside the CUnit standard mechanisms.

Return value: 1 if test is successfull, 0 on error.

Function: lw6sys_thread_handler_t * lw6sys_thread_create (lw6sys_context_t * sys_context, lw6sys_thread_callback_func_t callback_func, lw6sys_thread_callback_func_t callback_join, void * callback_data)

sys_context: global system context

callback_func: the main callback, the function that will run the thread

callback_join: function which will be called when joining, at the end

callback_data: data which will be passed to the callback

Creates a thread. All threads must be joined. This is because we really do not want the game to leak, and detached threads are typically the kind of thing that leaves stuff in the heap. Note that callback_func is just something which will be called when joining it can be NULL. The idea is to put in it free & delete functions, which you can’t call before joining when you want the main thread to get the results of the callback_func.

Return value: an opaque pointer on the thread. Can be NULL if failed.

Function: int lw6sys_thread_is_callback_done (lw6sys_context_t * sys_context, lw6sys_thread_handler_t * thread_handler)

sys_context: global system context

thread_handler: thread to work on

Tells wether the callback is done, that is to say, wether the results are available, and we can join.

Return value: 1 if done, else 0.

Function: int lw6sys_thread_wait_callback_done (lw6sys_context_t * sys_context, lw6sys_thread_handler_t * thread_handler)

sys_context: global system context

thread_handler: thread to work on

Waits until the callback of the thread is done, this does not necessarly mean it’s freed, in fact it’s not at this stage, the join callback can still be yet to call, but at least the main stuff is done.

Return value: 1 if done, 0 on error

Function: int lw6sys_thread_get_id (lw6sys_context_t * sys_context, lw6sys_thread_handler_t * thread_handler)

sys_context: global system context

thread_handler: thread to query

Returns the id of the thread, this is an internal value, unique for each process, which can help identifying the thread.

Return value: the id, should be >0.

Function: void * lw6sys_thread_get_data (lw6sys_context_t * sys_context, lw6sys_thread_handler_t * thread_handler)

sys_context: global system context

thread_handler: thread to query

Returns the data associated to the thread, that is, the pointer which was passed to the callback function.

Return value: a pointer.

Function: void lw6sys_thread_join (lw6sys_context_t * sys_context, lw6sys_thread_handler_t * thread_handler)

sys_context: global system context

thread_handler: thread to end

Joins the thread, that’s to say wait until the thread is over, and destroys the ressources associated to it. Note that if the thread is looping forever, this function will just wait forever. This is the only way to end a thread.

Return value: none.

Function: int lw6sys_get_thread_create_count (lw6sys_context_t * sys_context)

sys_context: global system context

Utility function used to check how many threads where created and joined.

Return value: how many threads were created.

Function: int lw6sys_get_thread_join_count (lw6sys_context_t * sys_context)

sys_context: global system context

Utility function used to check how many threads where created and joined.

Return value: how many threads were joined.

Function: int lw6sys_check_thread_count (lw6sys_context_t * sys_context)

sys_context: global system context

Utility function used to check how many threads where created and joined. This one will compare the results of lw6sys_get_thread_create_count and lw6sys_get_thread_join_count.

Return value: 1 if both are equals, 0 if not (error...).

Function: int64_t lw6sys_get_timestamp (lw6sys_context_t * sys_context)

sys_context: global system context

Returns a 64-bit timestamp, for general purpose. The unit is milliseconds, should return the number of milliseconds since EPOCH. Don’t use this for accurate date handling, but rather to technical stamp events.

Return value: the timestamp.

Function: int64_t lw6sys_get_uptime (lw6sys_context_t * sys_context)

sys_context: global system context

Returns the number of milliseconds since program was started. Milliseconds are often referred to as ’ticks’.

Return value: the number of milliseconds (64-bit)

Function: int32_t lw6sys_get_cycle (lw6sys_context_t * sys_context)

sys_context: global system context

Returns a 32-bit timestamp, which is likely to "loop" and have twice the same value during a single program execution. The idea here is just to provide a 32-bit value, not too big, for animation purposes. The idea is that with 64-bit values, numbers are too big and if the goal is just to animate a cursor or spin a sphere, one does not care if every ten hours there’s a display glitch because value became zero again. Besides, those values are often used for their "rest" in a module operation, to translate textures for instance, and having too big numbers causes floating point imprecisions. In fact those values or even only 20-bit. The function is based on lw6sys_get_uptime so it will return 0 at game startup.

Return value: the cycle value, a 20-bit integer.

Function: void lw6sys_timer_update (lw6sys_context_t * sys_context, int64_t * timestamp, int64_t * uptime, int32_t * cycle)

sys_context: global system context

timestamp: the timestamp in msec since EPOCH (output), can be NULL

uptime: the uptime in msec since startup (output), can be NULL

cycle: a 20-bit value for animation purpose.

Returns timestamp & uptime with only one system call.

Return value: none (parameters modified).

Function: void lw6sys_sleep (lw6sys_context_t * sys_context, float seconds)

sys_context: global system context

seconds: the number of seconds to wait, fractions allowed

Will sleep for the given amount of seconds. Same as lw6sys_delay only input is provided as a floating number of seconds instead of ticks.

Function: void lw6sys_delay (lw6sys_context_t * sys_context, int msec)

sys_context: global system context

msec: the number of milliseconds (ticks) to wait

Will sleep for the given amount of seconds. Provides accurate timing and has "about-millisecond" precision, since it uses usleep or select internally. Might however be interrupted in some cases, so consider function can always return quicker than specified. A common usage of this function is polling loops, where you don’t care if 2 polls are very close, but simply want to avoid polling continuously, therefore consumming 100% of the CPU for nothing.

Function: void lw6sys_idle (lw6sys_context_t * sys_context)

sys_context: global system context

Will sleep for a minimal amount of time, just giving the OS a chance to let other threads/processes execute themselves. This can make a big difference in polling loops between a process that eats 100% CPU and a process that has a very moderate load. of ticks.

Function: void lw6sys_snooze (lw6sys_context_t * sys_context)

sys_context: global system context

Will sleep for some time, like lw6sys_idle, except it’s a "longer" time, use this when you don’t really care about reactivity but are more concerned about saving CPU, not running uselessly the same polling code.

Function: void lw6sys_time_init (lw6sys_context_t * sys_context)

sys_context: global system context

Global initializations required to handle time properly.

Function: char * lw6sys_date_rfc1123 (lw6sys_context_t * sys_context, int seconds_from_now)

sys_context: global system context

seconds_from_now: an offset to add to current time

Gives the date according to RFC1123, this is typically usefull for HTTP protocol.

Return value: newly allocated string.

Function: char * lw6sys_date_clf (lw6sys_context_t * sys_context)

sys_context: global system context

Gives the date in a format which is compatible with Apache CLF Common Log Format.

Return value: newly allocated string.

Function: char * lw6sys_readable_uptime (lw6sys_context_t * sys_context, int64_t timestamp_delta)

sys_context: global system context

timestamp_delta: the duration to show, in msec

Returns a readable form of an uptime, typically 1d 12:34:06 for one day, 12 hours, 34 min, 6 sec or 7:03:45 for 7 hours, 3 minutes 45 sec.

Return value: newly allocated string

Function: extern char * lw6sys_url_http_from_ip_port (lw6sys_context_t * sys_context, const char * ip, int port)

sys_context: global system context

ip: IP address

port: IP port

Returns an http URL pointing to ip: port that is, adds a heading http:// and a trailing /, and treats port 80 as default. This is used to create public_url in net modules.

Return value: a newly allocated string, NULL on error.

Function: lw6sys_url_t * lw6sys_url_parse (lw6sys_context_t * sys_context, const char * url)

sys_context: global system context

url: the URL to parse

Parses a URL, this is not a complete RFC compliant parser, it’s only used to transform URLs into their ’canonical’ form as well as getting basic info such as on which port one should connect.

Return value: a newly allocated struct, NULL on error

Function: void lw6sys_url_free (lw6sys_context_t * sys_context, lw6sys_url_t * url)

sys_context: global system context

url: the url struct to free

Frees a URL struct and all its members.

Return value: none.

Function: char * lw6sys_url_canonize (lw6sys_context_t * sys_context, const char * url)

sys_context: global system context

url: the url to check & transform

Checks if a given URL is correct and, if it is, transforms it into its canonical form. This is mostly to get rid of typesettings error, add a tailing /, transform all domain into lowercase, among other things. A canonized url passed into this function should come out exactly the same.

Return value: a newly allocated string.

Function: int lw6sys_url_is_canonized (lw6sys_context_t * sys_context, const char * url)

sys_context: global system context

url: the URL to check

Checks wether an URL is in its canonized form.

Return value: 1 if OK (canonized form), 0 if not

Function: int lw6sys_version_is_compatible (lw6sys_context_t * sys_context, const char * version_a, const char * version_b)

sys_context: global system context

version_a: 1st version to compare

version_b: 2nd version to compare

Compares two versions and tells wether they are compatible or not. Actually, it only checks that MAJOR.MINOR is the same in both cases. As a side not, it’s not case sensitive. In most LW6 relevant cases, it’s a moot issue since MAJOR.MINOR is a number, but well, just in case.

Return value: 1 if compatible, 0 if not

Function: int lw6sys_vthread_run (lw6sys_context_t * sys_context, lw6sys_thread_callback_func_t callback_func, lw6sys_thread_callback_func_t callback_join, void * callback_data)

sys_context: global system context

callback_func: the main callback, the function that will run the thread

callback_join: function which will be called when joining, at the end

callback_data: data which will be passed to the callback

This function is similar to lw6sys_thread_create, but it’s dedicated to creating a unique (one per process only) thread, which, in turn, will be able to run commands in the main thread itself. This is a hack to allow apparently spawned child threads to be actually handled by main. This is because some libraries, which LW6 uses in threads, need to be actually called in the main thread. SDL, for instance. Note that after running this you loose control on the main thread, this one will only wait for possible commands from the spawned thread, typically sent with the lw6sys_vthread_create function.

Return value: 1 on success, 0 on failure.

Function: int lw6sys_vthread_is_running (lw6sys_context_t * sys_context)

sys_context: global system context

Returns true if lw6sys_vthread_run has been called. Note that this is not bullet proof, it will return true in a correct manner only if you call it from the vthread itself. In practise this shouldn’t be a problem, the idea is just to write portable code for the main control thread and be able to decide on the fly wether to create a thread we should prefer the lw6sys_thread_create or its equivalent the lw6sys_vthread_create function.

Return value: 1 on success, 0 on failure.

Function: int lw6sys_vthread_create (lw6sys_context_t * sys_context, lw6sys_thread_callback_func_t callback_func, lw6sys_thread_callback_func_t callback_join, void * callback_data)

sys_context: global system context

callback_func: the main callback, the function that will run the thread

callback_join: function which will be called when joining, at the end

callback_data: data which will be passed to the callback

The equivalent of lw6sys_thread_create but for the vthread infrastructure. The idea is to pretend firing a spawned thread, but in fact it’s the main thread that runs the code. This function must imperatively be called within the lw6sys_vthread_run function, else it will fail or be buggy.

Return value: 1 on success, 0 on failure.

Function: void lw6sys_vthread_join (lw6sys_context_t * sys_context)

sys_context: global system context

The equivalent of lw6sys_thread_join but for the vthread infrastructure. The idea is to pretend firing a spawned thread, but in fact it’s the main thread that runs the code. This function must imperatively be called within the lw6sys_vthread_run function, else it will fail or be buggy.

Return value: none.

Struct: lw6sys_assoc_s

Assoc is a basic key/pair structure where key is a string. Use it for basic associations, it’s not fast when there are many keys, in that case, prefer a hash.

Member of lw6sys_assoc_s: key

Type: char *

Definition: char* lw6sys_assoc_s::key

The key, a 0 terminated standard C string.

Member of lw6sys_assoc_s: value

Type: void *

Definition: void* lw6sys_assoc_s::value

The value, pointer to arbitrary data.

Member of lw6sys_assoc_s: free_func

Type: lw6sys_free_func_t

Definition: lw6sys_free_func_t lw6sys_assoc_s::free_func

This function will be called whenever the element is deleted. You can set it to NULL in that case no callback will be called on deletion.

Member of lw6sys_assoc_s: next_item

Type: lw6sys_assoc_p

Definition: lw6sys_assoc_p lw6sys_assoc_s::next_item

Pointer on the next item, will be NULL on last element, there’s a difference between a NULL pointer and a valid assoc with only one item being EOL.

Struct: lw6sys_cache_item_s

Cache item is the object used to hold data within hash, to implement cache features. It basically stores a pointer to the actual data, and a timestamp which marks the expiration time. In practice, a cache is just an hash which contains this kind of data.

Member of lw6sys_cache_item_s: expiration_timestamp

Type: int64_t

Definition: int64_t lw6sys_cache_item_s::expiration_timestamp

Expiration time, after this time, key is considered invalid.

Member of lw6sys_cache_item_s: real_free_func

Type: lw6sys_free_func_t

Definition: lw6sys_free_func_t lw6sys_cache_item_s::real_free_func

OK, now this requires some explanation : to use standard hash / assoc function we need the cache hash to behave like a real hash. So the trick is to store within the data structure the pointer on the real free callback. This way the special cache_free callback will have a way to call the genuine free function before destroying the cache container. This duplicates the pointer, but avoids code duplication. In practice caches shouldn’t be that big anyway, so it won’t eat up all your memory anyway.

Member of lw6sys_cache_item_s: value

Type: void *

Definition: void* lw6sys_cache_item_s::value

The actual value.

Struct: lw6sys_cache_s

Cache is an object based on which works pretty much the same but adds the possiblity to give an expiration time to a key. Any key with an expiration time in the past will be removed on query and appear as non-existing to callers.

Member of lw6sys_cache_s: delay_msec

Type: int

Definition: int lw6sys_cache_s::delay_msec

Delay in milliseconds before a key expires.

Member of lw6sys_cache_s: real_free_func

Type: lw6sys_free_func_t

Definition: lw6sys_free_func_t lw6sys_cache_s::real_free_func

The real free_func to call on objects.

Member of lw6sys_cache_s: data

Type: lw6sys_hash_t *

Definition: lw6sys_hash_t* lw6sys_cache_s::data

The actual data.

Struct: lw6sys_color_8_s

Used to store colors when representing them in RGBA mode with integers ranging from 0 to 255.

Member of lw6sys_color_8_s: r

Type: u_int8_t

Definition: u_int8_t lw6sys_color_8_s::r

Red [0 ... 255].

Member of lw6sys_color_8_s: g

Type: u_int8_t

Definition: u_int8_t lw6sys_color_8_s::g

Green [0 ... 255].

Member of lw6sys_color_8_s: b

Type: u_int8_t

Definition: u_int8_t lw6sys_color_8_s::b

Blue [0 ... 255].

Member of lw6sys_color_8_s: a

Type: u_int8_t

Definition: u_int8_t lw6sys_color_8_s::a

Alpha [0 ... 255]. 255 is opaque, 0 is transparent.

Struct: lw6sys_color_f_s

Used to store colors when representing them in RGBA mode with floats ranging from 0.0f to 1.0f.

Member of lw6sys_color_f_s: r

Type: float

Definition: float lw6sys_color_f_s::r

Red [0 ... 1.0f].

Member of lw6sys_color_f_s: g

Type: float

Definition: float lw6sys_color_f_s::g

Green [0 ... 1.0f].

Member of lw6sys_color_f_s: b

Type: float

Definition: float lw6sys_color_f_s::b

Blue [0 ... 1.0f].

Member of lw6sys_color_f_s: a

Type: float

Definition: float lw6sys_color_f_s::a

Alpha [0 ... 1.0f]. 1.0f is opaque, 0.0f is transparent.

Struct: lw6sys_color_hsv_s

Used to store colors when representing them in HSV mode with floats ranging from 0.0f to 1.0f. An alpha channel has been added so this is more HSVA than HSV.

Member of lw6sys_color_hsv_s: h

Type: float

Definition: float lw6sys_color_hsv_s::h

Hue [0 ... 360.0f]. 0.0f is red, 120.0f is green, 240.0f is blue.

Member of lw6sys_color_hsv_s: s

Type: float

Definition: float lw6sys_color_hsv_s::s

Saturation [0 ... 1.0f].

Member of lw6sys_color_hsv_s: v

Type: float

Definition: float lw6sys_color_hsv_s::v

Value [0 ... 1.0f].

Member of lw6sys_color_hsv_s: a

Type: float

Definition: float lw6sys_color_hsv_s::a

Alpha [0 ... 1.0f]. 1.0f is opaque, 0.0f is transparent.

Struct: lw6sys_context_s

Global context, used by pretty much any function, this is used to avoid storing global static variables, and allow all code to be used in a multithreaded context. In practice some libraries the program relies on might still use globals but at least the limitation is not induced by Liquid War 6 itself. Note that this structure is a wrapper over the internal structure which contains the real members, the first two members need be the same as it is casted internally.

Member of lw6sys_context_s: id

Type: u_int32_t

Definition: u_int32_t lw6sys_context_s::id

The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Struct: lw6sys_hash_s

Hash is a basic hash structure, relying on assoc for implementation. Actually, what it does is storing an array of assoc, the number of assoc elements is given at construction. Then when accessing a member, a quick checksum is made from the key, which enables finding out which assoc must be queried. If the hash is properly sized, then once one has found the right assoc, finding the right key is fast, since there are only a few of them in each assoc, and it avoids scanning for for all keys, which is the very purpose of the hash.

Member of lw6sys_hash_s: size

Type: int

Definition: int lw6sys_hash_s::size

Number of assoc used for this hash, passed at construction.

Member of lw6sys_hash_s: entries

Type: lw6sys_assoc_t **

Definition: lw6sys_assoc_t** lw6sys_hash_s::entries

Array of assoc holding the actual data.

Member of lw6sys_hash_s: free_func

Type: lw6sys_free_func_t

Definition: lw6sys_free_func_t lw6sys_hash_s::free_func

This function will be called whenever the element is deleted. You can set it to NULL in that case no callback will be called on deletion.

Struct: lw6sys_hexa_serializer_s

The hexa (for hexadecimal) serializer is a tool used to simplify serialization processes, you can just push/pop basic data types on it, it will concatenate the string, allocate memory, do all this dirty stuff without requiring you to plan the size of the buffer, among other things.

Member of lw6sys_hexa_serializer_s: buf

Type: char *

Definition: char* lw6sys_hexa_serializer_s::buf

Data buffer.

Member of lw6sys_hexa_serializer_s: buf_size

Type: int

Definition: int lw6sys_hexa_serializer_s::buf_size

Size of data buffer, in bytes.

Member of lw6sys_hexa_serializer_s: pos

Type: int

Definition: int lw6sys_hexa_serializer_s::pos

Current position within the buffer, this is, typically, the place where data will be appended at the next push call, or where it will be fetched from at the next pop call.

Struct: lw6sys_list_r_s

List_r is a list system based on list plus a mutex that ensures you can safely call functions on it, without worrying about concurrency. All functions with list_r_ in in their name do lock the list_r before using it, and release it afterwards. Else, the API is pretty much the same, except some functions that take a ** with a list take a simple * with a list_r.

Member of lw6sys_list_r_s: mutex

Type: lw6sys_mutex_t *

Definition: lw6sys_mutex_t* lw6sys_list_r_s::mutex

Mutex used to avoid multiple accesses. Locked / unlocked on each member function call except new and free.

Member of lw6sys_list_r_s: list

Type: lw6sys_list_t *

Definition: lw6sys_list_t* lw6sys_list_r_s::list

List containing the data. Basically, the list_r is just a wrapper on this, bundled with the mutex.

Member of lw6sys_list_r_s: free_func

Type: lw6sys_free_func_t

Definition: lw6sys_free_func_t lw6sys_list_r_s::free_func

This function will be called whenever the element is deleted. You can set it to NULL in that case no callback will be called on deletion.

Struct: lw6sys_list_s

List is a basic list system, with a void * pointer to hold arbitrary data and a callback function for deletion. Provides basic functions to push, pop, walk, any array-like call will of course be very slow. As of current implementation, front operations are fast, but back operations are slow.

Member of lw6sys_list_s: data

Type: void *

Definition: void* lw6sys_list_s::data

Opaque pointer on element data.

Member of lw6sys_list_s: free_func

Type: lw6sys_free_func_t

Definition: lw6sys_free_func_t lw6sys_list_s::free_func

This function will be called whenever the element is deleted. You can set it to NULL in that case no callback will be called on deletion.

Member of lw6sys_list_s: next_item

Type: lw6sys_list_p

Definition: lw6sys_list_p lw6sys_list_s::next_item

Pointer on the next item, will be NULL on last element, there’s a difference between a NULL pointer and a valid list with only one item being EOL. Other way to state it: NULL and empty list are two different things.

Struct: lw6sys_module_pedigree_s

Structure used to store informations about a module. This describes the module, its author license, this is both a legal check and a technical check, to maximize the chances the code we’re running is the right one, and to trace it.

Member of lw6sys_module_pedigree_s: id

Type: char *

Definition: char* lw6sys_module_pedigree_s::id

Module id, for instance, could be "gl1".

Member of lw6sys_module_pedigree_s: category

Type: char *

Definition: char* lw6sys_module_pedigree_s::category

Module category, for instance, could be "gfx".

Member of lw6sys_module_pedigree_s: name

Type: char *

Definition: char* lw6sys_module_pedigree_s::name

Module name, readable (displayable) name.

Member of lw6sys_module_pedigree_s: readme

Type: char *

Definition: char* lw6sys_module_pedigree_s::readme

Module readme text.

Member of lw6sys_module_pedigree_s: version

Type: char *

Definition: char* lw6sys_module_pedigree_s::version

Module version.

Member of lw6sys_module_pedigree_s: copyright

Type: char *

Definition: char* lw6sys_module_pedigree_s::copyright

Module (short) copyright information.

Member of lw6sys_module_pedigree_s: license

Type: char *

Definition: char* lw6sys_module_pedigree_s::license

Module (short) license.

Member of lw6sys_module_pedigree_s: date

Type: char *

Definition: char* lw6sys_module_pedigree_s::date

Date of module compilation.

Member of lw6sys_module_pedigree_s: time

Type: char *

Definition: char* lw6sys_module_pedigree_s::time

Time of module compilation.

Struct: lw6sys_mutex_s

Mutex is our own wrapper on the pthread mutex object. Why not use the pthread mutex directly? For debugging, this allows us to place and instrument hooks if needed.

Member of lw6sys_mutex_s: id

Type: u_int32_t

Definition: u_int32_t lw6sys_mutex_s::id

The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Struct: lw6sys_progress_s

Structure used to store progress information. The idea is that is that must be usable in polling mode or in multithreaded mode, and we must be able to truncate a progress indicator into several stages. So this structure contains a range start, a range end, and its value between those two, which is meant to be written by the code executing the operation and read by the caller/rendering thread.

Member of lw6sys_progress_s: min

Type: float

Definition: float lw6sys_progress_s::min

Where the progress operation starts.

Member of lw6sys_progress_s: max

Type: float

Definition: float lw6sys_progress_s::max

Where the progress operation ends.

Member of lw6sys_progress_s: value

Type: float *

Definition: volatile float* lw6sys_progress_s::value

Somewhere between min and max.

Struct: lw6sys_spinlock_s

Spinlock is our own wrapper on a spinlock based mutex. Why not use the pthread spinlock directly? For debugging, this allows us to place and instrument hooks if needed. Additionnally, some implementations of pthread do not provide spinlock and in that case we provide our own alternative.

Member of lw6sys_spinlock_s: id

Type: u_int32_t

Definition: u_int32_t lw6sys_spinlock_s::id

The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Struct: lw6sys_thread_handler_s

Thread handler is our own wrapper on the pthread object. Why not use the pthread handler directly? Basically to store basic flags and context data (void * pointer on our thread data for instance) along with the handler. This is merely for debugging and convenience. Internally this will be casted to _lw6sys_thread_handler_t.

Member of lw6sys_thread_handler_s: id

Type: u_int32_t

Definition: u_int32_t lw6sys_thread_handler_s::id

The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Struct: lw6sys_url_s

Describes an URL, with its elements splitted, this is just to be able to use half-parsed URLs and avoid redoing this parsing everytime.

Member of lw6sys_url_s: use_ssl

Type: int

Definition: int lw6sys_url_s::use_ssl

1 if in https, 0 if in http.

Member of lw6sys_url_s: host

Type: char *

Definition: char* lw6sys_url_s::host

Host name.

Member of lw6sys_url_s: port

Type: int

Definition: int lw6sys_url_s::port

IP port.

Member of lw6sys_url_s: uri

Type: char *

Definition: char* lw6sys_url_s::uri

URI, that is, everything after the port.

Struct: lw6sys_whd_s

Contains the shape of a 3D box. There are 3 differences with its "XYZ" equivalent. First, sometimes w*h*d reads better than x,y,z. Then, xyz is signed, whd is unsigned. Finally, these are real int32 values, they are not 14-bit limited. It does not really cost any memory for it’s usually used as a single "shape" attribute for a whole map. At the same time, it’s very often used as a test value in loops, so it’s interesting to have it in a value that’s easy to optimize for the compiler (exactly one register...)

Member of lw6sys_whd_s: w

Type: u_int32_t

Definition: u_int32_t lw6sys_whd_s::w

Width.

Member of lw6sys_whd_s: h

Type: u_int32_t

Definition: u_int32_t lw6sys_whd_s::h

Height.

Member of lw6sys_whd_s: d

Type: u_int32_t

Definition: u_int32_t lw6sys_whd_s::d

Depth.

Struct: lw6sys_xyz_s

All-in 32 bit 3D position, to save memory.It’s a deliberate choice in Liquid War to handle "limited size" levels. In fact 14 bits still allows 8000x8000 maps, which are at least 100 times too slow to play now (2008). Should we follow Moore’s law we’d have at least 6 years until those are playable, and well, until then, let’s wait. The point is that storing this information (x*y) on 4 bytes might be very important in some cases, since it can reduce memory footprint on structs which are stored in numerous quantities, and therefore maximize chances that we use level 1 &amp; 2 caches and other nice things which happen when memory consumption is not too high.Point is: why use INT32 and then limit it to 14 bits instead of using an INT16 or short in the first place? Answer: it’s easier to handle INT32 all the time in the rest of the code. Compiler and CPU might even handle that better than short. Then, and only when data will be read/written in the struct will it be truncated. Typical example is: we want to multiplicate y by w (which is a width). Result is beyond INT16/short scope but we want to handle it! Casting everything to INT32/int is a pain. With this int y:14 trick, we use y as a "full-featured" INT32/int and well, when it will be read/written we’ll loose values over 8191, but we simply do not care.

Member of lw6sys_xyz_s: x

Type: int32_t

Definition: int32_t lw6sys_xyz_s::x

X position, from -8192 to +8191.

Member of lw6sys_xyz_s: y

Type: int32_t

Definition: int32_t lw6sys_xyz_s::y

Y position, from -8192 to +8191.

Member of lw6sys_xyz_s: z

Type: int32_t

Definition: int32_t lw6sys_xyz_s::z

Z position, from -8 to +7.


Next: , Previous: , Up: C API   [Contents][Index]

5.48 libtsk

5.48.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/tsk/index.html.

5.48.2 API

Function: void lw6tsk_loader_push_ldr (lw6sys_context_t * sys_context, lw6tsk_loader_t * loader, const char * map_path, const char * relative_path, lw6sys_assoc_t * default_param, lw6sys_assoc_t * forced_param, int display_w, int display_h, int bench_value, int magic_number)

sys_context: global system context

loader: loader object

map_path: map-path config entry

relative_path: relative map path

default_param: default parameters to use for load

forced_param: parameters to be forced and their values

display_w: display width

display_h: display height

bench_value: bench value, reflecting computer CPU power

magic_number: used to calibrate speed

Pushes a load request to the loader. Will stop the current load and push a new one. The request concerns a map which should be loaded from a map directory on the filesystem.

Return value: none.

Function: void lw6tsk_loader_push_gen (lw6sys_context_t * sys_context, lw6tsk_loader_t * loader, const char * seed, int display_w, int display_h, int bench_value, int magic_number)

sys_context: global system context

loader: loader object

seed: seed string used to create the map

display_w: display width

display_h: display height

bench_value: bench value, reflecting computer CPU power

magic_number: used to calibrate speed

Pushes a load request to the loader. Will stop the current load and push a new one. The request is forwarded to the pseudo-random map generation module.

Return value: none.

Function: int lw6tsk_loader_pop (lw6sys_context_t * sys_context, lw6map_level_t ** level, lw6ker_game_struct_t ** game_struct, lw6ker_game_state_t ** game_state, int * bench_value, lw6tsk_loader_t * loader)

sys_context: global system context

level: loaded level (out param)

game_struct: loaded struct (out param)

game_state: loaded state (out param)

bench_value: the bench_value used (out param)

loader: loader object

Pops data from the loader, will allocate everything dynamically. Function can either return just level or level and game struct and game state (3 of them together). It’s safe to use the received level, display it right away, then wait for the rest. If things are loaded fast enough, you just receive everything at once.

Return value: 1 if some data, 0 if none.

Function: lw6tsk_loader_t * lw6tsk_loader_new (lw6sys_context_t * sys_context, float sleep, char * user_dir, volatile float * progress)

sys_context: global system context

sleep: how many seconds to wait between every poll

user_dir: user directory

progress: progress indicator to use

Creates a new loader. This object is used to do some reputed slow calculus in the background, in a separated thread. Typical example is map loading. This is a high-level objects which encapsulates threads and other wizardry.

Return value: a pointer to the loader, NULL if failed.

Function: void lw6tsk_loader_free (lw6sys_context_t * sys_context, lw6tsk_loader_t * loader)

sys_context: global system context

loader: the loader to free.

Deletes a loader. Will automatically stop the child thread, free data, and so on.

Return value: none.

Function: char * lw6tsk_loader_repr (lw6sys_context_t * sys_context, const lw6tsk_loader_t * loader)

sys_context: global system context

loader: the loader to represent.

Creates a string which briefly describes the loader.

Return value: a dynamically allocated pointer, must be freed.

Function: int lw6tsk_loader_get_stage (lw6sys_context_t * sys_context, lw6tsk_loader_t * loader)

sys_context: global system context

loader: the loader to query.

Returns the current stage of the loader.

Return value: 0 if idle, 1 if loading the map from disk, 2 if build dynamic stuff such as game_state.

Function: int lw6tsk_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libtsk module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6tsk_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the tsk module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Struct: lw6tsk_loader_s

Loader object, allows asynchronous map loading.

Member of lw6tsk_loader_s: id

Type: u_int32_t

Definition: u_int32_t lw6tsk_loader_s::id

The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Member of lw6tsk_loader_s: thread

Type: lw6sys_thread_handler_t *

Definition: lw6sys_thread_handler_t* lw6tsk_loader_s::thread

Thread used to run the loader.

Member of lw6tsk_loader_s: data

Type: void *

Definition: void* lw6tsk_loader_s::data

Data used by the loader.


Previous: , Up: C API   [Contents][Index]

5.49 libvox

5.49.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/vox/index.html.

5.49.2 API

Function: lw6vox_renderer_t * lw6vox_renderer_new (lw6sys_context_t * sys_context, lw6ker_game_state_t * game_state)

sys_context: global system context

game_state: the game state to use

Creates a voxel rendering object (todo, not implemented yet).

Return value: renderer object

Function: void lw6vox_renderer_free (lw6sys_context_t * sys_context, lw6vox_renderer_t * renderer)

sys_context: global system context

renderer: the renderer object

Frees a voxel rendering object (todo, not implemented yet).

Return value: none

Function: int lw6vox_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libvox module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6vox_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the vox module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Struct: lw6vox_renderer_s

Voxel renderer object, not implemented yet.

Member of lw6vox_renderer_s: dummy

Type: int

Definition: int lw6vox_renderer_s::dummy

Todo...


Next: , Up: Top   [Contents][Index]

Appendix A Authors

Here’s a list of contributors :

Project maintainer, main developper :

Original idea :

Artwork, level design :

Musics :

Libcaca backend :

Translations :

Many people contributed to Liquid War 5, their names are not listed here, but without them Liquid War 6 would obviously never have been started. Special thanks to all of them. However this is not a direct contribution to the project, in terms of code and other copyrightable materials.


Next: , Previous: , Up: Top   [Contents][Index]

Appendix B 2005 .plan

Here’s my .plan file, which describes what I (Christian Mauduit) have planned for Liquid War 6. There’s no garantee that what’s written here is a precise description of the real future, however it should give a good idea of what I have in mind.

Note that the information here was written in summer 2005, it might or not be accurate now, as the main reason for plans to exist is that people never follow them. I’m no exception.

B.1 Complete rewrite

Liquid War 6 will be an almost complete rewrite. I mean that common code between branches 5 and 6 might end up in representing 0% of the total code. I think this is a wise decision, for the current code is really hard to maintain, and would not survive any serious cleanup. LW5 was first written in 1998, for DOS, when I had much less experience in programming. In 7 years I - and other people as well - hacked major enhancements in it such as cross-platform support, network games, and if you compare release 5.0 with the latest 5.x.x release, you’ll see that a bunch of things have changed. I had never expected I would patch and fix this game for so long, and it’s no surprise that it’s bloated today.

FYI, here’s a list of what makes LW5 unsuitable for major improvements without a complete rewrite:

B.2 Technologies

Liquid War 6 will use a different technical framework than Liquid War 5.

B.2.1 Script + standard C + assembly

It happens that coding a large project in pure C is a waist of time, if possible at all.

If one applies the standard 80/20 rule to a computer game, one might state that 80% of the code eat up 20% of the CPU and the other 20% of the code eat up 80% of the CPU, the former being high-level glue code and the latter being low-level algorithmic code.

With Liquid War, one could speak of the 99/01 rule. I mean that 99% of the CPU time concerns only 1% of the code, and vice-versa. Basically, Liquid War has a very CPU-greedy core algorithm, still spends a fair amount of CPU displaying stuff (but this is delegated to the low-level game programming library) and the rest is totally unsignificant, in terms of CPU. Point is this "rest" represents the vast majority of the code, and also represents the very same buggy code I spend nights to patch on Liquid War 5. I’m talking about network code, GUI, and other high-level glue-code which are currently being written in C.

This idea is to write all this in a convenient scripting language. There won’t be any impact on performances. I can’t garantee Liquid War 6 will be blazingly fast, but for sure it won’t be the scripting language fault. And of course if, as in Liquid War 3 and 5, I feel the need to implement some stuff in assembly for performances issues, I will do it.

We end up with a multi-language architecture: script + C + assembly.

My guess is that I’ll use Scheme as an extension language. Python would be a good choice too. Let’s say I’ll give Scheme a chance, and if it’s really not adapted, I’ll switch back to Python. The point is that today I know Python and don’t really know Scheme, but, well, it’s always a pleasure for me to learn new things. It’s fun.

So what is planned today is that Liquid War 6 will be a Scheme program, which will call callbacks functions written in C and/or assembly. These functions will do all the low-level time consuming algorithmic and graphical stuff. The rest of the code being entirely scripted.

B.2.2 OpenGL

Liquid War is not a 3D game, so why use OpenGL?

This choice implies that I won’t use Allegro anymore. Allegro stays a very convenient library and I would recommend it for it’s excellent, easy to learn, powerfull, and stable. But for the needs of Liquid War 6 I’ll use something else (because of OpenGL). I first thought of using GLUT but I might end up simply using SDL. The idea is just fo have an OpenGL wrapper which sets up OpenGL in a similar manner on all platforms, and handles basic things such as mouse or keyboard.

B.2.3 CSound

I’ve got two excellent books on Csound, and the will to learn how to use this tool.

I’ll probably use Csound for a number of things, ranging from "bubbling sounds" to full blown music. Stay tuned 8-)

B.3 Functionnalities

B.3.1 Visual enhancements

Of course Liquid War 6 will look nicer than Liquid War 5, blah blah blah. What do you think?

Maybe I’ll try to use some OpenGL features to make it possible to play on a ball, on a Moebius ring, or other fancy things. I have zillion of ideas, future will decide which ones will be implemented first.

To make it clear, visual enhancements aren’t my top-level priority. However I’ll try and make room for these enhancements, and prepare the terrain correctly. So it’s possible that the first releases of Liquid War 6 won’t be that much better than Liquid War 5, but at least Liquid War 6 will have the possibility to evolve. Something Liquid War 5 doesn’t have.

B.3.2 Rules enhancements

There are many things that could be done easily:

As for graphical improvements, this is not my top-level priority. Simply, I’ll make the game ready-to-improve. Again, all these enhancements are very hard to code in Liquid War 5, else I would already have coded them. Network enhancements

That’s my top-level prioriry.

Why is that? Well, think of Liquid War in terms of "what makes it a good game?" and "what makes it a poor game?".

It’s a good game because:

It’s a poor game because:

For the ugliness, well, OpenGL and some artwork should make it. But for the network, what’s the real problem?

The real problem is that in the current situation, the server needs to have all "keystrokes" before doing anything, and all players must be connected before a game starts. Here’s what I plan to do to fix this:

This third point will be the real enhancement of Liquid War with version 6. It’s one of the very points which drives me to rewrite it completely. First because it’s impossible to implement it without some heavy work. Then because I find it very motivating.

B.3.3 Hey, you forgot my idea!!!

Many gamers submitted suggestions, either by mail or by posting messages on the mailing list.

Don’t worry, I keep them. Not reading them here does not mean I won’t implement them. It simply means I won’t implement them first. I first need the game basically function before enhancing it with fancy stuff.

B.4 Road map

As I stated on the mailing list, when thinking about Liquid War 6, think of years rather than months (unless I get fired, jobless, or spend several months in a hospital with a laptop).

Note that this road map takes it for granted that I’ll be the lone coder on the project. It’s unlikely that someone is going to help me for the first stages, until there’s at least something real, something playable. Something that proves that the concept is valid. Besides, (real) team work implies a significant overhead, especially at project start. It’s hard to figure out how to distribute tasks when the tasks themselves are not clearly identified. But for the rest (starting in 2007 or 2008), it’s possible that external help might greatly... ...help!


Next: , Previous: , Up: Top   [Contents][Index]

Appendix C Fanfic

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.”

So here it is, a Liquid War fanfic. It was initially written for Liquid War 5, but applies to Liquid War 6 as well. Enjoy!

C.1 The Battle of Emberlificoted


...


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.

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.

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.

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.

A long breath left his parched lips as at last he made his move.


...


“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:

“Very clever. Flawed, but still clever.”

“Flawed?” came the reply.

“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.

“We have an alliance...” Orange’s voice was unsure now.

Time for some sarcasm to through her even more off balance, thought the General,

“I gathered”, he spoke softly, slowly, and with too much meaning. Then closing the channel he turned his attention back to his escape.


...


“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.

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.

A glance at the status panel showed that Yellow’s life force was fading quickly: 8%, 3%, 1%, Gone.

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.


...


“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.

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

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!’.

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.

There was no escape. His life force was almost depleted and he was surrounded. Then it was that the Baron decided to communicate:

“Too bad. It was a good game”

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,

“What!? This is not a game!” were the General’s dying words.


Next: , Previous: , Up: Top   [Contents][Index]

Appendix D Links

This section lists various Internet Liquid War related links.

D.1 Official links

These are the “official” links, hopefully you’ll find everything you need here:

D.2 Other sites

Note that some of these links might link to and/or promote proprietary software. It’s important to emphasize Liquid War 6 is free software, free as in speech, and you are encouraged to use software that protects your freedom. However, for your convenience, those links are provided, they might give you a hopefully neutral idea of what the game is all about.

This list is also by no way extensive, it’s provided “as is”.

D.3 Old stuff

Various links that are deprecated, but still might contain interesting informations for those who enjoy digging into the past.


Next: , Previous: , Up: Top   [Contents][Index]

Appendix E GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. http://fsf.org/

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.

Preamble

The GNU General Public License is a free, copyleft license for software and other kinds of works.

The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program—to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. 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 them 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 prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.

For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. 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.

Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.

For the developers’ and authors’ protection, the GPL clearly explains that there is no warranty for this free software. For both users’ and authors’ sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.

Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users’ freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.

Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.

The precise terms and conditions for copying, distribution and modification follow.

TERMS AND CONDITIONS

  1. Definitions.

    “This License” refers to version 3 of the GNU General Public License.

    “Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.

    “The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.

    To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.

    A “covered work” means either the unmodified Program or a work based on the Program.

    To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.

    To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.

    An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.

  2. Source Code.

    The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.

    A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.

    The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.

    The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work’s System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.

    The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.

    The Corresponding Source for a work in source code form is that same work.

  3. Basic Permissions.

    All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.

    You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.

    Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.

  4. Protecting Users’ Legal Rights From Anti-Circumvention Law.

    No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.

    When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work’s users, your or third parties’ legal rights to forbid circumvention of technological measures.

  5. Conveying Verbatim Copies.

    You may convey 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; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.

    You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.

  6. Conveying Modified Source Versions.

    You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:

    1. The work must carry prominent notices stating that you modified it, and giving a relevant date.
    2. The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
    3. You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
    4. If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.

    A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation’s users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.

  7. Conveying Non-Source Forms.

    You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:

    1. Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
    2. Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
    3. Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
    4. Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
    5. Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.

    A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.

    A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.

    “Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.

    If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).

    The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.

    Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.

  8. Additional Terms.

    “Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.

    When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.

    Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:

    1. Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
    2. Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
    3. Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
    4. Limiting the use for publicity purposes of names of licensors or authors of the material; or
    5. Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
    6. Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.

    All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.

    If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.

    Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.

  9. Termination.

    You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).

    However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.

    Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.

    Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.

  10. Acceptance Not Required for Having Copies.

    You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.

  11. Automatic Licensing of Downstream Recipients.

    Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.

    An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party’s predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.

    You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.

  12. Patents.

    A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor’s “contributor version”.

    A contributor’s “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.

    Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor’s essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.

    In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.

    If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient’s use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.

    If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.

    A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.

    Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.

  13. No Surrender of Others’ Freedom.

    If 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 convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.

  14. Use with the GNU Affero General Public License.

    Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.

  15. Revised Versions of this License.

    The Free Software Foundation may publish revised and/or new versions of the GNU 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 that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.

    If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy’s public statement of acceptance of a version permanently authorizes you to choose that version for the Program.

    Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.

  16. Disclaimer of Warranty.

    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.

  17. Limitation of Liability.

    IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 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.

  18. Interpretation of Sections 15 and 16.

    If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.

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 state 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 3 of the License, or (at
your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see http://www.gnu.org/licenses/.

Also add information on how to contact you by electronic and paper mail.

If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:

program Copyright (C) year name of author 
This program 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, your program’s commands might be different; for a GUI interface, you would use an “about box”.

You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see http://www.gnu.org/licenses/.

The GNU 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 Lesser General Public License instead of this License. But first, please read http://www.gnu.org/philosophy/why-not-lgpl.html.


Next: , Previous: , Up: Top   [Contents][Index]

Appendix F GNU Free Documentation License

Version 1.3, 3 November 2008
Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
http://fsf.org/

Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
  1. PREAMBLE

    The purpose of this License is to make a manual, textbook, or other functional and useful document free in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.

    This License is a kind of “copyleft”, which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.

    We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.

  2. APPLICABILITY AND DEFINITIONS

    This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The “Document”, below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as “you”. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law.

    A “Modified Version” of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.

    A “Secondary Section” is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document’s overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.

    The “Invariant Sections” are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none.

    The “Cover Texts” are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.

    A “Transparent” copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not “Transparent” is called “Opaque”.

    Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only.

    The “Title Page” means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, “Title Page” means the text near the most prominent appearance of the work’s title, preceding the beginning of the body of the text.

    The “publisher” means any person or entity that distributes copies of the Document to the public.

    A section “Entitled XYZ” means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” of such a section when you modify the Document means that it remains a section “Entitled XYZ” according to this definition.

    The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.

  3. VERBATIM COPYING

    You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.

    You may also lend copies, under the same conditions stated above, and you may publicly display copies.

  4. COPYING IN QUANTITY

    If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document’s license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.

    If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.

    If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.

    It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.

  5. MODIFICATIONS

    You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:

    1. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.
    2. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement.
    3. State on the Title page the name of the publisher of the Modified Version, as the publisher.
    4. Preserve all the copyright notices of the Document.
    5. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.
    6. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.
    7. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document’s license notice.
    8. Include an unaltered copy of this License.
    9. Preserve the section Entitled “History”, Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled “History” in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.
    10. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the “History” section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.
    11. For any section Entitled “Acknowledgements” or “Dedications”, Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.
    12. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.
    13. Delete any section Entitled “Endorsements”. Such a section may not be included in the Modified Version.
    14. Do not retitle any existing section to be Entitled “Endorsements” or to conflict in title with any Invariant Section.
    15. Preserve any Warranty Disclaimers.

    If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version’s license notice. These titles must be distinct from any other section titles.

    You may add a section Entitled “Endorsements”, provided it contains nothing but endorsements of your Modified Version by various parties—for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.

    You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.

    The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.

  6. COMBINING DOCUMENTS

    You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers.

    The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.

    In the combination, you must combine any sections Entitled “History” in the various original documents, forming one section Entitled “History”; likewise combine any sections Entitled “Acknowledgements”, and any sections Entitled “Dedications”. You must delete all sections Entitled “Endorsements.”

  7. COLLECTIONS OF DOCUMENTS

    You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.

    You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.

  8. AGGREGATION WITH INDEPENDENT WORKS

    A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an “aggregate” if the copyright resulting from the compilation is not used to limit the legal rights of the compilation’s users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document.

    If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document’s Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate.

  9. TRANSLATION

    Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail.

    If a section in the Document is Entitled “Acknowledgements”, “Dedications”, or “History”, the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title.

  10. TERMINATION

    You may not copy, modify, sublicense, or distribute the Document except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, or distribute it is void, and will automatically terminate your rights under this License.

    However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.

    Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.

    Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, receipt of a copy of some or all of the same material does not give you any rights to use it.

  11. FUTURE REVISIONS OF THIS LICENSE

    The Free Software Foundation may publish new, revised versions of the GNU Free Documentation 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. See http://www.gnu.org/copyleft/.

    Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License “or any later version” applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. If the Document specifies that a proxy can decide which future versions of this License can be used, that proxy’s public statement of acceptance of a version permanently authorizes you to choose that version for the Document.

  12. RELICENSING

    “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any World Wide Web server that publishes copyrightable works and also provides prominent facilities for anybody to edit those works. A public wiki that anybody can edit is an example of such a server. A “Massive Multiauthor Collaboration” (or “MMC”) contained in the site means any set of copyrightable works thus published on the MMC site.

    “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 license published by Creative Commons Corporation, a not-for-profit corporation with a principal place of business in San Francisco, California, as well as future copyleft versions of that license published by that same organization.

    “Incorporate” means to publish or republish a Document, in whole or in part, as part of another Document.

    An MMC is “eligible for relicensing” if it is licensed under this License, and if all works that were first published under this License somewhere other than this MMC, and subsequently incorporated in whole or in part into the MMC, (1) had no cover texts or invariant sections, and (2) were thus incorporated prior to November 1, 2008.

    The operator of an MMC Site may republish an MMC contained in the site under CC-BY-SA on the same site at any time before August 1, 2009, provided the MMC is eligible for relicensing.

ADDENDUM: How to use this License for your documents

To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page:

  Copyright (C)  year  your name.
  Permission is granted to copy, distribute and/or modify this document
  under the terms of the GNU Free Documentation License, Version 1.3
  or any later version published by the Free Software Foundation;
  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
  Texts.  A copy of the license is included in the section entitled ``GNU
  Free Documentation License''.

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the “with…Texts.” line with this:

    with the Invariant Sections being list their titles, with
    the Front-Cover Texts being list, and with the Back-Cover Texts
    being list.

If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation.

If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.


Previous: , Up: Top   [Contents][Index]

Appendix G Indexes

G.1 Concept index

Jump to:   A   B   C   D   G   H   L   M   R   S   T  
Index Entry  Section

A
Apple: Compilation tips
Arch: Using GNU Arch

B
Bug report: Mailing lists
Bug report: Report bugs

C
Compilation: Troubleshooting
Compilation: Compilation tips
CVS: Using GIT

D
Download: Getting the game

G
GIT: Using GIT
GPL, GNU General Public License: Copying

H
hints.xml: Designing levels

L
Log file: Logs

M
Mac OS X: Compilation tips
Microsoft Windows: Compilation tips

R
rules.xml: Designing levels

S
source code: Using GIT
style.xml: Designing levels
subversion: Using GIT
SVN: Using GIT

T
teams.xml: Designing levels

Jump to:   A   B   C   D   G   H   L   M   R   S   T  

G.2 Function and keyword index

Jump to:   -   _  
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   R   S   T   U   V   W   X   Y   Z  
Index Entry  Section

-
--about=<value>: Basic options
--ambiance-exclude=<value>: Sound options
--ambiance-file=<value>: Sound options
--ambiance-filter=<value>: Sound options
--animation-density=<value>: Map style.xml
--animation-speed=<value>: Map style.xml
--audit: Basic options
--auto-release-delay=<value>: Input options
--background-color-auto=<value>: Map hints.xml
--background-color-root-bg=<value>: Map style.xml
--background-color-root-fg=<value>: Map style.xml
--background-color-stuff-bg=<value>: Map style.xml
--background-color-stuff-fg=<value>: Map style.xml
--background-style=<value>: Map style.xml
--base64-decode: Advanced settings
--base64-encode: Advanced settings
--bench: Advanced settings
--bench-value=<value>: Advanced settings
--bin-id=<value>: Advanced settings
--bind-ip=<value>: Network options
--bind-port=<value>: Network options
--blink-cursor=<value>: Map style.xml
--boost-power=<value>: Map rules.xml
--bot-iq=<value>: Map teams.xml
--bot-speed=<value>: Map teams.xml
--bot1-ai=<value>: Map teams.xml
--bot1-color=<value>: Map teams.xml
--bot2-ai=<value>: Map teams.xml
--bot2-color=<value>: Map teams.xml
--bot3-ai=<value>: Map teams.xml
--bot3-color=<value>: Map teams.xml
--bot4-ai=<value>: Map teams.xml
--bot4-color=<value>: Map teams.xml
--bot5-ai=<value>: Map teams.xml
--bot5-color=<value>: Map teams.xml
--bot6-ai=<value>: Map teams.xml
--bot6-color=<value>: Map teams.xml
--bot7-ai=<value>: Map teams.xml
--bot7-color=<value>: Map teams.xml
--bot8-ai=<value>: Map teams.xml
--bot8-color=<value>: Map teams.xml
--bot9-ai=<value>: Map teams.xml
--bot9-color=<value>: Map teams.xml
--broadcast=<value>: Network options
--capture=<value>: Graphics options
--check: Advanced settings
--chosen-map=<value>: Map parameters
--cli-backends=<value>: Network options
--click-to-focus=<value>: Input options
--color-alternate-bg=<value>: Map style.xml
--color-alternate-fg=<value>: Map style.xml
--color-base-bg=<value>: Map style.xml
--color-base-fg=<value>: Map style.xml
--color-conflict-mode=<value>: Map rules.xml
--colorize-cursor=<value>: Map style.xml
--colorize=<value>: Map style.xml
--commands-per-sec=<value>: Advanced settings
--config-file: Path options
--copyright: Basic options
--credits: Basic options
--cunit: Advanced settings
--cursor-pot-init=<value>: Map rules.xml
--cursor-sensitivity=<value>: Input options
--cursor-size=<value>: Map style.xml
--custom-alt=<value>: Input options
--custom-ctrl=<value>: Input options
--custom-down=<value>: Input options
--custom-enter=<value>: Input options
--custom-esc=<value>: Input options
--custom-left=<value>: Input options
--custom-pgdown=<value>: Input options
--custom-pgup=<value>: Input options
--custom-right=<value>: Input options
--custom-up=<value>: Input options
--daemon: Advanced settings
--danger-power=<value>: Map rules.xml
--data-dir: Path options
--debug: Basic options
--debug-layer-id=<value>: Advanced settings
--debug-team-id=<value>: Advanced settings
--defaults: Basic options
--demo: Advanced settings
--dialog-timeout=<value>: Advanced settings
--dirty-read=<value>: Advanced settings
--display-background=<value>: Advanced settings
--display-console=<value>: Advanced settings
--display-cursors=<value>: Advanced settings
--display-debug-gradient=<value>: Advanced settings
--display-debug-zones=<value>: Advanced settings
--display-fighters=<value>: Advanced settings
--display-fps=<value>: Advanced settings
--display-hud=<value>: Advanced settings
--display-log=<value>: Advanced settings
--display-map=<value>: Advanced settings
--display-menu=<value>: Advanced settings
--display-meta=<value>: Advanced settings
--display-mouse=<value>: Advanced settings
--display-mps=<value>: Advanced settings
--display-preview=<value>: Advanced settings
--display-progress=<value>: Advanced settings
--display-score=<value>: Advanced settings
--display-splash=<value>: Advanced settings
--display-url=<value>: Advanced settings
--double-click-delay=<value>: Input options
--downsize-using-bench-value=<value>: Map hints.xml
--downsize-using-fighter-scale=<value>: Map hints.xml
--example-hints-xml: Doc options
--example-rules-xml: Doc options
--example-style-xml: Doc options
--example-teams-xml: Doc options
--executed-again=<value>: Advanced settings
--exp=<value>: Map rules.xml
--fighter-attack=<value>: Map rules.xml
--fighter-defense=<value>: Map rules.xml
--fighter-new-health=<value>: Map rules.xml
--fighter-regenerate=<value>: Map rules.xml
--fighter-scale=<value>: Map hints.xml
--force=<value>: Map parameters
--frags-fade-out=<value>: Map rules.xml
--frags-mode=<value>: Map rules.xml
--frags-to-distribute=<value>: Map rules.xml
--fullscreen=<value>: Graphics options
--fx-volume=<value>: Sound options
--gfx-backend=<value>: Graphics options
--gfx-cpu-usage=<value>: Advanced settings
--gfx-debug=<value>: Advanced settings
--gfx-quality=<value>: Graphics options
--glue-power=<value>: Map rules.xml
--guess-colors=<value>: Map hints.xml
--guess-moves-per-sec=<value>: Map hints.xml
--height=<value>: Graphics options
--help: Basic options
--hidden-layer-alpha=<value>: Map style.xml
--highest-team-color-allowed=<value>: Map rules.xml
--highest-weapon-allowed=<value>: Map rules.xml
--host: Basic options
--hud-color-auto=<value>: Map hints.xml
--hud-color-frame-bg=<value>: Map style.xml
--hud-color-frame-fg=<value>: Map style.xml
--hud-color-text-bg=<value>: Map style.xml
--hud-color-text-fg=<value>: Map style.xml
--hud-style=<value>: Map style.xml
--io-per-sec=<value>: Advanced settings
--jpeg-quality=<value>: Advanced settings
--keep-ratio=<value>: Map style.xml
--known-nodes=<value>: Network options
--list: Basic options
--list-advanced: Doc options
--list-aliases: Doc options
--list-doc: Doc options
--list-funcs: Doc options
--list-graphics: Doc options
--list-hooks: Doc options
--list-input: Doc options
--list-map: Doc options
--list-map-hints: Doc options
--list-map-rules: Doc options
--list-map-style: Doc options
--list-map-teams: Doc options
--list-network: Doc options
--list-path: Doc options
--list-players: Doc options
--list-quick: Doc options
--list-show: Doc options
--list-sound: Doc options
--list-team-colors: Doc options
--list-weapons: Doc options
--loader-sleep=<value>: Advanced settings
--local-bench-delta=<value>: Advanced settings
--log-file=<value>: Path options
--log-level=<value>: Advanced settings
--log-timeout=<value>: Advanced settings
--magic-number=<value>: Advanced settings
--map-dir: Path options
--map-path=<value>: Path options
--max-cursor-pot-offset=<value>: Map rules.xml
--max-cursor-pot=<value>: Map rules.xml
--max-cursor-speed=<value>: Input options
--max-local-bench-value=<value>: Advanced settings
--max-map-height=<value>: Map hints.xml
--max-map-surface=<value>: Map hints.xml
--max-map-width=<value>: Map hints.xml
--max-nb-cursors=<value>: Map rules.xml
--max-nb-nodes=<value>: Map rules.xml
--max-nb-teams=<value>: Map rules.xml
--max-network-bench-value=<value>: Advanced settings
--max-round-delta=<value>: Map rules.xml
--max-zone-size=<value>: Map rules.xml
--medicine-power=<value>: Map rules.xml
--memory-bazooka-eraser=<value>: Advanced settings
--memory-bazooka-size=<value>: Advanced settings
--menu-color-auto=<value>: Map hints.xml
--menu-color-default-bg=<value>: Map style.xml
--menu-color-default-fg=<value>: Map style.xml
--menu-color-disabled-bg=<value>: Map style.xml
--menu-color-disabled-fg=<value>: Map style.xml
--menu-color-selected-bg=<value>: Map style.xml
--menu-color-selected-fg=<value>: Map style.xml
--menu-style=<value>: Map style.xml
--min-map-height=<value>: Map hints.xml
--min-map-surface=<value>: Map hints.xml
--min-map-width=<value>: Map hints.xml
--mod-dir: Path options
--modules: Basic options
--mouse-sensitivity=<value>: Input options
--moves-per-round=<value>: Map rules.xml
--music-dir=<value>: Path options
--music-exclude=<value>: Map style.xml
--music-file=<value>: Map style.xml
--music-filter=<value>: Map style.xml
--music-path=<value>: Path options
--music-volume=<value>: Sound options
--nb-attack-tries=<value>: Map rules.xml
--nb-bots=<value>: Map teams.xml
--nb-defense-tries=<value>: Map rules.xml
--nb-move-tries=<value>: Map rules.xml
--net-log=<value>: Advanced settings
--net-per-sec=<value>: Advanced settings
--network-bench-delta=<value>: Advanced settings
--network-reliability=<value>: Advanced settings
--node-description=<value>: Network options
--node-title=<value>: Network options
--open-relay=<value>: Advanced settings
--password=<value>: Network options
--pedigree: Basic options
--pilot-lag=<value>: Advanced settings
--pixelize=<value>: Map style.xml
--player1-color=<value>: Map teams.xml
--player1-control=<value>: Players options
--player1-name=<value>: Players options
--player1-status=<value>: Players options
--player2-color=<value>: Map teams.xml
--player2-control=<value>: Players options
--player2-name=<value>: Players options
--player2-status=<value>: Players options
--player3-color=<value>: Map teams.xml
--player3-control=<value>: Players options
--player3-name=<value>: Players options
--player3-status=<value>: Players options
--player4-color=<value>: Map teams.xml
--player4-control=<value>: Players options
--player4-name=<value>: Players options
--player4-status=<value>: Players options
--prefix: Path options
--public-url=<value>: Network options
--quick-start: Advanced settings
--repeat-delay=<value>: Input options
--repeat-interval=<value>: Input options
--resample=<value>: Map hints.xml
--reset: Advanced settings
--reset-config-on-upgrade=<value>: Advanced settings
--respawn-delay=<value>: Map rules.xml
--respawn-position-mode=<value>: Map rules.xml
--respawn-team=<value>: Map rules.xml
--round-delta=<value>: Map rules.xml
--rounds-per-sec=<value>: Map rules.xml
--screenshots-per-min=<value>: Advanced settings
--script-file: Path options
--server: Advanced settings
--show-build-abs-srcdir: Show options
--show-build-bin-id: Show options
--show-build-bugs-url: Show options
--show-build-cflags: Show options
--show-build-codename: Show options
--show-build-configure-args: Show options
--show-build-copyright: Show options
--show-build-datadir: Show options
--show-build-date: Show options
--show-build-docdir: Show options
--show-build-enable-allinone: Show options
--show-build-enable-console: Show options
--show-build-enable-fullstatic: Show options
--show-build-enable-gcov: Show options
--show-build-enable-gprof: Show options
--show-build-enable-gtk: Show options
--show-build-enable-instrument: Show options
--show-build-enable-mod-caca: Show options
--show-build-enable-mod-csound: Show options
--show-build-enable-mod-gl1: Show options
--show-build-enable-mod-gles2: Show options
--show-build-enable-mod-http: Show options
--show-build-enable-mod-ogg: Show options
--show-build-enable-mod-soft: Show options
--show-build-enable-openmp: Show options
--show-build-enable-optimize: Show options
--show-build-enable-paranoid: Show options
--show-build-enable-profiler: Show options
--show-build-enable-valgrind: Show options
--show-build-endianness: Show options
--show-build-gcc-version: Show options
--show-build-gnu: Show options
--show-build-gp2x: Show options
--show-build-home-url: Show options
--show-build-host-cpu: Show options
--show-build-host-os: Show options
--show-build-hostname: Show options
--show-build-includedir: Show options
--show-build-ldflags: Show options
--show-build-libdir: Show options
--show-build-license: Show options
--show-build-localedir: Show options
--show-build-mac-os-x: Show options
--show-build-md5sum: Show options
--show-build-ms-windows: Show options
--show-build-package-id: Show options
--show-build-package-name: Show options
--show-build-package-string: Show options
--show-build-package-tarname: Show options
--show-build-pointer-size: Show options
--show-build-prefix: Show options
--show-build-stamp: Show options
--show-build-time: Show options
--show-build-top-srcdir: Show options
--show-build-unix: Show options
--show-build-version: Show options
--show-build-version-base: Show options
--show-build-version-major: Show options
--show-build-version-minor: Show options
--show-build-x86: Show options
--show-config-file: Show options
--show-cwd: Show options
--show-data-dir: Show options
--show-default-config-file: Show options
--show-default-data-dir: Show options
--show-default-log-file: Show options
--show-default-map-dir: Show options
--show-default-map-path: Show options
--show-default-mod-dir: Show options
--show-default-music-dir: Show options
--show-default-music-path: Show options
--show-default-prefix: Show options
--show-default-script-file: Show options
--show-default-user-dir: Show options
--show-log-file: Show options
--show-map-dir: Show options
--show-map-path: Show options
--show-mod-dir: Show options
--show-music-dir: Show options
--show-music-path: Show options
--show-prefix: Show options
--show-run-dir: Show options
--show-script-file: Show options
--show-user-dir: Show options
--side-attack-factor=<value>: Map rules.xml
--side-defense-factor=<value>: Map rules.xml
--simulate-basic: Advanced settings
--simulate-full: Advanced settings
--single-army-size=<value>: Map rules.xml
--skip-network=<value>: Network options
--snd-backend=<value>: Sound options
--speed=<value>: Map hints.xml
--spread-mode=<value>: Map rules.xml
--spread-thread=<value>: Map rules.xml
--spreads-per-round=<value>: Map rules.xml
--srv-backends=<value>: Network options
--start-blue-x=<value>: Map rules.xml
--start-blue-y=<value>: Map rules.xml
--start-cyan-x=<value>: Map rules.xml
--start-cyan-y=<value>: Map rules.xml
--start-green-x=<value>: Map rules.xml
--start-green-y=<value>: Map rules.xml
--start-lightblue-x=<value>: Map rules.xml
--start-lightblue-y=<value>: Map rules.xml
--start-magenta-x=<value>: Map rules.xml
--start-magenta-y=<value>: Map rules.xml
--start-orange-x=<value>: Map rules.xml
--start-orange-y=<value>: Map rules.xml
--start-pink-x=<value>: Map rules.xml
--start-pink-y=<value>: Map rules.xml
--start-position-mode=<value>: Map rules.xml
--start-purple-x=<value>: Map rules.xml
--start-purple-y=<value>: Map rules.xml
--start-red-x=<value>: Map rules.xml
--start-red-y=<value>: Map rules.xml
--start-yellow-x=<value>: Map rules.xml
--start-yellow-y=<value>: Map rules.xml
--system-color-auto=<value>: Map hints.xml
--system-color-bg=<value>: Map style.xml
--system-color-fg=<value>: Map style.xml
--target-fps=<value>: Advanced settings
--team-color-blue=<value>: Map style.xml
--team-color-cyan=<value>: Map style.xml
--team-color-dead=<value>: Map style.xml
--team-color-green=<value>: Map style.xml
--team-color-lightblue=<value>: Map style.xml
--team-color-magenta=<value>: Map style.xml
--team-color-orange=<value>: Map style.xml
--team-color-pink=<value>: Map style.xml
--team-color-purple=<value>: Map style.xml
--team-color-red=<value>: Map style.xml
--team-color-yellow=<value>: Map style.xml
--team-profile-blue-aggressive=<value>: Map rules.xml
--team-profile-blue-fast=<value>: Map rules.xml
--team-profile-blue-handicap=<value>: Map rules.xml
--team-profile-blue-mobile=<value>: Map rules.xml
--team-profile-blue-vulnerable=<value>: Map rules.xml
--team-profile-blue-weapon-alternate-id=<value>: Map rules.xml
--team-profile-blue-weapon-id=<value>: Map rules.xml
--team-profile-blue-weapon-mode=<value>: Map rules.xml
--team-profile-cyan-aggressive=<value>: Map rules.xml
--team-profile-cyan-fast=<value>: Map rules.xml
--team-profile-cyan-handicap=<value>: Map rules.xml
--team-profile-cyan-mobile=<value>: Map rules.xml
--team-profile-cyan-vulnerable=<value>: Map rules.xml
--team-profile-cyan-weapon-alternate-id=<value>: Map rules.xml
--team-profile-cyan-weapon-id=<value>: Map rules.xml
--team-profile-cyan-weapon-mode=<value>: Map rules.xml
--team-profile-green-aggressive=<value>: Map rules.xml
--team-profile-green-fast=<value>: Map rules.xml
--team-profile-green-handicap=<value>: Map rules.xml
--team-profile-green-mobile=<value>: Map rules.xml
--team-profile-green-vulnerable=<value>: Map rules.xml
--team-profile-green-weapon-alternate-id=<value>: Map rules.xml
--team-profile-green-weapon-id=<value>: Map rules.xml
--team-profile-green-weapon-mode=<value>: Map rules.xml
--team-profile-lightblue-aggressive=<value>: Map rules.xml
--team-profile-lightblue-fast=<value>: Map rules.xml
--team-profile-lightblue-handicap=<value>: Map rules.xml
--team-profile-lightblue-mobile=<value>: Map rules.xml
--team-profile-lightblue-vulnerable=<value>: Map rules.xml
--team-profile-lightblue-weapon-alternate-id=<value>: Map rules.xml
--team-profile-lightblue-weapon-id=<value>: Map rules.xml
--team-profile-lightblue-weapon-mode=<value>: Map rules.xml
--team-profile-magenta-aggressive=<value>: Map rules.xml
--team-profile-magenta-fast=<value>: Map rules.xml
--team-profile-magenta-handicap=<value>: Map rules.xml
--team-profile-magenta-mobile=<value>: Map rules.xml
--team-profile-magenta-vulnerable=<value>: Map rules.xml
--team-profile-magenta-weapon-alternate-id=<value>: Map rules.xml
--team-profile-magenta-weapon-id=<value>: Map rules.xml
--team-profile-magenta-weapon-mode=<value>: Map rules.xml
--team-profile-orange-aggressive=<value>: Map rules.xml
--team-profile-orange-fast=<value>: Map rules.xml
--team-profile-orange-handicap=<value>: Map rules.xml
--team-profile-orange-mobile=<value>: Map rules.xml
--team-profile-orange-vulnerable=<value>: Map rules.xml
--team-profile-orange-weapon-alternate-id=<value>: Map rules.xml
--team-profile-orange-weapon-id=<value>: Map rules.xml
--team-profile-orange-weapon-mode=<value>: Map rules.xml
--team-profile-pink-aggressive=<value>: Map rules.xml
--team-profile-pink-fast=<value>: Map rules.xml
--team-profile-pink-handicap=<value>: Map rules.xml
--team-profile-pink-mobile=<value>: Map rules.xml
--team-profile-pink-vulnerable=<value>: Map rules.xml
--team-profile-pink-weapon-alternate-id=<value>: Map rules.xml
--team-profile-pink-weapon-id=<value>: Map rules.xml
--team-profile-pink-weapon-mode=<value>: Map rules.xml
--team-profile-purple-aggressive=<value>: Map rules.xml
--team-profile-purple-fast=<value>: Map rules.xml
--team-profile-purple-handicap=<value>: Map rules.xml
--team-profile-purple-mobile=<value>: Map rules.xml
--team-profile-purple-vulnerable=<value>: Map rules.xml
--team-profile-purple-weapon-alternate-id=<value>: Map rules.xml
--team-profile-purple-weapon-id=<value>: Map rules.xml
--team-profile-purple-weapon-mode=<value>: Map rules.xml
--team-profile-red-aggressive=<value>: Map rules.xml
--team-profile-red-fast=<value>: Map rules.xml
--team-profile-red-handicap=<value>: Map rules.xml
--team-profile-red-mobile=<value>: Map rules.xml
--team-profile-red-vulnerable=<value>: Map rules.xml
--team-profile-red-weapon-alternate-id=<value>: Map rules.xml
--team-profile-red-weapon-id=<value>: Map rules.xml
--team-profile-red-weapon-mode=<value>: Map rules.xml
--team-profile-yellow-aggressive=<value>: Map rules.xml
--team-profile-yellow-fast=<value>: Map rules.xml
--team-profile-yellow-handicap=<value>: Map rules.xml
--team-profile-yellow-mobile=<value>: Map rules.xml
--team-profile-yellow-vulnerable=<value>: Map rules.xml
--team-profile-yellow-weapon-alternate-id=<value>: Map rules.xml
--team-profile-yellow-weapon-id=<value>: Map rules.xml
--team-profile-yellow-weapon-mode=<value>: Map rules.xml
--test: Basic options
--total-armies-size=<value>: Map rules.xml
--total-time=<value>: Map rules.xml
--trap-errors=<value>: Advanced settings
--trojan=<value>: Advanced settings
--upsize-using-bench-value=<value>: Map hints.xml
--upsize-using-fighter-scale=<value>: Map hints.xml
--use-cursor-texture=<value>: Map parameters
--use-double-click=<value>: Input options
--use-esc-button=<value>: Input options
--use-hints-xml=<value>: Map parameters
--use-music-file=<value>: Map parameters
--use-rules-xml=<value>: Map parameters
--use-style-xml=<value>: Map parameters
--use-team-profiles=<value>: Map rules.xml
--use-teams-xml=<value>: Map parameters
--use-texture=<value>: Map parameters
--user-dir=<value>: Path options
--version: Basic options
--vertical-move=<value>: Map rules.xml
--view-color-auto=<value>: Map hints.xml
--view-color-cursor-bg=<value>: Map style.xml
--view-color-cursor-fg=<value>: Map style.xml
--view-color-map-bg=<value>: Map style.xml
--view-color-map-fg=<value>: Map style.xml
--view-style=<value>: Map style.xml
--wall-grease=<value>: Map hints.xml
--water-volume=<value>: Sound options
--waves=<value>: Map style.xml
--weapon-charge-delay=<value>: Map rules.xml
--weapon-charge-max=<value>: Map rules.xml
--weapon-duration=<value>: Map rules.xml
--weapon-tune-berzerk-power=<value>: Map rules.xml
--weapon-tune-turbo-power=<value>: Map rules.xml
--width=<value>: Graphics options
--windowed-mode-limit=<value>: Graphics options
--x-polarity=<value>: Map rules.xml
--x-wrap=<value>: Map style.xml
--y-polarity=<value>: Map rules.xml
--y-wrap=<value>: Map style.xml
--z-decode: Advanced settings
--z-encode: Advanced settings
--z-polarity=<value>: Map rules.xml
--zoom-max=<value>: Map style.xml
--zoom-min=<value>: Map style.xml
--zoom-step=<value>: Input options
--zoom-stick-delay=<value>: Input options
--zoom=<value>: Map style.xml

_
_lw6p2p_db_now: libp2p
_lw6p2p_db_timestamp: libp2p

A
ambiance-exclude: Sound options
ambiance-file: Sound options
ambiance-filter: Sound options
animation-density: Map style.xml
animation-speed: Map style.xml
auto-release-delay: Input options

B
background-color-auto: Map hints.xml
background-color-root-bg: Map style.xml
background-color-root-fg: Map style.xml
background-color-stuff-bg: Map style.xml
background-color-stuff-fg: Map style.xml
background-style: Map style.xml
bench-value: Advanced settings
bin-id: Advanced settings
bind-ip: Network options
bind-port: Network options
blink-cursor: Map style.xml
boost-power: Map rules.xml
bot-iq: Map teams.xml
bot-speed: Map teams.xml
bot1-ai: Map teams.xml
bot1-color: Map teams.xml
bot2-ai: Map teams.xml
bot2-color: Map teams.xml
bot3-ai: Map teams.xml
bot3-color: Map teams.xml
bot4-ai: Map teams.xml
bot4-color: Map teams.xml
bot5-ai: Map teams.xml
bot5-color: Map teams.xml
bot6-ai: Map teams.xml
bot6-color: Map teams.xml
bot7-ai: Map teams.xml
bot7-color: Map teams.xml
bot8-ai: Map teams.xml
bot8-color: Map teams.xml
bot9-ai: Map teams.xml
bot9-color: Map teams.xml
broadcast: Network options

C
c-gettext: C to Guile
c-lw6-exit: C to Guile
c-lw6-get-ret: C to Guile
c-lw6-release: C to Guile
c-lw6-set-ret: C to Guile
c-lw6bot-get-backends: C to Guile
c-lw6bot-new: C to Guile
c-lw6bot-next-move: C to Guile
c-lw6cfg-defaults: C to Guile
c-lw6cfg-get-option: C to Guile
c-lw6cfg-init: C to Guile
c-lw6cfg-load: C to Guile
c-lw6cfg-option-exists: C to Guile
c-lw6cfg-quit: C to Guile
c-lw6cfg-save: C to Guile
c-lw6cfg-set-option: C to Guile
c-lw6cfg-unified-get-log-file: C to Guile
c-lw6cfg-unified-get-map-path: C to Guile
c-lw6cfg-unified-get-music-path: C to Guile
c-lw6cfg-unified-get-user-dir: C to Guile
c-lw6cli-get-backends: C to Guile
c-lw6cns-console-support: C to Guile
c-lw6cns-init: C to Guile
c-lw6cns-poll: C to Guile
c-lw6cns-quit: C to Guile
c-lw6cns-term-support: C to Guile
c-lw6dsp-get-average-fps: C to Guile
c-lw6dsp-get-fullscreen-modes: C to Guile
c-lw6dsp-get-instant-fps: C to Guile
c-lw6dsp-get-last-frame-rendering-time: C to Guile
c-lw6dsp-get-nb-frames: C to Guile
c-lw6dsp-get-video-mode: C to Guile
c-lw6dsp-new: C to Guile
c-lw6dsp-release: C to Guile
c-lw6dsp-update: C to Guile
c-lw6gen-create-from-seed: C to Guile
c-lw6gen-seed-new: C to Guile
c-lw6gen-seed-normalize: C to Guile
c-lw6gfx-get-backends: C to Guile
c-lw6gui-default-look: C to Guile
c-lw6gui-input-reset: C to Guile
c-lw6gui-joystick1-get-move-pad: C to Guile
c-lw6gui-joystick1-pop-button-a: C to Guile
c-lw6gui-joystick1-pop-button-b: C to Guile
c-lw6gui-joystick1-pop-button-c: C to Guile
c-lw6gui-joystick1-pop-button-d: C to Guile
c-lw6gui-joystick1-pop-button-e: C to Guile
c-lw6gui-joystick1-pop-button-f: C to Guile
c-lw6gui-joystick1-pop-pad-down: C to Guile
c-lw6gui-joystick1-pop-pad-left: C to Guile
c-lw6gui-joystick1-pop-pad-right: C to Guile
c-lw6gui-joystick1-pop-pad-up: C to Guile
c-lw6gui-joystick2-get-move-pad: C to Guile
c-lw6gui-joystick2-pop-button-a: C to Guile
c-lw6gui-joystick2-pop-button-b: C to Guile
c-lw6gui-joystick2-pop-button-c: C to Guile
c-lw6gui-joystick2-pop-button-d: C to Guile
c-lw6gui-joystick2-pop-button-e: C to Guile
c-lw6gui-joystick2-pop-button-f: C to Guile
c-lw6gui-joystick2-pop-pad-down: C to Guile
c-lw6gui-joystick2-pop-pad-left: C to Guile
c-lw6gui-joystick2-pop-pad-right: C to Guile
c-lw6gui-joystick2-pop-pad-up: C to Guile
c-lw6gui-keyboard-get-move-pad: C to Guile
c-lw6gui-keyboard-is-pressed: C to Guile
c-lw6gui-keyboard-pop-arrow-down: C to Guile
c-lw6gui-keyboard-pop-arrow-left: C to Guile
c-lw6gui-keyboard-pop-arrow-right: C to Guile
c-lw6gui-keyboard-pop-arrow-up: C to Guile
c-lw6gui-keyboard-pop-key-alt: C to Guile
c-lw6gui-keyboard-pop-key-ctrl: C to Guile
c-lw6gui-keyboard-pop-key-enter: C to Guile
c-lw6gui-keyboard-pop-key-esc: C to Guile
c-lw6gui-keyboard-pop-key-pgdown: C to Guile
c-lw6gui-keyboard-pop-key-pgup: C to Guile
c-lw6gui-look-get: C to Guile
c-lw6gui-look-set: C to Guile
c-lw6gui-look-zoom-in: C to Guile
c-lw6gui-look-zoom-out: C to Guile
c-lw6gui-menu-append: C to Guile
c-lw6gui-menu-close-popup: C to Guile
c-lw6gui-menu-enable-esc: C to Guile
c-lw6gui-menu-has-popup: C to Guile
c-lw6gui-menu-new: C to Guile
c-lw6gui-menu-remove: C to Guile
c-lw6gui-menu-remove-all: C to Guile
c-lw6gui-menu-scroll-down: C to Guile
c-lw6gui-menu-scroll-up: C to Guile
c-lw6gui-menu-select: C to Guile
c-lw6gui-menu-select-esc: C to Guile
c-lw6gui-menu-set-breadcrumbs: C to Guile
c-lw6gui-menu-sync: C to Guile
c-lw6gui-mouse-get-state: C to Guile
c-lw6gui-mouse-poll-move: C to Guile
c-lw6gui-mouse-pop-button-left: C to Guile
c-lw6gui-mouse-pop-button-middle: C to Guile
c-lw6gui-mouse-pop-button-right: C to Guile
c-lw6gui-mouse-pop-double-click: C to Guile
c-lw6gui-mouse-pop-simple-click: C to Guile
c-lw6gui-mouse-pop-triple-click: C to Guile
c-lw6gui-mouse-pop-wheel-down: C to Guile
c-lw6gui-mouse-pop-wheel-up: C to Guile
c-lw6hlp-about: C to Guile
c-lw6hlp-get-default-value: C to Guile
c-lw6hlp-list: C to Guile
c-lw6hlp-list-advanced: C to Guile
c-lw6hlp-list-aliases: C to Guile
c-lw6hlp-list-doc: C to Guile
c-lw6hlp-list-funcs: C to Guile
c-lw6hlp-list-graphics: C to Guile
c-lw6hlp-list-hooks: C to Guile
c-lw6hlp-list-input: C to Guile
c-lw6hlp-list-map: C to Guile
c-lw6hlp-list-map-hints: C to Guile
c-lw6hlp-list-map-rules: C to Guile
c-lw6hlp-list-map-style: C to Guile
c-lw6hlp-list-map-teams: C to Guile
c-lw6hlp-list-network: C to Guile
c-lw6hlp-list-path: C to Guile
c-lw6hlp-list-players: C to Guile
c-lw6hlp-list-quick: C to Guile
c-lw6hlp-list-show: C to Guile
c-lw6hlp-list-sound: C to Guile
c-lw6hlp-list-team-colors: C to Guile
c-lw6hlp-list-weapons: C to Guile
c-lw6img-screenshot: C to Guile
c-lw6ker-add-cursor: C to Guile
c-lw6ker-build-game-state: C to Guile
c-lw6ker-build-game-struct: C to Guile
c-lw6ker-cursor-exists: C to Guile
c-lw6ker-did-cursor-win: C to Guile
c-lw6ker-do-round: C to Guile
c-lw6ker-dup-game-state: C to Guile
c-lw6ker-game-state-checksum: C to Guile
c-lw6ker-game-struct-checksum: C to Guile
c-lw6ker-get-cursor: C to Guile
c-lw6ker-get-moves: C to Guile
c-lw6ker-get-nb-colors: C to Guile
c-lw6ker-get-nb-cursors: C to Guile
c-lw6ker-get-nb-nodes: C to Guile
c-lw6ker-get-rounds: C to Guile
c-lw6ker-get-spreads: C to Guile
c-lw6ker-is-over: C to Guile
c-lw6ker-node-exists: C to Guile
c-lw6ker-register-node: C to Guile
c-lw6ker-remove-cursor: C to Guile
c-lw6ker-set-cursor: C to Guile
c-lw6ker-sync-game-state: C to Guile
c-lw6ker-unregister-node: C to Guile
c-lw6ldr-chain-entry: C to Guile
c-lw6ldr-exp-validate: C to Guile
c-lw6ldr-get-entries: C to Guile
c-lw6ldr-hints-get-default: C to Guile
c-lw6ldr-print-examples: C to Guile
c-lw6ldr-read: C to Guile
c-lw6ldr-read-relative: C to Guile
c-lw6map-exp-get-unlocked-team-color: C to Guile
c-lw6map-exp-get-unlocked-weapon: C to Guile
c-lw6map-exp-is-team-color-allowed: C to Guile
c-lw6map-exp-is-weapon-allowed: C to Guile
c-lw6map-get-look: C to Guile
c-lw6map-get-max-nb-colors: C to Guile
c-lw6map-get-max-nb-cursors: C to Guile
c-lw6map-get-max-nb-nodes: C to Guile
c-lw6map-get-music-dir: C to Guile
c-lw6map-get-title: C to Guile
c-lw6map-param-get: C to Guile
c-lw6map-rules-get-default: C to Guile
c-lw6map-rules-get-int: C to Guile
c-lw6map-rules-get-max: C to Guile
c-lw6map-rules-get-min: C to Guile
c-lw6map-style-get-default: C to Guile
c-lw6map-team-color-index-to-key: C to Guile
c-lw6map-team-color-index-to-label: C to Guile
c-lw6map-team-color-key-to-index: C to Guile
c-lw6map-team-color-list: C to Guile
c-lw6map-teams-get-default: C to Guile
c-lw6map-weapon-index-to-key: C to Guile
c-lw6map-weapon-index-to-label: C to Guile
c-lw6map-weapon-key-to-index: C to Guile
c-lw6map-weapon-list: C to Guile
c-lw6net-init: C to Guile
c-lw6net-quit: C to Guile
c-lw6p2p-db-default-name: C to Guile
c-lw6p2p-db-new: C to Guile
c-lw6p2p-db-reset: C to Guile
c-lw6p2p-node-calibrate: C to Guile
c-lw6p2p-node-client-join: C to Guile
c-lw6p2p-node-close: C to Guile
c-lw6p2p-node-disconnect: C to Guile
c-lw6p2p-node-get-entries: C to Guile
c-lw6p2p-node-get-id: C to Guile
c-lw6p2p-node-get-local-seq-0: C to Guile
c-lw6p2p-node-get-local-seq-last: C to Guile
c-lw6p2p-node-get-next-draft-msg: C to Guile
c-lw6p2p-node-get-next-reference-msg: C to Guile
c-lw6p2p-node-get-seq-draft: C to Guile
c-lw6p2p-node-get-seq-max: C to Guile
c-lw6p2p-node-get-seq-min: C to Guile
c-lw6p2p-node-get-seq-reference: C to Guile
c-lw6p2p-node-is-dump-needed: C to Guile
c-lw6p2p-node-is-peer-connected: C to Guile
c-lw6p2p-node-is-peer-registered: C to Guile
c-lw6p2p-node-is-seed-needed: C to Guile
c-lw6p2p-node-new: C to Guile
c-lw6p2p-node-poll: C to Guile
c-lw6p2p-node-put-local-msg: C to Guile
c-lw6p2p-node-refresh-peer: C to Guile
c-lw6p2p-node-server-start: C to Guile
c-lw6p2p-node-update-info: C to Guile
c-lw6pil-bench: C to Guile
c-lw6pil-build-pilot: C to Guile
c-lw6pil-calibrate: C to Guile
c-lw6pil-commit: C to Guile
c-lw6pil-did-cursor-win: C to Guile
c-lw6pil-dump-command-generate: C to Guile
c-lw6pil-execute-command: C to Guile
c-lw6pil-fix-coords: C to Guile
c-lw6pil-fix-coords-x10: C to Guile
c-lw6pil-get-last-commit-seq: C to Guile
c-lw6pil-get-looser: C to Guile
c-lw6pil-get-max-seq: C to Guile
c-lw6pil-get-next-seq: C to Guile
c-lw6pil-get-reference-current-seq: C to Guile
c-lw6pil-get-reference-target-seq: C to Guile
c-lw6pil-get-round-0: C to Guile
c-lw6pil-get-seq-0: C to Guile
c-lw6pil-get-winner: C to Guile
c-lw6pil-is-over: C to Guile
c-lw6pil-local-command: C to Guile
c-lw6pil-local-cursors-set-main: C to Guile
c-lw6pil-local-cursors-set-mouse-controlled: C to Guile
c-lw6pil-make-backup: C to Guile
c-lw6pil-poll-dump: C to Guile
c-lw6pil-round2seq: C to Guile
c-lw6pil-seed-command-generate: C to Guile
c-lw6pil-send-command: C to Guile
c-lw6pil-seq-random-0: C to Guile
c-lw6pil-seq2round: C to Guile
c-lw6pil-slow-down: C to Guile
c-lw6pil-speed-up: C to Guile
c-lw6pil-suite-get-checkpoint: C to Guile
c-lw6pil-suite-get-commands-by-node-index: C to Guile
c-lw6pil-suite-get-commands-by-stage: C to Guile
c-lw6pil-suite-get-node-id: C to Guile
c-lw6pil-suite-get-seq-0: C to Guile
c-lw6pil-suite-init: C to Guile
c-lw6pil-sync-from-backup: C to Guile
c-lw6pil-sync-from-draft: C to Guile
c-lw6pil-sync-from-reference: C to Guile
c-lw6snd-get-backends: C to Guile
c-lw6snd-is-music-file: C to Guile
c-lw6snd-new: C to Guile
c-lw6snd-play-fx: C to Guile
c-lw6snd-play-music-file: C to Guile
c-lw6snd-play-music-random: C to Guile
c-lw6snd-poll: C to Guile
c-lw6snd-release: C to Guile
c-lw6snd-set-fx-volume: C to Guile
c-lw6snd-set-music-volume: C to Guile
c-lw6snd-set-water-volume: C to Guile
c-lw6snd-stop-music: C to Guile
c-lw6srv-get-backends: C to Guile
c-lw6sys-build-get-abs-srcdir: C to Guile
c-lw6sys-build-get-bin-id: C to Guile
c-lw6sys-build-get-bugs-url: C to Guile
c-lw6sys-build-get-cflags: C to Guile
c-lw6sys-build-get-codename: C to Guile
c-lw6sys-build-get-configure-args: C to Guile
c-lw6sys-build-get-copyright: C to Guile
c-lw6sys-build-get-datadir: C to Guile
c-lw6sys-build-get-date: C to Guile
c-lw6sys-build-get-docdir: C to Guile
c-lw6sys-build-get-enable-allinone: C to Guile
c-lw6sys-build-get-enable-console: C to Guile
c-lw6sys-build-get-enable-fullstatic: C to Guile
c-lw6sys-build-get-enable-gcov: C to Guile
c-lw6sys-build-get-enable-gprof: C to Guile
c-lw6sys-build-get-enable-gtk: C to Guile
c-lw6sys-build-get-enable-instrument: C to Guile
c-lw6sys-build-get-enable-mod-caca: C to Guile
c-lw6sys-build-get-enable-mod-csound: C to Guile
c-lw6sys-build-get-enable-mod-gl1: C to Guile
c-lw6sys-build-get-enable-mod-gles2: C to Guile
c-lw6sys-build-get-enable-mod-http: C to Guile
c-lw6sys-build-get-enable-mod-ogg: C to Guile
c-lw6sys-build-get-enable-mod-soft: C to Guile
c-lw6sys-build-get-enable-openmp: C to Guile
c-lw6sys-build-get-enable-optimize: C to Guile
c-lw6sys-build-get-enable-paranoid: C to Guile
c-lw6sys-build-get-enable-profiler: C to Guile
c-lw6sys-build-get-enable-valgrind: C to Guile
c-lw6sys-build-get-endianness: C to Guile
c-lw6sys-build-get-gcc-version: C to Guile
c-lw6sys-build-get-home-url: C to Guile
c-lw6sys-build-get-host-cpu: C to Guile
c-lw6sys-build-get-host-os: C to Guile
c-lw6sys-build-get-hostname: C to Guile
c-lw6sys-build-get-includedir: C to Guile
c-lw6sys-build-get-ldflags: C to Guile
c-lw6sys-build-get-libdir: C to Guile
c-lw6sys-build-get-license: C to Guile
c-lw6sys-build-get-localedir: C to Guile
c-lw6sys-build-get-md5sum: C to Guile
c-lw6sys-build-get-package-id: C to Guile
c-lw6sys-build-get-package-name: C to Guile
c-lw6sys-build-get-package-string: C to Guile
c-lw6sys-build-get-package-tarname: C to Guile
c-lw6sys-build-get-pointer-size: C to Guile
c-lw6sys-build-get-prefix: C to Guile
c-lw6sys-build-get-stamp: C to Guile
c-lw6sys-build-get-time: C to Guile
c-lw6sys-build-get-top-srcdir: C to Guile
c-lw6sys-build-get-version: C to Guile
c-lw6sys-build-get-version-base: C to Guile
c-lw6sys-build-get-version-major: C to Guile
c-lw6sys-build-get-version-minor: C to Guile
c-lw6sys-build-is-gnu: C to Guile
c-lw6sys-build-is-gp2x: C to Guile
c-lw6sys-build-is-mac-os-x: C to Guile
c-lw6sys-build-is-ms-windows: C to Guile
c-lw6sys-build-is-unix: C to Guile
c-lw6sys-build-is-x86: C to Guile
c-lw6sys-debug-get: C to Guile
c-lw6sys-debug-set: C to Guile
c-lw6sys-delay: C to Guile
c-lw6sys-dump: C to Guile
c-lw6sys-dump-clear: C to Guile
c-lw6sys-generate-id-16: C to Guile
c-lw6sys-generate-id-32: C to Guile
c-lw6sys-generate-id-64: C to Guile
c-lw6sys-get-config-file: C to Guile
c-lw6sys-get-cwd: C to Guile
c-lw6sys-get-cycle: C to Guile
c-lw6sys-get-data-dir: C to Guile
c-lw6sys-get-default-config-file: C to Guile
c-lw6sys-get-default-data-dir: C to Guile
c-lw6sys-get-default-log-file: C to Guile
c-lw6sys-get-default-map-dir: C to Guile
c-lw6sys-get-default-map-path: C to Guile
c-lw6sys-get-default-mod-dir: C to Guile
c-lw6sys-get-default-music-dir: C to Guile
c-lw6sys-get-default-music-path: C to Guile
c-lw6sys-get-default-prefix: C to Guile
c-lw6sys-get-default-script-file: C to Guile
c-lw6sys-get-default-user-dir: C to Guile
c-lw6sys-get-hostname: C to Guile
c-lw6sys-get-log-file: C to Guile
c-lw6sys-get-map-dir: C to Guile
c-lw6sys-get-map-path: C to Guile
c-lw6sys-get-memory-bazooka-eraser: C to Guile
c-lw6sys-get-memory-bazooka-size: C to Guile
c-lw6sys-get-mod-dir: C to Guile
c-lw6sys-get-music-dir: C to Guile
c-lw6sys-get-music-path: C to Guile
c-lw6sys-get-prefix: C to Guile
c-lw6sys-get-run-dir: C to Guile
c-lw6sys-get-script-file: C to Guile
c-lw6sys-get-timestamp: C to Guile
c-lw6sys-get-uptime: C to Guile
c-lw6sys-get-user-dir: C to Guile
c-lw6sys-get-username: C to Guile
c-lw6sys-getenv: C to Guile
c-lw6sys-getenv-prefixed: C to Guile
c-lw6sys-idle: C to Guile
c-lw6sys-log: C to Guile
c-lw6sys-log-get-backtrace-mode: C to Guile
c-lw6sys-log-get-level: C to Guile
c-lw6sys-log-set-backtrace-mode: C to Guile
c-lw6sys-log-set-dialog-timeout: C to Guile
c-lw6sys-log-set-level: C to Guile
c-lw6sys-megabytes-available: C to Guile
c-lw6sys-openmp-get-num-procs: C to Guile
c-lw6sys-path-concat: C to Guile
c-lw6sys-path-file-only: C to Guile
c-lw6sys-path-parent: C to Guile
c-lw6sys-path-split: C to Guile
c-lw6sys-set-memory-bazooka-eraser: C to Guile
c-lw6sys-set-memory-bazooka-size: C to Guile
c-lw6sys-signal-custom: C to Guile
c-lw6sys-signal-default: C to Guile
c-lw6sys-signal-poll-quit: C to Guile
c-lw6sys-signal-send-quit: C to Guile
c-lw6sys-sleep: C to Guile
c-lw6sys-snooze: C to Guile
c-lw6sys-url-canonize: C to Guile
c-lw6tsk-loader-get-stage: C to Guile
c-lw6tsk-loader-new: C to Guile
c-lw6tsk-loader-pop: C to Guile
c-lw6tsk-loader-push-gen: C to Guile
c-lw6tsk-loader-push-ldr: C to Guile
capture: Graphics options
chosen-map: Map parameters
cli-backends: Network options
click-to-focus: Input options
color-alternate-bg: Map style.xml
color-alternate-fg: Map style.xml
color-base-bg: Map style.xml
color-base-fg: Map style.xml
color-conflict-mode: Map rules.xml
colorize: Map style.xml
colorize-cursor: Map style.xml
commands-per-sec: Advanced settings
cursor-pot-init: Map rules.xml
cursor-sensitivity: Input options
cursor-size: Map style.xml
custom-alt: Input options
custom-ctrl: Input options
custom-down: Input options
custom-enter: Input options
custom-esc: Input options
custom-left: Input options
custom-pgdown: Input options
custom-pgup: Input options
custom-right: Input options
custom-up: Input options

D
danger-power: Map rules.xml
debug-layer-id: Advanced settings
debug-team-id: Advanced settings
dialog-timeout: Advanced settings
dirty-read: Advanced settings
display-background: Advanced settings
display-console: Advanced settings
display-cursors: Advanced settings
display-debug-gradient: Advanced settings
display-debug-zones: Advanced settings
display-fighters: Advanced settings
display-fps: Advanced settings
display-hud: Advanced settings
display-log: Advanced settings
display-map: Advanced settings
display-menu: Advanced settings
display-meta: Advanced settings
display-mouse: Advanced settings
display-mps: Advanced settings
display-preview: Advanced settings
display-progress: Advanced settings
display-score: Advanced settings
display-splash: Advanced settings
display-url: Advanced settings
double-click-delay: Input options
downsize-using-bench-value: Map hints.xml
downsize-using-fighter-scale: Map hints.xml

E
executed-again: Advanced settings
exp: Map rules.xml

F
fighter-attack: Map rules.xml
fighter-defense: Map rules.xml
fighter-new-health: Map rules.xml
fighter-regenerate: Map rules.xml
fighter-scale: Map hints.xml
force: Map parameters
frags-fade-out: Map rules.xml
frags-mode: Map rules.xml
frags-to-distribute: Map rules.xml
fullscreen: Graphics options
fx-volume: Sound options

G
gfx-backend: Graphics options
gfx-cpu-usage: Advanced settings
gfx-debug: Advanced settings
gfx-quality: Graphics options
glue-power: Map rules.xml
guess-colors: Map hints.xml
guess-moves-per-sec: Map hints.xml

H
height: Graphics options
hidden-layer-alpha: Map style.xml
highest-team-color-allowed: Map rules.xml
highest-weapon-allowed: Map rules.xml
hud-color-auto: Map hints.xml
hud-color-frame-bg: Map style.xml
hud-color-frame-fg: Map style.xml
hud-color-text-bg: Map style.xml
hud-color-text-fg: Map style.xml
hud-style: Map style.xml

I
io-per-sec: Advanced settings

J
jpeg-quality: Advanced settings

K
keep-ratio: Map style.xml
known-nodes: Network options

L
loader-sleep: Advanced settings
local-bench-delta: Advanced settings
log-file: Path options
log-level: Advanced settings
log-timeout: Advanced settings
lw6bot_create_backend: libbot
lw6bot_destroy_backend: libbot
lw6bot_get_backends: libbot
lw6bot_init: libbot
lw6bot_next_move: libbot
lw6bot_quit: libbot
lw6bot_repr: libbot
lw6bot_test_register: libbot
lw6bot_test_run: libbot
lw6cfg_defaults: libcfg
lw6cfg_format: libcfg
lw6cfg_format_guess_type: libcfg
lw6cfg_get_option: libcfg
lw6cfg_get_option_bool: libcfg
lw6cfg_get_option_int: libcfg
lw6cfg_init: libcfg
lw6cfg_load: libcfg
lw6cfg_load_exp: libcfg
lw6cfg_merge_env: libcfg
lw6cfg_must_be_saved: libcfg
lw6cfg_option_exists: libcfg
lw6cfg_parse_command_line: libcfg
lw6cfg_quit: libcfg
lw6cfg_read_key_value_xml_file: libcfg
lw6cfg_read_xml_bool: libcfg
lw6cfg_read_xml_color: libcfg
lw6cfg_read_xml_float: libcfg
lw6cfg_read_xml_int: libcfg
lw6cfg_read_xml_string: libcfg
lw6cfg_reset: libcfg
lw6cfg_save: libcfg
lw6cfg_save_exp: libcfg
lw6cfg_set_option: libcfg
lw6cfg_set_option_bool: libcfg
lw6cfg_set_option_int: libcfg
lw6cfg_test_register: libcfg
lw6cfg_test_run: libcfg
lw6cfg_unified_get_log_file: libcfg
lw6cfg_unified_get_map_path: libcfg
lw6cfg_unified_get_music_path: libcfg
lw6cfg_unified_get_user_dir: libcfg
lw6cfg_unified_get_value: libcfg
lw6cfg_write_xml_bool: libcfg
lw6cfg_write_xml_color: libcfg
lw6cfg_write_xml_float: libcfg
lw6cfg_write_xml_guess_type: libcfg
lw6cfg_write_xml_guess_type_skip_same: libcfg
lw6cfg_write_xml_int: libcfg
lw6cfg_write_xml_string: libcfg
lw6cfg_xml_element: libcfg
lw6cli_can_send: libcli
lw6cli_close: libcli
lw6cli_create_backend: libcli
lw6cli_default_backends: libcli
lw6cli_destroy_backend: libcli
lw6cli_get_backends: libcli
lw6cli_init: libcli
lw6cli_oob_free: libcli
lw6cli_oob_new: libcli
lw6cli_open: libcli
lw6cli_poll: libcli
lw6cli_process_oob: libcli
lw6cli_quit: libcli
lw6cli_repr: libcli
lw6cli_send: libcli
lw6cli_test_register: libcli
lw6cli_test_run: libcli
lw6cns_console_support: libcns
lw6cns_handler_callback: libcns
lw6cns_handler_install: libcns
lw6cns_handler_poll: libcns
lw6cns_handler_remove: libcns
lw6cns_history_add_if_needed: libcns
lw6cns_term_support: libcns
lw6cns_test_register: libcns
lw6cns_test_run: libcns
lw6cnx_connection_free: libcnx
lw6cnx_connection_init_foo_bar_key: libcnx
lw6cnx_connection_lock_send: libcnx
lw6cnx_connection_new: libcnx
lw6cnx_connection_reliability_filter: libcnx
lw6cnx_connection_should_send_foo: libcnx
lw6cnx_connection_unlock_send: libcnx
lw6cnx_packet_checksum: libcnx
lw6cnx_packet_compare: libcnx
lw6cnx_packet_free: libcnx
lw6cnx_packet_new: libcnx
lw6cnx_packet_sort_callback: libcnx
lw6cnx_password_checksum: libcnx
lw6cnx_password_verify: libcnx
lw6cnx_test_register: libcnx
lw6cnx_test_run: libcnx
lw6cnx_ticket_table_ack_recv: libcnx
lw6cnx_ticket_table_clear: libcnx
lw6cnx_ticket_table_get_recv: libcnx
lw6cnx_ticket_table_get_send: libcnx
lw6cnx_ticket_table_init: libcnx
lw6cnx_ticket_table_set_send: libcnx
lw6cnx_ticket_table_was_recv_exchanged: libcnx
lw6cnx_ticket_table_zero: libcnx
lw6dat_miss_free: libdat
lw6dat_miss_is_included: libdat
lw6dat_miss_is_same: libdat
lw6dat_miss_new: libdat
lw6dat_miss_overlaps: libdat
lw6dat_miss_sync: libdat
lw6dat_test_register: libdat
lw6dat_test_run: libdat
lw6dat_warehouse_calc_serial_draft_and_reference: libdat
lw6dat_warehouse_clear: libdat
lw6dat_warehouse_free: libdat
lw6dat_warehouse_get_atom_str_list_not_sent: libdat
lw6dat_warehouse_get_local_id: libdat
lw6dat_warehouse_get_local_seq_0: libdat
lw6dat_warehouse_get_local_seq_last: libdat
lw6dat_warehouse_get_local_serial: libdat
lw6dat_warehouse_get_miss_list: libdat
lw6dat_warehouse_get_msg_list_by_seq: libdat
lw6dat_warehouse_get_nb_atom_parts_since_last_poll: libdat
lw6dat_warehouse_get_nb_nodes: libdat
lw6dat_warehouse_get_seq_draft: libdat
lw6dat_warehouse_get_seq_max: libdat
lw6dat_warehouse_get_seq_min: libdat
lw6dat_warehouse_get_seq_reference: libdat
lw6dat_warehouse_init: libdat
lw6dat_warehouse_is_node_registered: libdat
lw6dat_warehouse_meta_get: libdat
lw6dat_warehouse_meta_put: libdat
lw6dat_warehouse_miss_invalidate: libdat
lw6dat_warehouse_new: libdat
lw6dat_warehouse_purge: libdat
lw6dat_warehouse_put_atom_str: libdat
lw6dat_warehouse_put_local_msg: libdat
lw6dat_warehouse_register_node: libdat
lw6dat_warehouse_reset_nb_atom_parts_since_last_poll: libdat
lw6dat_warehouse_set_local_seq_0: libdat
lw6dat_warehouse_update_serial_miss_max: libdat
lw6dsp_create_backend: libdsp
lw6dsp_destroy_backend: libdsp
lw6dsp_get_average_fps: libdsp
lw6dsp_get_fullscreen_modes: libdsp
lw6dsp_get_instant_fps: libdsp
lw6dsp_get_last_frame_rendering_time: libdsp
lw6dsp_get_nb_frames: libdsp
lw6dsp_get_video_mode: libdsp
lw6dsp_init: libdsp
lw6dsp_param_zero: libdsp
lw6dsp_quit: libdsp
lw6dsp_repr: libdsp
lw6dsp_test_register: libdsp
lw6dsp_test_run: libdsp
lw6dsp_update: libdsp
lw6dyn_dlclose_backend: libdyn
lw6dyn_dlclose_shared: libdyn
lw6dyn_dlopen_backend: libdyn
lw6dyn_dlopen_backend_so: libdyn
lw6dyn_dlopen_shared: libdyn
lw6dyn_dlopen_shared_so: libdyn
lw6dyn_dlsym: libdyn
lw6dyn_list_backends: libdyn
lw6dyn_path_find_backend: libdyn
lw6dyn_path_find_shared: libdyn
lw6dyn_test_register: libdyn
lw6dyn_test_run: libdyn
lw6gen_create_from_seed: libgen
lw6gen_seed_char: libgen
lw6gen_seed_new: libgen
lw6gen_seed_normalize: libgen
lw6gen_test_register: libgen
lw6gen_test_run: libgen
lw6gfx_create_backend: libgfx
lw6gfx_destroy_backend: libgfx
lw6gfx_display: libgfx
lw6gfx_get_backends: libgfx
lw6gfx_get_fullscreen_modes: libgfx
lw6gfx_get_video_mode: libgfx
lw6gfx_init: libgfx
lw6gfx_pump_events: libgfx
lw6gfx_quit: libgfx
lw6gfx_repr: libgfx
lw6gfx_set_video_mode: libgfx
lw6gfx_test_register: libgfx
lw6gfx_test_run: libgfx
lw6glb_base64_decode_bin: libglb
lw6glb_base64_decode_bin_prefix: libglb
lw6glb_base64_decode_str: libglb
lw6glb_base64_decode_str_prefix: libglb
lw6glb_base64_encode_bin: libglb
lw6glb_base64_encode_bin_prefix: libglb
lw6glb_base64_encode_str: libglb
lw6glb_base64_encode_str_prefix: libglb
lw6glb_sha1_hmac_32_bin: libglb
lw6glb_sha1_hmac_32_str: libglb
lw6glb_sha1_hmac_80_bin: libglb
lw6glb_sha1_hmac_80_str: libglb
lw6glb_test_register: libglb
lw6glb_test_run: libglb
lw6gui_button_is_pressed: libgui
lw6gui_button_pop_double_click: libgui
lw6gui_button_pop_press: libgui
lw6gui_button_pop_simple_click: libgui
lw6gui_button_pop_triple_click: libgui
lw6gui_button_register_down: libgui
lw6gui_button_register_up: libgui
lw6gui_button_sync: libgui
lw6gui_button_update_repeat: libgui
lw6gui_coords_fix_xy_float: libgui
lw6gui_coord_calc_xy: libgui
lw6gui_input_enable_auto_release: libgui
lw6gui_input_free: libgui
lw6gui_input_init: libgui
lw6gui_input_need_sync: libgui
lw6gui_input_new: libgui
lw6gui_input_quit: libgui
lw6gui_input_register_change: libgui
lw6gui_input_reset: libgui
lw6gui_input_sync: libgui
lw6gui_input_update_repeat: libgui
lw6gui_joystick_check_index: libgui
lw6gui_joystick_get_move_pad: libgui
lw6gui_joystick_sync: libgui
lw6gui_joystick_update_axis_x: libgui
lw6gui_joystick_update_axis_y: libgui
lw6gui_joystick_update_repeat: libgui
lw6gui_keyboard_check_keysym: libgui
lw6gui_keyboard_get_move_pad: libgui
lw6gui_keyboard_is_pressed: libgui
lw6gui_keyboard_pop_keypress: libgui
lw6gui_keyboard_register_key_down: libgui
lw6gui_keyboard_register_key_up: libgui
lw6gui_keyboard_sync: libgui
lw6gui_keyboard_update_repeat: libgui
lw6gui_keypress_free: libgui
lw6gui_keypress_new: libgui
lw6gui_keypress_repr: libgui
lw6gui_look_dup: libgui
lw6gui_look_fix: libgui
lw6gui_look_free: libgui
lw6gui_look_get: libgui
lw6gui_look_is_same: libgui
lw6gui_look_memory_footprint: libgui
lw6gui_look_new: libgui
lw6gui_look_repr: libgui
lw6gui_look_set: libgui
lw6gui_look_zoom_in: libgui
lw6gui_look_zoom_out: libgui
lw6gui_menuitem_checksum: libgui
lw6gui_menuitem_dup: libgui
lw6gui_menuitem_enable: libgui
lw6gui_menuitem_free: libgui
lw6gui_menuitem_is_same: libgui
lw6gui_menuitem_memory_footprint: libgui
lw6gui_menuitem_new: libgui
lw6gui_menuitem_repr: libgui
lw6gui_menuitem_select: libgui
lw6gui_menuitem_set_label: libgui
lw6gui_menuitem_set_tooltip: libgui
lw6gui_menuitem_set_value: libgui
lw6gui_menuitem_sync: libgui
lw6gui_menu_append: libgui
lw6gui_menu_append_for_id_use: libgui
lw6gui_menu_center: libgui
lw6gui_menu_close_popup: libgui
lw6gui_menu_dup: libgui
lw6gui_menu_enable_esc: libgui
lw6gui_menu_free: libgui
lw6gui_menu_get_item: libgui
lw6gui_menu_has_popup: libgui
lw6gui_menu_insert: libgui
lw6gui_menu_insert_for_id_use: libgui
lw6gui_menu_is_same: libgui
lw6gui_menu_memory_footprint: libgui
lw6gui_menu_new: libgui
lw6gui_menu_remove: libgui
lw6gui_menu_remove_all: libgui
lw6gui_menu_remove_using_id: libgui
lw6gui_menu_repr: libgui
lw6gui_menu_scroll_down: libgui
lw6gui_menu_scroll_up: libgui
lw6gui_menu_select: libgui
lw6gui_menu_select_esc: libgui
lw6gui_menu_set_breadcrumbs: libgui
lw6gui_menu_set_help: libgui
lw6gui_menu_set_popup: libgui
lw6gui_menu_set_title: libgui
lw6gui_menu_sync: libgui
lw6gui_menu_sync_using_id: libgui
lw6gui_menu_update_display_range: libgui
lw6gui_mouse_drag_begin: libgui
lw6gui_mouse_drag_end: libgui
lw6gui_mouse_drag_pop: libgui
lw6gui_mouse_poll_move: libgui
lw6gui_mouse_register_move: libgui
lw6gui_mouse_sync: libgui
lw6gui_mouse_update_repeat: libgui
lw6gui_point_is_inside_rect: libgui
lw6gui_power_of_two_ge: libgui
lw6gui_power_of_two_le: libgui
lw6gui_quad_is_inside_rect: libgui
lw6gui_rect_array_get_tile_and_quad: libgui
lw6gui_rect_array_get_tile_by_i: libgui
lw6gui_rect_array_get_tile_by_source_xy: libgui
lw6gui_rect_array_init: libgui
lw6gui_rect_clip: libgui
lw6gui_rect_init_x1y1x2y2: libgui
lw6gui_rect_init_xywh: libgui
lw6gui_segment_is_inside_rect: libgui
lw6gui_smoother_fix_overflow: libgui
lw6gui_smoother_get_value: libgui
lw6gui_smoother_immediate_force: libgui
lw6gui_smoother_init: libgui
lw6gui_smoother_set_target: libgui
lw6gui_test_register: libgui
lw6gui_test_run: libgui
lw6gui_triangle_is_inside_rect: libgui
lw6gui_video_mode_find_closest: libgui
lw6gui_video_mode_is_same: libgui
lw6gui_video_mode_sync_ratio: libgui
lw6gui_viewport_calc_drag: libgui
lw6gui_viewport_init: libgui
lw6gui_viewport_map_to_screen: libgui
lw6gui_viewport_screen_to_map: libgui
lw6gui_zone_clip: libgui
lw6gui_zone_init_x1y1x2y2: libgui
lw6gui_zone_init_xywh: libgui
lw6hlp_about: libhlp
lw6hlp_get_credits: libhlp
lw6hlp_get_default_value: libhlp
lw6hlp_get_max_value: libhlp
lw6hlp_get_min_value: libhlp
lw6hlp_get_type: libhlp
lw6hlp_is_documented: libhlp
lw6hlp_list: libhlp
lw6hlp_list_advanced: libhlp
lw6hlp_list_aliases: libhlp
lw6hlp_list_doc: libhlp
lw6hlp_list_funcs: libhlp
lw6hlp_list_graphics: libhlp
lw6hlp_list_hooks: libhlp
lw6hlp_list_input: libhlp
lw6hlp_list_map: libhlp
lw6hlp_list_map_hints: libhlp
lw6hlp_list_map_rules: libhlp
lw6hlp_list_map_style: libhlp
lw6hlp_list_map_teams: libhlp
lw6hlp_list_network: libhlp
lw6hlp_list_path: libhlp
lw6hlp_list_players: libhlp
lw6hlp_list_quick: libhlp
lw6hlp_list_show: libhlp
lw6hlp_list_sound: libhlp
lw6hlp_list_team_colors: libhlp
lw6hlp_list_weapons: libhlp
lw6hlp_match: libhlp
lw6hlp_print_about: libhlp
lw6hlp_print_audit: libhlp
lw6hlp_print_bench: libhlp
lw6hlp_print_content: libhlp
lw6hlp_print_credits: libhlp
lw6hlp_print_goodbye: libhlp
lw6hlp_print_hello: libhlp
lw6hlp_print_help: libhlp
lw6hlp_print_host: libhlp
lw6hlp_print_keyword: libhlp
lw6hlp_print_list: libhlp
lw6hlp_print_list_advanced: libhlp
lw6hlp_print_list_aliases: libhlp
lw6hlp_print_list_doc: libhlp
lw6hlp_print_list_funcs: libhlp
lw6hlp_print_list_graphics: libhlp
lw6hlp_print_list_hooks: libhlp
lw6hlp_print_list_input: libhlp
lw6hlp_print_list_map: libhlp
lw6hlp_print_list_map_hints: libhlp
lw6hlp_print_list_map_rules: libhlp
lw6hlp_print_list_map_style: libhlp
lw6hlp_print_list_map_teams: libhlp
lw6hlp_print_list_network: libhlp
lw6hlp_print_list_path: libhlp
lw6hlp_print_list_players: libhlp
lw6hlp_print_list_quick: libhlp
lw6hlp_print_list_show: libhlp
lw6hlp_print_list_sound: libhlp
lw6hlp_print_list_team_colors: libhlp
lw6hlp_print_list_weapons: libhlp
lw6hlp_print_long_copyright: libhlp
lw6hlp_print_modules: libhlp
lw6hlp_print_pedigree: libhlp
lw6hlp_print_short_copyright: libhlp
lw6hlp_print_version: libhlp
lw6hlp_process_non_run_options: libhlp
lw6hlp_reference_init: libhlp
lw6hlp_reference_quit: libhlp
lw6hlp_test_register: libhlp
lw6hlp_test_run: libhlp
lw6img_repr: libimg
lw6img_screenshot_free: libimg
lw6img_screenshot_new: libimg
lw6img_test_register: libimg
lw6img_test_run: libimg
lw6ker_capture_str: libker
lw6ker_cursor_reset: libker
lw6ker_game_state_add_cursor: libker
lw6ker_game_state_can_sync: libker
lw6ker_game_state_checksum: libker
lw6ker_game_state_checksum_log_set_interval: libker
lw6ker_game_state_cursor_exists: libker
lw6ker_game_state_did_cursor_win: libker
lw6ker_game_state_do_move: libker
lw6ker_game_state_do_round: libker
lw6ker_game_state_do_spread: libker
lw6ker_game_state_dup: libker
lw6ker_game_state_finish_round: libker
lw6ker_game_state_free: libker
lw6ker_game_state_from_hexa: libker
lw6ker_game_state_get_charge_per1000: libker
lw6ker_game_state_get_cursor: libker
lw6ker_game_state_get_cursor_by_index: libker
lw6ker_game_state_get_d: libker
lw6ker_game_state_get_fighter_id: libker
lw6ker_game_state_get_fighter_ro_by_id: libker
lw6ker_game_state_get_fighter_ro_safe: libker
lw6ker_game_state_get_fighter_ro_unsafe: libker
lw6ker_game_state_get_fighter_rw_by_id: libker
lw6ker_game_state_get_fighter_rw_safe: libker
lw6ker_game_state_get_fighter_rw_unsafe: libker
lw6ker_game_state_get_global_history: libker
lw6ker_game_state_get_global_history_max: libker
lw6ker_game_state_get_h: libker
lw6ker_game_state_get_latest_history: libker
lw6ker_game_state_get_latest_history_max: libker
lw6ker_game_state_get_latest_weapon: libker
lw6ker_game_state_get_looser: libker
lw6ker_game_state_get_moves: libker
lw6ker_game_state_get_nb_active_fighters: libker
lw6ker_game_state_get_nb_colors: libker
lw6ker_game_state_get_nb_cursors: libker
lw6ker_game_state_get_nb_nodes: libker
lw6ker_game_state_get_nb_teams: libker
lw6ker_game_state_get_node_info: libker
lw6ker_game_state_get_rounds: libker
lw6ker_game_state_get_shape: libker
lw6ker_game_state_get_spreads: libker
lw6ker_game_state_get_team_info: libker
lw6ker_game_state_get_time_elapsed: libker
lw6ker_game_state_get_time_left: libker
lw6ker_game_state_get_total_rounds: libker
lw6ker_game_state_get_w: libker
lw6ker_game_state_get_weapon_per1000_left: libker
lw6ker_game_state_get_winner: libker
lw6ker_game_state_get_zone_potential: libker
lw6ker_game_state_is_over: libker
lw6ker_game_state_memory_footprint: libker
lw6ker_game_state_new: libker
lw6ker_game_state_node_exists: libker
lw6ker_game_state_point_to: libker
lw6ker_game_state_register_node: libker
lw6ker_game_state_remove_cursor: libker
lw6ker_game_state_repr: libker
lw6ker_game_state_set_cursor: libker
lw6ker_game_state_sync: libker
lw6ker_game_state_team_exists: libker
lw6ker_game_state_to_hexa: libker
lw6ker_game_state_unregister_node: libker
lw6ker_game_struct_checksum: libker
lw6ker_game_struct_dup: libker
lw6ker_game_struct_find_free_slot_near: libker
lw6ker_game_struct_free: libker
lw6ker_game_struct_from_hexa: libker
lw6ker_game_struct_get_d: libker
lw6ker_game_struct_get_h: libker
lw6ker_game_struct_get_shape: libker
lw6ker_game_struct_get_w: libker
lw6ker_game_struct_get_zones_info: libker
lw6ker_game_struct_get_zone_id: libker
lw6ker_game_struct_get_zone_info: libker
lw6ker_game_struct_is_bg: libker
lw6ker_game_struct_is_fg: libker
lw6ker_game_struct_memory_footprint: libker
lw6ker_game_struct_new: libker
lw6ker_game_struct_point_to: libker
lw6ker_game_struct_repr: libker
lw6ker_game_struct_to_hexa: libker
lw6ker_move_get_best_next_pos: libker
lw6ker_score_array_update: libker
lw6ker_team_mask_best: libker
lw6ker_team_mask_color2mask: libker
lw6ker_team_mask_get: libker
lw6ker_team_mask_is_concerned: libker
lw6ker_test_register: libker
lw6ker_test_run: libker
lw6ldr_auto_colors: libldr
lw6ldr_body_read: libldr
lw6ldr_chain_entry: libldr
lw6ldr_cursor_texture_read: libldr
lw6ldr_dup_entry: libldr
lw6ldr_exp_validate: libldr
lw6ldr_for_all_entries: libldr
lw6ldr_free_entry: libldr
lw6ldr_get_entries: libldr
lw6ldr_grease_apply: libldr
lw6ldr_hints_clear: libldr
lw6ldr_hints_defaults: libldr
lw6ldr_hints_get: libldr
lw6ldr_hints_get_default: libldr
lw6ldr_hints_read: libldr
lw6ldr_hints_set: libldr
lw6ldr_hints_update: libldr
lw6ldr_hints_zero: libldr
lw6ldr_layer_read_first: libldr
lw6ldr_layer_read_next: libldr
lw6ldr_metadata_read: libldr
lw6ldr_meta_layer_read: libldr
lw6ldr_meta_layer_read_if_exists: libldr
lw6ldr_param_read: libldr
lw6ldr_param_update: libldr
lw6ldr_print_examples: libldr
lw6ldr_print_example_hints_xml: libldr
lw6ldr_print_example_rules_xml: libldr
lw6ldr_print_example_style_xml: libldr
lw6ldr_print_example_teams_xml: libldr
lw6ldr_process_non_run_options: libldr
lw6ldr_read: libldr
lw6ldr_read_relative: libldr
lw6ldr_resampler_force: libldr
lw6ldr_resampler_init: libldr
lw6ldr_resampler_source2target: libldr
lw6ldr_resampler_target2source: libldr
lw6ldr_resampler_use_for_gen: libldr
lw6ldr_rules_read: libldr
lw6ldr_rules_update: libldr
lw6ldr_style_read: libldr
lw6ldr_style_set: libldr
lw6ldr_style_update: libldr
lw6ldr_teams_read: libldr
lw6ldr_teams_update: libldr
lw6ldr_test_register: libldr
lw6ldr_test_run: libldr
lw6ldr_texture_read: libldr
lw6ldr_use_clear: libldr
lw6ldr_use_defaults: libldr
lw6ldr_use_set: libldr
lw6ldr_use_update: libldr
lw6map_body_builtin_custom: libmap
lw6map_body_check_and_fix_holes: libmap
lw6map_body_clear: libmap
lw6map_body_coord_from_texture: libmap
lw6map_body_fix_checksum: libmap
lw6map_body_get_with_texture_coord: libmap
lw6map_builtin_custom: libmap
lw6map_builtin_defaults: libmap
lw6map_builtin_scale: libmap
lw6map_color_invert: libmap
lw6map_color_is_same: libmap
lw6map_color_set_is_same: libmap
lw6map_coords_fix_xy: libmap
lw6map_coords_fix_z: libmap
lw6map_cursor_texture_builtin: libmap
lw6map_cursor_texture_clear: libmap
lw6map_cursor_texture_layer_get: libmap
lw6map_cursor_texture_layer_set: libmap
lw6map_dup: libmap
lw6map_exp_get_highest_team_color_allowed: libmap
lw6map_exp_get_highest_weapon_allowed: libmap
lw6map_exp_get_unlocked_team_color: libmap
lw6map_exp_get_unlocked_weapon: libmap
lw6map_exp_is_team_color_allowed: libmap
lw6map_exp_is_weapon_allowed: libmap
lw6map_free: libmap
lw6map_from_hexa: libmap
lw6map_get_max_nb_colors: libmap
lw6map_get_max_nb_cursors: libmap
lw6map_get_max_nb_nodes: libmap
lw6map_get_title: libmap
lw6map_is_same: libmap
lw6map_layer_builtin_custom: libmap
lw6map_layer_clear: libmap
lw6map_local_info_clear: libmap
lw6map_local_info_set_music_dir: libmap
lw6map_memory_footprint: libmap
lw6map_metadata_clear: libmap
lw6map_metadata_defaults: libmap
lw6map_metadata_is_same: libmap
lw6map_meta_layer_builtin_custom: libmap
lw6map_meta_layer_clear: libmap
lw6map_meta_layer_get: libmap
lw6map_meta_layer_set: libmap
lw6map_new: libmap
lw6map_param_clear: libmap
lw6map_param_copy: libmap
lw6map_param_defaults: libmap
lw6map_param_get: libmap
lw6map_param_is_same: libmap
lw6map_param_set: libmap
lw6map_param_zero: libmap
lw6map_repr: libmap
lw6map_rules_clear: libmap
lw6map_rules_copy: libmap
lw6map_rules_defaults: libmap
lw6map_rules_get_bool: libmap
lw6map_rules_get_default: libmap
lw6map_rules_get_int: libmap
lw6map_rules_get_max: libmap
lw6map_rules_get_min: libmap
lw6map_rules_is_same: libmap
lw6map_rules_sanity_check: libmap
lw6map_rules_set_bool: libmap
lw6map_rules_set_int: libmap
lw6map_rules_update_checksum: libmap
lw6map_rules_zero: libmap
lw6map_style_clear: libmap
lw6map_style_copy: libmap
lw6map_style_defaults: libmap
lw6map_style_get: libmap
lw6map_style_get_default: libmap
lw6map_style_is_same: libmap
lw6map_style_set: libmap
lw6map_style_zero: libmap
lw6map_teams_clear: libmap
lw6map_teams_copy: libmap
lw6map_teams_defaults: libmap
lw6map_teams_get: libmap
lw6map_teams_get_default: libmap
lw6map_teams_is_same: libmap
lw6map_teams_set: libmap
lw6map_teams_zero: libmap
lw6map_team_color_index_to_key: libmap
lw6map_team_color_index_to_label: libmap
lw6map_team_color_key_to_index: libmap
lw6map_test_register: libmap
lw6map_test_run: libmap
lw6map_texture_clear: libmap
lw6map_texture_coord_from_body: libmap
lw6map_texture_from_body: libmap
lw6map_texture_get_with_body_coord: libmap
lw6map_texture_has_alpha: libmap
lw6map_to_hexa: libmap
lw6map_weapon_index_to_key: libmap
lw6map_weapon_index_to_label: libmap
lw6map_weapon_key_to_index: libmap
lw6mat_dmat2_det: libmat
lw6mat_dmat2_identity: libmat
lw6mat_dmat2_inv: libmat
lw6mat_dmat2_is_same: libmat
lw6mat_dmat2_mul_dmat2: libmat
lw6mat_dmat2_mul_dvec2: libmat
lw6mat_dmat2_mul_scale: libmat
lw6mat_dmat2_repr: libmat
lw6mat_dmat2_scale: libmat
lw6mat_dmat2_translation: libmat
lw6mat_dmat2_transpose: libmat
lw6mat_dmat2_zero: libmat
lw6mat_dmat3_det: libmat
lw6mat_dmat3_identity: libmat
lw6mat_dmat3_inv: libmat
lw6mat_dmat3_is_same: libmat
lw6mat_dmat3_mul_dmat3: libmat
lw6mat_dmat3_mul_dvec2: libmat
lw6mat_dmat3_mul_dvec3: libmat
lw6mat_dmat3_mul_scale: libmat
lw6mat_dmat3_repr: libmat
lw6mat_dmat3_rot: libmat
lw6mat_dmat3_scale: libmat
lw6mat_dmat3_translation: libmat
lw6mat_dmat3_transpose: libmat
lw6mat_dmat3_zero: libmat
lw6mat_dmat4_det: libmat
lw6mat_dmat4_identity: libmat
lw6mat_dmat4_inv: libmat
lw6mat_dmat4_is_same: libmat
lw6mat_dmat4_mul_dmat4: libmat
lw6mat_dmat4_mul_dvec3: libmat
lw6mat_dmat4_mul_dvec4: libmat
lw6mat_dmat4_mul_scale: libmat
lw6mat_dmat4_ortho: libmat
lw6mat_dmat4_perspective: libmat
lw6mat_dmat4_repr: libmat
lw6mat_dmat4_rot_x: libmat
lw6mat_dmat4_rot_y: libmat
lw6mat_dmat4_rot_z: libmat
lw6mat_dmat4_scale: libmat
lw6mat_dmat4_translation: libmat
lw6mat_dmat4_transpose: libmat
lw6mat_dmat4_zero: libmat
lw6mat_dvec2_add: libmat
lw6mat_dvec2_cross: libmat
lw6mat_dvec2_dot: libmat
lw6mat_dvec2_homogeneous: libmat
lw6mat_dvec2_is_same: libmat
lw6mat_dvec2_len: libmat
lw6mat_dvec2_len_sq: libmat
lw6mat_dvec2_mul_dvec2: libmat
lw6mat_dvec2_mul_scale: libmat
lw6mat_dvec2_neg: libmat
lw6mat_dvec2_normalize: libmat
lw6mat_dvec2_repr: libmat
lw6mat_dvec2_sub: libmat
lw6mat_dvec2_zero: libmat
lw6mat_dvec3_add: libmat
lw6mat_dvec3_cross: libmat
lw6mat_dvec3_dot: libmat
lw6mat_dvec3_homogeneous: libmat
lw6mat_dvec3_is_same: libmat
lw6mat_dvec3_len: libmat
lw6mat_dvec3_len_sq: libmat
lw6mat_dvec3_mul_dvec3: libmat
lw6mat_dvec3_mul_scale: libmat
lw6mat_dvec3_neg: libmat
lw6mat_dvec3_normalize: libmat
lw6mat_dvec3_repr: libmat
lw6mat_dvec3_sub: libmat
lw6mat_dvec3_zero: libmat
lw6mat_dvec4_add: libmat
lw6mat_dvec4_cross: libmat
lw6mat_dvec4_dot: libmat
lw6mat_dvec4_homogeneous: libmat
lw6mat_dvec4_is_same: libmat
lw6mat_dvec4_len: libmat
lw6mat_dvec4_len_sq: libmat
lw6mat_dvec4_mul_dvec4: libmat
lw6mat_dvec4_mul_scale: libmat
lw6mat_dvec4_neg: libmat
lw6mat_dvec4_normalize: libmat
lw6mat_dvec4_repr: libmat
lw6mat_dvec4_sub: libmat
lw6mat_dvec4_zero: libmat
lw6mat_fmat2_det: libmat
lw6mat_fmat2_identity: libmat
lw6mat_fmat2_inv: libmat
lw6mat_fmat2_is_same: libmat
lw6mat_fmat2_mul_fmat2: libmat
lw6mat_fmat2_mul_fvec2: libmat
lw6mat_fmat2_mul_scale: libmat
lw6mat_fmat2_repr: libmat
lw6mat_fmat2_scale: libmat
lw6mat_fmat2_translation: libmat
lw6mat_fmat2_transpose: libmat
lw6mat_fmat2_zero: libmat
lw6mat_fmat3_det: libmat
lw6mat_fmat3_identity: libmat
lw6mat_fmat3_inv: libmat
lw6mat_fmat3_is_same: libmat
lw6mat_fmat3_mul_fmat3: libmat
lw6mat_fmat3_mul_fvec2: libmat
lw6mat_fmat3_mul_fvec3: libmat
lw6mat_fmat3_mul_scale: libmat
lw6mat_fmat3_repr: libmat
lw6mat_fmat3_rot: libmat
lw6mat_fmat3_scale: libmat
lw6mat_fmat3_translation: libmat
lw6mat_fmat3_transpose: libmat
lw6mat_fmat3_zero: libmat
lw6mat_fmat4_det: libmat
lw6mat_fmat4_identity: libmat
lw6mat_fmat4_inv: libmat
lw6mat_fmat4_is_same: libmat
lw6mat_fmat4_mul_fmat4: libmat
lw6mat_fmat4_mul_fvec3: libmat
lw6mat_fmat4_mul_fvec4: libmat
lw6mat_fmat4_mul_scale: libmat
lw6mat_fmat4_ortho: libmat
lw6mat_fmat4_perspective: libmat
lw6mat_fmat4_repr: libmat
lw6mat_fmat4_rot_x: libmat
lw6mat_fmat4_rot_y: libmat
lw6mat_fmat4_rot_z: libmat
lw6mat_fmat4_scale: libmat
lw6mat_fmat4_translation: libmat
lw6mat_fmat4_transpose: libmat
lw6mat_fmat4_zero: libmat
lw6mat_fvec2_add: libmat
lw6mat_fvec2_cross: libmat
lw6mat_fvec2_dot: libmat
lw6mat_fvec2_homogeneous: libmat
lw6mat_fvec2_is_same: libmat
lw6mat_fvec2_len: libmat
lw6mat_fvec2_len_sq: libmat
lw6mat_fvec2_mul_fvec2: libmat
lw6mat_fvec2_mul_scale: libmat
lw6mat_fvec2_neg: libmat
lw6mat_fvec2_normalize: libmat
lw6mat_fvec2_repr: libmat
lw6mat_fvec2_sub: libmat
lw6mat_fvec2_zero: libmat
lw6mat_fvec3_add: libmat
lw6mat_fvec3_cross: libmat
lw6mat_fvec3_dot: libmat
lw6mat_fvec3_homogeneous: libmat
lw6mat_fvec3_is_same: libmat
lw6mat_fvec3_len: libmat
lw6mat_fvec3_len_sq: libmat
lw6mat_fvec3_mul_fvec3: libmat
lw6mat_fvec3_mul_scale: libmat
lw6mat_fvec3_neg: libmat
lw6mat_fvec3_normalize: libmat
lw6mat_fvec3_repr: libmat
lw6mat_fvec3_sub: libmat
lw6mat_fvec3_zero: libmat
lw6mat_fvec4_add: libmat
lw6mat_fvec4_cross: libmat
lw6mat_fvec4_dot: libmat
lw6mat_fvec4_homogeneous: libmat
lw6mat_fvec4_is_same: libmat
lw6mat_fvec4_len: libmat
lw6mat_fvec4_len_sq: libmat
lw6mat_fvec4_mul_fvec4: libmat
lw6mat_fvec4_mul_scale: libmat
lw6mat_fvec4_neg: libmat
lw6mat_fvec4_normalize: libmat
lw6mat_fvec4_repr: libmat
lw6mat_fvec4_sub: libmat
lw6mat_fvec4_zero: libmat
lw6mat_is_similar_d: libmat
lw6mat_is_similar_f: libmat
lw6mat_is_similar_i: libmat
lw6mat_is_similar_x: libmat
lw6mat_test_register: libmat
lw6mat_test_run: libmat
lw6msg_cmd_analyse_bar: libmsg
lw6msg_cmd_analyse_data: libmsg
lw6msg_cmd_analyse_foo: libmsg
lw6msg_cmd_analyse_goodbye: libmsg
lw6msg_cmd_analyse_hello: libmsg
lw6msg_cmd_analyse_join: libmsg
lw6msg_cmd_analyse_meta: libmsg
lw6msg_cmd_analyse_miss: libmsg
lw6msg_cmd_analyse_ticket: libmsg
lw6msg_cmd_generate_bar: libmsg
lw6msg_cmd_generate_data: libmsg
lw6msg_cmd_generate_foo: libmsg
lw6msg_cmd_generate_goodbye: libmsg
lw6msg_cmd_generate_hello: libmsg
lw6msg_cmd_generate_join: libmsg
lw6msg_cmd_generate_meta: libmsg
lw6msg_cmd_generate_miss: libmsg
lw6msg_cmd_generate_ticket: libmsg
lw6msg_cmd_guess_from_url: libmsg
lw6msg_envelope_analyse: libmsg
lw6msg_envelope_generate: libmsg
lw6msg_meta_array2str: libmsg
lw6msg_meta_array_exists: libmsg
lw6msg_meta_array_find: libmsg
lw6msg_meta_array_set: libmsg
lw6msg_meta_array_unset: libmsg
lw6msg_meta_array_zero: libmsg
lw6msg_meta_str2array: libmsg
lw6msg_oob_analyse_pong: libmsg
lw6msg_oob_analyse_request: libmsg
lw6msg_oob_generate_info: libmsg
lw6msg_oob_generate_list: libmsg
lw6msg_oob_generate_pong: libmsg
lw6msg_oob_generate_request: libmsg
lw6msg_sort_str_by_seq_callback: libmsg
lw6msg_test_register: libmsg
lw6msg_test_run: libmsg
lw6msg_ticket_calc_sig: libmsg
lw6msg_ticket_check_sig: libmsg
lw6msg_utils_get_assoc_int_with_default: libmsg
lw6msg_utils_get_assoc_str_with_default: libmsg
lw6msg_utils_parse_key_value_to_assoc: libmsg
lw6msg_utils_parse_key_value_to_ptr: libmsg
lw6msg_word_first: libmsg
lw6msg_word_first_base64: libmsg
lw6msg_word_first_id_16: libmsg
lw6msg_word_first_id_32: libmsg
lw6msg_word_first_id_64: libmsg
lw6msg_word_first_int_32: libmsg
lw6msg_word_first_int_32_ge0: libmsg
lw6msg_word_first_int_32_gt0: libmsg
lw6msg_word_first_int_64: libmsg
lw6msg_word_first_int_64_ge0: libmsg
lw6msg_word_first_int_64_gt0: libmsg
lw6msg_word_first_x: libmsg
lw6msg_z_decode: libmsg
lw6msg_z_encode: libmsg
lw6net_dns_gethostbyname: libnet
lw6net_dns_is_ip: libnet
lw6net_dns_lock: libnet
lw6net_dns_unlock: libnet
lw6net_if_guess_local: libnet
lw6net_if_guess_public_url: libnet
lw6net_init: libnet
lw6net_is_connectable: libnet
lw6net_last_error: libnet
lw6net_quit: libnet
lw6net_recv_lines_udp: libnet
lw6net_recv_line_tcp: libnet
lw6net_recv_line_udp: libnet
lw6net_send_line_tcp: libnet
lw6net_send_line_udp: libnet
lw6net_set_connectable: libnet
lw6net_socket_close: libnet
lw6net_socket_is_valid: libnet
lw6net_socket_set_blocking_mode: libnet
lw6net_tcp_accept: libnet
lw6net_tcp_connect: libnet
lw6net_tcp_is_alive: libnet
lw6net_tcp_listen: libnet
lw6net_tcp_peek: libnet
lw6net_tcp_recv: libnet
lw6net_tcp_send: libnet
lw6net_test_register: libnet
lw6net_test_run: libnet
lw6net_udp_client: libnet
lw6net_udp_peek: libnet
lw6net_udp_recv: libnet
lw6net_udp_send: libnet
lw6net_udp_server: libnet
lw6nod_dyn_info_free: libnod
lw6nod_info_add_discovered_node: libnod
lw6nod_info_community_add: libnod
lw6nod_info_community_count: libnod
lw6nod_info_community_get_id_from_url: libnod
lw6nod_info_community_get_peer_id_list_str: libnod
lw6nod_info_community_get_url_from_id: libnod
lw6nod_info_community_has_id: libnod
lw6nod_info_community_has_id_without_url: libnod
lw6nod_info_community_has_url: libnod
lw6nod_info_community_id_without_url_map: libnod
lw6nod_info_community_is_member: libnod
lw6nod_info_community_remove_by_id: libnod
lw6nod_info_community_remove_by_url: libnod
lw6nod_info_community_reset: libnod
lw6nod_info_community_set_peer_id_list_str: libnod
lw6nod_info_dup_dyn: libnod
lw6nod_info_free: libnod
lw6nod_info_idle: libnod
lw6nod_info_lock: libnod
lw6nod_info_map_verified_nodes: libnod
lw6nod_info_new: libnod
lw6nod_info_new_discovered_nodes: libnod
lw6nod_info_new_verified_nodes: libnod
lw6nod_info_pop_discovered_nodes: libnod
lw6nod_info_set_verified_nodes: libnod
lw6nod_info_unlock: libnod
lw6nod_info_update: libnod
lw6nod_test_register: libnod
lw6nod_test_run: libnod
lw6p2p_db_close: libp2p
lw6p2p_db_default_name: libp2p
lw6p2p_db_open: libp2p
lw6p2p_db_repr: libp2p
lw6p2p_db_reset: libp2p
lw6p2p_entry_free: libp2p
lw6p2p_entry_new: libp2p
lw6p2p_entry_repr: libp2p
lw6p2p_node_calibrate: libp2p
lw6p2p_node_client_join: libp2p
lw6p2p_node_close: libp2p
lw6p2p_node_disconnect: libp2p
lw6p2p_node_free: libp2p
lw6p2p_node_get_entries: libp2p
lw6p2p_node_get_id: libp2p
lw6p2p_node_get_local_seq_0: libp2p
lw6p2p_node_get_local_seq_last: libp2p
lw6p2p_node_get_next_draft_msg: libp2p
lw6p2p_node_get_next_reference_msg: libp2p
lw6p2p_node_get_seq_draft: libp2p
lw6p2p_node_get_seq_max: libp2p
lw6p2p_node_get_seq_min: libp2p
lw6p2p_node_get_seq_reference: libp2p
lw6p2p_node_is_dump_needed: libp2p
lw6p2p_node_is_peer_connected: libp2p
lw6p2p_node_is_peer_registered: libp2p
lw6p2p_node_is_seed_needed: libp2p
lw6p2p_node_new: libp2p
lw6p2p_node_poll: libp2p
lw6p2p_node_put_local_msg: libp2p
lw6p2p_node_refresh_peer: libp2p
lw6p2p_node_repr: libp2p
lw6p2p_node_server_start: libp2p
lw6p2p_node_update_info: libp2p
lw6p2p_test_register: libp2p
lw6p2p_test_run: libp2p
lw6pil_bench: libpil
lw6pil_command_dup: libpil
lw6pil_command_execute: libpil
lw6pil_command_execute_local: libpil
lw6pil_command_execute_local_text: libpil
lw6pil_command_execute_text: libpil
lw6pil_command_free: libpil
lw6pil_command_new: libpil
lw6pil_command_repr: libpil
lw6pil_coords_fix: libpil
lw6pil_coords_fix_x10: libpil
lw6pil_dump_clear: libpil
lw6pil_dump_command_execute: libpil
lw6pil_dump_command_generate: libpil
lw6pil_dump_exists: libpil
lw6pil_dump_zero: libpil
lw6pil_local_cursors_get_cursor: libpil
lw6pil_local_cursors_get_info: libpil
lw6pil_local_cursors_get_main_info: libpil
lw6pil_local_cursors_reset: libpil
lw6pil_local_cursors_set_main: libpil
lw6pil_local_cursors_set_mouse_controlled: libpil
lw6pil_local_cursors_set_xy: libpil
lw6pil_nopilot_poll_dump: libpil
lw6pil_pilot_calibrate: libpil
lw6pil_pilot_can_sync: libpil
lw6pil_pilot_checksum_log_set_interval: libpil
lw6pil_pilot_commit: libpil
lw6pil_pilot_did_cursor_win: libpil
lw6pil_pilot_dirty_read: libpil
lw6pil_pilot_free: libpil
lw6pil_pilot_get_last_commit_seq: libpil
lw6pil_pilot_get_local_cursors: libpil
lw6pil_pilot_get_looser: libpil
lw6pil_pilot_get_max_seq: libpil
lw6pil_pilot_get_next_seq: libpil
lw6pil_pilot_get_reference_current_seq: libpil
lw6pil_pilot_get_reference_target_seq: libpil
lw6pil_pilot_get_round_0: libpil
lw6pil_pilot_get_seq_0: libpil
lw6pil_pilot_get_winner: libpil
lw6pil_pilot_is_over: libpil
lw6pil_pilot_local_command: libpil
lw6pil_pilot_make_backup: libpil
lw6pil_pilot_new: libpil
lw6pil_pilot_repr: libpil
lw6pil_pilot_round2seq: libpil
lw6pil_pilot_send_command: libpil
lw6pil_pilot_seq2round: libpil
lw6pil_pilot_slow_down: libpil
lw6pil_pilot_speed_up: libpil
lw6pil_pilot_sync_from_backup: libpil
lw6pil_pilot_sync_from_draft: libpil
lw6pil_pilot_sync_from_reference: libpil
lw6pil_seed_command_generate: libpil
lw6pil_seq_random_0: libpil
lw6pil_suite_get_checkpoint: libpil
lw6pil_suite_get_command_by_node_index: libpil
lw6pil_suite_get_command_by_stage: libpil
lw6pil_suite_get_command_by_step: libpil
lw6pil_suite_get_node_id: libpil
lw6pil_suite_get_seq_0: libpil
lw6pil_suite_init: libpil
lw6pil_test_register: libpil
lw6pil_test_run: libpil
lw6scm_coverage_call: libscm
lw6scm_coverage_check: libscm
lw6scm_coverage_log: libscm
lw6scm_coverage_new: libscm
lw6scm_c_define_gsubr: libscm
lw6scm_c_primitive_load: libscm
lw6scm_funcname_c2scm: libscm
lw6scm_funcname_scm2c: libscm
lw6scm_gettext: libscm
lw6scm_test_register: libscm
lw6scm_test_run: libscm
lw6scm_utils_to_0str: libscm
lw6scm_utils_to_scm_str_assoc: libscm
lw6scm_utils_to_scm_str_list: libscm
lw6scm_utils_to_sys_str_assoc: libscm
lw6scm_utils_to_sys_str_list: libscm
lw6scm_with_guile: libscm
lw6sim_print: libsim
lw6sim_results_update_percents: libsim
lw6sim_results_zero: libsim
lw6sim_simulate: libsim
lw6sim_simulate_basic: libsim
lw6sim_simulate_full: libsim
lw6sim_test_register: libsim
lw6sim_test_run: libsim
lw6snd_create_backend: libsnd
lw6snd_destroy_backend: libsnd
lw6snd_get_backends: libsnd
lw6snd_init: libsnd
lw6snd_is_music_file: libsnd
lw6snd_play_fx: libsnd
lw6snd_play_music_file: libsnd
lw6snd_play_music_random: libsnd
lw6snd_poll: libsnd
lw6snd_quit: libsnd
lw6snd_repr: libsnd
lw6snd_set_fx_volume: libsnd
lw6snd_set_music_volume: libsnd
lw6snd_set_water_volume: libsnd
lw6snd_stop_music: libsnd
lw6snd_test_register: libsnd
lw6snd_test_run: libsnd
lw6srv_analyse_tcp: libsrv
lw6srv_analyse_udp: libsrv
lw6srv_can_send: libsrv
lw6srv_close: libsrv
lw6srv_create_backend: libsrv
lw6srv_default_backends: libsrv
lw6srv_destroy_backend: libsrv
lw6srv_feed_with_tcp: libsrv
lw6srv_feed_with_udp: libsrv
lw6srv_get_backends: libsrv
lw6srv_init: libsrv
lw6srv_oob_free: libsrv
lw6srv_oob_new: libsrv
lw6srv_open: libsrv
lw6srv_poll: libsrv
lw6srv_process_oob: libsrv
lw6srv_quit: libsrv
lw6srv_repr: libsrv
lw6srv_send: libsrv
lw6srv_start: libsrv
lw6srv_stop: libsrv
lw6srv_tcp_accepter_free: libsrv
lw6srv_tcp_accepter_new: libsrv
lw6srv_test_register: libsrv
lw6srv_test_run: libsrv
lw6srv_udp_buffer_free: libsrv
lw6srv_udp_buffer_new: libsrv
lw6sys_arg_exists: libsys
lw6sys_arg_get_value: libsys
lw6sys_arg_get_value_with_env: libsys
lw6sys_arg_match: libsys
lw6sys_arg_test_mode: libsys
lw6sys_assoc_dup: libsys
lw6sys_assoc_free: libsys
lw6sys_assoc_get: libsys
lw6sys_assoc_has_key: libsys
lw6sys_assoc_keys: libsys
lw6sys_assoc_map: libsys
lw6sys_assoc_new: libsys
lw6sys_assoc_set: libsys
lw6sys_assoc_sort_and_map: libsys
lw6sys_assoc_unset: libsys
lw6sys_atob: libsys
lw6sys_atof: libsys
lw6sys_atoi: libsys
lw6sys_atoll: libsys
lw6sys_backtrace: libsys
lw6sys_btoa: libsys
lw6sys_buf_sprintf: libsys
lw6sys_build_get_abs_srcdir: libsys
lw6sys_build_get_bin_id: libsys
lw6sys_build_get_bugs_url: libsys
lw6sys_build_get_cflags: libsys
lw6sys_build_get_codename: libsys
lw6sys_build_get_configure_args: libsys
lw6sys_build_get_copyright: libsys
lw6sys_build_get_datadir: libsys
lw6sys_build_get_date: libsys
lw6sys_build_get_docdir: libsys
lw6sys_build_get_enable_allinone: libsys
lw6sys_build_get_enable_console: libsys
lw6sys_build_get_enable_fullstatic: libsys
lw6sys_build_get_enable_gcov: libsys
lw6sys_build_get_enable_gprof: libsys
lw6sys_build_get_enable_gtk: libsys
lw6sys_build_get_enable_instrument: libsys
lw6sys_build_get_enable_mod_caca: libsys
lw6sys_build_get_enable_mod_csound: libsys
lw6sys_build_get_enable_mod_gl1: libsys
lw6sys_build_get_enable_mod_gles2: libsys
lw6sys_build_get_enable_mod_http: libsys
lw6sys_build_get_enable_mod_ogg: libsys
lw6sys_build_get_enable_mod_soft: libsys
lw6sys_build_get_enable_openmp: libsys
lw6sys_build_get_enable_optimize: libsys
lw6sys_build_get_enable_paranoid: libsys
lw6sys_build_get_enable_profiler: libsys
lw6sys_build_get_enable_valgrind: libsys
lw6sys_build_get_endianness: libsys
lw6sys_build_get_gcc_version: libsys
lw6sys_build_get_home_url: libsys
lw6sys_build_get_hostname: libsys
lw6sys_build_get_host_cpu: libsys
lw6sys_build_get_host_os: libsys
lw6sys_build_get_includedir: libsys
lw6sys_build_get_ldflags: libsys
lw6sys_build_get_libdir: libsys
lw6sys_build_get_license: libsys
lw6sys_build_get_localedir: libsys
lw6sys_build_get_md5sum: libsys
lw6sys_build_get_package_id: libsys
lw6sys_build_get_package_name: libsys
lw6sys_build_get_package_string: libsys
lw6sys_build_get_package_tarname: libsys
lw6sys_build_get_pointer_size: libsys
lw6sys_build_get_prefix: libsys
lw6sys_build_get_stamp: libsys
lw6sys_build_get_time: libsys
lw6sys_build_get_top_srcdir: libsys
lw6sys_build_get_version: libsys
lw6sys_build_get_version_base: libsys
lw6sys_build_get_version_major: libsys
lw6sys_build_get_version_minor: libsys
lw6sys_build_is_amd64: libsys
lw6sys_build_is_gnu: libsys
lw6sys_build_is_gp2x: libsys
lw6sys_build_is_mac_os_x: libsys
lw6sys_build_is_ms_windows: libsys
lw6sys_build_is_unix: libsys
lw6sys_build_is_x86: libsys
lw6sys_build_log_all: libsys
lw6sys_cache_free: libsys
lw6sys_cache_free_callback: libsys
lw6sys_cache_get: libsys
lw6sys_cache_has_key: libsys
lw6sys_cache_new: libsys
lw6sys_cache_set: libsys
lw6sys_cache_unset: libsys
lw6sys_calloc: libsys
lw6sys_checksum: libsys
lw6sys_checksum_int32: libsys
lw6sys_checksum_int64: libsys
lw6sys_checksum_str: libsys
lw6sys_checksum_update: libsys
lw6sys_checksum_update_int32: libsys
lw6sys_checksum_update_int64: libsys
lw6sys_checksum_update_str: libsys
lw6sys_checksum_update_whd: libsys
lw6sys_checksum_update_xyz: libsys
lw6sys_checksum_whd: libsys
lw6sys_checksum_xyz: libsys
lw6sys_check_id: libsys
lw6sys_check_id_16: libsys
lw6sys_check_id_32: libsys
lw6sys_check_id_64: libsys
lw6sys_check_mutex_count: libsys
lw6sys_check_thread_count: libsys
lw6sys_check_types_size: libsys
lw6sys_clear_file: libsys
lw6sys_clear_memory_bazooka: libsys
lw6sys_color_8_solid: libsys
lw6sys_color_8_to_a: libsys
lw6sys_color_8_to_f: libsys
lw6sys_color_8_to_iabgr: libsys
lw6sys_color_8_to_iargb: libsys
lw6sys_color_8_to_ibgra: libsys
lw6sys_color_8_to_irgba: libsys
lw6sys_color_average: libsys
lw6sys_color_a_to_8: libsys
lw6sys_color_a_to_f: libsys
lw6sys_color_char2float: libsys
lw6sys_color_distance: libsys
lw6sys_color_float2char: libsys
lw6sys_color_f_solid: libsys
lw6sys_color_f_to_8: libsys
lw6sys_color_f_to_iabgr: libsys
lw6sys_color_f_to_iargb: libsys
lw6sys_color_f_to_ibgra: libsys
lw6sys_color_f_to_irgba: libsys
lw6sys_color_hsv_invert: libsys
lw6sys_color_hsv_to_rgb: libsys
lw6sys_color_iabgr_to_8: libsys
lw6sys_color_iabgr_to_f: libsys
lw6sys_color_iargb_to_8: libsys
lw6sys_color_iargb_to_f: libsys
lw6sys_color_ibgra_to_8: libsys
lw6sys_color_ibgra_to_f: libsys
lw6sys_color_irgba_to_8: libsys
lw6sys_color_irgba_to_f: libsys
lw6sys_color_is_grey: libsys
lw6sys_color_is_same: libsys
lw6sys_color_ponderate: libsys
lw6sys_color_rgb_to_hsv: libsys
lw6sys_context_begin: libsys
lw6sys_context_end: libsys
lw6sys_context_free: libsys
lw6sys_context_init: libsys
lw6sys_context_new: libsys
lw6sys_context_quit: libsys
lw6sys_create_dir: libsys
lw6sys_create_dir_silent: libsys
lw6sys_cunit_clear: libsys
lw6sys_cunit_lock: libsys
lw6sys_cunit_run_tests: libsys
lw6sys_cunit_unlock: libsys
lw6sys_daemon_pid_file: libsys
lw6sys_daemon_start: libsys
lw6sys_daemon_stop: libsys
lw6sys_date_clf: libsys
lw6sys_date_rfc1123: libsys
lw6sys_debug_get: libsys
lw6sys_debug_set: libsys
lw6sys_default_memory_bazooka: libsys
lw6sys_delay: libsys
lw6sys_dir_exists: libsys
lw6sys_dir_exists_with_readme: libsys
lw6sys_dir_exists_with_readme_containing_text: libsys
lw6sys_dir_list: libsys
lw6sys_dump: libsys
lw6sys_dump_clear: libsys
lw6sys_env_concat: libsys
lw6sys_env_exists_prefixed: libsys
lw6sys_env_separator_char: libsys
lw6sys_env_separator_str: libsys
lw6sys_env_split: libsys
lw6sys_eol: libsys
lw6sys_escape_html_attribute: libsys
lw6sys_escape_http_uri: libsys
lw6sys_escape_sql_value: libsys
lw6sys_exec_again: libsys
lw6sys_exec_find_myself: libsys
lw6sys_exec_restart: libsys
lw6sys_false: libsys
lw6sys_fifo_pop: libsys
lw6sys_fifo_push: libsys
lw6sys_fifo_r_pop: libsys
lw6sys_fifo_r_push: libsys
lw6sys_file_exists: libsys
lw6sys_find_in_dir_and_path: libsys
lw6sys_free: libsys
lw6sys_free_callback: libsys
lw6sys_ftoa: libsys
lw6sys_generate_id_16: libsys
lw6sys_generate_id_32: libsys
lw6sys_generate_id_64: libsys
lw6sys_getenv: libsys
lw6sys_getenv_prefixed: libsys
lw6sys_get_config_file: libsys
lw6sys_get_cwd: libsys
lw6sys_get_cycle: libsys
lw6sys_get_data_dir: libsys
lw6sys_get_default_config_file: libsys
lw6sys_get_default_data_dir: libsys
lw6sys_get_default_log_file: libsys
lw6sys_get_default_map_dir: libsys
lw6sys_get_default_map_path: libsys
lw6sys_get_default_mod_dir: libsys
lw6sys_get_default_music_dir: libsys
lw6sys_get_default_music_path: libsys
lw6sys_get_default_prefix: libsys
lw6sys_get_default_script_file: libsys
lw6sys_get_default_user_dir: libsys
lw6sys_get_home: libsys
lw6sys_get_hostname: libsys
lw6sys_get_log_file: libsys
lw6sys_get_map_dir: libsys
lw6sys_get_map_path: libsys
lw6sys_get_memory_bazooka_free_count: libsys
lw6sys_get_memory_bazooka_free_megabytes: libsys
lw6sys_get_memory_bazooka_malloc_count: libsys
lw6sys_get_memory_bazooka_malloc_current_bytes: libsys
lw6sys_get_memory_bazooka_malloc_current_count: libsys
lw6sys_get_memory_bazooka_malloc_max_bytes: libsys
lw6sys_get_memory_bazooka_malloc_max_count: libsys
lw6sys_get_memory_bazooka_malloc_megabytes: libsys
lw6sys_get_memory_bazooka_size: libsys
lw6sys_get_mod_dir: libsys
lw6sys_get_music_dir: libsys
lw6sys_get_music_path: libsys
lw6sys_get_mutex_lock_count: libsys
lw6sys_get_mutex_unlock_count: libsys
lw6sys_get_prefix: libsys
lw6sys_get_run_dir: libsys
lw6sys_get_script_file: libsys
lw6sys_get_thread_create_count: libsys
lw6sys_get_thread_join_count: libsys
lw6sys_get_timestamp: libsys
lw6sys_get_uptime: libsys
lw6sys_get_username: libsys
lw6sys_get_user_dir: libsys
lw6sys_hash_dup: libsys
lw6sys_hash_free: libsys
lw6sys_hash_get: libsys
lw6sys_hash_has_key: libsys
lw6sys_hash_keys: libsys
lw6sys_hash_map: libsys
lw6sys_hash_new: libsys
lw6sys_hash_set: libsys
lw6sys_hash_sort_and_map: libsys
lw6sys_hash_unset: libsys
lw6sys_hexa_buf_to_str: libsys
lw6sys_hexa_ptr_to_str: libsys
lw6sys_hexa_serializer_as_string: libsys
lw6sys_hexa_serializer_eof: libsys
lw6sys_hexa_serializer_free: libsys
lw6sys_hexa_serializer_new: libsys
lw6sys_hexa_serializer_pop_color: libsys
lw6sys_hexa_serializer_pop_float: libsys
lw6sys_hexa_serializer_pop_int16: libsys
lw6sys_hexa_serializer_pop_int32: libsys
lw6sys_hexa_serializer_pop_int64: libsys
lw6sys_hexa_serializer_pop_int8: libsys
lw6sys_hexa_serializer_pop_str: libsys
lw6sys_hexa_serializer_pop_whd: libsys
lw6sys_hexa_serializer_pop_xyz: libsys
lw6sys_hexa_serializer_push_color: libsys
lw6sys_hexa_serializer_push_float: libsys
lw6sys_hexa_serializer_push_int16: libsys
lw6sys_hexa_serializer_push_int32: libsys
lw6sys_hexa_serializer_push_int64: libsys
lw6sys_hexa_serializer_push_int8: libsys
lw6sys_hexa_serializer_push_str: libsys
lw6sys_hexa_serializer_push_whd: libsys
lw6sys_hexa_serializer_push_xyz: libsys
lw6sys_hexa_serializer_rewind: libsys
lw6sys_hexa_str_to_buf: libsys
lw6sys_hexa_str_to_ptr: libsys
lw6sys_history_free: libsys
lw6sys_history_get: libsys
lw6sys_history_init: libsys
lw6sys_history_register: libsys
lw6sys_idle: libsys
lw6sys_id_atol: libsys
lw6sys_id_ltoa: libsys
lw6sys_is_big_endian: libsys
lw6sys_is_executed_again: libsys
lw6sys_is_little_endian: libsys
lw6sys_is_memory_bazooka_trustable: libsys
lw6sys_itoa: libsys
lw6sys_keyword_as_arg: libsys
lw6sys_keyword_as_env: libsys
lw6sys_keyword_as_key: libsys
lw6sys_keyword_as_xml: libsys
lw6sys_lifo_pop: libsys
lw6sys_lifo_push: libsys
lw6sys_lifo_r_pop: libsys
lw6sys_lifo_r_push: libsys
lw6sys_list_dup: libsys
lw6sys_list_filter: libsys
lw6sys_list_free: libsys
lw6sys_list_is_empty: libsys
lw6sys_list_length: libsys
lw6sys_list_map: libsys
lw6sys_list_new: libsys
lw6sys_list_next: libsys
lw6sys_list_pop_back: libsys
lw6sys_list_pop_front: libsys
lw6sys_list_push_back: libsys
lw6sys_list_push_front: libsys
lw6sys_list_r_dup: libsys
lw6sys_list_r_filter: libsys
lw6sys_list_r_free: libsys
lw6sys_list_r_is_empty: libsys
lw6sys_list_r_length: libsys
lw6sys_list_r_map: libsys
lw6sys_list_r_new: libsys
lw6sys_list_r_pop_back: libsys
lw6sys_list_r_pop_front: libsys
lw6sys_list_r_push_back: libsys
lw6sys_list_r_push_front: libsys
lw6sys_list_r_transfer_from: libsys
lw6sys_list_r_transfer_to: libsys
lw6sys_lltoa: libsys
lw6sys_locale_to_utf8: libsys
lw6sys_log: libsys
lw6sys_log_clear: libsys
lw6sys_log_critical: libsys
lw6sys_log_errno_str: libsys
lw6sys_log_get_backtrace_mode: libsys
lw6sys_log_get_console_state: libsys
lw6sys_log_get_level: libsys
lw6sys_log_set_backtrace_mode: libsys
lw6sys_log_set_console_state: libsys
lw6sys_log_set_dialog_timeout: libsys
lw6sys_log_set_file: libsys
lw6sys_log_set_level: libsys
lw6sys_malloc: libsys
lw6sys_math_angle_360: libsys
lw6sys_math_blink: libsys
lw6sys_math_deg2rad: libsys
lw6sys_math_heartbeat: libsys
lw6sys_math_lin2log: libsys
lw6sys_math_log2lin: libsys
lw6sys_math_poly_wy1y2s1: libsys
lw6sys_math_rad2deg: libsys
lw6sys_megabytes_available: libsys
lw6sys_memory_bazooka_report: libsys
lw6sys_mutex_create: libsys
lw6sys_mutex_destroy: libsys
lw6sys_mutex_lock: libsys
lw6sys_mutex_trylock: libsys
lw6sys_mutex_unlock: libsys
lw6sys_new_sprintf: libsys
lw6sys_openmp_get_num_procs: libsys
lw6sys_options_log: libsys
lw6sys_options_log_defaults: libsys
lw6sys_path_add_slash: libsys
lw6sys_path_concat: libsys
lw6sys_path_file_only: libsys
lw6sys_path_is_cwd: libsys
lw6sys_path_is_relative: libsys
lw6sys_path_list: libsys
lw6sys_path_parent: libsys
lw6sys_path_split: libsys
lw6sys_path_strip_slash: libsys
lw6sys_path_unparent: libsys
lw6sys_path_unparent_no_malloc: libsys
lw6sys_print_xml_footer: libsys
lw6sys_print_xml_header: libsys
lw6sys_process_fork_and_call: libsys
lw6sys_process_is_fully_supported: libsys
lw6sys_process_kill_1_9: libsys
lw6sys_profiler_check: libsys
lw6sys_progress_begin: libsys
lw6sys_progress_bind: libsys
lw6sys_progress_default: libsys
lw6sys_progress_end: libsys
lw6sys_progress_half: libsys
lw6sys_progress_split: libsys
lw6sys_progress_split3: libsys
lw6sys_progress_split4: libsys
lw6sys_progress_split5: libsys
lw6sys_progress_split_here: libsys
lw6sys_progress_update: libsys
lw6sys_random: libsys
lw6sys_random_float: libsys
lw6sys_readable_uptime: libsys
lw6sys_read_file_content: libsys
lw6sys_read_file_content_bin: libsys
lw6sys_realloc: libsys
lw6sys_sdl_register: libsys
lw6sys_sdl_unregister: libsys
lw6sys_serialize_int16: libsys
lw6sys_serialize_int32: libsys
lw6sys_serialize_int64: libsys
lw6sys_setenv: libsys
lw6sys_setenv_prefixed: libsys
lw6sys_set_memory_bazooka_eraser: libsys
lw6sys_set_memory_bazooka_size: libsys
lw6sys_shape_check_min_max_whd: libsys
lw6sys_shape_check_pos: libsys
lw6sys_shape_is_same: libsys
lw6sys_shape_is_same_xy: libsys
lw6sys_shape_surface_wh: libsys
lw6sys_shape_volume_whd: libsys
lw6sys_signal_custom: libsys
lw6sys_signal_default: libsys
lw6sys_signal_fpe_handler: libsys
lw6sys_signal_hup_handler: libsys
lw6sys_signal_int_handler: libsys
lw6sys_signal_poll_quit: libsys
lw6sys_signal_segv_handler: libsys
lw6sys_signal_send_quit: libsys
lw6sys_signal_term_handler: libsys
lw6sys_skip_blanks: libsys
lw6sys_sleep: libsys
lw6sys_snooze: libsys
lw6sys_sort: libsys
lw6sys_sort_float_callback: libsys
lw6sys_sort_float_desc_callback: libsys
lw6sys_sort_int_callback: libsys
lw6sys_sort_int_desc_callback: libsys
lw6sys_sort_str_callback: libsys
lw6sys_sort_str_desc_callback: libsys
lw6sys_spinlock_create: libsys
lw6sys_spinlock_destroy: libsys
lw6sys_spinlock_lock: libsys
lw6sys_spinlock_trylock: libsys
lw6sys_spinlock_unlock: libsys
lw6sys_stream_file_to_str: libsys
lw6sys_stream_str_to_file: libsys
lw6sys_str_cleanup: libsys
lw6sys_str_cleanup_ascii7: libsys
lw6sys_str_concat: libsys
lw6sys_str_copy: libsys
lw6sys_str_empty_if_null: libsys
lw6sys_str_is_bin: libsys
lw6sys_str_is_blank: libsys
lw6sys_str_is_null_or_empty: libsys
lw6sys_str_is_same: libsys
lw6sys_str_is_same_no_case: libsys
lw6sys_str_join: libsys
lw6sys_str_random: libsys
lw6sys_str_random_word: libsys
lw6sys_str_random_words: libsys
lw6sys_str_reformat: libsys
lw6sys_str_reformat_this: libsys
lw6sys_str_split: libsys
lw6sys_str_split_config_item: libsys
lw6sys_str_split_no_0: libsys
lw6sys_str_starts_with: libsys
lw6sys_str_starts_with_no_case: libsys
lw6sys_str_tolower: libsys
lw6sys_str_toupper: libsys
lw6sys_str_truncate: libsys
lw6sys_str_truncate_middle: libsys
lw6sys_test_and_set: libsys
lw6sys_test_and_set: libsys
lw6sys_test_exec: libsys
lw6sys_test_register: libsys
lw6sys_test_run: libsys
lw6sys_thread_create: libsys
lw6sys_thread_get_data: libsys
lw6sys_thread_get_id: libsys
lw6sys_thread_is_callback_done: libsys
lw6sys_thread_join: libsys
lw6sys_thread_wait_callback_done: libsys
lw6sys_timer_update: libsys
lw6sys_time_init: libsys
lw6sys_true: libsys
lw6sys_unserialize_int16: libsys
lw6sys_unserialize_int32: libsys
lw6sys_unserialize_int64: libsys
lw6sys_url_canonize: libsys
lw6sys_url_free: libsys
lw6sys_url_http_from_ip_port: libsys
lw6sys_url_is_canonized: libsys
lw6sys_url_parse: libsys
lw6sys_version_is_compatible: libsys
lw6sys_vthread_create: libsys
lw6sys_vthread_is_running: libsys
lw6sys_vthread_join: libsys
lw6sys_vthread_run: libsys
lw6sys_write_file_content: libsys
lw6tsk_loader_free: libtsk
lw6tsk_loader_get_stage: libtsk
lw6tsk_loader_new: libtsk
lw6tsk_loader_pop: libtsk
lw6tsk_loader_push_gen: libtsk
lw6tsk_loader_push_ldr: libtsk
lw6tsk_loader_repr: libtsk
lw6tsk_test_register: libtsk
lw6tsk_test_run: libtsk
lw6vox_renderer_free: libvox
lw6vox_renderer_new: libvox
lw6vox_test_register: libvox
lw6vox_test_run: libvox
LW6_AMBIANCE_EXCLUDE: Sound options
LW6_AMBIANCE_FILE: Sound options
LW6_AMBIANCE_FILTER: Sound options
LW6_ANIMATION_DENSITY: Map style.xml
LW6_ANIMATION_SPEED: Map style.xml
LW6_AUTO_RELEASE_DELAY: Input options
LW6_BACKGROUND_COLOR_AUTO: Map hints.xml
LW6_BACKGROUND_COLOR_ROOT_BG: Map style.xml
LW6_BACKGROUND_COLOR_ROOT_FG: Map style.xml
LW6_BACKGROUND_COLOR_STUFF_BG: Map style.xml
LW6_BACKGROUND_COLOR_STUFF_FG: Map style.xml
LW6_BACKGROUND_STYLE: Map style.xml
LW6_BENCH_VALUE: Advanced settings
LW6_BIND_IP: Network options
LW6_BIND_PORT: Network options
LW6_BIN_ID: Advanced settings
LW6_BLINK_CURSOR: Map style.xml
LW6_BOOST_POWER: Map rules.xml
LW6_BOT1_AI: Map teams.xml
LW6_BOT1_COLOR: Map teams.xml
LW6_BOT2_AI: Map teams.xml
LW6_BOT2_COLOR: Map teams.xml
LW6_BOT3_AI: Map teams.xml
LW6_BOT3_COLOR: Map teams.xml
LW6_BOT4_AI: Map teams.xml
LW6_BOT4_COLOR: Map teams.xml
LW6_BOT5_AI: Map teams.xml
LW6_BOT5_COLOR: Map teams.xml
LW6_BOT6_AI: Map teams.xml
LW6_BOT6_COLOR: Map teams.xml
LW6_BOT7_AI: Map teams.xml
LW6_BOT7_COLOR: Map teams.xml
LW6_BOT8_AI: Map teams.xml
LW6_BOT8_COLOR: Map teams.xml
LW6_BOT9_AI: Map teams.xml
LW6_BOT9_COLOR: Map teams.xml
LW6_BOT_IQ: Map teams.xml
LW6_BOT_SPEED: Map teams.xml
LW6_BROADCAST: Network options
LW6_CAPTURE: Graphics options
LW6_CHOSEN_MAP: Map parameters
LW6_CLICK_TO_FOCUS: Input options
LW6_CLI_BACKENDS: Network options
lw6_cns_handler: libliquidwar6
LW6_COLORIZE: Map style.xml
LW6_COLORIZE_CURSOR: Map style.xml
LW6_COLOR_ALTERNATE_BG: Map style.xml
LW6_COLOR_ALTERNATE_FG: Map style.xml
LW6_COLOR_BASE_BG: Map style.xml
LW6_COLOR_BASE_FG: Map style.xml
LW6_COLOR_CONFLICT_MODE: Map rules.xml
LW6_COMMANDS_PER_SEC: Advanced settings
LW6_CURSOR_POT_INIT: Map rules.xml
LW6_CURSOR_SENSITIVITY: Input options
LW6_CURSOR_SIZE: Map style.xml
LW6_CUSTOM_ALT: Input options
LW6_CUSTOM_CTRL: Input options
LW6_CUSTOM_DOWN: Input options
LW6_CUSTOM_ENTER: Input options
LW6_CUSTOM_ESC: Input options
LW6_CUSTOM_LEFT: Input options
LW6_CUSTOM_PGDOWN: Input options
LW6_CUSTOM_PGUP: Input options
LW6_CUSTOM_RIGHT: Input options
LW6_CUSTOM_UP: Input options
LW6_DANGER_POWER: Map rules.xml
LW6_DEBUG_LAYER_ID: Advanced settings
LW6_DEBUG_TEAM_ID: Advanced settings
LW6_DIALOG_TIMEOUT: Advanced settings
LW6_DIRTY_READ: Advanced settings
LW6_DISPLAY_BACKGROUND: Advanced settings
LW6_DISPLAY_CONSOLE: Advanced settings
LW6_DISPLAY_CURSORS: Advanced settings
LW6_DISPLAY_DEBUG_GRADIENT: Advanced settings
LW6_DISPLAY_DEBUG_ZONES: Advanced settings
LW6_DISPLAY_FIGHTERS: Advanced settings
LW6_DISPLAY_FPS: Advanced settings
LW6_DISPLAY_HUD: Advanced settings
LW6_DISPLAY_LOG: Advanced settings
LW6_DISPLAY_MAP: Advanced settings
LW6_DISPLAY_MENU: Advanced settings
LW6_DISPLAY_META: Advanced settings
LW6_DISPLAY_MOUSE: Advanced settings
LW6_DISPLAY_MPS: Advanced settings
LW6_DISPLAY_PREVIEW: Advanced settings
LW6_DISPLAY_PROGRESS: Advanced settings
LW6_DISPLAY_SCORE: Advanced settings
LW6_DISPLAY_SPLASH: Advanced settings
LW6_DISPLAY_URL: Advanced settings
LW6_DOUBLE_CLICK_DELAY: Input options
LW6_DOWNSIZE_USING_BENCH_VALUE: Map hints.xml
LW6_DOWNSIZE_USING_FIGHTER_SCALE: Map hints.xml
LW6_EXECUTED_AGAIN: Advanced settings
lw6_exit: libliquidwar6
LW6_EXP: Map rules.xml
LW6_FIGHTER_ATTACK: Map rules.xml
LW6_FIGHTER_DEFENSE: Map rules.xml
LW6_FIGHTER_NEW_HEALTH: Map rules.xml
LW6_FIGHTER_REGENERATE: Map rules.xml
LW6_FIGHTER_SCALE: Map hints.xml
lw6_fix_env: libliquidwar6
LW6_FORCE: Map parameters
LW6_FRAGS_FADE_OUT: Map rules.xml
LW6_FRAGS_MODE: Map rules.xml
LW6_FRAGS_TO_DISTRIBUTE: Map rules.xml
lw6_free_bot_smob: libliquidwar6
lw6_free_db_smob: libliquidwar6
lw6_free_dsp_smob: libliquidwar6
lw6_free_game_state_smob: libliquidwar6
lw6_free_game_struct_smob: libliquidwar6
lw6_free_jpeg_smob: libliquidwar6
lw6_free_loader_smob: libliquidwar6
lw6_free_look_smob: libliquidwar6
lw6_free_map_smob: libliquidwar6
lw6_free_menu_smob: libliquidwar6
lw6_free_node_smob: libliquidwar6
lw6_free_pilot_smob: libliquidwar6
lw6_free_snd_smob: libliquidwar6
LW6_FULLSCREEN: Graphics options
LW6_FX_VOLUME: Sound options
lw6_get_ret: libliquidwar6
LW6_GFX_BACKEND: Graphics options
LW6_GFX_CPU_USAGE: Advanced settings
LW6_GFX_DEBUG: Advanced settings
LW6_GFX_QUALITY: Graphics options
LW6_GLUE_POWER: Map rules.xml
LW6_GUESS_COLORS: Map hints.xml
LW6_GUESS_MOVES_PER_SEC: Map hints.xml
LW6_HEIGHT: Graphics options
LW6_HIDDEN_LAYER_ALPHA: Map style.xml
LW6_HIGHEST_TEAM_COLOR_ALLOWED: Map rules.xml
LW6_HIGHEST_WEAPON_ALLOWED: Map rules.xml
LW6_HUD_COLOR_AUTO: Map hints.xml
LW6_HUD_COLOR_FRAME_BG: Map style.xml
LW6_HUD_COLOR_FRAME_FG: Map style.xml
LW6_HUD_COLOR_TEXT_BG: Map style.xml
LW6_HUD_COLOR_TEXT_FG: Map style.xml
LW6_HUD_STYLE: Map style.xml
lw6_init_global: libliquidwar6
LW6_IO_PER_SEC: Advanced settings
LW6_JPEG_QUALITY: Advanced settings
LW6_KEEP_RATIO: Map style.xml
LW6_KNOWN_NODES: Network options
LW6_LOADER_SLEEP: Advanced settings
LW6_LOCAL_BENCH_DELTA: Advanced settings
LW6_LOG_FILE: Path options
LW6_LOG_LEVEL: Advanced settings
LW6_LOG_TIMEOUT: Advanced settings
LW6_MAGIC_NUMBER: Advanced settings
lw6_main: libliquidwar6
lw6_make_scm_bot: libliquidwar6
lw6_make_scm_db: libliquidwar6
lw6_make_scm_dsp: libliquidwar6
lw6_make_scm_game_state: libliquidwar6
lw6_make_scm_game_struct: libliquidwar6
lw6_make_scm_jpeg: libliquidwar6
lw6_make_scm_loader: libliquidwar6
lw6_make_scm_look: libliquidwar6
lw6_make_scm_map: libliquidwar6
lw6_make_scm_menu: libliquidwar6
lw6_make_scm_node: libliquidwar6
lw6_make_scm_pilot: libliquidwar6
lw6_make_scm_snd: libliquidwar6
LW6_MAP_PATH: Path options
LW6_MAX_CURSOR_POT: Map rules.xml
LW6_MAX_CURSOR_POT_OFFSET: Map rules.xml
LW6_MAX_CURSOR_SPEED: Input options
LW6_MAX_LOCAL_BENCH_VALUE: Advanced settings
LW6_MAX_MAP_HEIGHT: Map hints.xml
LW6_MAX_MAP_SURFACE: Map hints.xml
LW6_MAX_MAP_WIDTH: Map hints.xml
LW6_MAX_NB_CURSORS: Map rules.xml
LW6_MAX_NB_NODES: Map rules.xml
LW6_MAX_NB_TEAMS: Map rules.xml
LW6_MAX_NETWORK_BENCH_VALUE: Advanced settings
LW6_MAX_ROUND_DELTA: Map rules.xml
LW6_MAX_ZONE_SIZE: Map rules.xml
LW6_MEDICINE_POWER: Map rules.xml
LW6_MEMORY_BAZOOKA_ERASER: Advanced settings
LW6_MEMORY_BAZOOKA_SIZE: Advanced settings
LW6_MENU_COLOR_AUTO: Map hints.xml
LW6_MENU_COLOR_DEFAULT_BG: Map style.xml
LW6_MENU_COLOR_DEFAULT_FG: Map style.xml
LW6_MENU_COLOR_DISABLED_BG: Map style.xml
LW6_MENU_COLOR_DISABLED_FG: Map style.xml
LW6_MENU_COLOR_SELECTED_BG: Map style.xml
LW6_MENU_COLOR_SELECTED_FG: Map style.xml
LW6_MENU_STYLE: Map style.xml
LW6_MIN_MAP_HEIGHT: Map hints.xml
LW6_MIN_MAP_SURFACE: Map hints.xml
LW6_MIN_MAP_WIDTH: Map hints.xml
LW6_MOUSE_SENSITIVITY: Input options
LW6_MOVES_PER_ROUND: Map rules.xml
LW6_MUSIC_DIR: Path options
LW6_MUSIC_EXCLUDE: Map style.xml
LW6_MUSIC_FILE: Map style.xml
LW6_MUSIC_FILTER: Map style.xml
LW6_MUSIC_PATH: Path options
LW6_MUSIC_VOLUME: Sound options
LW6_NB_ATTACK_TRIES: Map rules.xml
LW6_NB_BOTS: Map teams.xml
LW6_NB_DEFENSE_TRIES: Map rules.xml
LW6_NB_MOVE_TRIES: Map rules.xml
LW6_NETWORK_BENCH_DELTA: Advanced settings
LW6_NETWORK_RELIABILITY: Advanced settings
LW6_NET_LOG: Advanced settings
LW6_NET_PER_SEC: Advanced settings
LW6_NODE_DESCRIPTION: Network options
LW6_NODE_TITLE: Network options
LW6_OPEN_RELAY: Advanced settings
LW6_PASSWORD: Network options
LW6_PILOT_LAG: Advanced settings
LW6_PIXELIZE: Map style.xml
LW6_PLAYER1_COLOR: Map teams.xml
LW6_PLAYER1_CONTROL: Players options
LW6_PLAYER1_NAME: Players options
LW6_PLAYER1_STATUS: Players options
LW6_PLAYER2_COLOR: Map teams.xml
LW6_PLAYER2_CONTROL: Players options
LW6_PLAYER2_NAME: Players options
LW6_PLAYER2_STATUS: Players options
LW6_PLAYER3_COLOR: Map teams.xml
LW6_PLAYER3_CONTROL: Players options
LW6_PLAYER3_NAME: Players options
LW6_PLAYER3_STATUS: Players options
LW6_PLAYER4_COLOR: Map teams.xml
LW6_PLAYER4_CONTROL: Players options
LW6_PLAYER4_NAME: Players options
LW6_PLAYER4_STATUS: Players options
lw6_process_non_run_options: libliquidwar6
LW6_PUBLIC_URL: Network options
lw6_quit_global: libliquidwar6
lw6_register_funcs: libliquidwar6
lw6_register_funcs_bot: libliquidwar6
lw6_register_funcs_cfg: libliquidwar6
lw6_register_funcs_cli: libliquidwar6
lw6_register_funcs_cns: libliquidwar6
lw6_register_funcs_dsp: libliquidwar6
lw6_register_funcs_gen: libliquidwar6
lw6_register_funcs_gfx: libliquidwar6
lw6_register_funcs_gui: libliquidwar6
lw6_register_funcs_hlp: libliquidwar6
lw6_register_funcs_img: libliquidwar6
lw6_register_funcs_ker: libliquidwar6
lw6_register_funcs_ldr: libliquidwar6
lw6_register_funcs_map: libliquidwar6
lw6_register_funcs_net: libliquidwar6
lw6_register_funcs_p2p: libliquidwar6
lw6_register_funcs_pil: libliquidwar6
lw6_register_funcs_snd: libliquidwar6
lw6_register_funcs_srv: libliquidwar6
lw6_register_funcs_sys: libliquidwar6
lw6_register_funcs_tsk: libliquidwar6
lw6_register_smobs: libliquidwar6
lw6_release: libliquidwar6
LW6_REPEAT_DELAY: Input options
LW6_REPEAT_INTERVAL: Input options
LW6_RESAMPLE: Map hints.xml
LW6_RESET_CONFIG_ON_UPGRADE: Advanced settings
lw6_resize_callback: libliquidwar6
LW6_RESPAWN_DELAY: Map rules.xml
LW6_RESPAWN_POSITION_MODE: Map rules.xml
LW6_RESPAWN_TEAM: Map rules.xml
LW6_ROUNDS_PER_SEC: Map rules.xml
LW6_ROUND_DELTA: Map rules.xml
lw6_scm_to_bot: libliquidwar6
lw6_scm_to_db: libliquidwar6
lw6_scm_to_dsp: libliquidwar6
lw6_scm_to_game_state: libliquidwar6
lw6_scm_to_game_struct: libliquidwar6
lw6_scm_to_jpeg: libliquidwar6
lw6_scm_to_loader: libliquidwar6
lw6_scm_to_look: libliquidwar6
lw6_scm_to_map: libliquidwar6
lw6_scm_to_menu: libliquidwar6
lw6_scm_to_node: libliquidwar6
lw6_scm_to_pilot: libliquidwar6
lw6_scm_to_snd: libliquidwar6
LW6_SCREENSHOTS_PER_MIN: Advanced settings
lw6_set_ret: libliquidwar6
LW6_SIDE_ATTACK_FACTOR: Map rules.xml
LW6_SIDE_DEFENSE_FACTOR: Map rules.xml
LW6_SINGLE_ARMY_SIZE: Map rules.xml
LW6_SKIP_NETWORK: Network options
LW6_SND_BACKEND: Sound options
LW6_SPEED: Map hints.xml
LW6_SPREADS_PER_ROUND: Map rules.xml
LW6_SPREAD_MODE: Map rules.xml
LW6_SPREAD_THREAD: Map rules.xml
LW6_SRV_BACKENDS: Network options
LW6_START_BLUE_X: Map rules.xml
LW6_START_BLUE_Y: Map rules.xml
LW6_START_CYAN_X: Map rules.xml
LW6_START_CYAN_Y: Map rules.xml
LW6_START_GREEN_X: Map rules.xml
LW6_START_GREEN_Y: Map rules.xml
LW6_START_LIGHTBLUE_X: Map rules.xml
LW6_START_LIGHTBLUE_Y: Map rules.xml
LW6_START_MAGENTA_X: Map rules.xml
LW6_START_MAGENTA_Y: Map rules.xml
LW6_START_ORANGE_X: Map rules.xml
LW6_START_ORANGE_Y: Map rules.xml
LW6_START_PINK_X: Map rules.xml
LW6_START_PINK_Y: Map rules.xml
LW6_START_POSITION_MODE: Map rules.xml
LW6_START_PURPLE_X: Map rules.xml
LW6_START_PURPLE_Y: Map rules.xml
LW6_START_RED_X: Map rules.xml
LW6_START_RED_Y: Map rules.xml
LW6_START_YELLOW_X: Map rules.xml
LW6_START_YELLOW_Y: Map rules.xml
LW6_SYSTEM_COLOR_AUTO: Map hints.xml
LW6_SYSTEM_COLOR_BG: Map style.xml
LW6_SYSTEM_COLOR_FG: Map style.xml
LW6_TARGET_FPS: Advanced settings
LW6_TEAM_COLOR_BLUE: Map style.xml
LW6_TEAM_COLOR_CYAN: Map style.xml
LW6_TEAM_COLOR_DEAD: Map style.xml
LW6_TEAM_COLOR_GREEN: Map style.xml
LW6_TEAM_COLOR_LIGHTBLUE: Map style.xml
LW6_TEAM_COLOR_MAGENTA: Map style.xml
LW6_TEAM_COLOR_ORANGE: Map style.xml
LW6_TEAM_COLOR_PINK: Map style.xml
LW6_TEAM_COLOR_PURPLE: Map style.xml
LW6_TEAM_COLOR_RED: Map style.xml
LW6_TEAM_COLOR_YELLOW: Map style.xml
LW6_TEAM_PROFILE_BLUE_AGGRESSIVE: Map rules.xml
LW6_TEAM_PROFILE_BLUE_FAST: Map rules.xml
LW6_TEAM_PROFILE_BLUE_HANDICAP: Map rules.xml
LW6_TEAM_PROFILE_BLUE_MOBILE: Map rules.xml
LW6_TEAM_PROFILE_BLUE_VULNERABLE: Map rules.xml
LW6_TEAM_PROFILE_BLUE_WEAPON_ALTERNATE_ID: Map rules.xml
LW6_TEAM_PROFILE_BLUE_WEAPON_ID: Map rules.xml
LW6_TEAM_PROFILE_BLUE_WEAPON_MODE: Map rules.xml
LW6_TEAM_PROFILE_CYAN_AGGRESSIVE: Map rules.xml
LW6_TEAM_PROFILE_CYAN_FAST: Map rules.xml
LW6_TEAM_PROFILE_CYAN_HANDICAP: Map rules.xml
LW6_TEAM_PROFILE_CYAN_MOBILE: Map rules.xml
LW6_TEAM_PROFILE_CYAN_VULNERABLE: Map rules.xml
LW6_TEAM_PROFILE_CYAN_WEAPON_ALTERNATE_ID: Map rules.xml
LW6_TEAM_PROFILE_CYAN_WEAPON_ID: Map rules.xml
LW6_TEAM_PROFILE_CYAN_WEAPON_MODE: Map rules.xml
LW6_TEAM_PROFILE_GREEN_AGGRESSIVE: Map rules.xml
LW6_TEAM_PROFILE_GREEN_FAST: Map rules.xml
LW6_TEAM_PROFILE_GREEN_HANDICAP: Map rules.xml
LW6_TEAM_PROFILE_GREEN_MOBILE: Map rules.xml
LW6_TEAM_PROFILE_GREEN_VULNERABLE: Map rules.xml
LW6_TEAM_PROFILE_GREEN_WEAPON_ALTERNATE_ID: Map rules.xml
LW6_TEAM_PROFILE_GREEN_WEAPON_ID: Map rules.xml
LW6_TEAM_PROFILE_GREEN_WEAPON_MODE: Map rules.xml
LW6_TEAM_PROFILE_LIGHTBLUE_AGGRESSIVE: Map rules.xml
LW6_TEAM_PROFILE_LIGHTBLUE_FAST: Map rules.xml
LW6_TEAM_PROFILE_LIGHTBLUE_HANDICAP: Map rules.xml
LW6_TEAM_PROFILE_LIGHTBLUE_MOBILE: Map rules.xml
LW6_TEAM_PROFILE_LIGHTBLUE_VULNERABLE: Map rules.xml
LW6_TEAM_PROFILE_LIGHTBLUE_WEAPON_ALTERNATE_ID: Map rules.xml
LW6_TEAM_PROFILE_LIGHTBLUE_WEAPON_ID: Map rules.xml
LW6_TEAM_PROFILE_LIGHTBLUE_WEAPON_MODE: Map rules.xml
LW6_TEAM_PROFILE_MAGENTA_AGGRESSIVE: Map rules.xml
LW6_TEAM_PROFILE_MAGENTA_FAST: Map rules.xml
LW6_TEAM_PROFILE_MAGENTA_HANDICAP: Map rules.xml
LW6_TEAM_PROFILE_MAGENTA_MOBILE: Map rules.xml
LW6_TEAM_PROFILE_MAGENTA_VULNERABLE: Map rules.xml
LW6_TEAM_PROFILE_MAGENTA_WEAPON_ALTERNATE_ID: Map rules.xml
LW6_TEAM_PROFILE_MAGENTA_WEAPON_ID: Map rules.xml
LW6_TEAM_PROFILE_MAGENTA_WEAPON_MODE: Map rules.xml
LW6_TEAM_PROFILE_ORANGE_AGGRESSIVE: Map rules.xml
LW6_TEAM_PROFILE_ORANGE_FAST: Map rules.xml
LW6_TEAM_PROFILE_ORANGE_HANDICAP: Map rules.xml
LW6_TEAM_PROFILE_ORANGE_MOBILE: Map rules.xml
LW6_TEAM_PROFILE_ORANGE_VULNERABLE: Map rules.xml
LW6_TEAM_PROFILE_ORANGE_WEAPON_ALTERNATE_ID: Map rules.xml
LW6_TEAM_PROFILE_ORANGE_WEAPON_ID: Map rules.xml
LW6_TEAM_PROFILE_ORANGE_WEAPON_MODE: Map rules.xml
LW6_TEAM_PROFILE_PINK_AGGRESSIVE: Map rules.xml
LW6_TEAM_PROFILE_PINK_FAST: Map rules.xml
LW6_TEAM_PROFILE_PINK_HANDICAP: Map rules.xml
LW6_TEAM_PROFILE_PINK_MOBILE: Map rules.xml
LW6_TEAM_PROFILE_PINK_VULNERABLE: Map rules.xml
LW6_TEAM_PROFILE_PINK_WEAPON_ALTERNATE_ID: Map rules.xml
LW6_TEAM_PROFILE_PINK_WEAPON_ID: Map rules.xml
LW6_TEAM_PROFILE_PINK_WEAPON_MODE: Map rules.xml
LW6_TEAM_PROFILE_PURPLE_AGGRESSIVE: Map rules.xml
LW6_TEAM_PROFILE_PURPLE_FAST: Map rules.xml
LW6_TEAM_PROFILE_PURPLE_HANDICAP: Map rules.xml
LW6_TEAM_PROFILE_PURPLE_MOBILE: Map rules.xml
LW6_TEAM_PROFILE_PURPLE_VULNERABLE: Map rules.xml
LW6_TEAM_PROFILE_PURPLE_WEAPON_ALTERNATE_ID: Map rules.xml
LW6_TEAM_PROFILE_PURPLE_WEAPON_ID: Map rules.xml
LW6_TEAM_PROFILE_PURPLE_WEAPON_MODE: Map rules.xml
LW6_TEAM_PROFILE_RED_AGGRESSIVE: Map rules.xml
LW6_TEAM_PROFILE_RED_FAST: Map rules.xml
LW6_TEAM_PROFILE_RED_HANDICAP: Map rules.xml
LW6_TEAM_PROFILE_RED_MOBILE: Map rules.xml
LW6_TEAM_PROFILE_RED_VULNERABLE: Map rules.xml
LW6_TEAM_PROFILE_RED_WEAPON_ALTERNATE_ID: Map rules.xml
LW6_TEAM_PROFILE_RED_WEAPON_ID: Map rules.xml
LW6_TEAM_PROFILE_RED_WEAPON_MODE: Map rules.xml
LW6_TEAM_PROFILE_YELLOW_AGGRESSIVE: Map rules.xml
LW6_TEAM_PROFILE_YELLOW_FAST: Map rules.xml
LW6_TEAM_PROFILE_YELLOW_HANDICAP: Map rules.xml
LW6_TEAM_PROFILE_YELLOW_MOBILE: Map rules.xml
LW6_TEAM_PROFILE_YELLOW_VULNERABLE: Map rules.xml
LW6_TEAM_PROFILE_YELLOW_WEAPON_ALTERNATE_ID: Map rules.xml
LW6_TEAM_PROFILE_YELLOW_WEAPON_ID: Map rules.xml
LW6_TEAM_PROFILE_YELLOW_WEAPON_MODE: Map rules.xml
lw6_test_register: libliquidwar6
lw6_test_run: libliquidwar6
LW6_TOTAL_ARMIES_SIZE: Map rules.xml
LW6_TOTAL_TIME: Map rules.xml
LW6_TRAP_ERRORS: Advanced settings
LW6_TROJAN: Advanced settings
LW6_UPSIZE_USING_BENCH_VALUE: Map hints.xml
LW6_UPSIZE_USING_FIGHTER_SCALE: Map hints.xml
LW6_USER_DIR: Path options
LW6_USE_CURSOR_TEXTURE: Map parameters
LW6_USE_DOUBLE_CLICK: Input options
LW6_USE_ESC_BUTTON: Input options
LW6_USE_HINTS_XML: Map parameters
LW6_USE_MUSIC_FILE: Map parameters
LW6_USE_RULES_XML: Map parameters
LW6_USE_STYLE_XML: Map parameters
LW6_USE_TEAMS_XML: Map parameters
LW6_USE_TEAM_PROFILES: Map rules.xml
LW6_USE_TEXTURE: Map parameters
LW6_VERTICAL_MOVE: Map rules.xml
LW6_VIEW_COLOR_AUTO: Map hints.xml
LW6_VIEW_COLOR_CURSOR_BG: Map style.xml
LW6_VIEW_COLOR_CURSOR_FG: Map style.xml
LW6_VIEW_COLOR_MAP_BG: Map style.xml
LW6_VIEW_COLOR_MAP_FG: Map style.xml
LW6_VIEW_STYLE: Map style.xml
LW6_WALL_GREASE: Map hints.xml
LW6_WATER_VOLUME: Sound options
LW6_WAVES: Map style.xml
LW6_WEAPON_CHARGE_DELAY: Map rules.xml
LW6_WEAPON_CHARGE_MAX: Map rules.xml
LW6_WEAPON_DURATION: Map rules.xml
LW6_WEAPON_TUNE_BERZERK_POWER: Map rules.xml
LW6_WEAPON_TUNE_TURBO_POWER: Map rules.xml
LW6_WIDTH: Graphics options
LW6_WINDOWED_MODE_LIMIT: Graphics options
LW6_X_POLARITY: Map rules.xml
LW6_X_WRAP: Map style.xml
LW6_Y_POLARITY: Map rules.xml
LW6_Y_WRAP: Map style.xml
LW6_ZOOM: Map style.xml
LW6_ZOOM_MAX: Map style.xml
LW6_ZOOM_MIN: Map style.xml
LW6_ZOOM_STEP: Input options
LW6_ZOOM_STICK_DELAY: Input options
LW6_Z_POLARITY: Map rules.xml

M
magic-number: Advanced settings
map-path: Path options
max-cursor-pot: Map rules.xml
max-cursor-pot-offset: Map rules.xml
max-cursor-speed: Input options
max-local-bench-value: Advanced settings
max-map-height: Map hints.xml
max-map-surface: Map hints.xml
max-map-width: Map hints.xml
max-nb-cursors: Map rules.xml
max-nb-nodes: Map rules.xml
max-nb-teams: Map rules.xml
max-network-bench-value: Advanced settings
max-round-delta: Map rules.xml
max-zone-size: Map rules.xml
medicine-power: Map rules.xml
memory-bazooka-eraser: Advanced settings
memory-bazooka-size: Advanced settings
menu-color-auto: Map hints.xml
menu-color-default-bg: Map style.xml
menu-color-default-fg: Map style.xml
menu-color-disabled-bg: Map style.xml
menu-color-disabled-fg: Map style.xml
menu-color-selected-bg: Map style.xml
menu-color-selected-fg: Map style.xml
menu-style: Map style.xml
min-map-height: Map hints.xml
min-map-surface: Map hints.xml
min-map-width: Map hints.xml
mod_brute_create_backend: mod-brute
mod_brute_get_pedigree: mod-brute
mod_brute_is_dlclose_safe: mod-brute
mod_brute_is_GPL_compatible: mod-brute
mod_caca_create_backend: mod-caca
mod_caca_get_pedigree: mod-caca
mod_caca_is_GPL_compatible: mod-caca
mod_csound_create_backend: mod-csound
mod_csound_get_pedigree: mod-csound
mod_csound_is_dlclose_safe: mod-csound
mod_csound_is_GPL_compatible: mod-csound
mod_follow_create_backend: mod-follow
mod_follow_get_pedigree: mod-follow
mod_follow_is_dlclose_safe: mod-follow
mod_follow_is_GPL_compatible: mod-follow
mod_gl1_create_backend: mod-gl1
mod_gl1_get_pedigree: mod-gl1
mod_gl1_is_GPL_compatible: mod-gl1
mod_gles2_create_backend: mod-gles2
mod_gles2_get_pedigree: mod-gles2
mod_gles2_is_GPL_compatible: mod-gles2
mod_httpd_create_backend: mod-httpd
mod_httpd_get_pedigree: mod-httpd
mod_httpd_is_dlclose_safe: mod-httpd
mod_httpd_is_GPL_compatible: mod-httpd
mod_http_create_backend: mod-http
mod_http_get_pedigree: mod-http
mod_http_is_dlclose_safe: mod-http
mod_http_is_GPL_compatible: mod-http
mod_idiot_create_backend: mod-idiot
mod_idiot_get_pedigree: mod-idiot
mod_idiot_is_dlclose_safe: mod-idiot
mod_idiot_is_GPL_compatible: mod-idiot
mod_ogg_create_backend: mod-ogg
mod_ogg_get_pedigree: mod-ogg
mod_ogg_is_dlclose_safe: mod-ogg
mod_ogg_is_GPL_compatible: mod-ogg
mod_random_create_backend: mod-random
mod_random_get_pedigree: mod-random
mod_random_is_dlclose_safe: mod-random
mod_random_is_GPL_compatible: mod-random
mod_soft_create_backend: mod-soft
mod_soft_get_pedigree: mod-soft
mod_soft_is_GPL_compatible: mod-soft
mod_tcpd_create_backend: mod-tcpd
mod_tcpd_get_pedigree: mod-tcpd
mod_tcpd_is_dlclose_safe: mod-tcpd
mod_tcpd_is_GPL_compatible: mod-tcpd
mod_tcp_create_backend: mod-tcp
mod_tcp_get_pedigree: mod-tcp
mod_tcp_is_dlclose_safe: mod-tcp
mod_tcp_is_GPL_compatible: mod-tcp
mod_udpd_create_backend: mod-udpd
mod_udpd_get_pedigree: mod-udpd
mod_udpd_is_dlclose_safe: mod-udpd
mod_udpd_is_GPL_compatible: mod-udpd
mod_udp_create_backend: mod-udp
mod_udp_get_pedigree: mod-udp
mod_udp_is_dlclose_safe: mod-udp
mod_udp_is_GPL_compatible: mod-udp
mouse-sensitivity: Input options
moves-per-round: Map rules.xml
music-dir: Path options
music-exclude: Map style.xml
music-file: Map style.xml
music-filter: Map style.xml
music-path: Path options
music-volume: Sound options

N
nb-attack-tries: Map rules.xml
nb-bots: Map teams.xml
nb-defense-tries: Map rules.xml
nb-move-tries: Map rules.xml
net-log: Advanced settings
net-per-sec: Advanced settings
network-bench-delta: Advanced settings
network-reliability: Advanced settings
node-description: Network options
node-title: Network options

O
open-relay: Advanced settings

P
password: Network options
pilot-lag: Advanced settings
pixelize: Map style.xml
player1-color: Map teams.xml
player1-control: Players options
player1-name: Players options
player1-status: Players options
player2-color: Map teams.xml
player2-control: Players options
player2-name: Players options
player2-status: Players options
player3-color: Map teams.xml
player3-control: Players options
player3-name: Players options
player3-status: Players options
player4-color: Map teams.xml
player4-control: Players options
player4-name: Players options
player4-status: Players options
public-url: Network options

R
repeat-delay: Input options
repeat-interval: Input options
resample: Map hints.xml
reset-config-on-upgrade: Advanced settings
respawn-delay: Map rules.xml
respawn-position-mode: Map rules.xml
respawn-team: Map rules.xml
round-delta: Map rules.xml
rounds-per-sec: Map rules.xml

S
screenshots-per-min: Advanced settings
shared_sdl_is_GPL_compatible: shared-sdl
side-attack-factor: Map rules.xml
side-defense-factor: Map rules.xml
single-army-size: Map rules.xml
skip-network: Network options
snd-backend: Sound options
speed: Map hints.xml
spread-mode: Map rules.xml
spread-thread: Map rules.xml
spreads-per-round: Map rules.xml
srv-backends: Network options
start-blue-x: Map rules.xml
start-blue-y: Map rules.xml
start-cyan-x: Map rules.xml
start-cyan-y: Map rules.xml
start-green-x: Map rules.xml
start-green-y: Map rules.xml
start-lightblue-x: Map rules.xml
start-lightblue-y: Map rules.xml
start-magenta-x: Map rules.xml
start-magenta-y: Map rules.xml
start-orange-x: Map rules.xml
start-orange-y: Map rules.xml
start-pink-x: Map rules.xml
start-pink-y: Map rules.xml
start-position-mode: Map rules.xml
start-purple-x: Map rules.xml
start-purple-y: Map rules.xml
start-red-x: Map rules.xml
start-red-y: Map rules.xml
start-yellow-x: Map rules.xml
start-yellow-y: Map rules.xml
system-color-auto: Map hints.xml
system-color-bg: Map style.xml
system-color-fg: Map style.xml

T
target-fps: Advanced settings
team-color-blue: Map style.xml
team-color-cyan: Map style.xml
team-color-dead: Map style.xml
team-color-green: Map style.xml
team-color-lightblue: Map style.xml
team-color-magenta: Map style.xml
team-color-orange: Map style.xml
team-color-pink: Map style.xml
team-color-purple: Map style.xml
team-color-red: Map style.xml
team-color-yellow: Map style.xml
team-profile-blue-aggressive: Map rules.xml
team-profile-blue-fast: Map rules.xml
team-profile-blue-handicap: Map rules.xml
team-profile-blue-mobile: Map rules.xml
team-profile-blue-vulnerable: Map rules.xml
team-profile-blue-weapon-alternate-id: Map rules.xml
team-profile-blue-weapon-id: Map rules.xml
team-profile-blue-weapon-mode: Map rules.xml
team-profile-cyan-aggressive: Map rules.xml
team-profile-cyan-fast: Map rules.xml
team-profile-cyan-handicap: Map rules.xml
team-profile-cyan-mobile: Map rules.xml
team-profile-cyan-vulnerable: Map rules.xml
team-profile-cyan-weapon-alternate-id: Map rules.xml
team-profile-cyan-weapon-id: Map rules.xml
team-profile-cyan-weapon-mode: Map rules.xml
team-profile-green-aggressive: Map rules.xml
team-profile-green-fast: Map rules.xml
team-profile-green-handicap: Map rules.xml
team-profile-green-mobile: Map rules.xml
team-profile-green-vulnerable: Map rules.xml
team-profile-green-weapon-alternate-id: Map rules.xml
team-profile-green-weapon-id: Map rules.xml
team-profile-green-weapon-mode: Map rules.xml
team-profile-lightblue-aggressive: Map rules.xml
team-profile-lightblue-fast: Map rules.xml
team-profile-lightblue-handicap: Map rules.xml
team-profile-lightblue-mobile: Map rules.xml
team-profile-lightblue-vulnerable: Map rules.xml
team-profile-lightblue-weapon-alternate-id: Map rules.xml
team-profile-lightblue-weapon-id: Map rules.xml
team-profile-lightblue-weapon-mode: Map rules.xml
team-profile-magenta-aggressive: Map rules.xml
team-profile-magenta-fast: Map rules.xml
team-profile-magenta-handicap: Map rules.xml
team-profile-magenta-mobile: Map rules.xml
team-profile-magenta-vulnerable: Map rules.xml
team-profile-magenta-weapon-alternate-id: Map rules.xml
team-profile-magenta-weapon-id: Map rules.xml
team-profile-magenta-weapon-mode: Map rules.xml
team-profile-orange-aggressive: Map rules.xml
team-profile-orange-fast: Map rules.xml
team-profile-orange-handicap: Map rules.xml
team-profile-orange-mobile: Map rules.xml
team-profile-orange-vulnerable: Map rules.xml
team-profile-orange-weapon-alternate-id: Map rules.xml
team-profile-orange-weapon-id: Map rules.xml
team-profile-orange-weapon-mode: Map rules.xml
team-profile-pink-aggressive: Map rules.xml
team-profile-pink-fast: Map rules.xml
team-profile-pink-handicap: Map rules.xml
team-profile-pink-mobile: Map rules.xml
team-profile-pink-vulnerable: Map rules.xml
team-profile-pink-weapon-alternate-id: Map rules.xml
team-profile-pink-weapon-id: Map rules.xml
team-profile-pink-weapon-mode: Map rules.xml
team-profile-purple-aggressive: Map rules.xml
team-profile-purple-fast: Map rules.xml
team-profile-purple-handicap: Map rules.xml
team-profile-purple-mobile: Map rules.xml
team-profile-purple-vulnerable: Map rules.xml
team-profile-purple-weapon-alternate-id: Map rules.xml
team-profile-purple-weapon-id: Map rules.xml
team-profile-purple-weapon-mode: Map rules.xml
team-profile-red-aggressive: Map rules.xml
team-profile-red-fast: Map rules.xml
team-profile-red-handicap: Map rules.xml
team-profile-red-mobile: Map rules.xml
team-profile-red-vulnerable: Map rules.xml
team-profile-red-weapon-alternate-id: Map rules.xml
team-profile-red-weapon-id: Map rules.xml
team-profile-red-weapon-mode: Map rules.xml
team-profile-yellow-aggressive: Map rules.xml
team-profile-yellow-fast: Map rules.xml
team-profile-yellow-handicap: Map rules.xml
team-profile-yellow-mobile: Map rules.xml
team-profile-yellow-vulnerable: Map rules.xml
team-profile-yellow-weapon-alternate-id: Map rules.xml
team-profile-yellow-weapon-id: Map rules.xml
team-profile-yellow-weapon-mode: Map rules.xml
total-armies-size: Map rules.xml
total-time: Map rules.xml
trap-errors: Advanced settings
trojan: Advanced settings

U
upsize-using-bench-value: Map hints.xml
upsize-using-fighter-scale: Map hints.xml
use-cursor-texture: Map parameters
use-double-click: Input options
use-esc-button: Input options
use-hints-xml: Map parameters
use-music-file: Map parameters
use-rules-xml: Map parameters
use-style-xml: Map parameters
use-team-profiles: Map rules.xml
use-teams-xml: Map parameters
use-texture: Map parameters
user-dir: Path options

V
vertical-move: Map rules.xml
view-color-auto: Map hints.xml
view-color-cursor-bg: Map style.xml
view-color-cursor-fg: Map style.xml
view-color-map-bg: Map style.xml
view-color-map-fg: Map style.xml
view-style: Map style.xml

W
wall-grease: Map hints.xml
water-volume: Sound options
waves: Map style.xml
weapon-charge-delay: Map rules.xml
weapon-charge-max: Map rules.xml
weapon-duration: Map rules.xml
weapon-tune-berzerk-power: Map rules.xml
weapon-tune-turbo-power: Map rules.xml
width: Graphics options
windowed-mode-limit: Graphics options

X
x-polarity: Map rules.xml
x-wrap: Map style.xml

Y
y-polarity: Map rules.xml
y-wrap: Map style.xml

Z
z-polarity: Map rules.xml
zoom: Map style.xml
zoom-max: Map style.xml
zoom-min: Map style.xml
zoom-step: Input options
zoom-stick-delay: Input options

Jump to:   -   _  
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   R   S   T   U   V   W   X   Y   Z  

G.3 Data types index

Jump to:   L  
Index Entry  Section

L
lw6bot_backend_s: libbot
lw6bot_data_s: libbot
lw6bot_param_s: libbot
lw6bot_seed_s: libbot
lw6cli_backend_s: libcli
lw6cli_oob_data_s: libcli
lw6cli_oob_s: libcli
lw6cnx_connection_s: libcnx
lw6cnx_packet_s: libcnx
lw6cnx_properties_s: libcnx
lw6cnx_ticket_table_s: libcnx
lw6dat_miss_s: libdat
lw6dat_warehouse_s: libdat
lw6dsp_backend_s: libdsp
lw6dsp_misc_s: libdsp
lw6dsp_param_s: libdsp
lw6dyn_dl_handle_s: libdyn
lw6gfx_backend_s: libgfx
lw6gui_button_s: libgui
lw6gui_fullscreen_modes_s: libgui
lw6gui_input_s: libgui
lw6gui_joystick_s: libgui
lw6gui_keyboard_s: libgui
lw6gui_keypress_s: libgui
lw6gui_look_s: libgui
lw6gui_menuitem_s: libgui
lw6gui_menu_s: libgui
lw6gui_mouse_pointer_s: libgui
lw6gui_mouse_s: libgui
lw6gui_move_pad_s: libgui
lw6gui_point_s: libgui
lw6gui_quad_s: libgui
lw6gui_rect_array_s: libgui
lw6gui_rect_s: libgui
lw6gui_repeat_settings_s: libgui
lw6gui_segment_s: libgui
lw6gui_smoother_s: libgui
lw6gui_triangle_s: libgui
lw6gui_video_mode_s: libgui
lw6gui_viewport_s: libgui
lw6gui_zone_s: libgui
lw6img_jpeg_s: libimg
lw6ker_cursor_control_s: libker
lw6ker_cursor_s: libker
lw6ker_fighter_s: libker
lw6ker_game_state_s: libker
lw6ker_game_struct_s: libker
lw6ker_score_array_s: libker
lw6ker_score_s: libker
lw6ldr_entry_s: libldr
lw6ldr_hints_s: libldr
lw6ldr_resampler_s: libldr
lw6ldr_use_s: libldr
lw6map_body_s: libmap
lw6map_bot_info_s: libmap
lw6map_color_couple_s: libmap
lw6map_color_set_s: libmap
lw6map_cursor_texture_layer_s: libmap
lw6map_cursor_texture_s: libmap
lw6map_layer_s: libmap
lw6map_level_s: libmap
lw6map_local_info_s: libmap
lw6map_metadata_s: libmap
lw6map_meta_layer_s: libmap
lw6map_param_s: libmap
lw6map_rules_s: libmap
lw6map_style_s: libmap
lw6map_teams_s: libmap
lw6map_texture_s: libmap
lw6mat_dmat2_t: libmat
lw6mat_dmat3_t: libmat
lw6mat_dmat4_t: libmat
lw6mat_dvec2_t: libmat
lw6mat_dvec3_t: libmat
lw6mat_dvec4_t: libmat
lw6mat_fmat2_t: libmat
lw6mat_fmat3_t: libmat
lw6mat_fmat4_t: libmat
lw6mat_fvec2_t: libmat
lw6mat_fvec3_t: libmat
lw6mat_fvec4_t: libmat
lw6mat_imat2_t: libmat
lw6mat_imat3_t: libmat
lw6mat_imat4_t: libmat
lw6mat_ivec2_t: libmat
lw6mat_ivec3_t: libmat
lw6mat_ivec4_t: libmat
lw6mat_xmat2_t: libmat
lw6mat_xmat3_t: libmat
lw6mat_xmat4_t: libmat
lw6mat_xvec2_t: libmat
lw6mat_xvec3_t: libmat
lw6mat_xvec4_t: libmat
lw6msg_meta_array_item_s: libmsg
lw6msg_meta_array_s: libmsg
lw6msg_word_s: libmsg
lw6nod_const_info_s: libnod
lw6nod_dyn_info_s: libnod
lw6nod_info_s: libnod
lw6nod_ref_info_s: libnod
lw6p2p_db_s: libp2p
lw6p2p_entry_s: libp2p
lw6p2p_node_s: libp2p
lw6pil_add_args_s: libpil
lw6pil_command_args_u: libpil
lw6pil_command_s: libpil
lw6pil_dump_args_s: libpil
lw6pil_dump_s: libpil
lw6pil_local_cursors_s: libpil
lw6pil_local_cursor_s: libpil
lw6pil_pilot_s: libpil
lw6pil_remove_args_s: libpil
lw6pil_set_args_s: libpil
lw6pil_worker_s: libpil
lw6sim_results_s: libsim
lw6snd_backend_s: libsnd
lw6srv_backend_s: libsrv
lw6srv_client_id_s: libsrv
lw6srv_listener_s: libsrv
lw6srv_oob_data_s: libsrv
lw6srv_oob_s: libsrv
lw6srv_tcp_accepter_s: libsrv
lw6srv_udp_buffer_s: libsrv
lw6sys_assoc_s: libsys
lw6sys_cache_item_s: libsys
lw6sys_cache_s: libsys
lw6sys_color_8_s: libsys
lw6sys_color_f_s: libsys
lw6sys_color_hsv_s: libsys
lw6sys_context_s: libsys
lw6sys_hash_s: libsys
lw6sys_hexa_serializer_s: libsys
lw6sys_list_r_s: libsys
lw6sys_list_s: libsys
lw6sys_module_pedigree_s: libsys
lw6sys_mutex_s: libsys
lw6sys_progress_s: libsys
lw6sys_spinlock_s: libsys
lw6sys_thread_handler_s: libsys
lw6sys_url_s: libsys
lw6sys_whd_s: libsys
lw6sys_xyz_s: libsys
lw6tsk_loader_s: libtsk
lw6vox_renderer_s: libvox

Jump to:   L