Landlord

Other Documents

Landlord library. This is the main Landlord library, containing game logic, basic rendering functionality, etc.

Landlord GTK+ Support. This provides support for GTK+ interfaces to Landlord programs. You might also want look at the Gnome API Reference.

Landlord home page. Check here for updates, etc.

General

Namespaces

Global symbols, enumeration constants and type names start "ll_". Macro names start "LL_". Library names start "liblandlord". Header files all match "<landlord/*.h>"

Interface Stability

This is a work in progress. Library interfaces may change at any moment, WITHOUT a corresponding change in version information. Only when a 1.0 release is made will library versions become trustworthy. Until then use static linking if this is a problem for you.

Error Handling

Memory allocation errors inside the library always cause the program to terminate. The best way to prevent lost games is to save regularly (and automatically). Errors finding important things like image files have the same effect.

Other errors are reported by returning a value from enum ll_error_code. Note that some of these errors have an associated errno value.

Error handling in display libraries will tend to depend on the GUI library they use.


How To Use Landlord

The right way to use Landlord is to write the game logic as separately as possible from any user interface questions. Avoiding including <landlord/gtksupport.h> (or any other display interface header) in any file that implements game logic is a reasonable way to achieve this.

In effect, you will be writing a subclass of struct ll_game.

The connection between the game and the display should be made in main or similar.

XXX example


Known Bugs

I18N

A number of functions are documented as returning localized versions of some string or other. In fact, currently they always return the English version. I18N in general is missing.

Thread-Safety

ll_get_error_string is not thread-safe at the moment in that it uses a static array for some messages.


Copyright © 2002 Richard Kettlewell

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA