00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _ABLE_CLIB_HISTORY_H
00030 #define _ABLE_CLIB_HISTORY_H 1
00031
00032 #include <time.h>
00033 #include <readline/able_history.h>
00034
00036 typedef struct line_hist_s HIST_ENTRY;
00037
00039 typedef struct _hist_state {
00040 HIST_ENTRY **entries;
00041 int offset;
00042 int length;
00043 int size;
00044 int flags;
00045 } HISTORY_STATE;
00046
00047
00048
00049
00050
00051 void using_history (void);
00052 HISTORY_STATE *history_get_history_state(void);
00053 void history_set_history_state(HISTORY_STATE *state);
00054 void add_history(const char *string);
00055 void add_history_time(const char *string);
00056 HIST_ENTRY *remove_history(int which);
00057 histdata_t free_history_entry(HIST_ENTRY *histent);
00058 HIST_ENTRY *replace_history_entry(int which, const char *line, histdata_t data);
00059 void clear_history(void);
00060 void stifle_history(int max);
00061 int unstifle_history(void);
00062 int history_is_stifled(void);
00063 HIST_ENTRY **history_list(void);
00064 int where_history(void);
00065 HIST_ENTRY *current_history(void);
00066 HIST_ENTRY *history_get(int offset);
00067 time_t history_get_time(HIST_ENTRY *);
00068 int history_total_bytes(void);
00069 int history_set_pos(int pos);
00070 HIST_ENTRY *previous_history(void);
00071 HIST_ENTRY *next_history(void);
00072 int history_search(const char *string, int direction);
00073 int history_search_prefix(const char *string, int direction);
00074 int history_search_pos(const char *string, int direction, int pos);
00075 int read_history(const char *filename);
00076 int read_history_range(const char *filename, int from, int to);
00077 int write_history(const char *filename);
00078 int append_history(int nelements, const char *filename);
00079 int history_truncate_file(const char *filename, int nlines);
00080 int history_expand(char *string, char **output);
00081 char *get_history_event(const char *string, int *cindex, int qchar);
00082 char **history_tokenize(const char *string);
00083 char *history_arg_extract(int first, int last, const char *string);
00084
00085
00086 extern int history_base;
00087 extern int history_length;
00088 extern int history_max_entries;
00089 extern int history_write_timestamps;
00090 extern char history_expansion_char;
00091 extern char history_subst_char;
00092 extern char history_comment_char;
00093 extern char *history_word_delimiters;
00094 extern char *history_no_expand_chars;
00095 extern char *history_search_delimiter_chars;
00096 extern int history_quotes_inhibit_expansion;
00097
00098 #endif