1 definition module ReadLine
3 :: HistoryItem = {line :: String, timestamp :: String}
4 :: HistoryState = {entries :: [HistoryItem], offset :: Int, flags :: Int}
6 //Non-library functions
7 setReadLineName :: !String !*env -> !*env
10 readLine :: !String !Bool !*env -> (!String, !*env)
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
19 //History List Management
20 addHistory :: !String !*env -> !*env
21 clearHistory :: !*env -> !*env
22 //TODO some more functions
24 //Information About the History List
27 //Moving Around the History List
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
34 historySearch :: !String !Int !*env-> (!Int, !*env)
35 historySearchPrefix :: !String !Int !*env-> (!Int, !*env)
36 historySearchPos :: !String !Int !Int !*env-> (!Int, !*env)
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)