summaryrefslogtreecommitdiff
path: root/src/map/script.h
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-27 21:00:19 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-27 21:00:19 +0000
commit6384f1dd85e311f1456351388f9a94a32ac1fad4 (patch)
tree19209d56704842750a50114e386b8e5490df73ca /src/map/script.h
parent3e29ca7edd4e8618fa24e6a2c65e35a3baeddad8 (diff)
downloadhercules-6384f1dd85e311f1456351388f9a94a32ac1fad4.tar.gz
hercules-6384f1dd85e311f1456351388f9a94a32ac1fad4.tar.bz2
hercules-6384f1dd85e311f1456351388f9a94a32ac1fad4.tar.xz
hercules-6384f1dd85e311f1456351388f9a94a32ac1fad4.zip
- Synced the script.c file with as much data as possible from jA's:
- A lot of functions were moved around, a bunch of indentation and space-usage changes were done to make it easier to diff against their files. - Miscellanous addition and corrections were applied. - Largest one is likely a restructuring of run_script_main, which hopes to solve the memory leaks. - script engine now uses the setjmp functions to restore memory state when there's an error parsing scripts, which means that script errors won't cause the map-server to inmediately bail out anymore. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7926 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.h')
-rw-r--r--src/map/script.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/map/script.h b/src/map/script.h
index 85ddc2d6a..8ce446212 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -45,26 +45,24 @@ struct script_code {
unsigned char* script_buf;
struct linkdb_node* script_vars;
};
-struct script_stack {
- int sp,sp_max,defsp;
- struct script_data *stack_data;
- struct linkdb_node **var_function; // 関数依存変数
-};
+
struct script_state {
- struct script_stack *stack;
+ struct script_stack {
+ int sp,sp_max,defsp;
+ struct script_data *stack_data;
+ struct linkdb_node **var_function; // 関数依存変数
+ } *stack;
int start,end;
int pos,state;
int rid,oid;
- //unsigned char *script,*new_script;
- int new_pos,new_defsp;
struct script_code *script, *scriptroot;
struct sleep_data {
int tick,timer,charid;
} sleep;
};
-struct script_code *parse_script(unsigned char *,int);
-void run_script(struct script_code *rootscript,int pos,int rid,int oid);
+struct script_code* parse_script(unsigned char *,const char*,int);
+void run_script(struct script_code*,int,int,int);
int set_var(struct map_session_data *sd, char *name, void *val);
int conv_num(struct script_state *st,struct script_data *data);
@@ -74,13 +72,13 @@ int run_script_timer(int tid, unsigned int tick, int id, int data);
void run_script_main(struct script_state *st);
struct linkdb_node* script_erase_sleepdb(struct linkdb_node *n);
+void script_free_stack(struct script_stack*);
void script_free_code(struct script_code* code);
struct dbt* script_get_label_db(void);
struct dbt* script_get_userfunc_db(void);
int script_config_read(char *cfgName);
-void script_free_stack(struct script_stack*);
int do_init_script(void);
int do_final_script(void);
int add_str(const unsigned char *p);