Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
3eb3ac1f
Commit
3eb3ac1f
authored
26 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1999-02-06 17:12:03 by sof]
H98ified
parent
69add38d
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/lib/misc/Readline.lhs
+5
-7
5 additions, 7 deletions
ghc/lib/misc/Readline.lhs
with
5 additions
and
7 deletions
ghc/lib/misc/Readline.lhs
+
5
−
7
View file @
3eb3ac1f
...
...
@@ -36,8 +36,6 @@ import Foreign
import System
--#include <readline/readline.h>
type KeyCode = Int
type RlCallbackFunction =
...
...
@@ -64,7 +62,7 @@ readline prompt = do
prompt (length prompt)
litstr <- _casm_GC_ ``%r = readline (rl_prompt_hack);''
if (litstr == ``NULL'')
then
fail
(userError "Readline has read EOF")
then
ioError
(userError "Readline has read EOF")
else do
str <- unpackCStringIO litstr
_ccall_ free litstr
...
...
@@ -80,7 +78,7 @@ rlBindKey :: KeyCode -- Key to Bind to
-> IO ()
rlBindKey key cback =
if (0 > key) || (key > 255) then
fail
(userError "Invalid ASCII Key Code, must be in range 0.255")
ioError
(userError "Invalid ASCII Key Code, must be in range 0.255")
else do
addCbackEntry (key,cback)
_casm_ `` rl_bind_key((KeyCode)%0,&genericRlCback); '' key
...
...
@@ -100,7 +98,7 @@ rlAddDefun :: String -> -- Function Name
IO ()
rlAddDefun name cback key =
if (0 > key) || (key > 255) then
fail
(userError "Invalid ASCII Key Code, must be in range 0..255")
ioError
(userError "Invalid ASCII Key Code, must be in range 0..255")
else do
addCbackEntry (key, cback)
_casm_ ``rl_add_defun (%0, &genericRlCback, (KeyCode)%1);'' name key
...
...
@@ -231,8 +229,8 @@ rlSetMark :: Int -> IO ()
rlSetMark mark = _casm_ ``rl_mark = %0;'' mark
rlSetDone :: Bool -> IO ()
rlSetDone True = _casm_ ``rl_done = %0;''
1
rlSetDone False = _casm_ ``rl_done = %0;''
0
rlSetDone True = _casm_ ``rl_done = %0;''
(1::Int)
rlSetDone False = _casm_ ``rl_done = %0;''
(0::Int)
rlPendingInput :: KeyCode -> IO ()
rlPendingInput key = primIOToIO (_casm_ ``rl_pending_input = %0;'' key)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment