diff options
Diffstat (limited to 'src/map/script.h')
-rw-r--r-- | src/map/script.h | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/src/map/script.h b/src/map/script.h index 75a57d82b..8076ea02e 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -22,9 +22,9 @@ struct eri; **/ // TODO: Remove temporary code #define ENABLE_CASE_CHECK -#define DeprecationWarning(func, bad, good, file, line) ShowWarning("%s: use of deprecated keyword '%s' (use '%s' instead) in file '%s', line '%d'. This will be a critical error in a near future.\n", (func), (bad), (good), (file), (line)); -#define DeprecationWarning2(func, bad, good, where) ShowWarning("%s: detected possible use of wrong case in a script. Found '%s', probably meant to be '%s' (in '%s'). This will become fatal in a near future.\n", (func), (bad), (good), (where)); -#define disp_deprecation_message(func, good, p) disp_warning_message(func": use of deprecated keyword (use '"good"' instead). This will be a critical error in a near future.", (p)); +#define DeprecationWarning(func, bad, good, file, line) ShowError("%s: use of deprecated keyword '%s' (use '%s' instead) in file '%s', line '%d'.\n", (func), (bad), (good), (file), (line)); +#define DeprecationWarning2(func, bad, good, where) ShowError("%s: detected possible use of wrong case in a script. Found '%s', probably meant to be '%s' (in '%s').\n", (func), (bad), (good), (where)); +#define disp_deprecation_message(func, good, p) disp_warning_message(func": use of deprecated keyword (use '"good"' instead).", (p)); #define NUM_WHISPER_VAR 10 @@ -443,6 +443,19 @@ struct script_syntax_data { int index; // Number of the syntax used in the script }; +struct casecheck_data { + struct str_data_struct *str_data; + int str_data_size; // size of the data + int str_num; // next id to be assigned + // str_buf holds the strings themselves + char *str_buf; + int str_size; // size of the buffer + int str_pos; // next position to be assigned + int str_hash[SCRIPT_HASH_SIZE]; + const char *(*add_str) (const char* p); + void (*clear) (void); +}; + /** * Interface **/ @@ -467,12 +480,12 @@ struct script_interface { int str_num; // next id to be assigned // str_buf holds the strings themselves char *str_buf; - int str_size; // size of the buffer + size_t str_size; // size of the buffer int str_pos; // next position to be assigned int str_hash[SCRIPT_HASH_SIZE]; /* */ char *word_buf; - int word_size; + size_t word_size; /* */ unsigned short current_item_id; /* */ @@ -522,6 +535,7 @@ struct script_interface { int (*reload) (void); /* parse */ struct script_code* (*parse) (const char* src,const char* file,int line,int options); + bool (*add_builtin) (const struct script_function *buildin, bool override); void (*parse_builtin) (void); const char* (*parse_subexpr) (const char* p,int limit); const char* (*skip_space) (const char* p); @@ -580,7 +594,6 @@ struct script_interface { void (*reportsrc) (struct script_state *st); void (*reportdata) (struct script_data *data); void (*reportfunc) (struct script_state *st); - void (*disp_error_message2) (const char *mes, const char *pos, int report); void (*disp_warning_message) (const char *mes, const char *pos); void (*check_event) (struct script_state *st, const char *evt); unsigned int (*calc_hash) (const char *p); @@ -642,16 +655,9 @@ struct script_interface { int (*run_func) (struct script_state *st); const char *(*getfuncname) (struct script_state *st); // for ENABLE_CASE_CHECK - struct str_data_struct *local_casecheck_str_data; - int local_casecheck_str_data_size; // size of the data - int local_casecheck_str_num; // next id to be assigned - // str_buf holds the strings themselves - char *local_casecheck_str_buf; - int local_casecheck_str_size; // size of the buffer - int local_casecheck_str_pos; // next position to be assigned - int local_casecheck_str_hash[SCRIPT_HASH_SIZE]; - bool (*local_casecheck_add_str) (const char* p, int h); - void (*local_casecheck_clear) (void); + unsigned int (*calc_hash_ci) (const char *p); + struct casecheck_data local_casecheck; + struct casecheck_data global_casecheck; // end ENABLE_CASE_CHECK }; |