Parsee/src/include/Command.h
LDA aa71c5cfeb [AYA] See alsos, live-alongs, more documentation
I need to work on _actual_ Parsee, now
2024-08-05 15:23:33 +02:00

25 lines
711 B
C

#ifndef PARSEE_COMMAND_H
#define PARSEE_COMMAND_H
/*-*
* A Matrix command manager (with a JCL/dd-style format).
* -----------
* Written-By: LDA */
#include <Cytoplasm/HashMap.h>
typedef struct Command {
char *command;
HashMap *arguments;
} Command;
typedef struct CommandRouter CommandRouter;
typedef void (*CommandRoute)(Command *cmd, void *data);
extern CommandRouter * CommandCreateRouter(void);
extern void CommandAddCommand(CommandRouter *rter, char *c, CommandRoute rte);
extern void RouteCommand(CommandRouter *rter, Command *cmd, void *data);
extern void CommandFreeRouter(CommandRouter *rter);
extern Command * CommandParse(char *cmd);
extern void CommandFree(Command *command);
#endif