Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 45541fdb8f
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 575 lines (559 sloc) 14.05 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575
(module terminfo scheme
  (require (lib "1.ss" "srfi")
           (lib "6.ss" "srfi")
           (lib "9.ss" "srfi")
           (lib "11.ss" "srfi")
           (rename-in (lib "13.ss" "srfi") (string-hash s:string-hash))
           (lib "14.ss" "srfi")
           (lib "23.ss" "srfi")
           (lib "60.ss" "srfi")
           (lib "69.ss" "srfi")
           (lib "optional.ss" "srfi"))

  (define-syntax let-optionals
    (syntax-rules ()
      ((let-optionals body ...)
       (let-optionals* body ...))))

  (define ignore void)
  (define (tty-info port) ignore)
  (define (uname) ignore)

  ;; Modify as necessary
  (define (uname:os-name uname)
    (let ((type (system-type 'os)))
      (case type
        ((macosx) "Darwin")
        (else (symbol->string type)))))

  (define (tty-info:output-speed ttyinfo) 'extb)

  (define (path-list->file-name path-list)
    (string-join path-list "/"))

  (define (infix-splitter delimiter)
    (lambda (input-string)
      (string-tokenize input-string
                       (char-set-complement (string->char-set delimiter)))))

  (define (file-readable? filename)
    (member 'read (file-or-directory-permissions filename)))

  (define (file-not-exists? filename)
    (not (file-exists? filename)))

  (define-syntax with-current-input-port
    (syntax-rules ()
      ((with-current-input-port port body ...)
       (parameterize ((current-input-port port)) body ...))))

  (define-syntax with-current-output-port
    (syntax-rules ()
      ((with-current-output-port port body ...)
       (parameterize ((current-output-port port)) body ...))))

  (include "terminfo.scm")
  (include "terminfo-capabilities.scm")
  (include "utilities.scm")

  (provide *current-terminal* *terminfo-directories*
           *capabilities* capability-available?
           setup-terminal
           console-input-port console-output-port
           terminal:baud-rate terminal:port
           terminal:capability terminal:names
           terminal:x-size terminal:y-size
           tparm tputs

           ;; capabilities
           auto-left-margin
           auto-right-margin
           no-esc-ctlc
           ceol-standout-glitch
           eat-newline-glitch
           erase-overstrike
           generic-type
           hard-copy
           has-meta-key
           has-status-line
           insert-null-glitch
           memory-above
           memory-below
           move-insert-mode
           move-standout-mode
           over-strike
           status-line-esc-ok
           dest-tabs-magic-smso
           tilde-glitch
           transparent-underline
           xon-xoff
           needs-xon-xoff
           prtr-silent
           hard-cursor
           non-rev-rmcup
           no-pad-char
           non-dest-scroll-region
           can-change
           back-color-erase
           hue-lightness-saturation
           col-addr-glitch
           cr-cancels-micro-mode
           has-print-wheel
           row-addr-glitch
           semi-auto-right-margin
           cpi-changes-res
           lpi-changes-res
           backspaces-with-bs
           crt-no-scrolling
           no-correctly-working-cr
           gnu-has-meta-key
           linefeed-is-newline
           has-hardware-tabs
           return-does-clr-eol

           columns
           init-tabs
           lines
           lines-of-memory
           magic-cookie-glitch
           padding-baud-rate
           virtual-terminal
           width-status-line
           num-labels
           label-height
           label-width
           max-attributes
           maximum-windows
           max-colors
           max-pairs
           no-color-video
           buffer-capacity
           dot-vert-spacing
           dot-horz-spacing
           max-micro-address
           max-micro-jump
           micro-col-size
           micro-line-size
           number-of-pins
           output-res-char
           output-res-line
           output-res-horz-inch
           output-res-vert-inch
           print-rate
           wide-char-size
           buttons
           bit-image-entwining
           bit-image-type
           magic-cookie-glitch-ul
           carriage-return-delay
           new-line-delay
           backspace-delay
           horizontal-tab-delay
           number-of-function-keys

           back-tab
           bell
           carriage-return
           change-scroll-region
           clear-all-tabs
           clear-screen
           clr-eol
           clr-eos
           column-address
           command-character
           cursor-address
           cursor-down
           cursor-home
           cursor-invisible
           cursor-left
           cursor-mem-address
           cursor-normal
           cursor-right
           cursor-to-ll
           cursor-up
           cursor-visible
           delete-character
           delete-line
           dis-status-line
           down-half-line
           enter-alt-charset-mode
           enter-blink-mode
           enter-bold-mode
           enter-ca-mode
           enter-delete-mode
           enter-dim-mode
           enter-insert-mode
           enter-secure-mode
           enter-protected-mode
           enter-reverse-mode
           enter-standout-mode
           enter-underline-mode
           erase-chars
           exit-alt-charset-mode
           exit-attribute-mode
           exit-ca-mode
           exit-delete-mode
           exit-insert-mode
           exit-standout-mode
           exit-underline-mode
           flash-screen
           form-feed
           from-status-line
           init-1string
           init-2string
           init-3string
           init-file
           insert-character
           insert-line
           insert-padding
           key-backspace
           key-catab
           key-clear
           key-ctab
           key-dc
           key-dl
           key-down
           key-eic
           key-eol
           key-eos
           key-f0
           key-f1
           key-f10
           key-f2
           key-f3
           key-f4
           key-f5
           key-f6
           key-f7
           key-f8
           key-f9
           key-home
           key-ic
           key-il
           key-left
           key-ll
           key-npage
           key-ppage
           key-right
           key-sf
           key-sr
           key-stab
           key-up
           keypad-local
           keypad-xmit
           lab-f0
           lab-f1
           lab-f10
           lab-f2
           lab-f3
           lab-f4
           lab-f5
           lab-f6
           lab-f7
           lab-f8
           lab-f9
           meta-off
           meta-on
           new-line
           pad-char
           parm-dch
           parm-delete-line
           parm-down-cursor
           parm-ich
           parm-index
           parm-insert-line
           parm-left-cursor
           parm-right-cursor
           parm-rindex
           parm-up-cursor
           pkey-key
           pkey-local
           pkey-xmit
           print-screen
           prtr-off
           prtr-on
           repeat-char
           reset-1string
           reset-2string
           reset-3string
           reset-file
           restore-cursor
           row-address
           save-cursor
           scroll-forward
           scroll-reverse
           set-attributes
           set-tab
           set-window
           tab
           to-status-line
           underline-char
           up-half-line
           init-prog
           key-a1
           key-a3
           key-b2
           key-c1
           key-c3
           prtr-non
           char-padding
           acs-chars
           plab-norm
           key-btab
           enter-xon-mode
           exit-xon-mode
           enter-am-mode
           exit-am-mode
           xon-character
           xoff-character
           ena-acs
           label-on
           label-off
           key-beg
           key-cancel
           key-close
           key-command
           key-copy
           key-create
           key-end
           key-enter
           key-exit
           key-find
           key-help
           key-mark
           key-message
           key-move
           key-next
           key-open
           key-options
           key-previous
           key-print
           key-redo
           key-reference
           key-refresh
           key-replace
           key-restart
           key-resume
           key-save
           key-suspend
           key-undo
           key-sbeg
           key-scancel
           key-scommand
           key-scopy
           key-screate
           key-sdc
           key-sdl
           key-select
           key-send
           key-seol
           key-sexit
           key-sfind
           key-shelp
           key-shome
           key-sic
           key-sleft
           key-smessage
           key-smove
           key-snext
           key-soptions
           key-sprevious
           key-sprint
           key-sredo
           key-sreplace
           key-sright
           key-srsume
           key-ssave
           key-ssuspend
           key-sundo
           req-for-input
           key-f11
           key-f12
           key-f13
           key-f14
           key-f15
           key-f16
           key-f17
           key-f18
           key-f19
           key-f20
           key-f21
           key-f22
           key-f23
           key-f24
           key-f25
           key-f26
           key-f27
           key-f28
           key-f29
           key-f30
           key-f31
           key-f32
           key-f33
           key-f34
           key-f35
           key-f36
           key-f37
           key-f38
           key-f39
           key-f40
           key-f41
           key-f42
           key-f43
           key-f44
           key-f45
           key-f46
           key-f47
           key-f48
           key-f49
           key-f50
           key-f51
           key-f52
           key-f53
           key-f54
           key-f55
           key-f56
           key-f57
           key-f58
           key-f59
           key-f60
           key-f61
           key-f62
           key-f63
           clr-bol
           clear-margins
           set-left-margin
           set-right-margin
           label-format
           set-clock
           display-clock
           remove-clock
           create-window
           goto-window
           hangup
           dial-phone
           quick-dial
           tone
           pulse
           flash-hook
           fixed-pause
           wait-tone
           user0
           user1
           user2
           user3
           user4
           user5
           user6
           user7
           user8
           user9
           orig-pair
           orig-colors
           initialize-color
           initialize-pair
           set-color-pair
           set-foreground
           set-background
           change-char-pitch
           change-line-pitch
           change-res-horz
           change-res-vert
           define-char
           enter-doublewide-mode
           enter-draft-quality
           enter-italics-mode
           enter-leftward-mode
           enter-micro-mode
           enter-near-letter-quality
           enter-normal-quality
           enter-shadow-mode
           enter-subscript-mode
           enter-superscript-mode
           enter-upward-mode
           exit-doublewide-mode
           exit-italics-mode
           exit-leftward-mode
           exit-micro-mode
           exit-shadow-mode
           exit-subscript-mode
           exit-superscript-mode
           exit-upward-mode
           micro-column-address
           micro-down
           micro-left
           micro-right
           micro-row-address
           micro-up
           order-of-pins
           parm-down-micro
           parm-left-micro
           parm-right-micro
           parm-up-micro
           select-char-set
           set-bottom-margin
           set-bottom-margin-parm
           set-left-margin-parm
           set-right-margin-parm
           set-top-margin
           set-top-margin-parm
           start-bit-image
           start-char-set-def
           stop-bit-image
           stop-char-set-def
           subscript-characters
           superscript-characters
           these-cause-cr
           zero-motion
           char-set-names
           key-mouse
           mouse-info
           req-mouse-pos
           get-mouse
           set-a-foreground
           set-a-background
           pkey-plab
           device-type
           code-set-init
           set0-des-seq
           set1-des-seq
           set2-des-seq
           set3-des-seq
           set-lr-margin
           set-tb-margin
           bit-image-repeat
           bit-image-newline
           bit-image-carriage-return
           color-names
           define-bit-image-region
           end-bit-image-region
           set-color-band
           set-page-length
           display-pc-char
           enter-pc-charset-mode
           exit-pc-charset-mode
           enter-scancode-mode
           exit-scancode-mode
           pc-term-options
           scancode-escape
           alt-scancode-esc
           enter-horizontal-hl-mode
           enter-left-hl-mode
           enter-low-hl-mode
           enter-right-hl-mode
           enter-top-hl-mode
           enter-vertical-hl-mode
           set-a-attributes
           set-pglen-inch
           termcap-init2
           termcap-reset
           linefeed-if-not-lf
           backspace-if-not-bs
           other-non-function-keys
           arrow-key-map
           acs-ulcorner
           acs-llcorner
           acs-urcorner
           acs-lrcorner
           acs-ltee
           acs-rtee
           acs-btee
           acs-ttee
           acs-hline
           acs-vline
           acs-plus
           memory-lock
           memory-unlock
           box-chars-1
           )
  )

;;
;; Local Variables:
;; eval: (put 'module 'scheme-indent-function 2)
;; End:
;;
Something went wrong with that request. Please try again.