curses 1.4.5 → 1.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/push_gem.yml +48 -0
  3. data/History.md +3 -0
  4. data/curses.gemspec +1 -1
  5. metadata +8 -247
  6. data/vendor/PDCurses/.gitignore +0 -47
  7. data/vendor/PDCurses/.travis.yml +0 -49
  8. data/vendor/PDCurses/CMakeLists.txt +0 -68
  9. data/vendor/PDCurses/HISTORY.md +0 -2036
  10. data/vendor/PDCurses/IMPLEMNT.md +0 -327
  11. data/vendor/PDCurses/Makefile +0 -27
  12. data/vendor/PDCurses/README.md +0 -77
  13. data/vendor/PDCurses/acs_defs.h +0 -265
  14. data/vendor/PDCurses/appveyor.yml +0 -218
  15. data/vendor/PDCurses/cmake/README.md +0 -71
  16. data/vendor/PDCurses/cmake/build_dependencies.cmake +0 -178
  17. data/vendor/PDCurses/cmake/build_options.cmake +0 -25
  18. data/vendor/PDCurses/cmake/dll_version.cmake +0 -26
  19. data/vendor/PDCurses/cmake/gen_config_header.cmake +0 -43
  20. data/vendor/PDCurses/cmake/get_version.cmake +0 -17
  21. data/vendor/PDCurses/cmake/make_uninstall.cmake +0 -19
  22. data/vendor/PDCurses/cmake/project_common.cmake +0 -121
  23. data/vendor/PDCurses/cmake/resource.in.cmake +0 -52
  24. data/vendor/PDCurses/cmake/sdl2_ttf/CMakeLists.txt +0 -83
  25. data/vendor/PDCurses/cmake/target_arch.cmake +0 -36
  26. data/vendor/PDCurses/cmake/version.in.cmake +0 -73
  27. data/vendor/PDCurses/cmake/watcom_open_dos16_toolchain.cmake +0 -96
  28. data/vendor/PDCurses/cmake/watcom_open_dos32_toolchain.cmake +0 -106
  29. data/vendor/PDCurses/cmake/watcom_open_os2v2_toolchain.cmake +0 -105
  30. data/vendor/PDCurses/curses.h +0 -1846
  31. data/vendor/PDCurses/curspriv.h +0 -134
  32. data/vendor/PDCurses/demos/README.md +0 -25
  33. data/vendor/PDCurses/demos/firework.c +0 -144
  34. data/vendor/PDCurses/demos/newtest.c +0 -581
  35. data/vendor/PDCurses/demos/ozdemo.c +0 -447
  36. data/vendor/PDCurses/demos/ptest.c +0 -283
  37. data/vendor/PDCurses/demos/rain.c +0 -157
  38. data/vendor/PDCurses/demos/testcurs.c +0 -1607
  39. data/vendor/PDCurses/demos/tui.c +0 -1048
  40. data/vendor/PDCurses/demos/tui.h +0 -65
  41. data/vendor/PDCurses/demos/tuidemo.c +0 -233
  42. data/vendor/PDCurses/demos/version.c +0 -61
  43. data/vendor/PDCurses/demos/worm.c +0 -432
  44. data/vendor/PDCurses/demos/xmas.c +0 -955
  45. data/vendor/PDCurses/dos/CMakeLists.txt +0 -47
  46. data/vendor/PDCurses/dos/Makefile +0 -105
  47. data/vendor/PDCurses/dos/Makefile.bcc +0 -83
  48. data/vendor/PDCurses/dos/Makefile.dmc +0 -257
  49. data/vendor/PDCurses/dos/Makefile.msc +0 -113
  50. data/vendor/PDCurses/dos/Makefile.wcc +0 -107
  51. data/vendor/PDCurses/dos/README.md +0 -51
  52. data/vendor/PDCurses/dos/bccdos.lrf +0 -9
  53. data/vendor/PDCurses/dos/mscdos.lrf +0 -50
  54. data/vendor/PDCurses/dos/pdcclip.c +0 -132
  55. data/vendor/PDCurses/dos/pdcdisp.c +0 -135
  56. data/vendor/PDCurses/dos/pdcdos.h +0 -194
  57. data/vendor/PDCurses/dos/pdcgetsc.c +0 -98
  58. data/vendor/PDCurses/dos/pdckbd.c +0 -513
  59. data/vendor/PDCurses/dos/pdcscrn.c +0 -785
  60. data/vendor/PDCurses/dos/pdcsetsc.c +0 -101
  61. data/vendor/PDCurses/dos/pdcutil.c +0 -212
  62. data/vendor/PDCurses/libobjs.mif +0 -26
  63. data/vendor/PDCurses/makedist.mif +0 -20
  64. data/vendor/PDCurses/man/Makefile +0 -37
  65. data/vendor/PDCurses/man/README.md +0 -21
  66. data/vendor/PDCurses/man/intro.md +0 -361
  67. data/vendor/PDCurses/man/manext.c +0 -119
  68. data/vendor/PDCurses/man/sdl.md +0 -152
  69. data/vendor/PDCurses/man/sdl2.md +0 -58
  70. data/vendor/PDCurses/man/x11.md +0 -407
  71. data/vendor/PDCurses/ncurses/CMakeLists.txt +0 -66
  72. data/vendor/PDCurses/ncurses/README.md +0 -26
  73. data/vendor/PDCurses/ncurses/makefile +0 -29
  74. data/vendor/PDCurses/os2/CMakeLists.txt +0 -41
  75. data/vendor/PDCurses/os2/Makefile +0 -132
  76. data/vendor/PDCurses/os2/Makefile.bcc +0 -90
  77. data/vendor/PDCurses/os2/Makefile.wcc +0 -43
  78. data/vendor/PDCurses/os2/README.md +0 -43
  79. data/vendor/PDCurses/os2/iccos2.lrf +0 -50
  80. data/vendor/PDCurses/os2/iccos2.mak +0 -256
  81. data/vendor/PDCurses/os2/pdcclip.c +0 -188
  82. data/vendor/PDCurses/os2/pdcdisp.c +0 -93
  83. data/vendor/PDCurses/os2/pdcgetsc.c +0 -89
  84. data/vendor/PDCurses/os2/pdckbd.c +0 -521
  85. data/vendor/PDCurses/os2/pdcos2.h +0 -55
  86. data/vendor/PDCurses/os2/pdcscrn.c +0 -449
  87. data/vendor/PDCurses/os2/pdcsetsc.c +0 -112
  88. data/vendor/PDCurses/os2/pdcutil.c +0 -52
  89. data/vendor/PDCurses/panel.h +0 -56
  90. data/vendor/PDCurses/pdcurses/README.md +0 -25
  91. data/vendor/PDCurses/pdcurses/addch.c +0 -693
  92. data/vendor/PDCurses/pdcurses/addchstr.c +0 -245
  93. data/vendor/PDCurses/pdcurses/addstr.c +0 -240
  94. data/vendor/PDCurses/pdcurses/attr.c +0 -359
  95. data/vendor/PDCurses/pdcurses/beep.c +0 -68
  96. data/vendor/PDCurses/pdcurses/bkgd.c +0 -223
  97. data/vendor/PDCurses/pdcurses/border.c +0 -411
  98. data/vendor/PDCurses/pdcurses/clear.c +0 -159
  99. data/vendor/PDCurses/pdcurses/color.c +0 -298
  100. data/vendor/PDCurses/pdcurses/debug.c +0 -109
  101. data/vendor/PDCurses/pdcurses/delch.c +0 -96
  102. data/vendor/PDCurses/pdcurses/deleteln.c +0 -211
  103. data/vendor/PDCurses/pdcurses/deprec.c +0 -27
  104. data/vendor/PDCurses/pdcurses/getch.c +0 -417
  105. data/vendor/PDCurses/pdcurses/getstr.c +0 -474
  106. data/vendor/PDCurses/pdcurses/getyx.c +0 -139
  107. data/vendor/PDCurses/pdcurses/inch.c +0 -127
  108. data/vendor/PDCurses/pdcurses/inchstr.c +0 -214
  109. data/vendor/PDCurses/pdcurses/initscr.c +0 -367
  110. data/vendor/PDCurses/pdcurses/inopts.c +0 -324
  111. data/vendor/PDCurses/pdcurses/insch.c +0 -271
  112. data/vendor/PDCurses/pdcurses/insstr.c +0 -264
  113. data/vendor/PDCurses/pdcurses/instr.c +0 -246
  114. data/vendor/PDCurses/pdcurses/kernel.c +0 -259
  115. data/vendor/PDCurses/pdcurses/keyname.c +0 -157
  116. data/vendor/PDCurses/pdcurses/mouse.c +0 -438
  117. data/vendor/PDCurses/pdcurses/move.c +0 -57
  118. data/vendor/PDCurses/pdcurses/outopts.c +0 -159
  119. data/vendor/PDCurses/pdcurses/overlay.c +0 -214
  120. data/vendor/PDCurses/pdcurses/pad.c +0 -260
  121. data/vendor/PDCurses/pdcurses/panel.c +0 -633
  122. data/vendor/PDCurses/pdcurses/printw.c +0 -126
  123. data/vendor/PDCurses/pdcurses/refresh.c +0 -279
  124. data/vendor/PDCurses/pdcurses/scanw.c +0 -578
  125. data/vendor/PDCurses/pdcurses/scr_dump.c +0 -213
  126. data/vendor/PDCurses/pdcurses/scroll.c +0 -101
  127. data/vendor/PDCurses/pdcurses/slk.c +0 -591
  128. data/vendor/PDCurses/pdcurses/termattr.c +0 -182
  129. data/vendor/PDCurses/pdcurses/terminfo.c +0 -217
  130. data/vendor/PDCurses/pdcurses/touch.c +0 -163
  131. data/vendor/PDCurses/pdcurses/util.c +0 -312
  132. data/vendor/PDCurses/pdcurses/window.c +0 -569
  133. data/vendor/PDCurses/sdl1/Makefile +0 -129
  134. data/vendor/PDCurses/sdl1/Makefile.mng +0 -110
  135. data/vendor/PDCurses/sdl1/README.md +0 -31
  136. data/vendor/PDCurses/sdl1/deffont.h +0 -385
  137. data/vendor/PDCurses/sdl1/deficon.h +0 -23
  138. data/vendor/PDCurses/sdl1/pdcclip.c +0 -131
  139. data/vendor/PDCurses/sdl1/pdcdisp.c +0 -373
  140. data/vendor/PDCurses/sdl1/pdcgetsc.c +0 -30
  141. data/vendor/PDCurses/sdl1/pdckbd.c +0 -405
  142. data/vendor/PDCurses/sdl1/pdcscrn.c +0 -414
  143. data/vendor/PDCurses/sdl1/pdcsdl.h +0 -31
  144. data/vendor/PDCurses/sdl1/pdcsetsc.c +0 -64
  145. data/vendor/PDCurses/sdl1/pdcutil.c +0 -40
  146. data/vendor/PDCurses/sdl1/sdltest.c +0 -79
  147. data/vendor/PDCurses/sdl2/CMakeLists.txt +0 -76
  148. data/vendor/PDCurses/sdl2/Makefile +0 -135
  149. data/vendor/PDCurses/sdl2/Makefile.vc +0 -164
  150. data/vendor/PDCurses/sdl2/README.md +0 -34
  151. data/vendor/PDCurses/sdl2/deffont.h +0 -385
  152. data/vendor/PDCurses/sdl2/deficon.h +0 -23
  153. data/vendor/PDCurses/sdl2/pdcclip.c +0 -93
  154. data/vendor/PDCurses/sdl2/pdcdisp.c +0 -534
  155. data/vendor/PDCurses/sdl2/pdcgetsc.c +0 -30
  156. data/vendor/PDCurses/sdl2/pdckbd.c +0 -480
  157. data/vendor/PDCurses/sdl2/pdcscrn.c +0 -443
  158. data/vendor/PDCurses/sdl2/pdcsdl.h +0 -33
  159. data/vendor/PDCurses/sdl2/pdcsetsc.c +0 -67
  160. data/vendor/PDCurses/sdl2/pdcutil.c +0 -39
  161. data/vendor/PDCurses/sdl2/sdltest.c +0 -81
  162. data/vendor/PDCurses/term.h +0 -48
  163. data/vendor/PDCurses/version.mif +0 -7
  164. data/vendor/PDCurses/vt/CMakeLists.txt +0 -28
  165. data/vendor/PDCurses/vt/Makefile +0 -135
  166. data/vendor/PDCurses/vt/Makefile.bcc +0 -111
  167. data/vendor/PDCurses/vt/Makefile.dmc +0 -258
  168. data/vendor/PDCurses/vt/Makefile.vc +0 -144
  169. data/vendor/PDCurses/vt/Makefile.wcc +0 -107
  170. data/vendor/PDCurses/vt/README.md +0 -64
  171. data/vendor/PDCurses/vt/pdcclip.c +0 -20
  172. data/vendor/PDCurses/vt/pdcdisp.c +0 -284
  173. data/vendor/PDCurses/vt/pdcgetsc.c +0 -27
  174. data/vendor/PDCurses/vt/pdckbd.c +0 -394
  175. data/vendor/PDCurses/vt/pdcscrn.c +0 -434
  176. data/vendor/PDCurses/vt/pdcsetsc.c +0 -45
  177. data/vendor/PDCurses/vt/pdcutil.c +0 -43
  178. data/vendor/PDCurses/vt/pdcvt.h +0 -16
  179. data/vendor/PDCurses/watcom.mif +0 -68
  180. data/vendor/PDCurses/wincon/CMakeLists.txt +0 -27
  181. data/vendor/PDCurses/wincon/Makefile.bcc +0 -88
  182. data/vendor/PDCurses/wincon/Makefile.dmc +0 -256
  183. data/vendor/PDCurses/wincon/Makefile.lcc +0 -273
  184. data/vendor/PDCurses/wincon/Makefile.mng +0 -176
  185. data/vendor/PDCurses/wincon/Makefile.vc +0 -144
  186. data/vendor/PDCurses/wincon/Makefile.wcc +0 -51
  187. data/vendor/PDCurses/wincon/README.md +0 -85
  188. data/vendor/PDCurses/wincon/pdcclip.c +0 -174
  189. data/vendor/PDCurses/wincon/pdcdisp.c +0 -143
  190. data/vendor/PDCurses/wincon/pdcgetsc.c +0 -55
  191. data/vendor/PDCurses/wincon/pdckbd.c +0 -786
  192. data/vendor/PDCurses/wincon/pdcscrn.c +0 -717
  193. data/vendor/PDCurses/wincon/pdcsetsc.c +0 -91
  194. data/vendor/PDCurses/wincon/pdcurses.ico +0 -0
  195. data/vendor/PDCurses/wincon/pdcurses.rc +0 -28
  196. data/vendor/PDCurses/wincon/pdcutil.c +0 -41
  197. data/vendor/PDCurses/wincon/pdcwin.h +0 -31
  198. data/vendor/PDCurses/wingui/CMakeLists.txt +0 -27
  199. data/vendor/PDCurses/wingui/Makefile.bcc +0 -85
  200. data/vendor/PDCurses/wingui/Makefile.dmc +0 -259
  201. data/vendor/PDCurses/wingui/Makefile.lcc +0 -273
  202. data/vendor/PDCurses/wingui/Makefile.mng +0 -171
  203. data/vendor/PDCurses/wingui/Makefile.vc +0 -144
  204. data/vendor/PDCurses/wingui/Makefile.wcc +0 -51
  205. data/vendor/PDCurses/wingui/README.md +0 -93
  206. data/vendor/PDCurses/wingui/pdcclip.c +0 -174
  207. data/vendor/PDCurses/wingui/pdcdisp.c +0 -718
  208. data/vendor/PDCurses/wingui/pdcgetsc.c +0 -30
  209. data/vendor/PDCurses/wingui/pdckbd.c +0 -143
  210. data/vendor/PDCurses/wingui/pdcscrn.c +0 -2797
  211. data/vendor/PDCurses/wingui/pdcsetsc.c +0 -89
  212. data/vendor/PDCurses/wingui/pdcurses.ico +0 -0
  213. data/vendor/PDCurses/wingui/pdcurses.rc +0 -28
  214. data/vendor/PDCurses/wingui/pdcutil.c +0 -61
  215. data/vendor/PDCurses/wingui/pdcwin.h +0 -122
  216. data/vendor/PDCurses/x11/Makefile.in +0 -754
  217. data/vendor/PDCurses/x11/PDCurses.spec +0 -82
  218. data/vendor/PDCurses/x11/README.md +0 -62
  219. data/vendor/PDCurses/x11/ScrollBox.c +0 -319
  220. data/vendor/PDCurses/x11/ScrollBox.h +0 -51
  221. data/vendor/PDCurses/x11/ScrollBoxP.h +0 -70
  222. data/vendor/PDCurses/x11/aclocal.m4 +0 -994
  223. data/vendor/PDCurses/x11/big_icon.xbm +0 -46
  224. data/vendor/PDCurses/x11/compose.h +0 -201
  225. data/vendor/PDCurses/x11/config.guess +0 -1500
  226. data/vendor/PDCurses/x11/config.h.in +0 -100
  227. data/vendor/PDCurses/x11/config.sub +0 -1616
  228. data/vendor/PDCurses/x11/configure +0 -6700
  229. data/vendor/PDCurses/x11/configure.ac +0 -295
  230. data/vendor/PDCurses/x11/debian/changelog +0 -6
  231. data/vendor/PDCurses/x11/debian/compat +0 -1
  232. data/vendor/PDCurses/x11/debian/control +0 -11
  233. data/vendor/PDCurses/x11/debian/copyright +0 -27
  234. data/vendor/PDCurses/x11/debian/rules +0 -98
  235. data/vendor/PDCurses/x11/install-sh +0 -253
  236. data/vendor/PDCurses/x11/little_icon.xbm +0 -14
  237. data/vendor/PDCurses/x11/ncurses_cfg.h +0 -45
  238. data/vendor/PDCurses/x11/pdcclip.c +0 -173
  239. data/vendor/PDCurses/x11/pdcdisp.c +0 -85
  240. data/vendor/PDCurses/x11/pdcgetsc.c +0 -28
  241. data/vendor/PDCurses/x11/pdckbd.c +0 -104
  242. data/vendor/PDCurses/x11/pdcscrn.c +0 -258
  243. data/vendor/PDCurses/x11/pdcsetsc.c +0 -95
  244. data/vendor/PDCurses/x11/pdcutil.c +0 -52
  245. data/vendor/PDCurses/x11/pdcx11.c +0 -316
  246. data/vendor/PDCurses/x11/pdcx11.h +0 -191
  247. data/vendor/PDCurses/x11/sb.c +0 -155
  248. data/vendor/PDCurses/x11/x11.c +0 -3686
  249. data/vendor/PDCurses/x11/xcurses-config.in +0 -81
