implementation module ReadLine import StdEnv import code from "readLine.o" //Readline readLine :: !String !Bool !*env -> (!String, !*env) readLine s h e = code { ccall cleanReadLine "SI:S:A" } setReadLineName :: !String !*env -> !*env setReadLineName s e = code inline { ccall cleanSetReadLineName "S-" } //Initializing History and State Management usingHistory :: !*env -> !*env usingHistory e = code inline { ccall cleanUsingHistory "-" } //History List Management addHistory :: !String !*env -> !*env addHistory s e = code inline { ccall cleanAddHistory "S-" } clearHistory :: !*env -> !*env clearHistory e = code inline{ ccall cleanClearHistory "-" } //Information About the History List //Moving Around the History List //Searching the History List historySearch :: !String !Int !*env-> (!Int, !*env) historySearch s i e = code { ccall cleanHistorySearch "SI:I:A" } historySearchPrefix :: !String !Int !*env-> (!Int, !*env) historySearchPrefix s i e = code { ccall cleanHistorySearchPrefix "SI:I:A" } historySearchPos :: !String !Int !Int !*env-> (!Int, !*env) historySearchPos s i1 i2 e = code { ccall cleanHistorySearchPos "SI:I:A" } //Managing the History File readHistory :: !String !*env -> (!Bool, !*env) readHistory s e = code { ccall cleanReadHistory "S:I:A" } readHistoryRange :: !String !Int !Int !*env -> (!Bool, !*env) readHistoryRange s i1 i2 e = code { ccall cleanReadHistoryRange "SII:I:A" } writeHistory :: !String !*env -> (!Bool, !*env) writeHistory s e = code { ccall cleanWriteHistory "S:I:A" } appendHistory :: !Int !String !*env -> (!Bool, !*env) appendHistory i s e = code { ccall cleanWriteHistory "IS:I:A" } historyTruncateFile :: !String !Int !*env -> (!Bool, !*env) historyTruncateFile i s e = code { ccall cleanWriteHistory "SI:I:A" }