summaryrefslogtreecommitdiff
path: root/src/map/script.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/script.h')
-rw-r--r--src/map/script.h30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/map/script.h b/src/map/script.h
index aace388ff..4d2c59d92 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -22,8 +22,8 @@ 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'.\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 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];
+ bool (*add_str) (const char* p);
+ void (*clear) (void);
+};
+
/**
* Interface
**/
@@ -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
};