aboutsummaryrefslogtreecommitdiff
path: root/nullfe.c
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2023-01-07 18:54:26 +0000
committerBen Harris <bjh21@bjh21.me.uk>2023-01-12 21:43:09 +0000
commit332873db834d641f4a28a5452cd7d32c373902a7 (patch)
treead5b7a3caf8139fec85b347b1dbf65241a055c8b /nullfe.c
parente66d027a81211d327319cf45bb4155e689513f72 (diff)
downloadpuzzles-332873db834d641f4a28a5452cd7d32c373902a7.zip
puzzles-332873db834d641f4a28a5452cd7d32c373902a7.tar.gz
puzzles-332873db834d641f4a28a5452cd7d32c373902a7.tar.bz2
puzzles-332873db834d641f4a28a5452cd7d32c373902a7.tar.xz
Add more functions to nullfe.c
The null get_random_seed required a little care. It's not OK for it to return NULL and zero because NULL isn't a valid argument to memcpy() even with a length of zero (thank you UBSan). So we return a single zero byte instead.
Diffstat (limited to 'nullfe.c')
-rw-r--r--nullfe.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/nullfe.c b/nullfe.c
index f55aec7..ee8b4ec 100644
--- a/nullfe.c
+++ b/nullfe.c
@@ -9,6 +9,13 @@
#include "puzzles.h"
void frontend_default_colour(frontend *fe, float *output) {}
+void get_random_seed(void **randseed, int *randseedsize)
+{ char *c = snewn(1, char); *c = 0; *randseed = c; *randseedsize = 1; }
+void deactivate_timer(frontend *fe) {}
+void activate_timer(frontend *fe) {}
+drawing *drawing_new(const drawing_api *api, midend *me, void *handle)
+{ return NULL; }
+void drawing_free(drawing *dr) {}
void draw_text(drawing *dr, int x, int y, int fonttype, int fontsize,
int align, int colour, const char *text) {}
void draw_rect(drawing *dr, int x, int y, int w, int h, int colour) {}
@@ -49,6 +56,8 @@ struct preset_menu *preset_menu_add_submenu(struct preset_menu *parent,
char *title) {return NULL;}
void preset_menu_add_preset(struct preset_menu *parent,
char *title, game_params *params) {}
+void document_add_puzzle(document *doc, const game *game, game_params *par,
+ game_state *st, game_state *st2) {}
void fatal(const char *fmt, ...)
{