You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
688 B

/*
* console.h
*
* Created on: 2019-7-4
* Author: Administrator
*/
#ifndef VCONSOLE_H_
#define VCONSOLE_H_
typedef struct console *vconsole_t;
struct vconsole_param {
int debug_console; /*debug default tty*/
char *prompt; /*NULL use default prompt: '> '*/
void *param;
int (*puts)(void *param, const char *s, int len);
int (*gets)(void *param, char *buf, int len, int blocking /*in millis*/);
};
vconsole_t vconsole_new(struct vconsole_param *cp);
void vconsole_free(vconsole_t cs);
void vconsole_loop(vconsole_t cs);
int vconsole_puts(vconsole_t cs, const char *s, int len);
int vconsole_status(vconsole_t cs); /*return: 0-running, 1-exit*/
#endif /* CONSOLE_H_ */