Added last history function descriptions
[CleanReadLine.git] / ReadLine.dcl
index 734ca20..30d3f4d 100644 (file)
@@ -1,6 +1,6 @@
 definition module ReadLine
 
-import StdEnv
+import StdClass
 
 :: Maybe a = Nothing | Just a
 :: HistoryItem = {line :: String, timestamp :: String}
@@ -9,6 +9,11 @@ import StdEnv
 instance toString HistoryItem
 instance toString HistoryState
 
+//Maybe functions
+isNothing :: !(Maybe .x) -> Bool
+isJust    :: !(Maybe .x) -> Bool
+fromJust  :: !(Maybe .x) -> .x
+
 //Non-library functions
 setReadLineName :: !String !*env -> *env
 
@@ -16,9 +21,7 @@ setReadLineName :: !String !*env -> *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
-//history has not been used
-usingHistory :: !*env -> *env
+usingHistory :: !*env -> *env 
 historyGetHistoryState :: !*env -> (!HistoryState, !*env)
 historySetHistoryState :: !HistoryState !*env -> *env
 
@@ -41,12 +44,11 @@ historyGetTime :: HistoryItem -> String
 historyTotalBytes :: !*env -> (!Int, !*env)
 
 //Moving Around the History List
-//TODO
+historySetPos :: !Int !*env -> (!Int, !*env)
+previousHistory :: !*env -> (!Maybe HistoryItem, !*env)
+nextHistory :: !*env -> (!Maybe HistoryItem, !*env)
 
 //Searching the History List
-//Note that the return integers are just success flags. The actual found item
-//will be the current history position and the int is the offset of the search
-//within that item...
 historySearch :: !String !Int !*env-> (!Int, !*env)
 historySearchPrefix :: !String !Int !*env-> (!Int, !*env)
 historySearchPos :: !String !Int !Int !*env-> (!Int, !*env)
@@ -57,3 +59,9 @@ readHistoryRange :: !String !Int !Int !*env -> (!Bool, !*env)
 writeHistory :: !String !*env -> (!Bool, !*env)
 appendHistory :: !Int !String !*env -> (!Bool, !*env)
 historyTruncateFile :: !String !Int !*env -> (!Bool, !*env)
+
+//History Expansion
+historyExpand :: !String !*env -> (!String, !Int, !*env)
+getHistoryEvent :: !String !Int !Int !*env -> (!String, !*env)
+historyTokenize :: !String !*env -> ([String], !*env)
+historyArgExtract :: !Int !Int !String !*env -> (!String, !*env)