From 09aa8de52cb962f1ceebfb1fd44f2c54a924fc5c Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Mon, 22 Jul 2024 21:43:25 -0400 Subject: puzzles: resync with upstream This brings the puzzles source in sync with Simon's branch, commit fd304c5 (from March 2024), with some added Rockbox-specific compatibility changes: https://www.franklinwei.com/git/puzzles/commit/?h=rockbox-devel&id=516830d9d76bdfe64fe5ccf2a9b59c33f5c7c078 There are quite a lot of backend changes, including a new "Mosaic" puzzle. In addition, some new frontend changes were necessary: - New "Preferences" menu to access the user preferences system. - Enabled spacebar input for several games. Change-Id: I94c7df674089c92f32d5f07025f6a1059068af1e --- apps/plugins/puzzles/src/tree234.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'apps/plugins/puzzles/src/tree234.h') diff --git a/apps/plugins/puzzles/src/tree234.h b/apps/plugins/puzzles/src/tree234.h index ccd943d69d..b58f939a0a 100644 --- a/apps/plugins/puzzles/src/tree234.h +++ b/apps/plugins/puzzles/src/tree234.h @@ -31,7 +31,11 @@ #include /* - * This typedef is opaque outside tree234.c itself. + * This typedef is typically opaque outside tree234.c itself. But you + * can define TREE234_INTERNALS to get a definition of it and its + * subsidiary node structure, as long as you're prepared to commit to + * responding to changes in the internals (which probably means you're + * tree234.c itself or tree234-test.c). */ typedef struct tree234_Tag tree234; @@ -39,6 +43,24 @@ typedef int (*cmpfn234)(void *, void *); typedef void *(*copyfn234)(void *state, void *element); +#ifdef TREE234_INTERNALS +typedef struct node234_Tag node234; + +struct tree234_Tag { + node234 *root; + cmpfn234 cmp; +}; + +struct node234_Tag { + node234 *parent; + node234 *kids[4]; + int counts[4]; + void *elems[3]; +}; + +int height234(tree234 *t); +#endif + /* * Create a 2-3-4 tree. If `cmp' is NULL, the tree is unsorted, and * lookups by key will fail: you can only look things up by numeric -- cgit v1.2.3