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