X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=ReadLine.dcl;h=f859e324d8ebb9110381981051b6f12fe7277281;hb=4930c9c0ddeaa5c9421d36396fd74d22db1385c6;hp=d66e37e0315e3191a570657fabd60a7c37959c49;hpb=b25f55e7fc44e6fedff55340f3d6e6cdfa413c54;p=CleanReadLine.git diff --git a/ReadLine.dcl b/ReadLine.dcl index d66e37e..f859e32 100644 --- a/ReadLine.dcl +++ b/ReadLine.dcl @@ -1,13 +1,19 @@ definition module ReadLine +import StdEnv + +:: Maybe a = Nothing | Just a :: HistoryItem = {line :: String, timestamp :: String} :: HistoryState = {entries :: [HistoryItem], offset :: Int, flags :: Int} +instance toString HistoryItem +instance toString HistoryState + //Non-library functions setReadLineName :: !String !*env -> !*env //Readline -readLine :: !String !Bool !*env -> (!String, !*env) +readLine :: !String !Bool !*env -> (!Maybe String, !*env) //Initializing History and State Management //Note that this HAS to be executed when you want to add entries when the @@ -18,11 +24,21 @@ historySetHistoryState :: !HistoryState !*env -> !*env //History List Management addHistory :: !String !*env -> !*env +addHistoryTime :: !String !*env -> !*env +removeHistory :: !Int !*env -> (!HistoryItem, !*env) +replaceHistoryEntry :: !Int !String !*env -> (!HistoryItem, !*env) clearHistory :: !*env -> !*env -//TODO some more functions +stifleHistory :: !Int !*env -> !*env +unstifleHistory :: !*env -> !*env +historyIsStifled :: !*env -> (!Int, !*env) //Information About the History List -//TODO +historyList :: !*env -> (![HistoryItem], !*env) +whereHistory :: !*env -> (!Int, !*env) +currentHistory :: !*env -> (!Maybe HistoryItem, !*env) +historyGet :: !Int !*env -> (!Maybe HistoryItem, !*env) +historyGetTime :: HistoryItem -> String +historyTotalBytes :: !*env -> (!Int, !*env) //Moving Around the History List //TODO