Added last history function descriptions
[CleanReadLine.git] / ReadLine.icl
index 4faf3ba..71d64df 100644 (file)
@@ -179,6 +179,30 @@ historyTotalBytes e = code {
        }
 
 //Moving Around the History List
+historySetPos :: !Int !*env -> (!Int, !*env)
+historySetPos i e = code {
+               ccall cleanHistorySetPos "I:I:A"
+       }
+
+previousHistory :: !*env -> (!Maybe HistoryItem, !*env)
+previousHistory e
+# (line, timestamp, null, e) = previousHistoryItem e
+= (if null Nothing (Just {HistoryItem | line=line, timestamp=timestamp}), e)
+       where
+               previousHistoryItem :: !*env -> (!String, !String, !Bool, !*env)
+               previousHistoryItem e = code {
+                               ccall cleanPreviousHistory ":VSSI:A"
+                       }
+
+nextHistory :: !*env -> (!Maybe HistoryItem, !*env)
+nextHistory e
+# (line, timestamp, null, e) = nextHistoryItem e
+= (if null Nothing (Just {HistoryItem | line=line, timestamp=timestamp}), e)
+       where
+               nextHistoryItem :: !*env -> (!String, !String, !Bool, !*env)
+               nextHistoryItem e = code {
+                               ccall cleanNextHistory ":VSSI:A"
+                       }
 
 //Searching the History List
 historySearch :: !String !Int !*env-> (!Int, !*env)
@@ -222,3 +246,8 @@ historyTruncateFile :: !String !Int !*env -> (!Bool, !*env)
 historyTruncateFile i s e = code {
                ccall cleanWriteHistory "SI:I:A"
        }
+
+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)