libscomp/exec.h

20 lines
318 B
C
Raw Normal View History

2021-07-30 22:14:16 -04:00
#pragma once
#include "input.h"
enum libscomm_cmd_r {
LIBSCOMM_NOT_FOUND = -1,
LIBSCOMM_CMD_OK = 0
};
struct libscomm_cmd {
const char *name;
int (*exec)(struct libscomm_line *);
};
struct libscomm_cmd_store {
struct libscomm_cmd *arr;
size_t len;
};
#define libscomm_mkcmds(l) {l, sizeof(l) / sizeof(l[0])}