1 /*
2   Page
3   Handle paging of the story to and from disk
4   JBS 15 June 1994
5 */
6 
7 #ifndef _PAGE_
8 
9 #define _PAGE_
10 
11 #include "config.h"
12 #include "types.h"
13 
14 extern byte *base_ptr;          /* Points to the first page */
15 
16 int pg_head(void);              /* Load in the first page */
17 int pg_init(word, word);        /* Load in the rest       */
18 
19 byte *pg_fetch(word); /* Give a pointer to the start of the page */
20 
21 /*
22   General utilities for converting between addresses
23   and page/offset pairs
24 */
25 
26 #include "mem.h"
27 
28 #define pg_page(a)              (word) ((a) >> BLOCK_SHIFT)
29 #define pg_offset(a)            (word) ((a) & (BLOCK_SIZE - 1))
30 #define pg_blocks(a)            pg_page((a) + BLOCK_SIZE - 1)
31 
32 void pg_save_undo(void);
33 void pg_restore_undo(void);
34 
35 #endif
36