Files
chat_rebot-connect-with-one…/c/tem/ctl.h

28 lines
510 B
C

#ifndef CTL
#define CTL
#include <pthread.h>
#include "tools/log/log.h"
#include "interpreter/interpreter.h"
#define MAX_BUF 256
#define HISTORY_BUF 256
#define PROMPT "chatbot$$ "
typedef struct Ctl
{
int (*run)(struct Ctl*,int *);
int (*infifo)(struct Ctl*,const char*);
int index;
char *history[HISTORY_BUF];
pthread_t logwathcher;
log_manager *logmanager;
ctx *command;//解释器上下文
}Ctl;
Ctl *init_tem(log_manager *logmanager);
int free_history(Ctl *self);
#endif