summaryrefslogtreecommitdiff
path: root/src/map/script.h
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-22 12:15:49 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-22 12:15:49 +0000
commitde7175c5bc24b6e8f3b87540ae93f40a75df2df2 (patch)
tree4517d2916188504401ad86868e641edb35b40617 /src/map/script.h
parentd0565d61b91c9784717e756c72b871099175408b (diff)
downloadhercules-de7175c5bc24b6e8f3b87540ae93f40a75df2df2.tar.gz
hercules-de7175c5bc24b6e8f3b87540ae93f40a75df2df2.tar.bz2
hercules-de7175c5bc24b6e8f3b87540ae93f40a75df2df2.tar.xz
hercules-de7175c5bc24b6e8f3b87540ae93f40a75df2df2.zip
* WARNING: New scripting system contains memory leak
TODO: Free all scripts using script_free_code() instead of old methods. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6690 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.h')
-rw-r--r--src/map/script.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/map/script.h b/src/map/script.h
index 61803da89..109ab7690 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -35,30 +35,45 @@ struct script_data {
int num;
char *str;
} u;
+ struct linkdb_node** ref; // リファレンス
};
// Moved defsp from script_state to script_stack since
// it must be saved when script state is RERUNLINE. [Eoe / jA 1094]
+struct script_code {
+ int script_size;
+ 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;
int start,end;
int pos,state;
int rid,oid;
- unsigned char *script,*new_script;
+ //unsigned char *script,*new_script;
int new_pos,new_defsp;
+ struct script_code *script, *scriptroot;
+ struct sleep_data {
+ int tick,timer,charid;
+ } sleep;
};
-unsigned char * parse_script(unsigned char *,int);
-int run_script(unsigned char *,int,int,int);
+struct script_code *parse_script(unsigned char *,int);
+int run_script(struct script_code *rootscript,int pos,int rid,int oid);
int set_var(struct map_session_data *sd, char *name, void *val);
int conv_num(struct script_state *st,struct script_data *data);
char* conv_str(struct script_state *st,struct script_data *data);
void setd_sub(struct map_session_data *sd, char *varname, int elem, void *value);
+int run_script_timer(int tid, unsigned int tick, int id, int data);
+int run_script_main(struct script_state *st);
+struct linkdb_node* script_erase_sleepdb(struct linkdb_node *n);
+void script_free_code(struct script_code* code);
struct dbt* script_get_label_db(void);
struct dbt* script_get_userfunc_db(void);