GlHistory
GlHistory *glh; /* The line-history buffer */
int _glh_save_history(GlHistory *glh, const char *filename, const char *comment,
static int _glh_cant_save_history(GlHistory *glh, const char *message,
int _glh_load_history(GlHistory *glh, const char *filename, const char *comment,
static GlhHashBucket *glh_find_bucket(GlHistory *glh, const char *line,
static int _glh_cant_load_history(GlHistory *glh, const char *filename,
int _glh_set_group(GlHistory *glh, unsigned group)
int _glh_get_group(GlHistory *glh)
int _glh_show_history(GlHistory *glh, GlWriteFn *write_fn, void *data,
int _glh_resize_history(GlHistory *glh, size_t bufsize)
void _glh_limit_history(GlHistory *glh, int max_lines)
void _glh_clear_history(GlHistory *glh, int all_groups)
void _glh_toggle_history(GlHistory *glh, int enable)
static void _glh_discard_line(GlHistory *glh, GlhLineNode *node)
int _glh_lookup_history(GlHistory *glh, GlhLineID id, const char **line,
static int _glh_cant_load_history(GlHistory *glh, const char *filename,
static int _glh_cant_save_history(GlHistory *glh, const char *message,
static GlhLineNode *_glh_find_id(GlHistory *glh, GlhLineID id)
static void _glh_discard_line(GlHistory *glh, GlhLineNode *node);
static GlhLineNode *_glh_find_id(GlHistory *glh, GlhLineID id);
void _glh_state_of_history(GlHistory *glh, int *enabled, unsigned *group,
static GlhHashNode *_glh_acquire_copy(GlHistory *glh, const char *line,
static GlhHashNode *_glh_discard_copy(GlHistory *glh, GlhHashNode *hnode);
void _glh_range_of_history(GlHistory *glh, unsigned long *oldest,
static int _glh_prepare_for_recall(GlHistory *glh, char *line);
void _glh_size_of_history(GlHistory *glh, size_t *buff_size, size_t *buff_used)
const char *_glh_last_error(GlHistory *glh)
static GlhHashNode *_glh_acquire_copy(GlHistory *glh, const char *line,
static GlhHashNode *_glh_discard_copy(GlHistory *glh, GlhHashNode *hnode)
static GlhHashBucket *glh_find_bucket(GlHistory *glh, const char *line,
GlHistory *_new_GlHistory(size_t buflen)
static int _glh_prepare_for_recall(GlHistory *glh, char *line)
GlHistory *glh; /* The object to be returned */
int _glh_search_active(GlHistory *glh)
glh = (GlHistory *) malloc(sizeof(GlHistory));
GlHistory *_del_GlHistory(GlHistory *glh)
int _glh_add_history(GlHistory *glh, const char *line, int force)
char *_glh_find_backwards(GlHistory *glh, char *line, size_t dim)
char *_glh_find_forwards(GlHistory *glh, char *line, size_t dim)
int _glh_cancel_search(GlHistory *glh)
int _glh_search_prefix(GlHistory *glh, const char *line, int prefix_len)
char *_glh_oldest_line(GlHistory *glh, char *line, size_t dim)
char *_glh_current_line(GlHistory *glh, char *line, size_t dim)
GlhLineID _glh_line_id(GlHistory *glh, int offset)
char *_glh_recall_line(GlHistory *glh, GlhLineID id, char *line, size_t dim)
int _glh_set_group(GlHistory *glh, unsigned group);
int _glh_get_group(GlHistory *glh);
int _glh_show_history(GlHistory *glh, GlWriteFn *write_fn, void *data,
int _glh_resize_history(GlHistory *glh, size_t bufsize);
void _glh_limit_history(GlHistory *glh, int max_lines);
void _glh_clear_history(GlHistory *glh, int all_groups);
void _glh_toggle_history(GlHistory *glh, int enable);
int _glh_lookup_history(GlHistory *glh, GlhLineID id, const char **line,
void _glh_state_of_history(GlHistory *glh, int *enabled, unsigned *group,
void _glh_range_of_history(GlHistory *glh, unsigned long *oldest,
void _glh_size_of_history(GlHistory *glh, size_t *buff_size, size_t *buff_used);
const char *_glh_last_error(GlHistory *glh);
int _glh_search_active(GlHistory *glh);
typedef struct GlHistory GlHistory;
GlHistory *_new_GlHistory(size_t buflen);
GlHistory *_del_GlHistory(GlHistory *glh);
int _glh_add_history(GlHistory *glh, const char *line, int force);
int _glh_search_prefix(GlHistory *glh, const char *line, int prefix_len);
char *_glh_find_backwards(GlHistory *glh, char *line, size_t dim);
char *_glh_find_forwards(GlHistory *glh, char *line, size_t dim);
int _glh_cancel_search(GlHistory *glh);
char *_glh_oldest_line(GlHistory *glh, char *line, size_t dim);
char *_glh_current_line(GlHistory *glh, char *line, size_t dim);
GlhLineID _glh_line_id(GlHistory *glh, int offset);
char *_glh_recall_line(GlHistory *glh, GlhLineID id, char *line, size_t dim);
int _glh_save_history(GlHistory *glh, const char *filename,
int _glh_load_history(GlHistory *glh, const char *filename, const char *comment,