Ticket #2050: readline-history-1.patch

File readline-history-1.patch, 1.2 KB (added by ajd, 8 years ago)

Additional readline bindings to read_history and write_history

  • System/Console/Readline.hsc

    Fri Jan 18 22:08:11 PST 2008  [email protected]
      * GHC Trac 2050: Added bindings for read_history and write_history
    diff -rN -u old-readline/System/Console/Readline.hsc new-readline/System/Console/Readline.hsc
    old new  
    4141   
    4242    readline,   -- :: String -> IO (Maybe String)
    4343    addHistory, -- :: String -> IO ()
     44    readHistory, -- :: String -> IO ()
     45    writeHistory, -- :: String -> IO ()
    4446   
    4547    --------------------------------------------------------------------
    4648    -- Readline Variables.
     
    333335addHistory line = withCString line add_history
    334336foreign import ccall unsafe add_history :: Ptr CChar -> IO ()
    335337
     338readHistory :: FilePath -> IO ()
     339readHistory fp = withCString fp read_history
     340foreign import ccall unsafe read_history :: Ptr CChar -> IO ()
     341
     342writeHistory :: FilePath -> IO ()
     343writeHistory fp = withCString fp write_history
     344foreign import ccall unsafe write_history :: Ptr CChar -> IO ()
     345
    336346------------------------------------------------------------------------
    337347-- Readline Variables.
    338348