c-scripting/examples/hello_world.h

25 lines
496 B
C

#ifndef HELLO_WORLD_H
#define HELLO_WORLD_H
typedef void Hook(void);
typedef struct Command{
char *name;
char *description;
Hook *hook;
int is_word;
} Command;
#define SYMBOL_SET_DEFINE COMMAND
#define COMMAND_Type Command
#define COMMAND_section ".sy.cmd"
#define COMMAND_marker cmd
#include "symbol_set.define.h"
#define COMMAND_DEF(N,desc,is_word) \
void cmd_##N(void); \
SyDefine(COMMAND, N) = { #N, desc, cmd_##N, (is_word) };\
void cmd_##N(void)
#endif /* HELLO_WORLD_H */