--- libaitcli/src/aitcli.c 2010/04/20 11:48:49 1.1.1.1.2.4 +++ libaitcli/src/aitcli.c 2010/04/20 12:09:48 1.1.1.1.2.5 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitcli.c,v 1.1.1.1.2.4 2010/04/20 11:48:49 misho Exp $ +* $Id: aitcli.c,v 1.1.1.1.2.5 2010/04/20 12:09:48 misho Exp $ * *************************************************************************/ #include "global.h" @@ -141,6 +141,26 @@ inline int cliTTY(const char *term, FILE *inp, FILE *o } return 0; +} + +/* + * cli_ReadHistory() Read CLI History from file + * @csFile = history file name, if NULL default history name is ".aitcli.history" + * return: -1 error; != -1 readed ok +*/ +inline int cli_ReadHistory(const char *csFile) +{ + return read_history(!csFile ? ".aitcli.history" : csFile); +} + +/* + * cli_WriteHistory() Write CLI History to file + * @csFile = history file name, if NULL default history name is ".aitcli.history" + * return: -1 error; != -1 readed ok +*/ +inline int cli_WriteHistory(const char *csFile) +{ + return write_history(!csFile ? ".aitcli.history" : csFile); } /*