nothing is inline anymore
authorMart Lubbers <mart@martlubbers.net>
Tue, 26 Jan 2016 15:47:53 +0000 (16:47 +0100)
committerMart Lubbers <mart@martlubbers.net>
Tue, 26 Jan 2016 15:47:53 +0000 (16:47 +0100)
Clean System Files/readLine.c
README.md
ReadLine.dcl
ReadLine.icl

index c81e7db..4836bcb 100644 (file)
@@ -62,8 +62,11 @@ void cleanGetState(int *offset, int *num, int *flags){
        *flags = history_get_history_state()->flags;
 }
 
-void cleanGetHistoryItem(int num, CleanString *line, CleanString *timestamp){
+void cleanSetState(int offset, int num, int flags){
        ;
+}
+
+void cleanGetHistoryItem(int num, CleanString *line, CleanString *timestamp){
        char *cs_line = history_get_history_state()->entries[num]->line;
        char *cs_stamp = history_get_history_state()->entries[num]->timestamp;
 
index f02d3f9..7f51018 100644 (file)
--- a/README.md
+++ b/README.md
@@ -35,8 +35,6 @@ functions as close as possible
 
 ###Todo
 
-- Access to the history datastructure
-- Access to the current location
 - Complete history api implementation
 - Embed the readline library in the object files in such a way that no special
   compiler flag is needed.
index 5e529c1..d66e37e 100644 (file)
@@ -1,12 +1,13 @@
 definition module ReadLine
 
 :: HistoryItem = {line :: String, timestamp :: String}
-
 :: HistoryState = {entries :: [HistoryItem], offset :: Int, flags :: Int}
 
+//Non-library functions
+setReadLineName :: !String !*env -> !*env
+
 //Readline
 readLine :: !String !Bool !*env -> (!String, !*env)
-setReadLineName :: !String !*env -> !*env
 
 //Initializing History and State Management
 //Note that this HAS to be executed when you want to add entries when the
index cb4cfbb..b377371 100644 (file)
@@ -11,14 +11,14 @@ readLine s h e = code {
        }
 
 setReadLineName :: !String !*env -> !*env
-setReadLineName s e = code inline {
-                       ccall cleanSetReadLineName "S-"
+setReadLineName s e = code {
+                       ccall cleanSetReadLineName "S:V:A"
        }
 
 //Initializing History and State Management
 usingHistory :: !*env -> !*env
-usingHistory e = code inline {
-                       ccall cleanUsingHistory "-"
+usingHistory e = code {
+                       ccall cleanUsingHistory ":V:A"
        }
 
 historyGetHistoryState :: !*env -> (!HistoryState, !*env)
@@ -28,8 +28,8 @@ historyGetHistoryState e
 = ({HistoryState | entries=entries, offset=offset, flags=flags}, e)
        where
                getState :: !*env -> (!Int, !Int, !Int, !*env)
-               getState e= code inline {
-                       ccall cleanGetState "-III"
+               getState e= code {
+                       ccall cleanGetState ":VIII:A"
                }
                getItems :: !Int !*env -> (![HistoryItem], !*env)
                getItems 0 e = ([], e)
@@ -39,8 +39,8 @@ historyGetHistoryState e
                = ([{line=line,timestamp=timestamp}:rest], e)
 
                getItem :: !Int !*env -> (!String, !String, !*env)
-               getItem i e = code inline {
-                       ccall cleanGetHistoryItem "I-SS"
+               getItem i e = code {
+                       ccall cleanGetHistoryItem "I:VSS:A"
                }
                
 
@@ -49,13 +49,13 @@ historySetHistoryState hs e = abort "Not Implemented"
 
 //History List Management
 addHistory :: !String !*env -> !*env
-addHistory s e = code inline {
-                       ccall cleanAddHistory "S-"
+addHistory s e = code {
+                       ccall cleanAddHistory "S:V:A"
        }
 
 clearHistory :: !*env -> !*env
-clearHistory e = code inline{
-                       ccall cleanClearHistory "-"
+clearHistory e = code {
+                       ccall cleanClearHistory ":V:A"
        }
 
 //Information About the History List