|
Namespaces |
namespace | Xconq |
Classes |
struct | a_packed_bool_table |
| Table of Packed Booleans. More...
|
struct | a_library_path |
| Library path. More...
|
Defines |
#define | TRUE (1) |
#define | FALSE (0) |
#define | CONST const |
| const definiton.
|
#define | ABS(x) (((x) < 0) ? (0 - (x)) : (x)) |
| Absolute value.
|
#define | min(x, y) (((x) < (y)) ? (x) : (y)) |
| Minimum value.
|
#define | max(x, y) (((x) > (y)) ? (x) : (y)) |
| Maximum value.
|
#define | between(lo, n, hi) ((lo) <= (n) && (n) <= (hi)) |
| Is between.
|
#define | limitn(lo, n, hi) |
| Limit value.
|
#define | flip_coin() (xrandom(257) % 2) |
| Random true/false.
|
#define | avg(a, b) (((a) + (b)) / 2) |
| Average.
|
#define | dice1(N, NUMDICE, SPOTS, OFFSET) |
| Decompose dice representation into Type 1 dice parts.
|
#define | dice2(N, NUMDICE, SPOTS, OFFSET) |
| Decompose dice representation into Type 2 dice parts.
|
#define | normalize_on_pmscale(n, max, range) ((max) ? (((n) * (range)) / (max)) : 0) |
| Normalize a number on a scale between -range and +range.
|
#define | isspace(c) ((c) == ' ' || (c) == '\n' || (c) == '\t' || (c) == '\r') |
| Is space.
|
#define | lowercase(c) (isupper(c) ? tolower(c) : (c)) |
#define | uppercase(c) (islower(c) ? toupper(c) : (c)) |
#define | empty_string(s) ((s) == NULL || s[0] == '\0') |
| Is string empty.
|
#define | get_packed_bool(tbl, m, n) (((tbl)->pbools[((tbl)->whichway ? (m) : (n)) * (tbl)->rdim1size + ((tbl)->whichway ? (n) : (m)) / (tbl)->sizeofint] & (1 << ((tbl)->whichway ? (n) : (m)) % (tbl)->sizeofint)) ? TRUE : FALSE) |
| Get a boolean value from a table of packed booleans.
|
#define | set_packed_bool(tbl, m, n, boolval) ((boolval) ? ((tbl)->pbools[((tbl)->whichway ? (m) : (n)) * (tbl)->rdim1size + ((tbl)->whichway ? (n) : (m)) / (tbl)->sizeofint] |= (1 << ((tbl)->whichway ? (n) : (m)) % (tbl)->sizeofint)) : ((tbl)->pbools[((tbl)->whichway ? (m) : (n)) * (tbl)->rdim1size + ((tbl)->whichway ? (n) : (m)) / (tbl)->sizeofint] &= ~(1 << ((tbl)->whichway ? (n) : (m)) % (tbl)->sizeofint))) |
| Set a boolean value in a table of packed booleans.
|
#define | valid_packed_bool_table(tbl) (((tbl) != NULL) && ((tbl)->pbools != NULL) && ((tbl)->sizeofint > 0) && ((tbl)->rdim1size >= 0) && ((tbl)->dim2size > 0)) |
| Validate a supposed table of packed booleans.
|
#define | assert_warning(cond, msg) { assert(cond); if (!(cond)) run_warning(msg); } |
#define | assert_warning_break(cond, msg) { assert(cond); if (!(cond)) { run_warning(msg); break; } } |
#define | assert_warning_continue(cond, msg) { assert(cond); if (!(cond)) { run_warning(msg); continue; } } |
#define | assert_warning_goto(cond, msg, label) { assert(cond); if (!(cond)) { run_warning(msg); goto label; } } |
#define | assert_warning_return(cond, msg, retval) { assert(cond); if (!(cond)) { run_warning(msg); return retval; } } |
#define | assert_error(cond, msg) { assert(cond); if (!(cond)) run_error(msg); } |
#define | assert_break(cond) { assert(cond); if (!(cond)) break; } |
#define | assert_continue(cond) { assert(cond); if (!(cond)) continue; } |
#define | assert_goto(cond, label) { assert(cond); if (!(cond)) goto label; } |
#define | assert_return(cond, retval) { assert(cond); if (!(cond)) return retval; } |
#define | Dprintf if (0) debug_printf |
#define | DMprintf if (0) debugm_printf |
#define | DGprintf if (0) debugg_printf |
#define | Dprintlisp(X) |
#define | DMprintlisp(X) |
#define | DGprintlisp(X) |
#define | Debug (0) |
#define | DebugM (0) |
#define | DebugG (0) |
#define | dfp stdout |
#define | dmfp stdout |
#define | dgfp stdout |
#define | for_all_library_paths(p) for (p = xconq_libs; p != NULL; p = p->next) |
| Iterate library paths.
|
Typedefs |
typedef a_packed_bool_table | PackedBoolTable |
| Table of Packed Booleans.
|
typedef a_library_path | LibraryPath |
| Library path.
|
Functions |
PackedBoolTable * | create_packed_bool_table (int m, int n) |
| Prototypes of functions used in the packed boolean implementation.
|
void | init_packed_bool_table (PackedBoolTable *tbl) |
void | destroy_packed_bool_table (PackedBoolTable *tbl) |
void | init_xrandom (int seed) |
int | xrandom (int m) |
int | probability (int prob) |
int | prob_fraction (int n) |
void * | xmalloc (int amt) |
void | report_malloc (void) |
void | tprintf (char *buf, char *str,...) |
void | tnprintf (char *buf, int n, char *str,...) |
int | select_by_weight (int *arr, int numvals) |
char * | copy_string (char *str) |
char * | pad_blanks (char *str, int n) |
int | iindex (int ch, char *str) |
long | idifftime (time_t t1, time_t t0) |
void | case_panic (char *str, int var) |
int | isqrt (int i) |
void | init_debug_to_stdout (void) |
void | update_debugging (void) |
void | toggle_debugging (int *flagp) |
void | debug_printf (char *str,...) |
void | debugm_printf (char *str,...) |
void | debugg_printf (char *str,...) |
void | prealloc_debug (void) |
void | record_activity_start (char *type, int detail) |
void | record_activity_end (char *type, int detail) |
void | dump_activity_trace (void) |
void | vtprintf (char *buf, char *str, va_list ap) |
void | log_warning (char *typ, char *str) |
int | write_entire_game_state (char *fname) |
char * | find_name (char *fname) |
FILE * | open_file (char *filename, char *mode) |
void | save_game (char *fname) |
void | close_displays (void) |
Variables |
char | spbuf [] |
| ???
|
char | tmpbuf [] |
| ???
|
LibraryPath * | xconq_libs |
| Library path list.
|
LibraryPath * | last_user_xconq_lib |
| Last user library.
|
This file contains miscellaneous macro and constant definitions.