home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume33 / pdcurses / part10 < prev    next >
Encoding:
Text File  |  1992-11-19  |  54.5 KB  |  1,931 lines

  1. Newsgroups: comp.sources.misc
  2. From: M.Hessling@gu.edu.au (Mark Hessling)
  3. Subject:  v33i090:  pdcurses - Public Domain curses library for DOS and OS/2 v2.0, Part10/11
  4. Message-ID: <1992Nov19.040854.8383@sparky.imd.sterling.com>
  5. X-Md4-Signature: 45b2bda9ce028a0c276ed5a9fdb64bdc
  6. Date: Thu, 19 Nov 1992 04:08:54 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: M.Hessling@gu.edu.au (Mark Hessling)
  10. Posting-number: Volume 33, Issue 90
  11. Archive-name: pdcurses/part10
  12. Environment: DOS,OS/2,ANSI-C
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then feed it
  16. # into a shell via "sh file" or similar.  To overwrite existing files,
  17. # type "sh file -c".
  18. # Contents:  flexos/_16bitmo.c flexos/_8bitmod.c nonport/wborder.c
  19. #   pdcurses.cfg portable/baudrate.c portable/beep.c portable/box.c
  20. #   portable/cbreak.c portable/delay_ou.c portable/getyx.c
  21. #   portable/has_ic.c portable/initcolo.c portable/meta.c
  22. #   portable/mvcur.c portable/mvwin.c portable/nl.c
  23. #   portable/nocbreak.c portable/refresh.c portable/scrollok.c
  24. #   portable/startcol.c portable/touchlin.c portable/wclear.c
  25. #   portable/werase.c portable/winsch.c private/_addtail.c
  26. #   private/_ckbiosk.c private/_gcrspos.c private/_gcurcol.c
  27. #   private/_gcurrow.c private/_getattr.c private/_scrnmod.c
  28. # Wrapped by kent@sparky on Wed Nov 18 21:44:10 1992
  29. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  30. echo If this archive is complete, you will see the following message:
  31. echo '          "shar: End of archive 10 (of 11)."'
  32. if test -f 'flexos/_16bitmo.c' -a "${1}" != "-c" ; then 
  33.   echo shar: Will not clobber existing file \"'flexos/_16bitmo.c'\"
  34. else
  35.   echo shar: Extracting \"'flexos/_16bitmo.c'\" \(1370 characters\)
  36.   sed "s/^X//" >'flexos/_16bitmo.c' <<'END_OF_FILE'
  37. X#define    CURSES_LIBRARY    1
  38. X#include <curses.h>
  39. X
  40. X#ifndef    NDEBUG
  41. Xchar *rcsid__16bitmo = "$Header: c:/curses/flexos/RCS/_16bitmod.c%v 2.0 1992/11/15 02:42:04 mh Rel $";
  42. X#endif
  43. X
  44. X
  45. X
  46. X
  47. X#ifdef    FLEXOS
  48. X/*man-start*********************************************************************
  49. X
  50. X  _flexos_16bitmode()    - Puts console 16 bit mode.
  51. X
  52. X  PDCurses Description:
  53. X     This routine sets 16 bit mode (8 bit character +
  54. X     8 bit attribute) for Flexos.
  55. X
  56. X  PDCurses Return Value:
  57. X     This function returns OK on success and ERR on error.
  58. X
  59. X  PDCurses Errors:
  60. X     Under FLEXOS, an ERR will be returned if the s_get() call
  61. X     fails, or if the s_set() call fails.  You are referred to
  62. X     the Flexos Programmer's Reference Guide for details on the
  63. X     actual error.
  64. X
  65. X  Portability:
  66. X     PDCurses    int _flexos_16bitmode( void );
  67. X
  68. X**man-end**********************************************************************/
  69. X
  70. Xint    _flexos_16bitmode(void)
  71. X{
  72. Xextern    VIRCON    vir;        /* Allocate a Virtual Console Structure */
  73. X
  74. X    retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
  75. X    if (retcode < 0L)
  76. X        return( ERR );
  77. X
  78. X    vir.vc_kbmode = vir.vc_kbmode | (VCKM_NABORT | VCKM_NSTOP |
  79. X                     VCKM_NXLAT  | VCKM_NESC  |
  80. X                     VCKM_16BIT  | VCKM_NECHO |
  81. X                     VCKM_NEOF);
  82. X
  83. X    vir.vc_smode = vir.vc_smode | VCSM_16BIT;
  84. X
  85. X    retcode = s_set(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
  86. X    return( (retcode < 0L) ? ERR : OK );
  87. X}
  88. X#endif
  89. END_OF_FILE
  90.   if test 1370 -ne `wc -c <'flexos/_16bitmo.c'`; then
  91.     echo shar: \"'flexos/_16bitmo.c'\" unpacked with wrong size!
  92.   fi
  93.   # end of 'flexos/_16bitmo.c'
  94. fi
  95. if test -f 'flexos/_8bitmod.c' -a "${1}" != "-c" ; then 
  96.   echo shar: Will not clobber existing file \"'flexos/_8bitmod.c'\"
  97. else
  98.   echo shar: Extracting \"'flexos/_8bitmod.c'\" \(1254 characters\)
  99.   sed "s/^X//" >'flexos/_8bitmod.c' <<'END_OF_FILE'
  100. X#define    CURSES_LIBRARY    1
  101. X#include <curses.h>
  102. X
  103. X#ifndef    NDEBUG
  104. Xchar *rcsid__8bitmod = "$Header: c:/curses/flexos/RCS/_8bitmod.c%v 2.0 1992/11/15 02:42:10 mh Rel $";
  105. X#endif
  106. X
  107. X
  108. X
  109. X
  110. X#ifdef    FLEXOS
  111. X/*man-start*********************************************************************
  112. X
  113. X  _flexos_8bitmode()    - Puts console into 8 bit mode.
  114. X
  115. X  PDCurses Description:
  116. X     This routine sets 8 bit mode (no 8 bit attribute) for Flexos.
  117. X
  118. X  PDCurses Return Value:
  119. X     This function returns OK on success and ERR on error.
  120. X
  121. X  PDCurses Errors:
  122. X     Under FLEXOS, an ERR will be returned if the s_get() call
  123. X     fails, or if the s_set() call fails.  You are referred to
  124. X     the Flexos Programmer's Reference Guide for details on the
  125. X     actual error.
  126. X
  127. X  Portability:
  128. X     PDCurses    int _flexos_16bitmode( void );
  129. X
  130. X**man-end**********************************************************************/
  131. X
  132. Xint    _flexos_8bitmode(void)
  133. X{
  134. Xextern    VIRCON    vir;        /* Allocate a Virtual Console Structure */
  135. X
  136. X    retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
  137. X    if (retcode < 0L)
  138. X        return( ERR );
  139. X
  140. X    vir.vc_kbmode = vir.vc_kbmode & ~VCKM_16BIT;
  141. X    vir.vc_smode = vir.vc_smode & ~VCKM_16BIT;
  142. X
  143. X    retcode = s_set(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
  144. X    return( (retcode < 0L) ? ERR : OK );
  145. X}
  146. X#endif
  147. END_OF_FILE
  148.   if test 1254 -ne `wc -c <'flexos/_8bitmod.c'`; then
  149.     echo shar: \"'flexos/_8bitmod.c'\" unpacked with wrong size!
  150.   fi
  151.   # end of 'flexos/_8bitmod.c'
  152. fi
  153. if test -f 'nonport/wborder.c' -a "${1}" != "-c" ; then 
  154.   echo shar: Will not clobber existing file \"'nonport/wborder.c'\"
  155. else
  156.   echo shar: Extracting \"'nonport/wborder.c'\" \(1193 characters\)
  157.   sed "s/^X//" >'nonport/wborder.c' <<'END_OF_FILE'
  158. X#define    CURSES_LIBRARY    1
  159. X#include <curses.h>
  160. X#undef    wborder
  161. X
  162. X#ifndef    NDEBUG
  163. Xchar *rcsid_wborder = "$Header: c:/curses/nonport/RCS/wborder.c%v 2.0 1992/11/15 03:18:29 MH Rel $";
  164. X#endif
  165. X
  166. X
  167. X
  168. X
  169. X/*man-start*********************************************************************
  170. X
  171. X  wborder()    - sets the border characters in the passed window.
  172. X
  173. X  PDCurses Description:
  174. X     This routine sets the border characters for the passed window.
  175. X
  176. X  PDCurses Return Value:
  177. X     This function returns OK upon success otherwise ERR is returned.
  178. X
  179. X  PDCurses Errors:
  180. X     It is an error for stdscr to be a NULL pointer.
  181. X
  182. X  Portability:
  183. X     PDCurses    int wborder( chtype l,  chtype r,  chtype t,  chtype b,
  184. X                     chtype tl, chtype tr  chtype bl, chtype br );
  185. X
  186. X**man-end**********************************************************************/
  187. X
  188. Xint    wborder(WINDOW *win,chtype l,chtype r,chtype t,chtype b,chtype tl,chtype tr,chtype bl,chtype br)
  189. X{
  190. X    if (win == (WINDOW *)NULL)
  191. X        return( ERR );
  192. X
  193. X    win->_borderchars[0] = l;
  194. X    win->_borderchars[1] = r;
  195. X    win->_borderchars[2] = t;
  196. X    win->_borderchars[3] = b;
  197. X    win->_borderchars[4] = tl;
  198. X    win->_borderchars[5] = tr;
  199. X    win->_borderchars[6] = bl;
  200. X    win->_borderchars[7] = br;
  201. X    return( OK );
  202. X}
  203. END_OF_FILE
  204.   if test 1193 -ne `wc -c <'nonport/wborder.c'`; then
  205.     echo shar: \"'nonport/wborder.c'\" unpacked with wrong size!
  206.   fi
  207.   # end of 'nonport/wborder.c'
  208. fi
  209. if test -f 'pdcurses.cfg' -a "${1}" != "-c" ; then 
  210.   echo shar: Will not clobber existing file \"'pdcurses.cfg'\"
  211. else
  212.   echo shar: Extracting \"'pdcurses.cfg'\" \(43 characters\)
  213.   sed "s/^X//" >'pdcurses.cfg' <<'END_OF_FILE'
  214. X-1-
  215. X-2-
  216. X-K
  217. X-G
  218. X-rd
  219. X-d
  220. X-V
  221. X-w-eff
  222. X-j0
  223. X-c 
  224. X-P-
  225. END_OF_FILE
  226.   if test 43 -ne `wc -c <'pdcurses.cfg'`; then
  227.     echo shar: \"'pdcurses.cfg'\" unpacked with wrong size!
  228.   fi
  229.   # end of 'pdcurses.cfg'
  230. fi
  231. if test -f 'portable/baudrate.c' -a "${1}" != "-c" ; then 
  232.   echo shar: Will not clobber existing file \"'portable/baudrate.c'\"
  233. else
  234.   echo shar: Extracting \"'portable/baudrate.c'\" \(1358 characters\)
  235.   sed "s/^X//" >'portable/baudrate.c' <<'END_OF_FILE'
  236. X#include <limits.h>
  237. X#define CURSES_LIBRARY    1
  238. X#include <curses.h>
  239. X#undef baudrate
  240. X
  241. X#ifndef    NDEBUG
  242. Xchar *rcsid_baudrate = "$Header: c:/curses/portable/RCS/baudrate.c%v 2.0 1992/11/15 03:28:45 MH Rel $";
  243. X#endif
  244. X
  245. X
  246. X
  247. X
  248. X/*man-start*********************************************************************
  249. X
  250. X  baudrate()    - Return terminal baud rate
  251. X
  252. X  X/Open Description:
  253. X     Returns the output speed of the terminal.  The number returned
  254. X     is bits per second, for example 9600, and is an integer.
  255. X
  256. X  PDCurses Description:
  257. X     If FAST_VIDEO is true, then this is the largest possible
  258. X     (portable) int value (INT_MAX from limits.h) IF direct
  259. X     video is possible, OR the approximate guess at BIOS speeds,
  260. X     19200.
  261. X
  262. X     If FAST_VIDEO is false, this is an approximate guess at BIOS
  263. X     speeds, 19200.
  264. X
  265. X  X/Open Return Value:
  266. X     The baudrate() function returns a pointer to a verbose description
  267. X     of the current terminal on success and the null pointer on error.
  268. X
  269. X  X/Open Errors:
  270. X     No errors are defined for this function.
  271. X
  272. X  Portability:
  273. X     PDCurses        int baudrate( void );
  274. X     X/Open Dec '88        int baudrate( void );
  275. X     BSD Curses
  276. X     SYS V Curses
  277. X
  278. X**man-end**********************************************************************/
  279. X
  280. Xint    baudrate(void)
  281. X{
  282. X#ifdef FAST_VIDEO
  283. X    return (_cursvar.direct_video ? INT_MAX : 19200 );
  284. X#else
  285. X    return (19200);            /* Approx. guess at BIOS speeds.*/
  286. X#endif
  287. X}
  288. END_OF_FILE
  289.   if test 1358 -ne `wc -c <'portable/baudrate.c'`; then
  290.     echo shar: \"'portable/baudrate.c'\" unpacked with wrong size!
  291.   fi
  292.   # end of 'portable/baudrate.c'
  293. fi
  294. if test -f 'portable/beep.c' -a "${1}" != "-c" ; then 
  295.   echo shar: Will not clobber existing file \"'portable/beep.c'\"
  296. else
  297.   echo shar: Extracting \"'portable/beep.c'\" \(1324 characters\)
  298.   sed "s/^X//" >'portable/beep.c' <<'END_OF_FILE'
  299. X#define    CURSES_LIBRARY    1
  300. X#include <curses.h>
  301. X#undef beep
  302. X
  303. X#ifndef    NDEBUG
  304. Xchar *rcsid_beep = "$Header: c:/curses/portable/RCS/beep.c%v 2.0 1992/11/15 03:29:34 MH Rel $";
  305. X#endif
  306. X
  307. X
  308. X
  309. X
  310. X/*man-start*********************************************************************
  311. X
  312. X  beep()    - generate audio-visual alarm.
  313. X
  314. X  X/Open Description:
  315. X     This routine is used to signal the terminal user.  The beep()
  316. X     function will sound the audible bell on the terminal, if possible
  317. X     and if not, will flash the screen (visible bell), if possible.
  318. X     The flash() function will flash the screen, and if that is not
  319. X     possible, will sound the audible signal.  If neither signal is
  320. X     possible, nothing will happen.  Nearly all terminals have an
  321. X     audible signal (bell or beep), but only some can flash the screen.
  322. X
  323. X  X/Open Return Value:
  324. X     The beep() and flash() functions return OK on success and ERR on
  325. X     error.
  326. X
  327. X  X/Open Errors:
  328. X     No errors are defined for this function.
  329. X
  330. X  Portability:
  331. X     PDCurses    int beep( void );
  332. X     X/Open Dec '88    int beep( void );
  333. X     BSD Curses    int beep( void );
  334. X     SYS V Curses    int beep( void );
  335. X
  336. X**man-end**********************************************************************/
  337. X
  338. Xint    beep(void)
  339. X{
  340. X    if (!_cursvar.audible)
  341. X    {
  342. X        flash();
  343. X        return( ERR );        /* We try to flash instead...*/
  344. X    }
  345. X    PDC_putctty( '\007', 0 );
  346. X    return( OK );
  347. X}
  348. END_OF_FILE
  349.   if test 1324 -ne `wc -c <'portable/beep.c'`; then
  350.     echo shar: \"'portable/beep.c'\" unpacked with wrong size!
  351.   fi
  352.   # end of 'portable/beep.c'
  353. fi
  354. if test -f 'portable/box.c' -a "${1}" != "-c" ; then 
  355.   echo shar: Will not clobber existing file \"'portable/box.c'\"
  356. else
  357.   echo shar: Extracting \"'portable/box.c'\" \(1359 characters\)
  358.   sed "s/^X//" >'portable/box.c' <<'END_OF_FILE'
  359. X#define    CURSES_LIBRARY    1
  360. X#include <curses.h>
  361. X#undef    box
  362. X
  363. X#ifndef    NDEBUG
  364. Xchar *rcsid_box = "$Header: c:/curses/portable/RCS/box.c%v 2.0 1992/11/15 03:28:51 MH Rel $";
  365. X#endif
  366. X
  367. X
  368. X
  369. X
  370. X/*man-start*********************************************************************
  371. X
  372. X  box()    - draw box
  373. X
  374. X  X/Open Description:    
  375. X     A box is drawn around the edge of the window.  The characters
  376. X     vert and hor are the characters used to draw the box.  If vert or
  377. X     hor are zero, then appropriate default characters will be used.
  378. X
  379. X  PDCurses Description:
  380. X     See border() for additional control over the sides and corners
  381. X     of the box drawn.
  382. X
  383. X  X/Open Return Value:
  384. X     The box() function returns OK on success and ERR on error.
  385. X
  386. X  PDCurses Errors:
  387. X     No errors are defined for these functions.
  388. X
  389. X  Portability:
  390. X     PDCurses    int box( WINDOW* win, chtype vert, chtype hor );
  391. X     X/Open Dec '88    int box( WINDOW* win, chtype vert, chtype hor );
  392. X     BSD Curses    int box( WINDOW* win, chtype vert, chtype hor );
  393. X     SYS V Curses    int box( WINDOW* win, chtype vert, chtype hor );
  394. X
  395. X**man-end**********************************************************************/
  396. X
  397. Xint    box( WINDOW *win, chtype vert, chtype hor )
  398. X{
  399. X    if  (!vert || !hor)    /*
  400. X    {            * SYSV Fix Courtesy of Augustine Cano
  401. X        vert= ACS_VLINE;* afc@shibaya.lonestar.org
  402. X        hor = ACS_HLINE;* 19920520
  403. X    }            */
  404. X    return( wbox( win, 0, 0, 0, 0, vert, hor ) );
  405. X}
  406. END_OF_FILE
  407.   if test 1359 -ne `wc -c <'portable/box.c'`; then
  408.     echo shar: \"'portable/box.c'\" unpacked with wrong size!
  409.   fi
  410.   # end of 'portable/box.c'
  411. fi
  412. if test -f 'portable/cbreak.c' -a "${1}" != "-c" ; then 
  413.   echo shar: Will not clobber existing file \"'portable/cbreak.c'\"
  414. else
  415.   echo shar: Extracting \"'portable/cbreak.c'\" \(1345 characters\)
  416.   sed "s/^X//" >'portable/cbreak.c' <<'END_OF_FILE'
  417. X#define    CURSES_LIBRARY    1
  418. X#include <curses.h>
  419. X#undef    cbreak
  420. X
  421. X#ifndef    NDEBUG
  422. Xchar *rcsid_cbreak = "$Header: c:/curses/portable/RCS/cbreak.c%v 2.0 1992/11/15 03:28:47 MH Rel $";
  423. X#endif
  424. X
  425. X
  426. X
  427. X
  428. X/*man-start*********************************************************************
  429. X
  430. X  cbreak()    - set/clear cbreak mode
  431. X
  432. X  X/Open Description:    cbreak() and nocbreak()
  433. X     These two routines put the terminal into and out of cbreak mode.
  434. X     In cbreak mode, characters typed by the user are immediately
  435. X     available to the program and erase/kill character processing is
  436. X     not performed.  When out of cbreak mode, the terminal driver
  437. X     will buffer characters typed until a newline or carriage return
  438. X     is typed.  Interrupt and flow control characters are unaffected
  439. X     by this mode.  Initially the terminal may or may not need be
  440. X     in cbreak mode.
  441. X
  442. X  PDCurses Description:
  443. X     There is no additional PDCurses functionality.
  444. X
  445. X  X/Open Return Value:
  446. X     The cbreak() function returns OK on success and ERR on error.
  447. X
  448. X  PDCurses Errors:
  449. X     No errors are defined for these functions.
  450. X
  451. X  Portability:
  452. X     PDCurses    int cbreak( void );
  453. X     X/Open Dec '88    int cbreak( void );
  454. X     BSD Curses    int cbreak( void );
  455. X     SYS V Curses    int cbreak( void );
  456. X
  457. X**man-end**********************************************************************/
  458. X
  459. Xint    cbreak(void)
  460. X{
  461. X    _cursvar.cbreak = TRUE;
  462. X    return( OK );
  463. X}
  464. END_OF_FILE
  465.   if test 1345 -ne `wc -c <'portable/cbreak.c'`; then
  466.     echo shar: \"'portable/cbreak.c'\" unpacked with wrong size!
  467.   fi
  468.   # end of 'portable/cbreak.c'
  469. fi
  470. if test -f 'portable/delay_ou.c' -a "${1}" != "-c" ; then 
  471.   echo shar: Will not clobber existing file \"'portable/delay_ou.c'\"
  472. else
  473.   echo shar: Extracting \"'portable/delay_ou.c'\" \(1328 characters\)
  474.   sed "s/^X//" >'portable/delay_ou.c' <<'END_OF_FILE'
  475. X#define    CURSES_LIBRARY    1
  476. X/*#define NEEDS_OS2       1*/
  477. X#include <curses.h>
  478. X#undef    delay_output
  479. X
  480. X#if defined(DOS) && defined(MSC)
  481. X#include <time.h>
  482. X#endif
  483. X
  484. X#ifndef    NDEBUG
  485. Xchar *rcsid_delay_ou = "$Header: c:/curses/portable/RCS/delay_ou.c%v 2.0 1992/11/15 03:28:46 MH Rel $";
  486. X#endif
  487. X
  488. X#ifdef OS2
  489. X    APIRET APIENTRY DosSleep(ULONG ulTime);
  490. X#endif
  491. X
  492. X
  493. X/*man-start*********************************************************************
  494. X
  495. X  delay_output()    - cause short delay
  496. X
  497. X  X/Open Description:
  498. X     Insert ms millisecond pause in output.  On some systems, this
  499. X     has no effect.
  500. X
  501. X  PDCurses Description:
  502. X     This routine relies on the compiler's delay() routine and
  503. X     provides this x millisecond granularity to the application.
  504. X
  505. X  X/Open Return Value:
  506. X     The delay_output() function returns OK on success and ERR on error.
  507. X
  508. X  PDCurses Errors:
  509. X     If this function is a nop, then an ERR is returned.
  510. X
  511. X  Portability:
  512. X     PDCurses    int delay_output( int ms );
  513. X     X/Open Dec '88    int delay_output( int ms );
  514. X     BSD Curses    
  515. X     SYS V Curses    
  516. X
  517. X**man-end**********************************************************************/
  518. X
  519. Xint    delay_output( int ms )
  520. X{
  521. X#if defined(TC) && defined(DOS)
  522. X    delay( ms );
  523. X    return( OK );
  524. X#endif
  525. X#if    defined(OS2)
  526. X    DosSleep(ms);
  527. X    return( OK );
  528. X#endif
  529. X#if    defined(DOS) && defined(MSC)
  530. X    PDC_usleep((clock_t)ms);
  531. X    return( OK );
  532. X#endif
  533. X}
  534. END_OF_FILE
  535.   if test 1328 -ne `wc -c <'portable/delay_ou.c'`; then
  536.     echo shar: \"'portable/delay_ou.c'\" unpacked with wrong size!
  537.   fi
  538.   # end of 'portable/delay_ou.c'
  539. fi
  540. if test -f 'portable/getyx.c' -a "${1}" != "-c" ; then 
  541.   echo shar: Will not clobber existing file \"'portable/getyx.c'\"
  542. else
  543.   echo shar: Extracting \"'portable/getyx.c'\" \(1326 characters\)
  544.   sed "s/^X//" >'portable/getyx.c' <<'END_OF_FILE'
  545. X#define    CURSES_LIBRARY    1
  546. X#include <curses.h>
  547. X#undef    getyx
  548. X
  549. X#ifndef    NDEBUG
  550. Xchar *rcsid_getyx = "$Header: c:/curses/portable/RCS/getyx.c%v 2.0 1992/11/15 03:28:53 MH Rel $";
  551. X#endif
  552. X
  553. X
  554. X
  555. X
  556. X/*man-start*********************************************************************
  557. X
  558. X  getyx()    - get cursor position
  559. X
  560. X  X/Open Description:
  561. X     The cursor position of the window is placed in the two integer
  562. X     variables y and x.  This is implemented as a macro, so no & is
  563. X     necessary before the variables.
  564. X
  565. X     NOTE: getyx() is a macro.
  566. X
  567. X  PDCurses Description:
  568. X     This routine is here to as a documentation place holder.  The
  569. X     code in this module will never be executed unless you #undef
  570. X     getyx(), in which case, you will need the & operator.
  571. X
  572. X  X/Open Return Value:
  573. X     This function returns OK on success and ERR on error.
  574. X
  575. X  X/Open Errors:
  576. X     No errors are defined for this function.
  577. X
  578. X  Portability:
  579. X     PDCurses    int getyx( WINDOW* win, int* y, int* x );
  580. X         or         int getyx( WINDOW* win, int y, int x );
  581. X     X/Open Dec '88    int getyx( WINDOW* win, int y, int x );
  582. X     BSD Curses    int getyx( WINDOW* win, int y, int x );
  583. X     SYS V Curses    int getyx( WINDOW* win, int y, int x );
  584. X
  585. X**man-end**********************************************************************/
  586. X
  587. Xint    getyx( WINDOW *win, int *y, int *x )
  588. X{
  589. X    *y = win->_cury;
  590. X    *x = win->_curx;
  591. X    return( OK );
  592. X}
  593. END_OF_FILE
  594.   if test 1326 -ne `wc -c <'portable/getyx.c'`; then
  595.     echo shar: \"'portable/getyx.c'\" unpacked with wrong size!
  596.   fi
  597.   # end of 'portable/getyx.c'
  598. fi
  599. if test -f 'portable/has_ic.c' -a "${1}" != "-c" ; then 
  600.   echo shar: Will not clobber existing file \"'portable/has_ic.c'\"
  601. else
  602.   echo shar: Extracting \"'portable/has_ic.c'\" \(1205 characters\)
  603.   sed "s/^X//" >'portable/has_ic.c' <<'END_OF_FILE'
  604. X#define    CURSES_LIBRARY    1
  605. X#include <curses.h>
  606. X#undef    has_ic
  607. X
  608. X#ifndef    NDEBUG
  609. Xchar *rcsid_has_ic = "$Header: c:/curses/portable/RCS/has_ic.c%v 2.0 1992/11/15 03:28:54 MH Rel $";
  610. X#endif
  611. X
  612. X
  613. X
  614. X
  615. X/*man-start*********************************************************************
  616. X
  617. X  has_ic()    - determine whether insert/delete character available
  618. X
  619. X  X/Open Description:
  620. X     This function will return TRUE if the terminal has insert character
  621. X     and delete character capabilities.
  622. X
  623. X  PDCurses Description:
  624. X     For DOS, this is irrelevant (and ALWAYS TRUE), as the speed of
  625. X     the DIRECT VIDEO or even BIOS writes is quicker than on a
  626. X     serial terminal.
  627. X
  628. X     For FLEXOS, this value has meaning and depends on the terminal,
  629. X     though at this time, it is a constant TRUE.
  630. X
  631. X  X/Open Return Value:
  632. X     The has_ic() function returns TRUE if the terminal has insert
  633. X     character and delete character capabilities, otherwise it returns
  634. X     FALSE.
  635. X
  636. X  X/Open Errors:
  637. X     No errors are defined for this function.
  638. X
  639. X  Portability:
  640. X     PDCurses    bool has_ic(void);
  641. X     X/Open Dec '88    bool has_ic(void);
  642. X     BSD Curses    
  643. X     SYS V Curses    
  644. X
  645. X**man-end**********************************************************************/
  646. X
  647. Xbool    has_ic(void)
  648. X{
  649. X    return( TRUE );
  650. X}
  651. END_OF_FILE
  652.   if test 1205 -ne `wc -c <'portable/has_ic.c'`; then
  653.     echo shar: \"'portable/has_ic.c'\" unpacked with wrong size!
  654.   fi
  655.   # end of 'portable/has_ic.c'
  656. fi
  657. if test -f 'portable/initcolo.c' -a "${1}" != "-c" ; then 
  658.   echo shar: Will not clobber existing file \"'portable/initcolo.c'\"
  659. else
  660.   echo shar: Extracting \"'portable/initcolo.c'\" \(1319 characters\)
  661.   sed "s/^X//" >'portable/initcolo.c' <<'END_OF_FILE'
  662. X#define    CURSES_LIBRARY    1
  663. X#include <curses.h>
  664. X
  665. X#ifndef    NDEBUG
  666. Xchar *rcsid_initcolo = "$Header: c:/curses/portable/RCS/initcolo.c%v 2.0 1992/11/15 03:28:55 MH Rel $";
  667. X#endif
  668. X
  669. X
  670. X
  671. X
  672. X/*man-start*********************************************************************
  673. X
  674. X  init_color()    - Change the definition of a color.
  675. X
  676. X  PDCurses Description:
  677. X
  678. X     This routine is used to change the definition of a color.
  679. X     The routine takes four arguments: the number of the color to be
  680. X     redefined, and the new values of the red, green and blue
  681. X     components of the color.
  682. X
  683. X     The value of color must be between 0 and COLORS-1.
  684. X     The values of red, green and blue must each fall between 0 and
  685. X     1000;
  686. X
  687. X     ***** This function doesn't do anything yet *****
  688. X
  689. X  PDCurses Return Value:
  690. X     This function returns OK if the color change was possible or
  691. X     ERR on error.
  692. X
  693. X  PDCurses Errors:
  694. X     N/A
  695. X
  696. X  Portability:
  697. X     PDCurses    int init_color( int color, short red, short green, short blue);
  698. X     SYS V curses    int init_color( int color, short red, short green, short blue);
  699. X
  700. X**man-end**********************************************************************/
  701. X
  702. X
  703. Xint init_color(int color, short red, short green, short blue)
  704. X{
  705. X extern int COLORS;
  706. X
  707. X if (color >= COLORS -1 || color < 1)
  708. X    return(ERR);
  709. X/*
  710. X * This function doesn't do anything yet...
  711. X */
  712. X return(ERR);
  713. X}
  714. END_OF_FILE
  715.   if test 1319 -ne `wc -c <'portable/initcolo.c'`; then
  716.     echo shar: \"'portable/initcolo.c'\" unpacked with wrong size!
  717.   fi
  718.   # end of 'portable/initcolo.c'
  719. fi
  720. if test -f 'portable/meta.c' -a "${1}" != "-c" ; then 
  721.   echo shar: Will not clobber existing file \"'portable/meta.c'\"
  722. else
  723.   echo shar: Extracting \"'portable/meta.c'\" \(1302 characters\)
  724.   sed "s/^X//" >'portable/meta.c' <<'END_OF_FILE'
  725. X#define    CURSES_LIBRARY    1
  726. X#include <curses.h>
  727. X#undef    meta
  728. X
  729. X#ifndef    NDEBUG
  730. Xchar *rcsid_meta = "$Header: c:/curses/portable/RCS/meta.c%v 2.0 1992/11/15 03:29:00 MH Rel $";
  731. X#endif
  732. X
  733. X
  734. X
  735. X
  736. X/*man-start*********************************************************************
  737. X
  738. X  meta()    - Force the number of significant bits on input.
  739. X
  740. X  Ultrix 4.1 Description:
  741. X     This function forces the user's terminal to return 7 or 8
  742. X     significant bits on input.  To force 8 bits to be returned,
  743. X     invoke meta() with bf as TRUE.  To force 7 bits to be returned,
  744. X     invoke meta() with bf as FALSE.
  745. X
  746. X     The window argument is always ignored, but it must still be a
  747. X     valid window to avoid compiler errors.
  748. X
  749. X  PDCurses Description:
  750. X     This function is provided for portability.  By default, 8 bits
  751. X     are returned.
  752. X
  753. X     FYI:  The Ultrix DOC needs confirmation...
  754. X
  755. X  PDCurses Return Value:
  756. X     The meta() function returns OK.
  757. X
  758. X  PDCurses Errors:
  759. X     No errors are defined for this function.
  760. X
  761. X  Portability:
  762. X     PDCurses    int meta( WINDOW* win, bool bf );
  763. X     BSD Curses    int meta( WINDOW* win, bool bf );
  764. X     SYS V Curses    int meta( WINDOW* win, bool bf );
  765. X
  766. X**man-end**********************************************************************/
  767. X
  768. Xint    meta( WINDOW *win, bool bf )
  769. X{
  770. X#ifdef    TC
  771. X# pragma argsused;
  772. X#endif
  773. X    _cursvar.raw_inp = bf;
  774. X    return( OK );
  775. X}
  776. END_OF_FILE
  777.   if test 1302 -ne `wc -c <'portable/meta.c'`; then
  778.     echo shar: \"'portable/meta.c'\" unpacked with wrong size!
  779.   fi
  780.   # end of 'portable/meta.c'
  781. fi
  782. if test -f 'portable/mvcur.c' -a "${1}" != "-c" ; then 
  783.   echo shar: Will not clobber existing file \"'portable/mvcur.c'\"
  784. else
  785.   echo shar: Extracting \"'portable/mvcur.c'\" \(1382 characters\)
  786.   sed "s/^X//" >'portable/mvcur.c' <<'END_OF_FILE'
  787. X#define    CURSES_LIBRARY    1
  788. X#include <curses.h>
  789. X#undef    mvcur
  790. X
  791. X#ifndef    NDEBUG
  792. Xchar *rcsid_mvcur = "$Header: c:/curses/portable/RCS/mvcur.c%v 2.0 1992/11/15 03:29:00 MH Rel $";
  793. X#endif
  794. X
  795. X
  796. X
  797. X
  798. X/*man-start*********************************************************************
  799. X
  800. X  mvcur()    - low-level cursor movement
  801. X
  802. X  Ultrix 4.1 Description:
  803. X     This function controls low-level cursor motion with optimization.
  804. X
  805. X  PDCurses Description:
  806. X     There is no optimization here since the PC has memory mapped
  807. X     video and we support, under certain compilation options, direct
  808. X     video writes.
  809. X
  810. X  PDCurses Return Value:
  811. X     The mvcur() function returns OK on success and ERR on error.
  812. X
  813. X  PDCurses Errors:
  814. X     If the new cursor position is outside the physical screen size,
  815. X     an error occurs.
  816. X
  817. X  Portability:
  818. X     PDCurses    int mvcur(int oldrow,int oldcol,int newrow,int newcol);
  819. X     BSD Curses    int mvcur(int oldrow,int oldcol,int newrow,int newcol);
  820. X     SYS V Curses    int mvcur(int oldrow,int oldcol,int newrow,int newcol);
  821. X
  822. X**man-end**********************************************************************/
  823. X
  824. Xint    mvcur(int oldrow, int oldcol, int newrow, int newcol)
  825. X{
  826. X#ifdef    TC
  827. X#  pragma argsused
  828. X#endif
  829. X    if ((newrow >= LINES)    ||
  830. X        (newcol >= COLS)    ||
  831. X        (newrow < 0)    ||
  832. X        (newcol < 0))
  833. X    {
  834. X        return( ERR );
  835. X    }
  836. X    PDC_gotoxy( newrow, newcol );
  837. X    _cursvar.cursrow = newrow;
  838. X    _cursvar.curscol = newcol;
  839. X    return( OK );
  840. X}
  841. END_OF_FILE
  842.   if test 1382 -ne `wc -c <'portable/mvcur.c'`; then
  843.     echo shar: \"'portable/mvcur.c'\" unpacked with wrong size!
  844.   fi
  845.   # end of 'portable/mvcur.c'
  846. fi
  847. if test -f 'portable/mvwin.c' -a "${1}" != "-c" ; then 
  848.   echo shar: Will not clobber existing file \"'portable/mvwin.c'\"
  849. else
  850.   echo shar: Extracting \"'portable/mvwin.c'\" \(1253 characters\)
  851.   sed "s/^X//" >'portable/mvwin.c' <<'END_OF_FILE'
  852. X#define    CURSES_LIBRARY    1
  853. X#include <curses.h>
  854. X#undef    mvwin
  855. X
  856. X#ifndef    NDEBUG
  857. Xchar *rcsid_mvwin = "$Header: c:/curses/portable/RCS/mvwin.c%v 2.0 1992/11/15 03:29:01 MH Rel $";
  858. X#endif
  859. X
  860. X
  861. X
  862. X
  863. X/*man-start*********************************************************************
  864. X
  865. X  mvwin()    - move window
  866. X
  867. X  X/Open Description:
  868. X     
  869. X
  870. X  PDCurses Description:
  871. X     There is no additional PDCurses functionality.
  872. X
  873. X  X/Open Return Value:
  874. X     The mvwin() routine returns OK on success and otherwise ERR
  875. X     is returned.
  876. X
  877. X  PDCurses Errors:
  878. X     It is an error to call this function with a NULL window pointer.
  879. X     It is also an error to address a position that is outside the
  880. X     bounds of the specified window.
  881. X
  882. X  Portability:
  883. X     PDCurses    int mvwin( WINDOW* win, int y, int x );
  884. X     X/Open Dec '88    int mvwin( WINDOW* win, int y, int x );
  885. X     BSD Curses    int mvwin( WINDOW* win, int y, int x );
  886. X     SYS V Curses    int mvwin( WINDOW* win, int y, int x );
  887. X
  888. X**man-end**********************************************************************/
  889. X
  890. Xint    mvwin(WINDOW *win, int y, int x)
  891. X{
  892. X    if (win == (WINDOW *)NULL)
  893. X        return( ERR );
  894. X
  895. X    if (win->_begy + win->_maxy > LINES)
  896. X        return( ERR );
  897. X
  898. X    if (win->_begx + win->_maxx > COLS)
  899. X        return( ERR );
  900. X
  901. X    win->_begy = y;
  902. X    win->_begx = x;
  903. X    touchwin(win);
  904. X    return( OK );
  905. X}
  906. END_OF_FILE
  907.   if test 1253 -ne `wc -c <'portable/mvwin.c'`; then
  908.     echo shar: \"'portable/mvwin.c'\" unpacked with wrong size!
  909.   fi
  910.   # end of 'portable/mvwin.c'
  911. fi
  912. if test -f 'portable/nl.c' -a "${1}" != "-c" ; then 
  913.   echo shar: Will not clobber existing file \"'portable/nl.c'\"
  914. else
  915.   echo shar: Extracting \"'portable/nl.c'\" \(1437 characters\)
  916.   sed "s/^X//" >'portable/nl.c' <<'END_OF_FILE'
  917. X#define    CURSES_LIBRARY    1
  918. X#include <curses.h>
  919. X#undef    nl
  920. X
  921. X#ifndef    NDEBUG
  922. Xchar *rcsid_nl = "$Header: c:/curses/portable/RCS/nl.c%v 2.0 1992/11/15 03:29:04 MH Rel $";
  923. X#endif
  924. X
  925. X
  926. X
  927. X
  928. X/*man-start*********************************************************************
  929. X
  930. X  nl()    - enable/disable newline control
  931. X
  932. X  X/Open Description:    nl(), nonl()
  933. X     These functions control whether a newline is translated into a
  934. X     carriage return and a line-feed on output, and wether a return
  935. X     is translated into a newline on input.  Initially, the translations
  936. X     do occur.  By disabling these translations, curses is able to
  937. X     make better use of the line-feed capability, resulting in faster
  938. X     cursor motion.
  939. X
  940. X     NOTE: nl() and nonl() are macros.
  941. X
  942. X  PDCurses Description:
  943. X     This module is not an executable, it is merely a documentation
  944. X     place holder.  This module will only execute code if the user
  945. X     #undefs nl.
  946. X
  947. X  X/Open Return Value:
  948. X     The nl() and nonl() functions return OK on success and ERR on error.
  949. X
  950. X  X/Open Errors:
  951. X     No errors are defined for this function.
  952. X
  953. X  Portability:
  954. X     PDCurses    int mvprintw( int y, int x, char* fmt, ... );
  955. X     X/Open Dec '88    int mvprintw( int y, int x, char* fmt, ... );
  956. X     BSD Curses    int mvprintw( int y, int x, char* fmt, ... );
  957. X     SYS V Curses    int mvprintw( int y, int x, char* fmt, ... );
  958. X
  959. X**man-end**********************************************************************/
  960. X
  961. Xint    nl(void)
  962. X{
  963. X    _cursvar.autocr = TRUE;
  964. X    return( OK );
  965. X}
  966. END_OF_FILE
  967.   if test 1437 -ne `wc -c <'portable/nl.c'`; then
  968.     echo shar: \"'portable/nl.c'\" unpacked with wrong size!
  969.   fi
  970.   # end of 'portable/nl.c'
  971. fi
  972. if test -f 'portable/nocbreak.c' -a "${1}" != "-c" ; then 
  973.   echo shar: Will not clobber existing file \"'portable/nocbreak.c'\"
  974. else
  975.   echo shar: Extracting \"'portable/nocbreak.c'\" \(1366 characters\)
  976.   sed "s/^X//" >'portable/nocbreak.c' <<'END_OF_FILE'
  977. X#define    CURSES_LIBRARY    1
  978. X#include <curses.h>
  979. X#undef    nocbreak
  980. X
  981. X#ifndef    NDEBUG
  982. Xchar *rcsid_nocbreak = "$Header: c:/curses/portable/RCS/nocbreak.c%v 2.0 1992/11/15 03:29:04 MH Rel $";
  983. X#endif
  984. X
  985. X
  986. X
  987. X
  988. X/*man-start*********************************************************************
  989. X
  990. X  nocbreak()    - set/clear cbreak mode
  991. X
  992. X  X/Open Description:    cbreak() and nocbreak()
  993. X     These two routines put the terminal into and out of cbreak mode.
  994. X     In cbreak mode, characters typed by the user are immediately
  995. X     available to the program and erase/kill character processing is
  996. X     not performed.  When out of cbreak mode, the terminal driver
  997. X     will buffer characters typed until a newline or carriage return
  998. X     is typed.  Interrupt and flow control characters are unaffected
  999. X     by this mode.  Initially the terminal may or may not need be
  1000. X     in cbreak mode.
  1001. X
  1002. X  PDCurses Description:
  1003. X     There is no additional PDCurses functionality.
  1004. X
  1005. X  X/Open Return Value:
  1006. X     The nocbreak() function returns OK on success and ERR on error.
  1007. X
  1008. X  PDCurses Errors:
  1009. X     No errors are defined for these functions.
  1010. X
  1011. X  Portability:
  1012. X     PDCurses    int nocbreak( void );
  1013. X     X/Open Dec '88    int nocbreak( void );
  1014. X     BSD Curses    int nocbreak( void );
  1015. X     SYS V Curses    int nocbreak( void );
  1016. X
  1017. X**man-end**********************************************************************/
  1018. X
  1019. Xint    nocbreak(void)
  1020. X{
  1021. X    _cursvar.cbreak = FALSE;
  1022. X    return( OK );
  1023. X}
  1024. END_OF_FILE
  1025.   if test 1366 -ne `wc -c <'portable/nocbreak.c'`; then
  1026.     echo shar: \"'portable/nocbreak.c'\" unpacked with wrong size!
  1027.   fi
  1028.   # end of 'portable/nocbreak.c'
  1029. fi
  1030. if test -f 'portable/refresh.c' -a "${1}" != "-c" ; then 
  1031.   echo shar: Will not clobber existing file \"'portable/refresh.c'\"
  1032. else
  1033.   echo shar: Extracting \"'portable/refresh.c'\" \(1246 characters\)
  1034.   sed "s/^X//" >'portable/refresh.c' <<'END_OF_FILE'
  1035. X#define    CURSES_LIBRARY    1
  1036. X#include <curses.h>
  1037. X#undef    refresh
  1038. X
  1039. X#ifndef    NDEBUG
  1040. Xchar *rcsid_refresh = "$Header: c:/curses/portable/RCS/refresh.c%v 2.0 1992/11/15 03:29:10 MH Rel $";
  1041. X#endif
  1042. X
  1043. X
  1044. X
  1045. X
  1046. X/*man-start*********************************************************************
  1047. X
  1048. X  refresh()    - refresh window
  1049. X
  1050. X  X/Open Description:
  1051. X     The routine wrefresh copies the named window to the physical
  1052. X     terminal screen, taking into account what is already there in
  1053. X     order to optimize cursor movement.
  1054. X
  1055. X     The routine refresh does the same, using stdscr as a default
  1056. X     screen.
  1057. X
  1058. X     These routines must be called to get any output on the
  1059. X     terminal, as other routines only manipulate data structures.
  1060. X
  1061. X     Unless leaveok has been enabled, the physical cursor of the
  1062. X     terminal is left at the location of the window's cursor.
  1063. X
  1064. X  X/Open Return Value:
  1065. X     The refresh() function returns OK on success and ERR on error.
  1066. X
  1067. X  X/Open Errors:
  1068. X     No errors are defined for this function.
  1069. X
  1070. X  Portability:
  1071. X     PDCurses    int refresh( void );
  1072. X     X/Open Dec '88    int refresh( void );
  1073. X     BSD Curses    int refresh( void );
  1074. X     SYS V Curses    int refresh( void );
  1075. X
  1076. X**man-end**********************************************************************/
  1077. X
  1078. Xint    refresh( void )
  1079. X{
  1080. X    return( wrefresh(stdscr) );
  1081. X}
  1082. END_OF_FILE
  1083.   if test 1246 -ne `wc -c <'portable/refresh.c'`; then
  1084.     echo shar: \"'portable/refresh.c'\" unpacked with wrong size!
  1085.   fi
  1086.   # end of 'portable/refresh.c'
  1087. fi
  1088. if test -f 'portable/scrollok.c' -a "${1}" != "-c" ; then 
  1089.   echo shar: Will not clobber existing file \"'portable/scrollok.c'\"
  1090. else
  1091.   echo shar: Extracting \"'portable/scrollok.c'\" \(1341 characters\)
  1092.   sed "s/^X//" >'portable/scrollok.c' <<'END_OF_FILE'
  1093. X#define    CURSES_LIBRARY    1
  1094. X#include <curses.h>
  1095. X#undef    scrollok
  1096. X
  1097. X#ifndef    NDEBUG
  1098. Xchar *rcsid_scrollok = "$Header: c:/curses/portable/RCS/scrollok.c%v 2.0 1992/11/15 03:29:31 MH Rel $";
  1099. X#endif
  1100. X
  1101. X
  1102. X
  1103. X
  1104. X
  1105. X/*man-start*********************************************************************
  1106. X
  1107. X  scrollok()    - scrollok window
  1108. X
  1109. X  X/Open Description:
  1110. X     This function controls what happens when the cursor of a window
  1111. X     is moved off the edge of the window or scrolling region, either
  1112. X     from a newline on the bottom line or by typing the last character
  1113. X     of the last line.  If the option is disabled, the cursor is left
  1114. X     on the bottom line.  If enabled, the window is scrolled up one
  1115. X     line and then refreshed.
  1116. X
  1117. X  PDCurses Description:
  1118. X     This is also implemented as a macro.
  1119. X
  1120. X  X/Open Return Value:
  1121. X     The scrollok() function returns OK on success otherwise ERR
  1122. X     is returned.
  1123. X
  1124. X  PDCurses Errors:
  1125. X     It is an error to pass a NULL* window.
  1126. X
  1127. X  Portability:
  1128. X     PDCurses    int scrollok( WINDOW* win, bool bf );
  1129. X     X/Open Dec '88    int scrollok( WINDOW* win, bool bf );
  1130. X     SysV Curses    int scrollok( WINDOW* win, bool bf );
  1131. X     BSD Curses    int scrollok( WINDOW* win, bool bf );
  1132. X
  1133. X**man-end**********************************************************************/
  1134. X
  1135. Xint    scrollok(WINDOW *win, bool bf)
  1136. X{
  1137. X    if  (win == (WINDOW *)NULL)
  1138. X        return( ERR );
  1139. X
  1140. X    win->_scroll    = bf;
  1141. X    return( OK );
  1142. X}
  1143. END_OF_FILE
  1144.   if test 1341 -ne `wc -c <'portable/scrollok.c'`; then
  1145.     echo shar: \"'portable/scrollok.c'\" unpacked with wrong size!
  1146.   fi
  1147.   # end of 'portable/scrollok.c'
  1148. fi
  1149. if test -f 'portable/startcol.c' -a "${1}" != "-c" ; then 
  1150.   echo shar: Will not clobber existing file \"'portable/startcol.c'\"
  1151. else
  1152.   echo shar: Extracting \"'portable/startcol.c'\" \(1377 characters\)
  1153.   sed "s/^X//" >'portable/startcol.c' <<'END_OF_FILE'
  1154. X#define    CURSES_LIBRARY    1
  1155. X#include <curses.h>
  1156. X#undef start_color
  1157. X
  1158. X#ifndef    NDEBUG
  1159. Xchar *rcsid_startcol = "$Header: c:/curses/portable/RCS/startcol.c%v 2.0 1992/11/15 03:29:17 MH Rel $";
  1160. X#endif
  1161. X
  1162. X
  1163. X
  1164. X
  1165. X/*man-start*********************************************************************
  1166. X
  1167. X  start_color()    - Initialize and set up curses for color mode.
  1168. X
  1169. X  PDCurses Description:
  1170. X     This routine sets up curses to enable color support.
  1171. X
  1172. X     Eight basic color are initialized: black, blue, green, cyan, red,
  1173. X     magenta, yellow and white. Two global variables - COLORS and
  1174. X     COLOR_PAIRS, as defined in <curses.h> header file - are also
  1175. X     initialized. The se variables define the maximum number of colors
  1176. X     and the maximum number of color-pairs supported.
  1177. X
  1178. X     This routine must be called before any other curses routine which
  1179. X     manipulates or uses colors. A good place to call it is immediately
  1180. X     after initscr().
  1181. X
  1182. X  PDCurses Return Value:
  1183. X     This function returns ERR if the monitor does not support color.
  1184. X     Otherwise OK is returned.
  1185. X
  1186. X  PDCurses Errors:
  1187. X     N/A
  1188. X
  1189. X  Portability:
  1190. X     PDCurses    int start_color(void);
  1191. X     SYS V curses    int start_color(void);
  1192. X
  1193. X**man-end**********************************************************************/
  1194. X
  1195. Xint COLORS=0,COLOR_PAIRS=0;
  1196. X
  1197. Xint start_color(void)
  1198. X{
  1199. X if (_cursvar.mono)
  1200. X    return(ERR);
  1201. X COLORS = 8;
  1202. X COLOR_PAIRS = 33;  /* actually only allows 32 */
  1203. X return(OK);
  1204. X}
  1205. END_OF_FILE
  1206.   if test 1377 -ne `wc -c <'portable/startcol.c'`; then
  1207.     echo shar: \"'portable/startcol.c'\" unpacked with wrong size!
  1208.   fi
  1209.   # end of 'portable/startcol.c'
  1210. fi
  1211. if test -f 'portable/touchlin.c' -a "${1}" != "-c" ; then 
  1212.   echo shar: Will not clobber existing file \"'portable/touchlin.c'\"
  1213. else
  1214.   echo shar: Extracting \"'portable/touchlin.c'\" \(1277 characters\)
  1215.   sed "s/^X//" >'portable/touchlin.c' <<'END_OF_FILE'
  1216. X#define    CURSES_LIBRARY    1
  1217. X#include <curses.h>
  1218. X#undef    touchline
  1219. X
  1220. X#ifndef    NDEBUG
  1221. Xchar *rcsid_touchlin = "$Header: c:/curses/portable/RCS/touchlin.c%v 2.0 1992/11/15 03:29:18 MH Rel $";
  1222. X#endif
  1223. X
  1224. X
  1225. X
  1226. X
  1227. X
  1228. X/*man-start*********************************************************************
  1229. X
  1230. X  touchline()    - touch line in window
  1231. X
  1232. X  PDCurses Description:
  1233. X     Similar to touchwin(), but less drastic.
  1234. X
  1235. X     Throw away all optimisation information about which parts of the
  1236. X     window (well, lines) have been touched, by pretending that the
  1237. X     entire line(s) has been drawn on.
  1238. X
  1239. X  PDCurses Errors:
  1240. X     The touchline() function returns OK on success and ERR on error.
  1241. X
  1242. X     It is an error to pass a NULL window.
  1243. X
  1244. X     It is also an error to specify a line outside the boundaries of
  1245. X     the passed window or if the start line plus the number of lines
  1246. X     exceeds the boundary of the window.
  1247. X
  1248. X  Portability:
  1249. X     PDCurses    
  1250. X     SysV Curses    
  1251. X     BSD Curses    
  1252. X
  1253. X**man-end**********************************************************************/
  1254. X
  1255. Xint    touchline(WINDOW *w, int start,int num)
  1256. X{
  1257. X    register int i;
  1258. X
  1259. X    if (w == (WINDOW *)NULL)
  1260. X        return( ERR );
  1261. X
  1262. X    if  (start > w->_maxy || start + num > w->_maxy)
  1263. X        return( ERR );
  1264. X    for(i=start;i<start+num;i++)
  1265. X       {
  1266. X        w->_firstch[i] = 0;
  1267. X        w->_lastch[i] = w->_maxx - 1;
  1268. X       }
  1269. X    return( OK );
  1270. X}
  1271. END_OF_FILE
  1272.   if test 1277 -ne `wc -c <'portable/touchlin.c'`; then
  1273.     echo shar: \"'portable/touchlin.c'\" unpacked with wrong size!
  1274.   fi
  1275.   # end of 'portable/touchlin.c'
  1276. fi
  1277. if test -f 'portable/wclear.c' -a "${1}" != "-c" ; then 
  1278.   echo shar: Will not clobber existing file \"'portable/wclear.c'\"
  1279. else
  1280.   echo shar: Extracting \"'portable/wclear.c'\" \(1309 characters\)
  1281.   sed "s/^X//" >'portable/wclear.c' <<'END_OF_FILE'
  1282. X#define    CURSES_LIBRARY    1
  1283. X#include <curses.h>
  1284. X#undef    wclear
  1285. X
  1286. X#ifndef    NDEBUG
  1287. Xchar *rcsid_wclear = "$Header: c:/curses/portable/RCS/wclear.c%v 2.0 1992/11/15 03:29:23 MH Rel $";
  1288. X#endif
  1289. X
  1290. X
  1291. X
  1292. X
  1293. X/*man-start*********************************************************************
  1294. X
  1295. X  wclear()    - Clear window
  1296. X
  1297. X  X/Open Description:    clear() and wclear()
  1298. X     These functions are like erase(), but they also call clearok(),
  1299. X     arranging that the screen will be cleared completely on the
  1300. X     next call to wrefresh() for that window and repainted.
  1301. X
  1302. X     NOTE: clear() is a macro.
  1303. X
  1304. X  PDCurses Description:
  1305. X     There is no additional PDCurses functionality.  This module is
  1306. X     a documentation place holder.  No code will execute in this module
  1307. X     unless the user #undefs wclear.
  1308. X
  1309. X  X/Open Return Value:
  1310. X     The wclear() function returns OK on success and ERR on error.
  1311. X
  1312. X  PDCurses Errors:
  1313. X     It is an error to call this function with a NULL window pointer.
  1314. X
  1315. X  Portability:
  1316. X     PDCurses    int wclear( WINDOW* win );
  1317. X     X/Open Dec '88    int wclear( WINDOW* win );
  1318. X     BSD Curses    int wclear( WINDOW* win );
  1319. X     SYS V Curses    int wclear( WINDOW* win );
  1320. X
  1321. X**man-end**********************************************************************/
  1322. X
  1323. Xint    wclear( WINDOW *win )
  1324. X{
  1325. X    if  (win == (WINDOW *)NULL)
  1326. X        return( ERR );
  1327. X
  1328. X    clearok( win, TRUE );
  1329. X    return( werase( win ) );
  1330. X}
  1331. END_OF_FILE
  1332.   if test 1309 -ne `wc -c <'portable/wclear.c'`; then
  1333.     echo shar: \"'portable/wclear.c'\" unpacked with wrong size!
  1334.   fi
  1335.   # end of 'portable/wclear.c'
  1336. fi
  1337. if test -f 'portable/werase.c' -a "${1}" != "-c" ; then 
  1338.   echo shar: Will not clobber existing file \"'portable/werase.c'\"
  1339. else
  1340.   echo shar: Extracting \"'portable/werase.c'\" \(1405 characters\)
  1341.   sed "s/^X//" >'portable/werase.c' <<'END_OF_FILE'
  1342. X#define    CURSES_LIBRARY    1
  1343. X#include <curses.h>
  1344. X#undef    werase
  1345. X
  1346. X#ifndef    NDEBUG
  1347. Xchar *rcsid_werase = "$Header: c:/curses/portable/RCS/werase.c%v 2.0 1992/11/15 03:29:07 MH Rel $";
  1348. X#endif
  1349. X
  1350. X
  1351. X
  1352. X
  1353. X/*man-start*********************************************************************
  1354. X
  1355. X  werase()    - copy blanks into window
  1356. X
  1357. X  X/Open Description:
  1358. X     These functions copy blanks to every position in the window.
  1359. X
  1360. X     NOTE: erase() is a macro.
  1361. X
  1362. X  PDCurses Description:
  1363. X     There is no additional PDCurses functionality.
  1364. X
  1365. X  X/Open Return Value:
  1366. X     These functions return OK on success and ERR on error.
  1367. X
  1368. X  PDCurses Errors:
  1369. X     It is an error to call this function with a NULL window pointer.
  1370. X
  1371. X  Portability:
  1372. X     PDCurses    int werase( WINDOW* win );
  1373. X     X/Open Dec '88    int werase( WINDOW* win );
  1374. X     BSD Curses    int werase( WINDOW* win );
  1375. X     SYS V Curses    int werase( WINDOW* win );
  1376. X
  1377. X**man-end**********************************************************************/
  1378. X
  1379. Xint    werase(WINDOW *win)
  1380. X{
  1381. X    chtype*    end;
  1382. X    chtype*    start;
  1383. X    int    y;
  1384. Xstatic    chtype    blank;
  1385. X
  1386. X    if (win == (WINDOW *)NULL)
  1387. X        return( ERR );
  1388. X
  1389. X    blank = win->_blank | win->_attrs;
  1390. X
  1391. X    for (y = win->_tmarg; y <= win->_bmarg; y++)
  1392. X    {
  1393. X        start = win->_y[y];
  1394. X        end = &start[win->_maxx - 1];
  1395. X/* changed JGB 6/92 < to <= */
  1396. X        while (start <= end)
  1397. X        {
  1398. X            *start++ = blank;
  1399. X        }
  1400. X        win->_firstch[y] = 0;
  1401. X        win->_lastch[y] = win->_maxx - 1;
  1402. X    }
  1403. X    win->_cury = win->_tmarg;
  1404. X    win->_curx = 0;
  1405. X    return( OK );
  1406. X}
  1407. X
  1408. END_OF_FILE
  1409.   if test 1405 -ne `wc -c <'portable/werase.c'`; then
  1410.     echo shar: \"'portable/werase.c'\" unpacked with wrong size!
  1411.   fi
  1412.   # end of 'portable/werase.c'
  1413. fi
  1414. if test -f 'portable/winsch.c' -a "${1}" != "-c" ; then 
  1415.   echo shar: Will not clobber existing file \"'portable/winsch.c'\"
  1416. else
  1417.   echo shar: Extracting \"'portable/winsch.c'\" \(1339 characters\)
  1418.   sed "s/^X//" >'portable/winsch.c' <<'END_OF_FILE'
  1419. X#define    CURSES_LIBRARY    1
  1420. X#include <curses.h>
  1421. X#undef    winsch
  1422. X
  1423. X#ifndef    NDEBUG
  1424. Xchar *rcsid_winsch = "$Header: c:/curses/portable/RCS/winsch.c%v 2.0 1992/11/15 03:29:26 MH Rel $";
  1425. X#endif
  1426. X
  1427. X
  1428. X
  1429. X
  1430. X/*man-start*********************************************************************
  1431. X
  1432. X  winsch()    - Insert character
  1433. X
  1434. X  X/Open Description:
  1435. X     The character ch is inserted before the character under the
  1436. X     cursor.  All characters to the right are moved one space to the
  1437. X     right, possibly losing the rightmost character on the line.
  1438. X     The cursor position does not change (after moving to y,x if
  1439. X     specified).
  1440. X
  1441. X     NOTE: insch(), mvinsch(), mvwinsch() are macros.
  1442. X
  1443. X  PDCurses Description:
  1444. X     See the call ctrl( bool bf ); for information regarding the
  1445. X     replacement of all former 1.4 and prior "raw" PDCurses
  1446. X     routines.
  1447. X
  1448. X  X/Open Return Value:
  1449. X     These functions return OK on success and ERR on error.
  1450. X
  1451. X  X/Open Errors:
  1452. X     No errors are defined for this function.
  1453. X
  1454. X  Portability:
  1455. X     PDCurses    int winsch( WINDOW* win, chtype ch );
  1456. X     X/Open Dec '88    int winsch( WINDOW* win, chtype ch );
  1457. X     BSD Curses    int winsch( WINDOW* win, chtype ch );
  1458. X     SYS V Curses    int winsch( WINDOW* win, chtype ch );
  1459. X
  1460. X**man-end**********************************************************************/
  1461. X
  1462. Xint    winsch( WINDOW *win, chtype ch )
  1463. X{
  1464. X    return( PDC_chins( win, ch, !(_cursvar.raw_out) ) );
  1465. X}
  1466. END_OF_FILE
  1467.   if test 1339 -ne `wc -c <'portable/winsch.c'`; then
  1468.     echo shar: \"'portable/winsch.c'\" unpacked with wrong size!
  1469.   fi
  1470.   # end of 'portable/winsch.c'
  1471. fi
  1472. if test -f 'private/_addtail.c' -a "${1}" != "-c" ; then 
  1473.   echo shar: Will not clobber existing file \"'private/_addtail.c'\"
  1474. else
  1475.   echo shar: Extracting \"'private/_addtail.c'\" \(1281 characters\)
  1476.   sed "s/^X//" >'private/_addtail.c' <<'END_OF_FILE'
  1477. X#define    CURSES_LIBRARY    1
  1478. X#include <curses.h>
  1479. X
  1480. X#ifdef    REGISTERWINDOWS
  1481. X#ifndef    NDEBUG
  1482. Xchar *rcsid__addtail = "$Header: c:/curses/private/RCS/_addtail.c%v 2.0 1992/11/15 03:24:17 MH Rel $";
  1483. X#endif
  1484. X
  1485. X
  1486. X
  1487. X
  1488. X/*man-start*********************************************************************
  1489. X
  1490. X  PDC_addtail()    - add window to the visible window list
  1491. X
  1492. X  PDCurses Description:
  1493. X     This is a private PDCurses function.
  1494. X
  1495. X     This routine adds the passed window pointer to the end fo the
  1496. X     visible window list.  All windows on this list will automatically
  1497. X     be refreshed if _cursvar.refreshall is true.
  1498. X
  1499. X  PDCurses Return Value:
  1500. X     This function returns OK upon success otherwise ERR is returned.
  1501. X
  1502. X  PDCurses Errors:
  1503. X     It is an error to pass a NULL window pointer.
  1504. X
  1505. X  Portability:
  1506. X     PDCurses    int    PDC_addtail( WINDOW* tail );
  1507. X
  1508. X**man-end**********************************************************************/
  1509. X
  1510. Xint    PDC_addtail(WINDOW *tail)
  1511. X{
  1512. X    WINDS  *next = _cursvar.visible;
  1513. X
  1514. X    if  (tail == (WINDOW *)NULL)
  1515. X        return( ERR );
  1516. X
  1517. X    while (next != (WINDS *)NULL)
  1518. X    {
  1519. X        if (next->next == NULL)
  1520. X            break;
  1521. X        next = next->next;
  1522. X    }
  1523. X    if (next == NULL)
  1524. X        PDC_inswin(tail, (WINDOW *)NULL);
  1525. X    else
  1526. X    {
  1527. X        if (next->w == NULL)
  1528. X            PDC_inswin(tail, (WINDOW *)NULL);
  1529. X        else
  1530. X            PDC_addwin(tail, next->w);
  1531. X    }
  1532. X    return( OK );
  1533. X}
  1534. X#endif
  1535. END_OF_FILE
  1536.   if test 1281 -ne `wc -c <'private/_addtail.c'`; then
  1537.     echo shar: \"'private/_addtail.c'\" unpacked with wrong size!
  1538.   fi
  1539.   # end of 'private/_addtail.c'
  1540. fi
  1541. if test -f 'private/_ckbiosk.c' -a "${1}" != "-c" ; then 
  1542.   echo shar: Will not clobber existing file \"'private/_ckbiosk.c'\"
  1543. else
  1544.   echo shar: Extracting \"'private/_ckbiosk.c'\" \(1229 characters\)
  1545.   sed "s/^X//" >'private/_ckbiosk.c' <<'END_OF_FILE'
  1546. X#define    CURSES_LIBRARY    1
  1547. X#define NEEDS_OS2       1
  1548. X#include <curses.h>
  1549. X
  1550. X#ifndef    NDEBUG
  1551. Xchar *rcsid__ckbiosk = "$Header: c:/curses/private/RCS/_ckbiosk.c%v 2.0 1992/11/15 03:24:29 MH Rel $";
  1552. X#endif
  1553. X
  1554. X
  1555. X
  1556. X
  1557. X/*man-start*********************************************************************
  1558. X
  1559. X  PDC_check_bios_key()    - Check BIOS key data area for input
  1560. X
  1561. X  PDCurses Description:
  1562. X     This is a private PDCurses routine.
  1563. X
  1564. X     This routine will check the BIOS for any indication that
  1565. X     keystrokes are pending.
  1566. X
  1567. X  PDCurses Return Value:
  1568. X     Returns 1 if a keyboard character is available, 0 otherwise.
  1569. X
  1570. X  PDCurses Errors:
  1571. X     No errors are defined for this function.
  1572. X
  1573. X  Portability:
  1574. X     PDCurses    bool    PDC_check_bios_key( void );
  1575. X
  1576. X**man-end**********************************************************************/
  1577. X
  1578. Xbool PDC_check_bios_key(void)
  1579. X{
  1580. X#ifdef    FLEXOS
  1581. X    retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
  1582. X    return( (retcode < 0L) ? ERR : vir.vc_tahead );
  1583. X#endif
  1584. X#if    defined (DOS)
  1585. X return(kbhit());
  1586. X#endif
  1587. X#if    OS2
  1588. X#if !defined(MSC)
  1589. X    KBDKEYINFO keyInfo;
  1590. X    
  1591. X/*    KbdCharIn(&keyInfo, IO_NOWAIT, 0);*/    /* get a character    */
  1592. X    KbdPeek(&keyInfo, 0);    /* peek at keyboard    */
  1593. X    return (keyInfo.fbStatus != 0);
  1594. X#else
  1595. X return(kbhit());
  1596. X#endif
  1597. X#endif
  1598. X}
  1599. END_OF_FILE
  1600.   if test 1229 -ne `wc -c <'private/_ckbiosk.c'`; then
  1601.     echo shar: \"'private/_ckbiosk.c'\" unpacked with wrong size!
  1602.   fi
  1603.   # end of 'private/_ckbiosk.c'
  1604. fi
  1605. if test -f 'private/_gcrspos.c' -a "${1}" != "-c" ; then 
  1606.   echo shar: Will not clobber existing file \"'private/_gcrspos.c'\"
  1607. else
  1608.   echo shar: Extracting \"'private/_gcrspos.c'\" \(1348 characters\)
  1609.   sed "s/^X//" >'private/_gcrspos.c' <<'END_OF_FILE'
  1610. X#define    CURSES_LIBRARY    1
  1611. X#include <curses.h>
  1612. X
  1613. X#ifndef    NDEBUG
  1614. Xchar *rcsid__gcrspos = "$Header: c:/curses/private/RCS/_gcrspos.c%v 2.0 1992/11/15 03:24:22 MH Rel $";
  1615. X#endif
  1616. X
  1617. X
  1618. X
  1619. X
  1620. X/*man-start*********************************************************************
  1621. X
  1622. X  PDC_get_cursor_pos()    - return current cursor position
  1623. X
  1624. X  PDCurses Description:
  1625. X     This is a private PDCurses function
  1626. X
  1627. X     Gets the cursor position in video page 0.  'row' and 'column'
  1628. X     are the cursor address.  At this time, there is no support for
  1629. X     use of multiple screen pages.
  1630. X
  1631. X  PDCurses Return Value:
  1632. X     This routine will return OK upon success and otherwise ERR will be
  1633. X     returned.
  1634. X
  1635. X  PDCurses Errors:
  1636. X     There are no defined errors for this routine.
  1637. X
  1638. X  Portability:
  1639. X     PDCurses    int    PDC_get_cursor_pos( int* row, int* col );
  1640. X
  1641. X**man-end**********************************************************************/
  1642. X
  1643. Xint    PDC_get_cursor_pos(int *row, int *col)
  1644. X{
  1645. X#ifdef    FLEXOS
  1646. X    retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
  1647. X    if (retcode < 0L)
  1648. X        return( ERR );
  1649. X    *row = vir.vc_cursor.pos_row;
  1650. X    *col = vir.vc_cursor.pos_col;
  1651. X    return( OK );
  1652. X#endif
  1653. X#ifdef    DOS
  1654. X    regs.h.ah = 0x03;
  1655. X    regs.h.bh = _cursvar.video_page;
  1656. X    int86(0x10, ®s, ®s);
  1657. X    *row = regs.h.dh;
  1658. X    *col = regs.h.dl;
  1659. X    return( OK );
  1660. X#endif
  1661. X#ifdef    OS2
  1662. X    VioGetCurPos((PUSHORT)&row,(PUSHORT)&col,0);
  1663. X    return( OK );
  1664. X#endif
  1665. X}
  1666. END_OF_FILE
  1667.   if test 1348 -ne `wc -c <'private/_gcrspos.c'`; then
  1668.     echo shar: \"'private/_gcrspos.c'\" unpacked with wrong size!
  1669.   fi
  1670.   # end of 'private/_gcrspos.c'
  1671. fi
  1672. if test -f 'private/_gcurcol.c' -a "${1}" != "-c" ; then 
  1673.   echo shar: Will not clobber existing file \"'private/_gcurcol.c'\"
  1674. else
  1675.   echo shar: Extracting \"'private/_gcurcol.c'\" \(1243 characters\)
  1676.   sed "s/^X//" >'private/_gcurcol.c' <<'END_OF_FILE'
  1677. X#define    CURSES_LIBRARY    1
  1678. X#include <curses.h>
  1679. X
  1680. X#ifndef    NDEBUG
  1681. Xchar *rcsid__gcurcol = "$Header: c:/curses/private/RCS/_gcurcol.c%v 2.0 1992/11/15 03:24:22 MH Rel $";
  1682. X#endif
  1683. X
  1684. X
  1685. X
  1686. X
  1687. X/*man-start*********************************************************************
  1688. X
  1689. X  PDC_get_cur_col()    - get current column position of cursor
  1690. X
  1691. X  PDCurses Description:
  1692. X     This is a private PDCurses function
  1693. X
  1694. X     This routine returns the current column position of the cursor on
  1695. X     screen.
  1696. X
  1697. X  PDCurses Return Value:
  1698. X     This routine returns the current column position of the cursor. No
  1699. X     error is returned.
  1700. X
  1701. X  PDCurses Errors:
  1702. X     There are no defined errors for this routine.
  1703. X
  1704. X  Portability:
  1705. X     PDCurses    int    PDC_get_cur_col( void );
  1706. X
  1707. X**man-end**********************************************************************/
  1708. X
  1709. Xint    PDC_get_cur_col(void)
  1710. X{
  1711. X#ifdef    FLEXOS
  1712. X    retcode = s_get(T_VIRCON, 1L, (char *) &vir, (long) sizeof(vir));
  1713. X    return( (retcode < 0L) ? ERR : vir.vc_cursor.pos_col );
  1714. X#endif
  1715. X#ifdef    DOS
  1716. X    regs.x.ax = 0x0003;
  1717. X    regs.h.bh = _cursvar.video_page;
  1718. X    int86(0x10, ®s, ®s);
  1719. X    return((int) regs.h.dl);
  1720. X#endif
  1721. X#ifdef    OS2
  1722. X    USHORT curCol, curRow;
  1723. X    
  1724. X    /* find the current cursor position */
  1725. X    VioGetCurPos ((PUSHORT) &curRow, (PUSHORT) &curCol, 0);
  1726. X    return (curCol);
  1727. X#endif
  1728. X}
  1729. END_OF_FILE
  1730.   if test 1243 -ne `wc -c <'private/_gcurcol.c'`; then
  1731.     echo shar: \"'private/_gcurcol.c'\" unpacked with wrong size!
  1732.   fi
  1733.   # end of 'private/_gcurcol.c'
  1734. fi
  1735. if test -f 'private/_gcurrow.c' -a "${1}" != "-c" ; then 
  1736.   echo shar: Will not clobber existing file \"'private/_gcurrow.c'\"
  1737. else
  1738.   echo shar: Extracting \"'private/_gcurrow.c'\" \(1235 characters\)
  1739.   sed "s/^X//" >'private/_gcurrow.c' <<'END_OF_FILE'
  1740. X#define    CURSES_LIBRARY    1
  1741. X#include <curses.h>
  1742. X
  1743. X#ifndef    NDEBUG
  1744. Xchar *rcsid__gcurrow = "$Header: c:/curses/private/RCS/_gcurrow.c%v 2.0 1992/11/15 03:24:23 MH Rel $";
  1745. X#endif
  1746. X
  1747. X
  1748. X
  1749. X
  1750. X/*man-start*********************************************************************
  1751. X
  1752. X  PDC_get_cur_row()    - get current row position of cursor
  1753. X
  1754. X  PDCurses Description:
  1755. X     This is a private PDCurses function
  1756. X
  1757. X     This routine returns the current row position of the cursor on
  1758. X     screen.
  1759. X
  1760. X  PDCurses Return Value:
  1761. X     This routine returns the current row position of the cursor. No
  1762. X     error is returned.
  1763. X
  1764. X  PDCurses Errors:
  1765. X     There are no defined errors for this routine.
  1766. X
  1767. X  Portability:
  1768. X     PDCurses    int    PDC_get_cur_row( void );
  1769. X
  1770. X**man-end**********************************************************************/
  1771. X
  1772. Xint    PDC_get_cur_row(void)
  1773. X{
  1774. X#ifdef    FLEXOS
  1775. X    retcode = s_get(T_VIRCON, 1L, (char *) &vir, (long) sizeof(vir));
  1776. X    return( (retcode < 0L) ? ERR : vir.vc_cursor.pos_col );
  1777. X#endif
  1778. X#ifdef    DOS
  1779. X    regs.x.ax = 0x0003;
  1780. X    regs.h.bh = _cursvar.video_page;
  1781. X    int86(0x10, ®s, ®s);
  1782. X    return ((int) regs.h.dh);
  1783. X#endif
  1784. X#ifdef    OS2
  1785. X    USHORT curCol, curRow;
  1786. X    
  1787. X    /* find the current cursor position */
  1788. X    VioGetCurPos ((PUSHORT) &curRow, (PUSHORT) &curCol, 0);
  1789. X    return (curRow);
  1790. X#endif
  1791. X}
  1792. END_OF_FILE
  1793.   if test 1235 -ne `wc -c <'private/_gcurrow.c'`; then
  1794.     echo shar: \"'private/_gcurrow.c'\" unpacked with wrong size!
  1795.   fi
  1796.   # end of 'private/_gcurrow.c'
  1797. fi
  1798. if test -f 'private/_getattr.c' -a "${1}" != "-c" ; then 
  1799.   echo shar: Will not clobber existing file \"'private/_getattr.c'\"
  1800. else
  1801.   echo shar: Extracting \"'private/_getattr.c'\" \(1298 characters\)
  1802.   sed "s/^X//" >'private/_getattr.c' <<'END_OF_FILE'
  1803. X#define    CURSES_LIBRARY    1
  1804. X#include <curses.h>
  1805. X
  1806. X#ifndef    NDEBUG
  1807. Xchar *rcsid__getattr = "$Header: c:/curses/private/RCS/_getattr.c%v 2.0 1992/11/15 03:24:23 MH Rel $";
  1808. X#endif
  1809. X
  1810. X
  1811. X
  1812. X
  1813. X/*man-start*********************************************************************
  1814. X
  1815. X  PDC_get_attribute()    - Get attribute at current cursor
  1816. X
  1817. X  PDCurses Description:
  1818. X     This is a private PDCurses function
  1819. X
  1820. X     Return the current attr at current cursor position on the screen.
  1821. X
  1822. X  PDCurses Return Value:
  1823. X     This routine will return OK upon success and otherwise ERR will be
  1824. X     returned.
  1825. X
  1826. X  PDCurses Errors:
  1827. X     There are no defined errors for this routine.
  1828. X
  1829. X  Portability:
  1830. X     PDCurses    int    PDC_get_attribute( void );
  1831. X
  1832. X**man-end**********************************************************************/
  1833. X
  1834. Xint    PDC_get_attribute(void)
  1835. X{
  1836. X#ifdef    FLEXOS
  1837. X    /* Get and return current attribute.  Force error until fixed. */
  1838. X    return ((COLOR_CYAN) >> ((sizeof(ch type) / 2) * 8));
  1839. X#endif
  1840. X#ifdef    DOS
  1841. X    regs.x.ax = 0x0800;
  1842. X    regs.h.bh = _cursvar.video_page;
  1843. X    int86(0x10, ®s, ®s);
  1844. X    return ((int) regs.h.ah);
  1845. X#endif
  1846. X#ifdef    OS2
  1847. X    char Cell[4];
  1848. X    USHORT cellLen = 2;
  1849. X    USHORT curRow = PDC_get_cur_row();
  1850. X    USHORT curCol = PDC_get_cur_col();
  1851. X    VioReadCellStr((PCH)&Cell, (PUSHORT)&cellLen, (USHORT)curRow, (USHORT)curCol, 0);
  1852. X    return ((int) Cell[1]);
  1853. X#endif
  1854. X}
  1855. END_OF_FILE
  1856.   if test 1298 -ne `wc -c <'private/_getattr.c'`; then
  1857.     echo shar: \"'private/_getattr.c'\" unpacked with wrong size!
  1858.   fi
  1859.   # end of 'private/_getattr.c'
  1860. fi
  1861. if test -f 'private/_scrnmod.c' -a "${1}" != "-c" ; then 
  1862.   echo shar: Will not clobber existing file \"'private/_scrnmod.c'\"
  1863. else
  1864.   echo shar: Extracting \"'private/_scrnmod.c'\" \(1210 characters\)
  1865.   sed "s/^X//" >'private/_scrnmod.c' <<'END_OF_FILE'
  1866. X#define    CURSES_LIBRARY    1
  1867. X#include <curses.h>
  1868. X
  1869. X
  1870. X
  1871. X
  1872. X/*man-start*********************************************************************
  1873. X
  1874. X  PDC_scrn_modes_equal()    - Decide if two screen modes are equal
  1875. X
  1876. X  PDCurses Description:
  1877. X     Mainly required for OS/2. It decides if two screen modes
  1878. X        (VIOMODEINFO structure) are equal. Under DOS it just compares
  1879. X        two integers
  1880. X
  1881. X  PDCurses Return Value:
  1882. X     This function returns TRUE if equal else FALSe.
  1883. X
  1884. X  PDCurses Errors:
  1885. X     No errors are defined for this function.
  1886. X
  1887. X  Portability:
  1888. X     PDCurses    int PDC_scrn_modes_equal( int mode1, int mode2 );
  1889. X     OS2 PDCurses    int PDC_scrn_modes_equal( VIOMODEINFO mode1, VIOMODEINFO mode2 );
  1890. X
  1891. X**man-end**********************************************************************/
  1892. X
  1893. X#ifdef     OS2
  1894. Xbool    PDC_scrn_modes_equal(VIOMODEINFO mode1, VIOMODEINFO mode2)
  1895. X#else
  1896. Xbool    PDC_scrn_modes_equal(int mode1, int mode2)
  1897. X#endif
  1898. X{
  1899. X#ifdef     OS2
  1900. X    return (   (mode1.cb == mode2.cb) && (mode1.fbType == mode2.fbType)
  1901. X            && (mode1.color == mode2.color) && (mode1.col == mode2.col)
  1902. X            && (mode1.row == mode2.row) && (mode1.hres == mode2.vres)
  1903. X            && (mode1.vres == mode2.vres) );
  1904. X#else
  1905. X    return (mode1 == mode2);
  1906. X#endif
  1907. X}
  1908. END_OF_FILE
  1909.   if test 1210 -ne `wc -c <'private/_scrnmod.c'`; then
  1910.     echo shar: \"'private/_scrnmod.c'\" unpacked with wrong size!
  1911.   fi
  1912.   # end of 'private/_scrnmod.c'
  1913. fi
  1914. echo shar: End of archive 10 \(of 11\).
  1915. cp /dev/null ark10isdone
  1916. MISSING=""
  1917. for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
  1918.     if test ! -f ark${I}isdone ; then
  1919.     MISSING="${MISSING} ${I}"
  1920.     fi
  1921. done
  1922. if test "${MISSING}" = "" ; then
  1923.     echo You have unpacked all 11 archives.
  1924.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1925. else
  1926.     echo You still must unpack the following archives:
  1927.     echo "        " ${MISSING}
  1928. fi
  1929. exit 0
  1930. exit 0 # Just in case...
  1931.