2015-01-30 20:37:14 +01:00
|
|
|
/*
|
2010-08-08 10:06:34 +02:00
|
|
|
+-------------------+ Christian Schlittchen <corwin@amber.kn-bremen.de>
|
|
|
|
| | Enno Rehling <enno@eressea.de>
|
|
|
|
| Eressea PBEM host | Katja Zedel <katze@felidae.kn-bremen.de>
|
|
|
|
| (c) 1998 - 2003 | Henning Peters <faroul@beyond.kn-bremen.de>
|
|
|
|
| | Ingo Wilken <Ingo.Wilken@informatik.uni-oldenburg.de>
|
|
|
|
+-------------------+ Stefan Reich <reich@halbling.de>
|
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
This program may not be used, modified or distributed
|
2010-08-08 10:06:34 +02:00
|
|
|
without prior permission by the authors of Eressea.
|
2015-01-30 20:37:14 +01:00
|
|
|
*/
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
|
|
#ifndef H_UTIL_TRANSLATION
|
|
|
|
#define H_UTIL_TRANSLATION
|
2016-11-25 20:15:11 +01:00
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
2010-08-08 10:06:34 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "variant.h"
|
2015-01-30 20:37:14 +01:00
|
|
|
struct opstack;
|
|
|
|
extern void opstack_push(struct opstack **stack, variant data);
|
2010-08-08 10:06:34 +02:00
|
|
|
#define opush_i(stack, x) { variant localvar; localvar.i = x; opstack_push(stack, localvar); }
|
|
|
|
#define opush_v(stack, x) { variant localvar; localvar.v = x; opstack_push(stack, localvar); }
|
|
|
|
#define opush(stack, i) opstack_push(stack, i)
|
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
extern variant opstack_pop(struct opstack **stack);
|
2010-08-08 10:06:34 +02:00
|
|
|
#define opop_v(stack) opstack_pop(stack).v
|
|
|
|
#define opop_i(stack) opstack_pop(stack).i
|
|
|
|
#define opop(stack) opstack_pop(stack)
|
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
extern void translation_init(void);
|
|
|
|
extern void translation_done(void);
|
|
|
|
extern const char *translate(const char *format, const void *userdata,
|
|
|
|
const char *vars, variant args[]);
|
2010-08-08 10:06:34 +02:00
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
/* eval_x functions */
|
|
|
|
typedef void(*evalfun) (struct opstack ** stack, const void *);
|
|
|
|
extern void add_function(const char *symbol, evalfun parse);
|
2010-08-08 10:06:34 +02:00
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
/* transient memory blocks */
|
|
|
|
extern char *balloc(size_t size);
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|