chiark / gitweb /
changelog: document last change
[sgt-puzzles.git] / list.c
diff --git a/list.c b/list.c
index 5883a9a8cd46e082b42dcbb554e5c4961a5eca3c..ec019c31b2b75b7b18226717915612f37c4c1346 100644 (file)
--- a/list.c
+++ b/list.c
@@ -1,52 +1,55 @@
 /*
- * list.c: List of puzzles.
+ * list.c: List of pointers to puzzle structures, for monolithic
+ * platforms.
+ *
+ * This file is automatically generated by mkfiles.pl. Do not edit
+ * it directly, or the changes will be lost next time mkfiles.pl runs.
+ * Instead, edit Recipe and/or its *.R subfiles.
  */
-
 #include "puzzles.h"
+#define GAMELIST(A) \
+    A(blackbox) \
+    A(bridges) \
+    A(cube) \
+    A(dominosa) \
+    A(fifteen) \
+    A(filling) \
+    A(flip) \
+    A(flood) \
+    A(galaxies) \
+    A(guess) \
+    A(inertia) \
+    A(keen) \
+    A(lightup) \
+    A(loopy) \
+    A(magnets) \
+    A(map) \
+    A(mines) \
+    A(net) \
+    A(netslide) \
+    A(palisade) \
+    A(pattern) \
+    A(pearl) \
+    A(pegs) \
+    A(range) \
+    A(rect) \
+    A(samegame) \
+    A(signpost) \
+    A(singles) \
+    A(sixteen) \
+    A(slant) \
+    A(solo) \
+    A(tents) \
+    A(towers) \
+    A(tracks) \
+    A(twiddle) \
+    A(undead) \
+    A(unequal) \
+    A(unruly) \
+    A(untangle) \
 
-/*
- * The available games can be most easily enumerated by searching
- * for the line in each game source file saying "#define thegame
- * <gamename>". Hence, the following piece of shell/Perl should
- * regenerate this list automatically:
-
-perl -ne '/^#define thegame (\S+)/ and $1 ne "nullgame" and print "extern const game $1;\n"' *.c
-echo -e '\nconst game *gamelist[] = {'
-perl -ne '/^#define thegame (\S+)/ and $1 ne "nullgame" and print "    &$1,\n"' *.c
-echo -e '};\n\nconst int gamecount = lenof(gamelist);'
-
- */
-
-extern const game cube;
-extern const game fifteen;
-extern const game flip;
-extern const game guess;
-extern const game mines;
-extern const game net;
-extern const game netslide;
-extern const game pattern;
-extern const game pegs;
-extern const game rect;
-extern const game samegame;
-extern const game sixteen;
-extern const game solo;
-extern const game twiddle;
-
-const game *gamelist[] = {
-    &cube,
-    &fifteen,
-    &flip,
-    &guess,
-    &mines,
-    &net,
-    &netslide,
-    &pattern,
-    &pegs,
-    &rect,
-    &samegame,
-    &sixteen,
-    &solo,
-    &twiddle,
-};
-
+#define DECL(x) extern const game x;
+#define REF(x) &x,
+GAMELIST(DECL)
+const game *gamelist[] = { GAMELIST(REF) };
 const int gamecount = lenof(gamelist);