Changeset 11906 for fact/BIASctrl/BIASctrl.cc
- Timestamp:
- 08/15/11 17:01:20 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/BIASctrl/BIASctrl.cc
r11205 r11906 14 14 #include <readline/history.h> 15 15 16 const char READLINE_HIST_FILE[] = "/tmp/.history.BIASctrl"; 16 using namespace std; 17 18 const string READLINE_HIST_FILE = string(getenv("HOME"))+"/.history_BIASctrl"; 17 19 18 20 // Main program … … 24 26 // Uses getc() for readline library (allows interruption by signal) and load history buffer 25 27 rl_getc_function = getc; 26 read_history(READLINE_HIST_FILE );28 read_history(READLINE_HIST_FILE.c_str()); 27 29 28 30 // Set signal SIGTERM to interrupt blocking system calls … … 38 40 // Handle command-line input 39 41 while (!M.ExitRequest) { 40 Command = readline(" \rBias> ");42 Command = readline("Bias> "); 41 43 42 44 // NULL returned if interrupted by signal … … 55 57 56 58 // Save history buffer 57 int Ret = write_history(READLINE_HIST_FILE );58 if (Ret != 0 ) printf("Error writing history file to '%s' (%s)\n", READLINE_HIST_FILE , strerror(Ret));59 int Ret = write_history(READLINE_HIST_FILE.c_str()); 60 if (Ret != 0 ) printf("Error writing history file to '%s' (%s)\n", READLINE_HIST_FILE.c_str(), strerror(Ret)); 59 61 }
Note:
See TracChangeset
for help on using the changeset viewer.