#ifndef KHEPCTRL_RAW_H #define KHEPCTRL_RAW_H #include #include "khep_config.h" #include "access.h" /** TYPES **/ typedef enum { KHEP_CMD_OK, /* Good answer */ KHEP_CMD_UNKNOWN, /* Unknown command */ KHEP_CMD_BADREP, /* Reply doesn't match question */ KHEP_CMD_E_IO, /* I/O Error */ } khep_cmd_ret_code_t; typedef struct { khep_cmd_ret_code_t result; char **args; /* NULL terminated array */ } khep_rawcmd_ret_t; /** FUNCTIONS **/ char* khep_read(khep_hand_t hand); ssize_t khep_write(khep_hand_t hand, char *data, ssize_t length); khep_rawcmd_ret_t khep_cmd_raw(khep_hand_t hand, char *cmd); void khep_treat_answer(char *question, char *answer, khep_rawcmd_ret_t *res); #endif /* KHEPCTRL_RAW_H */