aboutsummaryrefslogtreecommitdiff
path: root/grid.h
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2023-01-11 23:11:46 +0000
committerBen Harris <bjh21@bjh21.me.uk>2023-01-15 16:24:27 +0000
commitd71bba1a17d6b228e7dd8b437dccbd3f6bc4698c (patch)
tree0d4f0eced96f0947d00f57b6291b019b7b9034de /grid.h
parentfcda12f4b73e69841fd8957b8e33930c584093e5 (diff)
downloadpuzzles-d71bba1a17d6b228e7dd8b437dccbd3f6bc4698c.zip
puzzles-d71bba1a17d6b228e7dd8b437dccbd3f6bc4698c.tar.gz
puzzles-d71bba1a17d6b228e7dd8b437dccbd3f6bc4698c.tar.bz2
puzzles-d71bba1a17d6b228e7dd8b437dccbd3f6bc4698c.tar.xz
Limit maximum grid size in Loopy
Every grid shape has its own limit, so this involved adding a new interface between loopy.c and grid.c. The limits are based on ensuring that the co-ordinate system of the grid doesn't overflow INT_MAX and neither do the lengths of the face and dot arrays. Though now I come to look at it I think the actual limits of grid.c are much lower. Hmm.
Diffstat (limited to 'grid.h')
-rw-r--r--grid.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/grid.h b/grid.h
index 57c739d..69108d4 100644
--- a/grid.h
+++ b/grid.h
@@ -115,6 +115,8 @@ typedef struct grid {
typedef enum grid_type { GRIDGEN_LIST(ENUM) GRID_TYPE_MAX } grid_type;
#undef ENUM
+const char *grid_validate_params(grid_type type, int width, int height);
+
/* Free directly after use if non-NULL. Will never contain an underscore
* (so clients can safely use that as a separator). */
char *grid_new_desc(grid_type type, int width, int height, random_state *rs);