1 definition module ReadLine
4 from Data.Maybe import :: Maybe
6 :: HistoryItem = {line :: String, timestamp :: String}
7 :: HistoryState = {entries :: [HistoryItem], offset :: Int, flags :: Int}
9 instance toString HistoryItem
10 instance toString HistoryState
12 //Non-library functions
13 setReadLineName :: !String !*env -> *env
16 readLine :: !String !Bool !*env -> (!Maybe String, !*env)
18 //Initializing History and State Management
19 usingHistory :: !*env -> *env
20 historyGetHistoryState :: !*env -> (!HistoryState, !*env)
21 historySetHistoryState :: !HistoryState !*env -> *env
23 //History List Management
24 addHistory :: !String !*env -> *env
25 addHistoryTime :: !String !*env -> *env
26 removeHistory :: !Int !*env -> (!HistoryItem, !*env)
27 replaceHistoryEntry :: !Int !String !*env -> (!HistoryItem, !*env)
28 clearHistory :: !*env -> *env
29 stifleHistory :: !Int !*env -> *env
30 unstifleHistory :: !*env -> *env
31 historyIsStifled :: !*env -> (!Int, !*env)
33 //Information About the History List
34 historyList :: !*env -> (![HistoryItem], !*env)
35 whereHistory :: !*env -> (!Int, !*env)
36 currentHistory :: !*env -> (!Maybe HistoryItem, !*env)
37 historyGet :: !Int !*env -> (!Maybe HistoryItem, !*env)
38 historyGetTime :: HistoryItem -> String
39 historyTotalBytes :: !*env -> (!Int, !*env)
41 //Moving Around the History List
42 historySetPos :: !Int !*env -> (!Int, !*env)
43 previousHistory :: !*env -> (!Maybe HistoryItem, !*env)
44 nextHistory :: !*env -> (!Maybe HistoryItem, !*env)
46 //Searching the History List
47 historySearch :: !String !Int !*env-> (!Int, !*env)
48 historySearchPrefix :: !String !Int !*env-> (!Int, !*env)
49 historySearchPos :: !String !Int !Int !*env-> (!Int, !*env)
51 //Managing the History File
52 readHistory :: !String !*env -> (!Bool, !*env)
53 readHistoryRange :: !String !Int !Int !*env -> (!Bool, !*env)
54 writeHistory :: !String !*env -> (!Bool, !*env)
55 appendHistory :: !Int !String !*env -> (!Bool, !*env)
56 historyTruncateFile :: !String !Int !*env -> (!Bool, !*env)
59 historyExpand :: !String !*env -> (!String, !Int, !*env)
60 getHistoryEvent :: !String !Int !Int !*env -> (!Maybe String, !Int, !*env)
61 historyTokenize :: !String !*env -> ([String], !*env)
62 historyArgExtract :: !Int !Int !String !*env -> (!Maybe String, !*env)