Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Roblox
GitHub Repository: Roblox/luau
Path: blob/master/extern/isocline/src/history.h
2727 views
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
10
11
#include "common.h"
12
13
//-------------------------------------------------------------
14
// History
15
//-------------------------------------------------------------
16
17
struct history_s;
18
typedef struct history_s history_t;
19
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);
25
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 );
29
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);
34
35
ic_private bool history_search( const history_t* h, ssize_t from, const char* search, bool backward, ssize_t* hidx, ssize_t* hpos);
36
37
38
#endif // IC_HISTORY_H
39
40