-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathncurses.carp
82 lines (76 loc) · 2.09 KB
/
ncurses.carp
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
(system-include "ncurses.h")
(relative-include "lib/ncurses_helper.h")
(add-lib "-lncurses")
(add-lib "-ltinfo")
(register-type WINDOW)
(register-type SCREEN)
(register-type Chtype)
;; Just a synonym for chtype under the hood.
(register-type Short)
(register-type MEVENT)
(register-type Wchar)
(load "lib/addch.carp")
(load "lib/addstr.carp")
(load "lib/attr.carp")
(load "lib/color.carp")
(load "lib/getch.carp")
(load "lib/init.carp")
(load "lib/refresh.carp")
(load "lib/memleaks.carp")
(load "lib/addchstr.carp")
(load "lib/newpair.carp")
(load "lib/defaultcolors.carp")
(load "lib/termattrs.carp")
(load "lib/beep.carp")
(load "lib/bkgd.carp")
(load "lib/border.carp")
(load "lib/inopts.carp")
(load "lib/clear.carp")
(load "lib/outopts.carp")
(load "lib/overlay.carp")
(load "lib/kernel.carp")
(load "lib/extend.carp")
(load "lib/definekey.carp")
(load "lib/delch.carp")
(load "lib/deleteln.carp")
(load "lib/move.carp")
(load "lib/legacy.carp")
(load "lib/getyx.carp")
(load "lib/scroll.carp")
(load "lib/keybound.carp")
(load "lib/print.carp")
(load "lib/keyok.carp")
(load "lib/keydefined.carp")
(load "lib/wresize.carp")
(load "lib/legacycoding.carp")
(load "lib/scrdump.carp")
(load "lib/resizeterm.carp")
(load "lib/touch.carp")
(load "lib/opaque.carp")
(load "lib/insstr.carp")
(load "lib/insch.carp")
(load "lib/instr.carp")
(load "lib/inchstr.carp")
(load "lib/inch.carp")
(load "lib/getstr.carp")
(load "lib/window.carp")
(defmodule NCurses
(register ERR Int "ERR")
(register OK Int "OK")
(register TRUE Int "TRUE")
(register FALSE Int "FALSE")
(register printw (Fn [String] ()) "printw") ;; memory leak, switch to (Ptr Char)
(defmodule Short
(register from-int (Fn [Int] Short))
(implements from-int from-int))
(defmodule Chtype
(register from-int (Fn [Int] Chtype))
(implements from-int from-int))
;; From ncurses_helper.h
(register width (Fn [] Int))
(register height (Fn [] Int))
;; Windows
(register wattron (Fn [(Ptr WINDOW) Int] ()) "wattron")
(register wrefresh (Fn [(Ptr WINDOW)] ()) "wrefresh")
(register mvwprintw (Fn [(Ptr WINDOW) Int Int String] ()) "mvwprintw") ;; Leak!
)