Collab_RPG/src/events.h

36 lines
630 B
C
Raw Normal View History

2024-07-20 16:53:13 +02:00
#ifndef EVENTS_H
#define EVENTS_H
#define MAX_VARIABLES 32
#define MESSAGE_BUFFER_SZ 256
#define TOKEN_MAX_SZ 32
typedef struct {
int *variables[MAX_VARIABLES];
char *var_names[MAX_VARIABLES];
unsigned int vars;
} EventHandler;
typedef enum {
T_NULL,
T_VAR_EDIT,
T_AMOUNT
} Token;
typedef enum {
OP_NULL,
OP_SET,
OP_ADD,
OP_SUB,
OP_DIV,
OP_MUL,
OP_MOD,
OP_AMOUNT
} Operation;
void events_init_handler(EventHandler *handler);
int events_bind_variable(EventHandler *handler, int *var, char *name);
char *events_parse_string(EventHandler *handler, char *message);
#endif