@@ -1,474 +0,0 @@
1
- /* Public Domain Curses */
2
-
3
- #include <curspriv.h>
4
-
5
- /*man-start**************************************************************
6
-
7
- getstr
8
- ------
9
-
10
- ### Synopsis
11
-
12
- int getstr(char *str);
13
- int wgetstr(WINDOW *win, char *str);
14
- int mvgetstr(int y, int x, char *str);
15
- int mvwgetstr(WINDOW *win, int y, int x, char *str);
16
- int getnstr(char *str, int n);
17
- int wgetnstr(WINDOW *win, char *str, int n);
18
- int mvgetnstr(int y, int x, char *str, int n);
19
- int mvwgetnstr(WINDOW *win, int y, int x, char *str, int n);
20
-
21
- int get_wstr(wint_t *wstr);
22
- int wget_wstr(WINDOW *win, wint_t *wstr);
23
- int mvget_wstr(int y, int x, wint_t *wstr);
24
- int mvwget_wstr(WINDOW *win, int, int, wint_t *wstr);
25
- int getn_wstr(wint_t *wstr, int n);
26
- int wgetn_wstr(WINDOW *win, wint_t *wstr, int n);
27
- int mvgetn_wstr(int y, int x, wint_t *wstr, int n);
28
- int mvwgetn_wstr(WINDOW *win, int y, int x, wint_t *wstr, int n);
29
-
30
- ### Description
31
-
32
- These routines call wgetch() repeatedly to build a string,
33
- interpreting erase and kill characters along the way, until a
34
- newline or carriage return is received. When PDCurses is built
35
- with wide-character support enabled, the narrow-character
36
- functions convert the wgetch()'d values into a multibyte string
37
- in the current locale before returning it. The resulting string
38
- is placed in the area pointed to by *str. The routines with n as
39
- the last argument read at most n characters.
40
-
41
- Note that there's no way to know how long the buffer passed to
42
- wgetstr() is, so use wgetnstr() to avoid buffer overflows.
43
-
44
- ### Return Value
45
-
46
- These functions return ERR on failure or any other value on
47
- success.
48
-
49
- ### Portability
50
- X/Open BSD SYS V
51
- getstr Y Y Y
52
- wgetstr Y Y Y
53
- mvgetstr Y Y Y
54
- mvwgetstr Y Y Y
55
- getnstr Y - 4.0
56
- wgetnstr Y - 4.0
57
- mvgetnstr Y - -
58
- mvwgetnstr Y - -
59
- get_wstr Y
60
- wget_wstr Y
61
- mvget_wstr Y
62
- mvwget_wstr Y
63
- getn_wstr Y
64
- wgetn_wstr Y
65
- mvgetn_wstr Y
66
- mvwgetn_wstr Y
67
-
68
- **man-end****************************************************************/
69
-
70
- #define MAXLINE 255
71
-
72
- int wgetnstr(WINDOW *win, char *str, int n)
73
- {
74
- #ifdef PDC_WIDE
75
- wchar_t wstr[MAXLINE + 1];
76
-
77
- if (n < 0 || n > MAXLINE)
78
- n = MAXLINE;
79
-
80
- if (wgetn_wstr(win, (wint_t *)wstr, n) == ERR)
81
- return ERR;
82
-
83
- return (int)PDC_wcstombs(str, wstr, n);
84
- #else
85
- int ch, i, num, x, chars;
86
- char *p;
87
- bool stop, oldecho, oldcbreak, oldnodelay;
88
-
89
- PDC_LOG(("wgetnstr() - called\n"));
90
-
91
- if (!win || !str)
92
- return ERR;
93
-
94
- chars = 0;
95
- p = str;
96
- stop = FALSE;
97
-
98
- x = win->_curx;
99
-
100
- oldcbreak = SP->cbreak; /* remember states */
101
- oldecho = SP->echo;
102
- oldnodelay = win->_nodelay;
103
-
104
- SP->echo = FALSE; /* we do echo ourselves */
105
- cbreak(); /* ensure each key is returned immediately */
106
- win->_nodelay = FALSE; /* don't return -1 */
107
-
108
- wrefresh(win);
109
-
110
- while (!stop)
111
- {
112
- ch = wgetch(win);
113
-
114
- switch (ch)
115
- {
116
-
117
- case '\t':
118
- ch = ' ';
119
- num = TABSIZE - (win->_curx - x) % TABSIZE;
120
- for (i = 0; i < num; i++)
121
- {
122
- if (chars < n)
123
- {
124
- if (oldecho)
125
- waddch(win, ch);
126
- *p++ = (char)ch;
127
- ++chars;
128
- }
129
- else
130
- beep();
131
- }
132
- break;
133
-
134
- case _ECHAR: /* CTRL-H -- Delete character */
135
- if (p > str)
136
- {
137
- if (oldecho)
138
- waddstr(win, "\b \b");
139
- ch = (unsigned char)(*--p);
140
- if ((ch < ' ') && (oldecho))
141
- waddstr(win, "\b \b");
142
- chars--;
143
- }
144
- break;
145
-
146
- case _DLCHAR: /* CTRL-U -- Delete line */
147
- while (p > str)
148
- {
149
- if (oldecho)
150
- waddstr(win, "\b \b");
151
- ch = (unsigned char)(*--p);
152
- if ((ch < ' ') && (oldecho))
153
- waddstr(win, "\b \b");
154
- }
155
- chars = 0;
156
- break;
157
-
158
- case _DWCHAR: /* CTRL-W -- Delete word */
159
-
160
- while ((p > str) && (*(p - 1) == ' '))
161
- {
162
- if (oldecho)
163
- waddstr(win, "\b \b");
164
-
165
- --p; /* remove space */
166
- chars--;
167
- }
168
- while ((p > str) && (*(p - 1) != ' '))
169
- {
170
- if (oldecho)
171
- waddstr(win, "\b \b");
172
-
173
- ch = (unsigned char)(*--p);
174
- if ((ch < ' ') && (oldecho))
175
- waddstr(win, "\b \b");
176
- chars--;
177
- }
178
- break;
179
-
180
- case '\n':
181
- case '\r':
182
- stop = TRUE;
183
- if (oldecho)
184
- waddch(win, '\n');
185
- break;
186
-
187
- default:
188
- if (chars < n)
189
- {
190
- if (!SP->key_code && ch < 0x100)
191
- {
192
- *p++ = (char)ch;
193
- if (oldecho)
194
- waddch(win, ch);
195
- chars++;
196
- }
197
- }
198
- else
199
- beep();
200
-
201
- break;
202
-
203
- }
204
-
205
- wrefresh(win);
206
- }
207
-
208
- *p = '\0';
209
-
210
- SP->echo = oldecho; /* restore old settings */
211
- SP->cbreak = oldcbreak;
212
- win->_nodelay = oldnodelay;
213
-
214
- return OK;
215
- #endif
216
- }
217
-
218
- int getstr(char *str)
219
- {
220
- PDC_LOG(("getstr() - called\n"));
221
-
222
- return wgetnstr(stdscr, str, MAXLINE);
223
- }
224
-
225
- int wgetstr(WINDOW *win, char *str)
226
- {
227
- PDC_LOG(("wgetstr() - called\n"));
228
-
229
- return wgetnstr(win, str, MAXLINE);
230
- }
231
-
232
- int mvgetstr(int y, int x, char *str)
233
- {
234
- PDC_LOG(("mvgetstr() - called\n"));
235
-
236
- if (move(y, x) == ERR)
237
- return ERR;
238
-
239
- return wgetnstr(stdscr, str, MAXLINE);
240
- }
241
-
242
- int mvwgetstr(WINDOW *win, int y, int x, char *str)
243
- {
244
- PDC_LOG(("mvwgetstr() - called\n"));
245
-
246
- if (wmove(win, y, x) == ERR)
247
- return ERR;
248
-
249
- return wgetnstr(win, str, MAXLINE);
250
- }
251
-
252
- int getnstr(char *str, int n)
253
- {
254
- PDC_LOG(("getnstr() - called\n"));
255
-
256
- return wgetnstr(stdscr, str, n);
257
- }
258
-
259
- int mvgetnstr(int y, int x, char *str, int n)
260
- {
261
- PDC_LOG(("mvgetnstr() - called\n"));
262
-
263
- if (move(y, x) == ERR)
264
- return ERR;
265
-
266
- return wgetnstr(stdscr, str, n);
267
- }
268
-
269
- int mvwgetnstr(WINDOW *win, int y, int x, char *str, int n)
270
- {
271
- PDC_LOG(("mvwgetnstr() - called\n"));
272
-
273
- if (wmove(win, y, x) == ERR)
274
- return ERR;
275
-
276
- return wgetnstr(win, str, n);
277
- }
278
-
279
- #ifdef PDC_WIDE
280
- int wgetn_wstr(WINDOW *win, wint_t *wstr, int n)
281
- {
282
- int ch, i, num, x, chars;
283
- wint_t *p;
284
- bool stop, oldecho, oldcbreak, oldnodelay;
285
-
286
- PDC_LOG(("wgetn_wstr() - called\n"));
287
-
288
- if (!win || !wstr)
289
- return ERR;
290
-
291
- chars = 0;
292
- p = wstr;
293
- stop = FALSE;
294
-
295
- x = win->_curx;
296
-
297
- oldcbreak = SP->cbreak; /* remember states */
298
- oldecho = SP->echo;
299
- oldnodelay = win->_nodelay;
300
-
301
- SP->echo = FALSE; /* we do echo ourselves */
302
- cbreak(); /* ensure each key is returned immediately */
303
- win->_nodelay = FALSE; /* don't return -1 */
304
-
305
- wrefresh(win);
306
-
307
- while (!stop)
308
- {
309
- ch = wgetch(win);
310
-
311
- switch (ch)
312
- {
313
-
314
- case '\t':
315
- ch = ' ';
316
- num = TABSIZE - (win->_curx - x) % TABSIZE;
317
- for (i = 0; i < num; i++)
318
- {
319
- if (chars < n)
320
- {
321
- if (oldecho)
322
- waddch(win, ch);
323
- *p++ = ch;
324
- ++chars;
325
- }
326
- else
327
- beep();
328
- }
329
- break;
330
-
331
- case _ECHAR: /* CTRL-H -- Delete character */
332
- if (p > wstr)
333
- {
334
- if (oldecho)
335
- waddstr(win, "\b \b");
336
- ch = *--p;
337
- if ((ch < ' ') && (oldecho))
338
- waddstr(win, "\b \b");
339
- chars--;
340
- }
341
- break;
342
-
343
- case _DLCHAR: /* CTRL-U -- Delete line */
344
- while (p > wstr)
345
- {
346
- if (oldecho)
347
- waddstr(win, "\b \b");
348
- ch = *--p;
349
- if ((ch < ' ') && (oldecho))
350
- waddstr(win, "\b \b");
351
- }
352
- chars = 0;
353
- break;
354
-
355
- case _DWCHAR: /* CTRL-W -- Delete word */
356
-
357
- while ((p > wstr) && (*(p - 1) == ' '))
358
- {
359
- if (oldecho)
360
- waddstr(win, "\b \b");
361
-
362
- --p; /* remove space */
363
- chars--;
364
- }
365
- while ((p > wstr) && (*(p - 1) != ' '))
366
- {
367
- if (oldecho)
368
- waddstr(win, "\b \b");
369
-
370
- ch = *--p;
371
- if ((ch < ' ') && (oldecho))
372
- waddstr(win, "\b \b");
373
- chars--;
374
- }
375
- break;
376
-
377
- case '\n':
378
- case '\r':
379
- stop = TRUE;
380
- if (oldecho)
381
- waddch(win, '\n');
382
- break;
383
-
384
- default:
385
- if (chars < n)
386
- {
387
- if (!SP->key_code)
388
- {
389
- *p++ = ch;
390
- if (oldecho)
391
- waddch(win, ch);
392
- chars++;
393
- }
394
- }
395
- else
396
- beep();
397
-
398
- break;
399
-
400
- }
401
-
402
- wrefresh(win);
403
- }
404
-
405
- *p = '\0';
406
-
407
- SP->echo = oldecho; /* restore old settings */
408
- SP->cbreak = oldcbreak;
409
- win->_nodelay = oldnodelay;
410
-
411
- return OK;
412
- }
413
-
414
- int get_wstr(wint_t *wstr)
415
- {
416
- PDC_LOG(("get_wstr() - called\n"));
417
-
418
- return wgetn_wstr(stdscr, wstr, MAXLINE);
419
- }
420
-
421
- int wget_wstr(WINDOW *win, wint_t *wstr)
422
- {
423
- PDC_LOG(("wget_wstr() - called\n"));
424
-
425
- return wgetn_wstr(win, wstr, MAXLINE);
426
- }
427
-
428
- int mvget_wstr(int y, int x, wint_t *wstr)
429
- {
430
- PDC_LOG(("mvget_wstr() - called\n"));
431
-
432
- if (move(y, x) == ERR)
433
- return ERR;
434
-
435
- return wgetn_wstr(stdscr, wstr, MAXLINE);
436
- }
437
-
438
- int mvwget_wstr(WINDOW *win, int y, int x, wint_t *wstr)
439
- {
440
- PDC_LOG(("mvwget_wstr() - called\n"));
441
-
442
- if (wmove(win, y, x) == ERR)
443
- return ERR;
444
-
445
- return wgetn_wstr(win, wstr, MAXLINE);
446
- }
447
-
448
- int getn_wstr(wint_t *wstr, int n)
449
- {
450
- PDC_LOG(("getn_wstr() - called\n"));
451
-
452
- return wgetn_wstr(stdscr, wstr, n);
453
- }
454
-
455
- int mvgetn_wstr(int y, int x, wint_t *wstr, int n)
456
- {
457
- PDC_LOG(("mvgetn_wstr() - called\n"));
458
-
459
- if (move(y, x) == ERR)
460
- return ERR;
461
-
462
- return wgetn_wstr(stdscr, wstr, n);
463
- }
464
-
465
- int mvwgetn_wstr(WINDOW *win, int y, int x, wint_t *wstr, int n)
466
- {
467
- PDC_LOG(("mvwgetn_wstr() - called\n"));
468
-
469
- if (wmove(win, y, x) == ERR)
470
- return ERR;
471
-
472
- return wgetn_wstr(win, wstr, n);
473
- }
474
- #endif
@@ -1,139 +0,0 @@
1
- /* Public Domain Curses */
2
-
3
- #include <curspriv.h>
4
-
5
- /*man-start**************************************************************
6
-
7
- getyx
8
- -----
9
-
10
- ### Synopsis
11
-
12
- void getyx(WINDOW *win, int y, int x);
13
- void getparyx(WINDOW *win, int y, int x);
14
- void getbegyx(WINDOW *win, int y, int x);
15
- void getmaxyx(WINDOW *win, int y, int x);
16
-
17
- void getsyx(int y, int x);
18
- void setsyx(int y, int x);
19
-
20
- int getbegy(WINDOW *win);
21
- int getbegx(WINDOW *win);
22
- int getcury(WINDOW *win);
23
- int getcurx(WINDOW *win);
24
- int getpary(WINDOW *win);
25
- int getparx(WINDOW *win);
26
- int getmaxy(WINDOW *win);
27
- int getmaxx(WINDOW *win);
28
-
29
- ### Description
30
-
31
- The getyx() macro (defined in curses.h -- the prototypes here
32
- are merely illustrative) puts the current cursor position of the
33
- specified window into y and x. getbegyx() and getmaxyx() return
34
- the starting coordinates and size of the specified window,
35
- respectively. getparyx() returns the starting coordinates of the
36
- parent's window, if the specified window is a subwindow;
37
- otherwise it sets y and x to -1. These are all macros.
38
-
39
- getsyx() gets the coordinates of the virtual screen cursor, and
40
- stores them in y and x. If leaveok() is TRUE, it returns -1, -1.
41
- If lines have been removed with ripoffline(), then getsyx()
42
- includes these lines in its count; so, the returned y and x
43
- values should only be used with setsyx().
44
-
45
- setsyx() sets the virtual screen cursor to the y, x coordinates.
46
- If either y or x is -1, leaveok() is set TRUE, else it's set FALSE.
47
-
48
- getsyx() and setsyx() are meant to be used by a library routine
49
- that manipulates curses windows without altering the position of
50
- the cursor. Note that getsyx() is defined only as a macro.
51
-
52
- getbegy(), getbegx(), getcurx(), getcury(), getmaxy(),
53
- getmaxx(), getpary(), and getparx() return the appropriate
54
- coordinate or size values, or ERR in the case of a NULL window.
55
-
56
- ### Portability
57
- X/Open BSD SYS V
58
- getyx Y Y Y
59
- getparyx - - 4.0
60
- getbegyx - - 3.0
61
- getmaxyx - - 3.0
62
- getsyx - - 3.0
63
- setsyx - - 3.0
64
- getbegy - - -
65
- getbegx - - -
66
- getcury - - -
67
- getcurx - - -
68
- getpary - - -
69
- getparx - - -
70
- getmaxy - - -
71
- getmaxx - - -
72
-
73
- **man-end****************************************************************/
74
-
75
- int getbegy(WINDOW *win)
76
- {
77
- PDC_LOG(("getbegy() - called\n"));
78
-
79
- return win ? win->_begy : ERR;
80
- }
81
-
82
- int getbegx(WINDOW *win)
83
- {
84
- PDC_LOG(("getbegx() - called\n"));
85
-
86
- return win ? win->_begx : ERR;
87
- }
88
-
89
- int getcury(WINDOW *win)
90
- {
91
- PDC_LOG(("getcury() - called\n"));
92
-
93
- return win ? win->_cury : ERR;
94
- }
95
-
96
- int getcurx(WINDOW *win)
97
- {
98
- PDC_LOG(("getcurx() - called\n"));
99
-
100
- return win ? win->_curx : ERR;
101
- }
102
-
103
- int getpary(WINDOW *win)
104
- {
105
- PDC_LOG(("getpary() - called\n"));
106
-
107
- return win ? win->_pary : ERR;
108
- }
109
-
110
- int getparx(WINDOW *win)
111
- {
112
- PDC_LOG(("getparx() - called\n"));
113
-
114
- return win ? win->_parx : ERR;
115
- }
116
-
117
- int getmaxy(WINDOW *win)
118
- {
119
- PDC_LOG(("getmaxy() - called\n"));
120
-
121
- return win ? win->_maxy : ERR;
122
- }
123
-
124
- int getmaxx(WINDOW *win)
125
- {
126
- PDC_LOG(("getmaxx() - called\n"));
127
-
128
- return win ? win->_maxx : ERR;
129
- }
130
-
131
- void setsyx(int y, int x)
132
- {
133
- PDC_LOG(("setsyx() - called\n"));
134
-
135
- curscr->_leaveit = y == -1 || x == -1;
136
-
137
- if (!curscr->_leaveit)
138
- wmove(curscr, y, x);
139
- }