remove gcc for MacOS in conan.yml
[liba.git] / lua / isocline / src / history.h
blob76a37160f29fbf2eba307067d874ffdb1118d429
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 -----------------------------------------------------------------------------*/
7 #pragma once
8 #ifndef IC_HISTORY_H
9 #define IC_HISTORY_H
11 #include "common.h"
13 //-------------------------------------------------------------
14 // History
15 //-------------------------------------------------------------
17 struct history_s;
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