3 #ifndef INCLUDED_Z_UTIL_H
4 #define INCLUDED_Z_UTIL_H
10 * Extremely basic stuff, like global temp and constant variables.
11 * Also, some very useful low level functions, such as "streq()".
12 * All variables and functions in this file are "addressable".
16 /**** Available variables ****/
27 /* Temporary Pointers */
32 /* Constant pointers (NULL) */
33 extern cptr cptr_null;
34 extern vptr vptr_null;
37 /* A bizarre vptr that always points at itself */
38 extern vptr vptr_self;
41 /* A cptr to the name of the program */
46 extern void (*plog_aux)(cptr);
47 extern void (*quit_aux)(cptr);
48 extern void (*core_aux)(cptr);
51 /**** Available Functions ****/
53 /* Function that does nothing */
54 extern void func_nothing(void);
56 /* Functions that return basic "errr" codes */
57 extern errr func_success(void);
58 extern errr func_problem(void);
59 extern errr func_failure(void);
61 /* Functions that return bools */
62 extern bool func_true(void);
63 extern bool func_false(void);
66 /* Test equality, prefix, suffix */
67 extern bool streq(cptr s, cptr t);
68 extern bool prefix(cptr s, cptr t);
69 extern bool suffix(cptr s, cptr t);
72 /* Print an error message */
73 extern void plog(cptr str);
75 /* Exit, with optional message */
76 extern void quit(cptr str);
78 /* Dump core, with optional message */
79 extern void core(cptr str);