event.h 486 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
#ifndef _EVENT_H_
#define _EVENT_H_

#include "../T_defs.h"

enum event_arg_type {
  EVENT_INT,
  EVENT_STRING,
  EVENT_BUFFER
};

typedef struct {
  enum event_arg_type type;
  //int offset;
  union {
    int i;
    char *s;
    struct {
      int bsize;
      void *b;
    };
  };
} event_arg;

typedef struct {
  int type;
  char *buffer;
  event_arg e[T_MAX_ARGS];
  int ecount;
} event;

event new_event(int type, int length, char *buffer, void *database);

#endif /* _EVENT_H_ */