history state added
[CleanReadLine.git] / ReadLine.dcl
1 definition module ReadLine
2
3 :: HistoryItem = {line :: String, timestamp :: String}
4
5 :: HistoryState = {entries :: [HistoryItem], offset :: Int, flags :: Int}
6
7 //Readline
8 readLine :: !String !Bool !*env -> (!String, !*env)
9 setReadLineName :: !String !*env -> !*env
10
11 //Initializing History and State Management
12 //Note that this HAS to be executed when you want to add entries when the
13 //history has not been used
14 usingHistory :: !*env -> !*env
15 historyGetHistoryState :: !*env -> (!HistoryState, !*env)
16 historySetHistoryState :: !HistoryState !*env -> !*env
17
18 //History List Management
19 addHistory :: !String !*env -> !*env
20 clearHistory :: !*env -> !*env
21 //TODO some more functions
22
23 //Information About the History List
24 //TODO
25
26 //Moving Around the History List
27 //TODO
28
29 //Searching the History List
30 //Note that the return integers are just success flags. The actual found item
31 //will be the current history position and the int is the offset of the search
32 //within that item...
33 historySearch :: !String !Int !*env-> (!Int, !*env)
34 historySearchPrefix :: !String !Int !*env-> (!Int, !*env)
35 historySearchPos :: !String !Int !Int !*env-> (!Int, !*env)
36
37 //Managing the History File
38 readHistory :: !String !*env -> (!Bool, !*env)
39 readHistoryRange :: !String !Int !Int !*env -> (!Bool, !*env)
40 writeHistory :: !String !*env -> (!Bool, !*env)
41 appendHistory :: !Int !String !*env -> (!Bool, !*env)
42 historyTruncateFile :: !String !Int !*env -> (!Bool, !*env)