1 /* ----------------------------------------------------------------------------
2 Copyright (c) 2021, Daan Leijen
3 This is free software; you can redistribute it and/or modify it
4 under the terms of the MIT License. A copy of the license can be
5 found in the "LICENSE" file at the root of this distribution.
6 -----------------------------------------------------------------------------*/
13 //-------------------------------------------------------------
15 //-------------------------------------------------------------
18 typedef struct history_s history_t
;
20 ic_private history_t
* history_new(alloc_t
* mem
);
21 ic_private
void history_free(history_t
* h
);
22 ic_private
void history_clear(history_t
* h
);
23 ic_private
bool history_enable_duplicates( history_t
* h
, bool enable
);
24 ic_private ssize_t
history_count(const history_t
* h
);
26 ic_private
void history_load_from(history_t
* h
, const char* fname
, long max_entries
);
27 ic_private
void history_load( history_t
* h
);
28 ic_private
void history_save( const history_t
* h
);
30 ic_private
bool history_push( history_t
* h
, const char* entry
);
31 ic_private
bool history_update( history_t
* h
, const char* entry
);
32 ic_private
const char* history_get( const history_t
* h
, ssize_t n
);
33 ic_private
void history_remove_last(history_t
* h
);
35 ic_private
bool history_search( const history_t
* h
, ssize_t from
, const char* search
, bool backward
, ssize_t
* hidx
, ssize_t
* hpos
);
38 #endif // IC_HISTORY_H