-/* Lines that have particular relationships with given dots or squares */
-#define ABOVE_SQUARE(state, i, j) ((state)->hl[(i) + (state)->w * (j)])
-#define BELOW_SQUARE(state, i, j) ABOVE_SQUARE(state, i, (j)+1)
-#define LEFTOF_SQUARE(state, i, j) ((state)->vl[(i) + ((state)->w + 1) * (j)])
-#define RIGHTOF_SQUARE(state, i, j) LEFTOF_SQUARE(state, (i)+1, j)
-
-/*
- * These macros return rvalues only, but can cope with being passed
- * out-of-range coordinates.
- */
-/* XXX replace these with functions so we can create an array of function
- * pointers for nicer iteration over them. This could probably be done with
- * loads of other things for eliminating many nasty hacks. */
-#define ABOVE_DOT(state, i, j) ((!LEGAL_DOT(state, i, j) || j <= 0) ? \
- LINE_NO : LV_ABOVE_DOT(state, i, j))
-#define BELOW_DOT(state, i, j) ((!LEGAL_DOT(state, i, j) || j >= (state)->h) ? \
- LINE_NO : LV_BELOW_DOT(state, i, j))
-
-#define LEFTOF_DOT(state, i, j) ((!LEGAL_DOT(state, i, j) || i <= 0) ? \
- LINE_NO : LV_LEFTOF_DOT(state, i, j))
-#define RIGHTOF_DOT(state, i, j) ((!LEGAL_DOT(state, i, j) || i >= (state)->w)? \
- LINE_NO : LV_RIGHTOF_DOT(state, i, j))
-
-/*
- * These macros expect to be passed valid coordinates, and return
- * lvalues.
- */
-#define LV_BELOW_DOT(state, i, j) ((state)->vl[VL_INDEX(state, i, j)])
-#define LV_ABOVE_DOT(state, i, j) LV_BELOW_DOT(state, i, (j)-1)
-
-#define LV_RIGHTOF_DOT(state, i, j) ((state)->hl[HL_INDEX(state, i, j)])
-#define LV_LEFTOF_DOT(state, i, j) LV_RIGHTOF_DOT(state, (i)-1, j)
-
-/* Counts of interesting things */
-#define DOT_YES_COUNT(sstate, i, j) \
- ((sstate)->dot_yescount[DOT_INDEX((sstate)->state, i, j)])
-
-#define DOT_NO_COUNT(sstate, i, j) \
- ((sstate)->dot_nocount[DOT_INDEX((sstate)->state, i, j)])
-
-#define SQUARE_YES_COUNT(sstate, i, j) \
- ((sstate)->square_yescount[SQUARE_INDEX((sstate)->state, i, j)])
-
-#define SQUARE_NO_COUNT(sstate, i, j) \
- ((sstate)->square_nocount[SQUARE_INDEX((sstate)->state, i, j)])
-
-/* Iterators. NB these iterate over height more slowly than over width so that
- * the elements come out in 'reading' order */
-/* XXX considering adding a 'current' element to each of these which gets the
- * address of the current dot, say. But expecting we'd need more than that
- * most of the time. */
-#define FORALL(i, j, w, h) \
- for ((j) = 0; (j) < (h); ++(j)) \
- for ((i) = 0; (i) < (w); ++(i))
-
-#define FORALL_DOTS(state, i, j) \
- FORALL(i, j, (state)->w + 1, (state)->h + 1)
-
-#define FORALL_SQUARES(state, i, j) \
- FORALL(i, j, (state)->w, (state)->h)
-
-#define FORALL_HL(state, i, j) \
- FORALL(i, j, (state)->w, (state)->h+1)
-
-#define FORALL_VL(state, i, j) \
- FORALL(i, j, (state)->w+1, (state)->h)
-