Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2004:
[Freeciv-Dev] (PR#8239) Speclist generator
Home

[Freeciv-Dev] (PR#8239) Speclist generator

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#8239) Speclist generator
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sat, 20 Mar 2004 12:51:22 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8239 >

To overcome some limitations in the specfile system, I've made a python
generator to create speclist header files. It is small and simple, and
from a lists.def file in each relevant directory, creates a named header
file which contains all the speclists listed in lists.def. They are
all inlined, so no .c file is needed.

The reason I choose to make this patch is because I am reusing some
freeciv code in another project, which has a lot more genlists than
freeciv, and when you use many speclists in a file, it looks outright
ghastly and has big chance of containing errors; and because my new
genlist patch wants to have a speclisted macro, but currently speclists
can be neither inline nor macro.

Benefits for freeciv? It looks nicer (specfile includes are ugly). It is
shorter (just one include and you're done). They are inlined (tiny bit
faster). We can use highly useful __LINE__ and __FILE__ macros with
speclist functions (used by my new genlist patch for eg). No lingering
errors from forgetting to update parts of the cut'n'paste speclist glue.

The patch contains a removal of speclist_c.h and speclist.h and fixes for
compiling the gtk2 client, but not the other clients. Almost all the patch
is from me having run sed on some gtk2 files to avoid list name collisions
(several files contained dialog_list lists).

  - Per

Attachment: genpy.tar.gz
Description: application/gunzip


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#8239) Speclist generator, Per I. Mathisen <=