server/src/util/translation.h

50 lines
1.6 KiB
C
Raw Normal View History

/*
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>
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.
*/
2010-08-08 10:06:34 +02:00
#ifndef H_UTIL_TRANSLATION
#define H_UTIL_TRANSLATION
#include <stddef.h>
2010-08-08 10:06:34 +02:00
#ifdef __cplusplus
extern "C" {
#endif
#include "variant.h"
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)
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)
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
/* 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
/* transient memory blocks */
extern char *balloc(size_t size);
2010-08-08 10:06:34 +02:00
#ifdef __cplusplus
}
#endif
#endif