From 41974ae5265fbc23a06f276f9e008d5dad020e0b Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 30 Aug 2012 16:16:25 -0700 Subject: Rename files for C++ conversion. Does not compile. After updating, you can remove these files, as shown in 'git status': Untracked files: (use "git add ..." to include in what will be committed) src/map/magic-interpreter-lexer.c src/map/magic-interpreter-parser.c src/map/magic-interpreter-parser.h --- src/map/magic-expr-eval.hpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/map/magic-expr-eval.hpp (limited to 'src/map/magic-expr-eval.hpp') diff --git a/src/map/magic-expr-eval.hpp b/src/map/magic-expr-eval.hpp new file mode 100644 index 0000000..71c1d86 --- /dev/null +++ b/src/map/magic-expr-eval.hpp @@ -0,0 +1,44 @@ +#ifndef MAGIC_EXPR_EVAL +#define MAGIC_EXPR_EVAL + +/* Helper definitions for dealing with functions and operations */ + +static int heading_x[8] = { 0, -1, -1, -1, 0, 1, 1, 1 }; +static int heading_y[8] = { 1, 1, 0, -1, -1, -1, 0, 1 }; + +int + magic_signature_check (char *opname, char *funname, char *signature, + int args_nr, val_t * args, int line, int column); + +void +magic_area_rect (int *m, int *x, int *y, int *width, int *height, + area_t * area); + +#define ARGINT(x) args[x].v.v_int +#define ARGDIR(x) args[x].v.v_int +#define ARGSTR(x) args[x].v.v_string +#define ARGENTITY(x) args[x].v.v_entity +#define ARGLOCATION(x) args[x].v.v_location +#define ARGAREA(x) args[x].v.v_area +#define ARGSPELL(x) args[x].v.v_spell +#define ARGINVOCATION(x) args[x].v.v_invocation + +#define RESULTINT result->v.v_int +#define RESULTDIR result->v.v_int +#define RESULTSTR result->v.v_string +#define RESULTENTITY result->v.v_entity +#define RESULTLOCATION result->v.v_location +#define RESULTAREA result->v.v_area +#define RESULTSPELL result->v.v_spell +#define RESULTINVOCATION result->v.v_invocation + +#define TY(x) args[x].ty +#define ETY(x) ARGENTITY(x)->type + +#define ARGPC(x) ((struct map_session_data *)ARGENTITY(x)) +#define ARGNPC(x) ((struct map_session_data *)ARGENTITY(x)) +#define ARGMOB(x) ((struct map_session_data *)ARGENTITY(x)) + +#define ARG_MAY_BE_AREA(x) (TY(x) == TY_AREA || TY(x) == TY_LOCATION) + +#endif /* !defined(MAGIC_EXPR_EVAL) */ -- cgit v1.2.3-60-g2f50