#include <stdbool.h>
Go to the source code of this file.
Enumerations | |
enum | HistoryClass { HC_CMD, HC_ALIAS, HC_COMMAND, HC_FILE, HC_PATTERN, HC_OTHER, HC_MBOX, HC_MAX } |
Type to differentiate different histories. More... | |
Functions | |
void | mutt_hist_add (enum HistoryClass hclass, const char *str, bool save) |
Add a string to a history. More... | |
bool | mutt_hist_at_scratch (enum HistoryClass hclass) |
Is the current History position at the 'scratch' place? More... | |
void | mutt_hist_free (void) |
Free all the history lists. More... | |
void | mutt_hist_init (void) |
Create a set of empty History ring buffers. More... | |
char * | mutt_hist_next (enum HistoryClass hclass) |
Get the next string in a History. More... | |
char * | mutt_hist_prev (enum HistoryClass hclass) |
Get the previous string in a History. More... | |
void | mutt_hist_read_file (void) |
Read the History from a file. More... | |
void | mutt_hist_reset_state (enum HistoryClass hclass) |
Move the 'current' position to the end of the History. More... | |
void | mutt_hist_save_scratch (enum HistoryClass hclass, const char *str) |
Save a temporary string to the History. More... | |
int | mutt_hist_search (const char *search_buf, enum HistoryClass hclass, char **matches) |
Find matches in a history list. More... | |
void | dlg_select_history (char *buf, size_t buflen, char **matches, int match_count) |
Select an item from a history list. More... | |
Variables | |
short | C_History |
Config: Number of history entries to keep in memory per category. More... | |
char * | C_HistoryFile |
Config: File to save history in. More... | |
bool | C_HistoryRemoveDups |
Config: Remove duplicate entries from the history. More... | |
short | C_SaveHistory |
Config: Number of history entries to save per category. More... | |
Read/write command history from/to a file
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file lib.h.
enum HistoryClass |
void mutt_hist_add | ( | enum HistoryClass | hclass, |
const char * | str, | ||
bool | save | ||
) |
bool mutt_hist_at_scratch | ( | enum HistoryClass | hclass | ) |
Is the current History position at the 'scratch' place?
hclass | History to use |
true | History is at 'scratch' place |
The last entry in the history is used as a 'scratch' area. It can be overwritten as the user types and edits.
To get (back) to the scratch area, call mutt_hist_next(), mutt_hist_prev() or mutt_hist_reset_state().
Definition at line 618 of file history.c.
void mutt_hist_free | ( | void | ) |
void mutt_hist_init | ( | void | ) |
Create a set of empty History ring buffers.
This just creates empty histories. To fill them, call mutt_hist_read_file().
Definition at line 447 of file history.c.
char* mutt_hist_next | ( | enum HistoryClass | hclass | ) |
char* mutt_hist_prev | ( | enum HistoryClass | hclass | ) |
Get the previous string in a History.
hclass | History to choose |
ptr | Previous string |
If there is no previous string, and empty string will be returned.
Definition at line 527 of file history.c.
void mutt_hist_read_file | ( | void | ) |
void mutt_hist_reset_state | ( | enum HistoryClass | hclass | ) |
Move the 'current' position to the end of the History.
hclass | History to reset |
After calling mutt_hist_next() and mutt_hist_prev(), this function resets the current position ('cur' pointer).
Definition at line 554 of file history.c.
void mutt_hist_save_scratch | ( | enum HistoryClass | hclass, |
const char * | str | ||
) |
Save a temporary string to the History.
hclass | History to alter |
str | String to set |
Write a 'scratch' string into the History's current position. This is useful to preserver a user's edits.
Definition at line 635 of file history.c.
int mutt_hist_search | ( | const char * | search_buf, |
enum HistoryClass | hclass, | ||
char ** | matches | ||
) |
void dlg_select_history | ( | char * | buf, |
size_t | buflen, | ||
char ** | matches, | ||
int | match_count | ||
) |
Select an item from a history list.
[in] | buf | Buffer in which to save string |
[in] | buflen | Buffer length |
[out] | matches | Items to choose from |
[in] | match_count | Number of items |
Definition at line 96 of file dlghistory.c.
short C_History |
bool C_HistoryRemoveDups |