version 1.1.1.1.2.5, 2010/04/20 12:09:48
|
version 1.1.1.1.2.6, 2010/04/20 12:16:52
|
Line 156 inline int cli_ReadHistory(const char *csFile)
|
Line 156 inline int cli_ReadHistory(const char *csFile)
|
/* |
/* |
* cli_WriteHistory() Write CLI History to file |
* cli_WriteHistory() Write CLI History to file |
* @csFile = history file name, if NULL default history name is ".aitcli.history" |
* @csFile = history file name, if NULL default history name is ".aitcli.history" |
|
* @lineNum = save number of history entry lines, if -1 all lines saved without limit |
* return: -1 error; != -1 readed ok |
* return: -1 error; != -1 readed ok |
*/ |
*/ |
inline int cli_WriteHistory(const char *csFile) | inline int cli_WriteHistory(const char *csFile, int lineNum) |
{ |
{ |
return write_history(!csFile ? ".aitcli.history" : csFile); | int ret; |
| const char *psFile = !csFile ? ".aitcli.history" : csFile; |
| |
| ret = write_history(psFile); |
| if (-1 != ret && -1 != lineNum) |
| history_truncate_file(psFile, lineNum); |
| |
| return ret; |
} |
} |
|
|
/* |
/* |