| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#include "scare.h" |
| 21 |
|
| 22 |
#ifndef SCAREEXT_PROTOTYPES_H |
| 23 |
#define SCAREEXT_PROTOTYPES_H |
| 24 |
|
| 25 |
|
| 26 |
#ifndef FALSE |
| 27 |
# define FALSE 0 |
| 28 |
#endif |
| 29 |
#ifndef TRUE |
| 30 |
# define TRUE (!FALSE) |
| 31 |
#endif |
| 32 |
|
| 33 |
|
| 34 |
typedef FILE *sx_script; |
| 35 |
|
| 36 |
|
| 37 |
typedef struct sx_test_descriptor_s |
| 38 |
{ |
| 39 |
const sc_char *name; |
| 40 |
sc_game game; |
| 41 |
sx_script script; |
| 42 |
} sx_test_descriptor_t; |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) |
| 50 |
extern void sx_trace (const sc_char *format, ...) |
| 51 |
__attribute__ ((__format__ (__printf__, 1, 2))); |
| 52 |
extern void sx_error (const sc_char *format, ...) |
| 53 |
__attribute__ ((__format__ (__printf__, 1, 2))); |
| 54 |
extern void sx_fatal (const sc_char *format, ...) |
| 55 |
__attribute__ ((__format__ (__printf__, 1, 2))); |
| 56 |
#else |
| 57 |
extern void sx_trace (const sc_char *format, ...); |
| 58 |
extern void sx_error (const sc_char *format, ...); |
| 59 |
extern void sx_fatal (const sc_char *format, ...); |
| 60 |
#endif |
| 61 |
extern void *sx_malloc (size_t size); |
| 62 |
extern void *sx_realloc (void *pointer, size_t size); |
| 63 |
extern void sx_free (void *pointer); |
| 64 |
extern FILE *sx_fopen (const sc_char *name, |
| 65 |
const sc_char *extension, const sc_char *mode); |
| 66 |
extern sc_char *sx_trim_string (sc_char *string); |
| 67 |
extern sc_char *sx_normalize_string (sc_char *string); |
| 68 |
|
| 69 |
|
| 70 |
extern void stub_attach_handlers (sc_bool (*read_line) (sc_char *, sc_int), |
| 71 |
void (*print_string) (const sc_char *), |
| 72 |
void *(*open_file) (sc_bool), |
| 73 |
sc_int (*read_file) |
| 74 |
(void*, sc_byte*, sc_int), |
| 75 |
void (*write_file) |
| 76 |
(void*, const sc_byte*, sc_int), |
| 77 |
void (*close_file) (void*)); |
| 78 |
extern void stub_detach_handlers (void); |
| 79 |
extern void stub_debug_trace (sc_bool flag); |
| 80 |
|
| 81 |
|
| 82 |
extern sc_int test_run_game_tests (const sx_test_descriptor_t tests[], |
| 83 |
sc_int count, sc_bool is_verbose); |
| 84 |
|
| 85 |
|
| 86 |
extern sc_bool glob_match (const sc_char *pattern, const sc_char *string); |
| 87 |
|
| 88 |
|
| 89 |
extern void scr_test_failed (const sc_char *format, const sc_char *string); |
| 90 |
extern void scr_set_verbose (sc_bool flag); |
| 91 |
extern void scr_start_script (sc_game game, FILE *script); |
| 92 |
extern sc_int scr_finalize_script (void); |
| 93 |
|
| 94 |
|
| 95 |
extern void *file_open_file_callback (sc_bool is_save); |
| 96 |
extern sc_int file_read_file_callback (void *opaque, |
| 97 |
sc_byte *buffer, sc_int length); |
| 98 |
extern void file_write_file_callback (void *opaque, |
| 99 |
const sc_byte *buffer, sc_int length); |
| 100 |
extern void file_close_file_callback (void *opaque); |
| 101 |
extern void file_cleanup (void); |
| 102 |
|
| 103 |
#endif |