From 6b9e690c89973e8e98de7dfc768849f0b8b411a0 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 30 May 2005 10:08:27 +0000 Subject: Initial checkin of my Minesweeper clone, which uses a solver during grid generation to arrange a mine layout that never requires guessing. [originally from svn r5859] --- puzzles.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'puzzles.h') diff --git a/puzzles.h b/puzzles.h index 1dbe130..d2a22a5 100644 --- a/puzzles.h +++ b/puzzles.h @@ -176,6 +176,18 @@ random_state *random_init(char *seed, int len); unsigned long random_bits(random_state *state, int bits); unsigned long random_upto(random_state *state, unsigned long limit); void random_free(random_state *state); +/* random.c also exports SHA, which occasionally comes in useful. */ +typedef unsigned long uint32; +typedef struct { + uint32 h[5]; + unsigned char block[64]; + int blkused; + uint32 lenhi, lenlo; +} SHA_State; +void SHA_Init(SHA_State *s); +void SHA_Bytes(SHA_State *s, void *p, int len); +void SHA_Final(SHA_State *s, unsigned char *output); +void SHA_Simple(void *p, int len, unsigned char *output); /* * Data structure containing the function calls and data specific -- cgit v1.1