Schiffsbeschleunigung auf Englisch

- needed a "$lt()" function
This commit is contained in:
Enno Rehling 2007-03-11 14:18:03 +00:00
parent 349f6f9828
commit 8b2897406c

View file

@ -384,14 +384,24 @@ translate(const char* format, const void * userdata, const char* vars, variant a
return rv; return rv;
} }
static void
eval_lt(opstack ** stack, const void * userdata) /* (int, int) -> int */
{
int a = opop_i(stack);
int b = opop_i(stack);
int rval = (b<a)?1:0;
opush_i(stack, rval);
unused(userdata);
}
static void static void
eval_eq(opstack ** stack, const void * userdata) /* (int, int) -> int */ eval_eq(opstack ** stack, const void * userdata) /* (int, int) -> int */
{ {
int a = opop_i(stack); int a = opop_i(stack);
int b = opop_i(stack); int b = opop_i(stack);
int rval = (a==b)?1:0; int rval = (a==b)?1:0;
opush_i(stack, rval); opush_i(stack, rval);
unused(userdata); unused(userdata);
} }
static void static void
@ -465,14 +475,15 @@ eval_locale(opstack ** stack, const void * userdata) /* (string) -> locale */
void void
translation_init(void) translation_init(void)
{ {
add_function("eq", &eval_eq); add_function("lt", &eval_lt);
add_function("int", &eval_int); add_function("eq", &eval_eq);
add_function("add", &eval_add); add_function("int", &eval_int);
add_function("strlen", &eval_strlen); add_function("add", &eval_add);
add_function("if", &eval_if); add_function("strlen", &eval_strlen);
add_function("isnull", &eval_isnull); add_function("if", &eval_if);
add_function("localize", &eval_localize); add_function("isnull", &eval_isnull);
add_function("locale", &eval_locale); add_function("localize", &eval_localize);
add_function("locale", &eval_locale);
} }
void void