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

  1. Newsgroups: comp.sources.misc
  2. From: M.Hessling@gu.edu.au (Mark Hessling)
  3. Subject:  v33i087:  pdcurses - Public Domain curses library for DOS and OS/2 v2.0, Part07/11
  4. Message-ID: <1992Nov19.040506.7756@sparky.imd.sterling.com>
  5. X-Md4-Signature: 414132a88fc497d53df201ce761daa9a
  6. Date: Thu, 19 Nov 1992 04:05:06 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 87
  11. Archive-name: pdcurses/part07
  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:  portable/endwin.c portable/mvscanw.c portable/printw.c
  19. #   portable/resetty.c portable/scanw.c portable/standend.c
  20. #   portable/standout.c portable/typeahea.c portable/wattroff.c
  21. #   portable/wattron.c portable/wattrset.c portable/wdelch.c
  22. #   portable/wprintw.c portable/wscanw.c portable/wstanden.c
  23. #   portable/wstandou.c private/_backchr.c private/_cattr.c
  24. #   private/_sanity.c private/_scb.c tools/buildlrf.c
  25. # Wrapped by kent@sparky on Wed Nov 18 21:44:08 1992
  26. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  27. echo If this archive is complete, you will see the following message:
  28. echo '          "shar: End of archive 7 (of 11)."'
  29. if test -f 'portable/endwin.c' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'portable/endwin.c'\"
  31. else
  32.   echo shar: Extracting \"'portable/endwin.c'\" \(2189 characters\)
  33.   sed "s/^X//" >'portable/endwin.c' <<'END_OF_FILE'
  34. X#define    CURSES_LIBRARY    1
  35. X#include <curses.h>
  36. X#undef    endwin
  37. X
  38. X#ifndef    NDEBUG
  39. Xchar *rcsid_endwin = "$Header: c:/curses/portable/RCS/endwin.c%v 2.0 1992/11/15 03:28:46 MH Rel $";
  40. X#endif
  41. X
  42. X
  43. X
  44. X
  45. X/*man-start*********************************************************************
  46. X
  47. X  endwin()    - restore initial terminal environment
  48. X
  49. X  X/Open Description:
  50. X     A program should always call endwin() before exiting or
  51. X     escaping from curses mode temporarily.  This routine will
  52. X     restore tty modes, move the cursor to the lower left corner
  53. X     of the screen and reset the terminal into the proper non-visual
  54. X     mode.  To resume curses after a temporary escape, refresh() or
  55. X     doupdate() should be called.
  56. X
  57. X  PDCurses Description:
  58. X     At this time, endwin() must be followed by a call to initscr()
  59. X     for temporary escapes.
  60. X
  61. X     In addition, endwin() will resize the screen, if necessary.
  62. X
  63. X  X/Open Return Value:
  64. X     The endwin() function returns OK on success and ERR on error.
  65. X
  66. X  X/Open Errors:
  67. X     No errors are defined for this function.
  68. X
  69. X  Portability:
  70. X     PDCurses    int endwin( void );
  71. X     X/Open Dec '88    int endwin( void );
  72. X     BSD Curses    
  73. X     SYS V Curses    
  74. X
  75. X**man-end**********************************************************************/
  76. X
  77. Xint    endwin(void)
  78. X{
  79. X    PDC_scr_close();
  80. X/*    resetty();*/
  81. X    if (_cursvar.orig_font != _cursvar.font)  /* screen has not been resized */
  82. X        {
  83. X        PDC_set_font(_cursvar.orig_font);
  84. X        resize(PDC_get_rows());
  85. X        }
  86. X
  87. X    _cursvar.visible_cursor = FALSE;    /* Force the visible cursor */
  88. X    _cursvar.cursor = _cursvar.orig_cursor;
  89. X    curson();
  90. X#if 0
  91. X    _cursvar.blank = ' ';         /* Reset blank char to a space */
  92. X    wmove(stdscr, 0, 0);         /* Ensure full window clear    */
  93. X    wclrtobot(stdscr);
  94. X    wrefresh(stdscr);
  95. X#endif
  96. X
  97. X    delwin(stdscr);
  98. X    delwin(curscr);
  99. X    delwin(tmpwin);
  100. X    stdscr = (WINDOW *)NULL;
  101. X    curscr = (WINDOW *)NULL;
  102. X    tmpwin = (WINDOW *)NULL;
  103. X    _cursvar.alive = FALSE;
  104. X
  105. X    /*
  106. X     * Position cursor so that the screen will not scroll until they hit
  107. X     * a carriage return.
  108. X     */
  109. X    PDC_gotoxy(PDC_get_rows() - 2, 0);
  110. X#ifdef    FLEXOS
  111. X    _flexos_8bitmode();
  112. X#endif
  113. X/*    PDC_fix_cursor(_cursvar.orig_emulation);*/
  114. X    if (_cursvar.orig_font != _cursvar.font)  /* screen has not been resized */
  115. X        reset_shell_mode();
  116. X    return( OK );
  117. X}
  118. END_OF_FILE
  119.   if test 2189 -ne `wc -c <'portable/endwin.c'`; then
  120.     echo shar: \"'portable/endwin.c'\" unpacked with wrong size!
  121.   fi
  122.   # end of 'portable/endwin.c'
  123. fi
  124. if test -f 'portable/mvscanw.c' -a "${1}" != "-c" ; then 
  125.   echo shar: Will not clobber existing file \"'portable/mvscanw.c'\"
  126. else
  127.   echo shar: Extracting \"'portable/mvscanw.c'\" \(2287 characters\)
  128.   sed "s/^X//" >'portable/mvscanw.c' <<'END_OF_FILE'
  129. X#include <stdarg.h>
  130. X#include <string.h>
  131. X#define    CURSES_LIBRARY    1
  132. X#include <curses.h>
  133. X#undef    mvscanw
  134. X
  135. X#ifndef    NDEBUG
  136. Xchar *rcsid_mvscanw = "$Header: c:/curses/portable/RCS/mvscanw.c%v 2.0 1992/11/15 03:29:01 MH Rel $";
  137. X#endif
  138. X
  139. X
  140. X
  141. X
  142. X
  143. X/*man-start*********************************************************************
  144. X
  145. X  mvscanw()    - read formatted from window
  146. X
  147. X  X/Open Description:
  148. X     These routines correspond to scanf.  The function scanw reads
  149. X     input from the default window.  The function wscanw reads
  150. X     input from the specified window.  The function mvscanw moves
  151. X     the cursor to the specified position and then reads input from
  152. X     the default window.  The function mvwscanw moves the cursor to
  153. X     the specified position and then reads input from the specified
  154. X     window.
  155. X
  156. X     For all the functions, the routine wgetstr is called to get a
  157. X     string from the window, and the resulting line is used as
  158. X     input for the scan.  All character interpretation is carried
  159. X     out according to the scanf function rules.
  160. X
  161. X  PDCurses Description:
  162. X     The old Bjorn Larssen code for the 68K platform has been removed
  163. X     from this module.
  164. X
  165. X  X/Open Return Value:
  166. X     Upon successful completion, the scanw, mvscanw, mvwscanw and
  167. X     wscanw functions return the number of items successfully
  168. X     matched.  On end-of-file, they return EOF.  Otherwise they
  169. X     return ERR.
  170. X
  171. X  PDCurses Errors:
  172. X     No errors.
  173. X
  174. X  Portability:
  175. X     PDCurses    int mvscanw( int y, int x, char *fmt, ...);
  176. X     X/Open Dec '88    int mvscanw( int y, int x, char *fmt, ...);
  177. X     BSD Curses    int mvscanw( int y, int x, char *fmt, ...);
  178. X     SYS V Curses    int mvscanw( int y, int x, char *fmt, ...);
  179. X
  180. X**man-end**********************************************************************/
  181. X
  182. Xint    mvscanw(int y, int x, char *fmt, ... )
  183. X{
  184. X    va_list args;
  185. X    int    retval = ERR;
  186. X
  187. X#if    !defined (HC)
  188. X    if (stdscr == (WINDOW *)NULL)
  189. X        return( retval );
  190. X
  191. X    if (wmove(stdscr, y, x) == ERR)
  192. X        return( retval );
  193. X
  194. X    wrefresh(stdscr);            /* set cursor position */
  195. X
  196. X    /*
  197. X     * get string
  198. X     */
  199. X    c_printscanbuf[0] = '\0';  /* reset to empty string */
  200. X    if (wgetstr(stdscr, c_printscanbuf) == ERR)
  201. X        return( retval );
  202. X    va_start(args, fmt);
  203. X#ifdef NO_VSSCANF
  204. X    retval = PDC_vsscanf(c_printscanbuf, fmt, args);
  205. X#else
  206. X    retval = vsscanf(c_printscanbuf, fmt, args);
  207. X#endif
  208. X    va_end(args);
  209. X#endif
  210. X    return( retval );
  211. X}
  212. END_OF_FILE
  213.   if test 2287 -ne `wc -c <'portable/mvscanw.c'`; then
  214.     echo shar: \"'portable/mvscanw.c'\" unpacked with wrong size!
  215.   fi
  216.   # end of 'portable/mvscanw.c'
  217. fi
  218. if test -f 'portable/printw.c' -a "${1}" != "-c" ; then 
  219.   echo shar: Will not clobber existing file \"'portable/printw.c'\"
  220. else
  221.   echo shar: Extracting \"'portable/printw.c'\" \(2217 characters\)
  222.   sed "s/^X//" >'portable/printw.c' <<'END_OF_FILE'
  223. X#include <stdarg.h>
  224. X#include <string.h>
  225. X#define    CURSES_LIBRARY    1
  226. X#include <curses.h>
  227. X#undef    printw
  228. X
  229. X#ifndef    NDEBUG
  230. Xchar *rcsid_printw = "$Header: c:/curses/portable/RCS/printw.c%v 2.0 1992/11/15 03:29:33 MH Rel $";
  231. X#endif
  232. X
  233. X
  234. X
  235. X
  236. X
  237. X/*man-start*********************************************************************
  238. X
  239. X  printw()    - formatted write to a window
  240. X
  241. X  X/Open Description:
  242. X     The printw routine adds a string to the default window
  243. X     starting at the current cursor position.  This routine causes
  244. X     the string that would normally be output by printf to be
  245. X     output by addstr.
  246. X
  247. X     The routine wprintw adds a string to the specified window
  248. X     starting at the current cursor position.  This routine causes
  249. X     the string that would normally be output by printf to be
  250. X     output by waddstr.
  251. X
  252. X     The routine mvprintw adds a string to the default window
  253. X     starting at the specified cursor position.  This routine
  254. X     causes the string that would normally be output by printf to
  255. X     be output by addstr.
  256. X
  257. X     The routine mvwprintw adds a string to the specified window
  258. X     starting at the specified cursor position.  This routine
  259. X     causes the string that would normally be output by printf to
  260. X     be output by waddstr.
  261. X
  262. X     All these routines are analogous to printf.  It is advisable
  263. X     to use the field width options of printf to avoid leaving
  264. X     unwanted characters on the screen from earlier calls.
  265. X
  266. X  PDCurses Description:
  267. X     The old Bjorn Larssen code for the 68K platform has been removed
  268. X     from this module.
  269. X
  270. X  X/Open Return Value:
  271. X     The printw() function returns OK on success and ERR on error.
  272. X
  273. X  X/Open Errors:
  274. X     No errors are defined for this function.
  275. X
  276. X  Portability:
  277. X     PDCurses    int printw( char *fmt, ... );
  278. X     X/Open Dec '88    int printw( char *fmt, ... );
  279. X     BSD Curses    int printw( char *fmt, ... );
  280. X     SYS V Curses    int printw( char *fmt, ... );
  281. X
  282. X**man-end**********************************************************************/
  283. X
  284. Xint    printw(char *fmt,...)
  285. X{
  286. X    int    retval = ERR;
  287. X    va_list args;
  288. X
  289. X    if (stdscr == (WINDOW *)NULL)
  290. X        return (retval);
  291. X
  292. X    va_start(args, fmt);
  293. X    vsprintf(c_printscanbuf, fmt, args);
  294. X    va_end(args);
  295. X    if (waddstr(stdscr, c_printscanbuf) == ERR)
  296. X        return (retval);
  297. X    retval = (strlen(c_printscanbuf));
  298. X    return (retval);
  299. X}
  300. END_OF_FILE
  301.   if test 2217 -ne `wc -c <'portable/printw.c'`; then
  302.     echo shar: \"'portable/printw.c'\" unpacked with wrong size!
  303.   fi
  304.   # end of 'portable/printw.c'
  305. fi
  306. if test -f 'portable/resetty.c' -a "${1}" != "-c" ; then 
  307.   echo shar: Will not clobber existing file \"'portable/resetty.c'\"
  308. else
  309.   echo shar: Extracting \"'portable/resetty.c'\" \(2058 characters\)
  310.   sed "s/^X//" >'portable/resetty.c' <<'END_OF_FILE'
  311. X#include <string.h>
  312. X#define    CURSES_LIBRARY    1
  313. X#include <curses.h>
  314. X#undef    resetty
  315. X
  316. X#ifndef NDEBUG
  317. Xchar *rcsid_resetty = "$Header: c:/curses/portable/RCS/resetty.c%v 2.0 1992/11/15 03:29:10 MH Rel $";
  318. X#endif
  319. X
  320. X
  321. X
  322. X
  323. X/*man-start*********************************************************************
  324. X
  325. X  resetty()    - save/restore terminal modes
  326. X
  327. X  X/Open Description:
  328. X     These routines save and restore the state of the terminal modes.
  329. X     The savetty() function saves the current state in a buffer and
  330. X     resetty() restores the state to what it was at the last call to
  331. X     savetty().
  332. X
  333. X  PDCurses Description:
  334. X     FYI: It is very unclear whether this is a duplication of the
  335. X     reset_prog_mode() and reset_shell_mode() functions or whether
  336. X     this is a backing store type of operation.  At this time, they
  337. X     are implemented similar to the reset_*_mode() routines.
  338. X
  339. X  X/Open Return Value:
  340. X     The resetty() function returns OK upon success otherwise ERR is
  341. X     returned.
  342. X
  343. X  Portability:
  344. X     PDCurses    int resetty( void );
  345. X     X/Open Dec '88    int resetty( void );
  346. X     SysV Curses    int resetty( void );
  347. X     BSD Curses    int resetty( void );
  348. X
  349. X**man-end**********************************************************************/
  350. X
  351. Xint    resetty(void)
  352. X{
  353. X    if    (c_save_tty.been_set == TRUE)
  354. X    {
  355. X#if     defined(DOS) || defined(OS2)
  356. X#  if    SMALL || MEDIUM
  357. X    movedata( FP_SEG(&c_save_tty.saved), FP_OFF(&c_save_tty.saved),
  358. X          FP_SEG(&_cursvar), FP_OFF(&_cursvar),
  359. X          sizeof(SCREEN) );
  360. X#  else
  361. X        memcpy(&_cursvar, &c_save_tty.saved, sizeof(SCREEN));
  362. X#  endif
  363. X#endif
  364. X
  365. X        mvcur(0, 0, c_save_tty.saved.cursrow, c_save_tty.saved.curscol);
  366. X        if (PDC_get_ctrl_break() != c_save_tty.saved.orgcbr)
  367. X            PDC_set_ctrl_break(c_save_tty.saved.orgcbr);
  368. X        if (c_save_tty.saved.raw_out)
  369. X            raw();
  370. X        if (c_save_tty.saved.visible_cursor)
  371. X            curson();
  372. X        _cursvar.font = PDC_get_font();
  373. X        PDC_set_font(c_save_tty.saved.font);
  374. X        if (!PDC_scrn_modes_equal (PDC_get_scrn_mode(), c_save_tty.saved.scrnmode))
  375. X            PDC_set_scrn_mode(c_save_tty.saved.scrnmode);
  376. X
  377. X        PDC_set_rows(c_save_tty.saved.lines);
  378. X    }
  379. X    return( c_save_tty.been_set ? OK : ERR );
  380. X}
  381. END_OF_FILE
  382.   if test 2058 -ne `wc -c <'portable/resetty.c'`; then
  383.     echo shar: \"'portable/resetty.c'\" unpacked with wrong size!
  384.   fi
  385.   # end of 'portable/resetty.c'
  386. fi
  387. if test -f 'portable/scanw.c' -a "${1}" != "-c" ; then 
  388.   echo shar: Will not clobber existing file \"'portable/scanw.c'\"
  389. else
  390.   echo shar: Extracting \"'portable/scanw.c'\" \(2142 characters\)
  391.   sed "s/^X//" >'portable/scanw.c' <<'END_OF_FILE'
  392. X#include <stdarg.h>
  393. X#include <string.h>
  394. X#define    CURSES_LIBRARY    1
  395. X#include <curses.h>
  396. X#undef    scanw
  397. X
  398. X#ifndef    NDEBUG
  399. Xchar *rcsid_scanw = "$Header: c:/curses/portable/RCS/scanw.c%v 2.0 1992/11/15 03:29:02 MH Rel $";
  400. X#endif
  401. X
  402. X
  403. X
  404. X
  405. X
  406. X/*man-start*********************************************************************
  407. X
  408. X  scanw()    - read formatted from window
  409. X
  410. X  X/Open Description:
  411. X     These routines correspond to scanf.  The function scanw reads
  412. X     input from the default window.  The function wscanw reads
  413. X     input from the specified window.  The function mvscanw moves
  414. X     the cursor to the specified position and then reads input from
  415. X     the default window.  The function mvwscanw moves the cursor to
  416. X     the specified position and then reads input from the specified
  417. X     window.
  418. X
  419. X     For all the functions, the routine wgetstr is called to get a
  420. X     string from the window, and the resulting line is used as
  421. X     input for the scan.  All character interpretation is carried
  422. X     out according to the scanf function rules.
  423. X
  424. X  PDCurses Description:
  425. X     The old Bjorn Larssen code for the 68K platform has been removed
  426. X     from this module.
  427. X
  428. X  X/Open Return Value:
  429. X     Upon successful completion, the scanw, mvscanw, mvwscanw and
  430. X     wscanw functions return the number of items successfully
  431. X     matched.  On end-of-file, they return EOF.  Otherwise they
  432. X     return ERR.
  433. X
  434. X  PDCurses Errors:
  435. X     No errors.
  436. X
  437. X  Portability:
  438. X     PDCurses    int scanw( char *fmt, ...);
  439. X     X/Open Dec '88    int scanw( char *fmt, ...);
  440. X     BSD Curses    int scanw( char *fmt, ...);
  441. X     SYS V Curses    int scanw( char *fmt, ...);
  442. X
  443. X**man-end**********************************************************************/
  444. X
  445. Xint    scanw(char *fmt, ...)
  446. X{
  447. X    va_list args;
  448. X    int    retval = ERR;
  449. X
  450. X#if    !defined (HC)
  451. X    if (stdscr == (WINDOW *)NULL)
  452. X        return( retval );
  453. X
  454. X    wrefresh(stdscr);    /* set cursor position */
  455. X
  456. X    /*
  457. X     * get string
  458. X     */
  459. X    c_printscanbuf[0] = '\0';  /* reset to empty string */
  460. X    if (wgetstr(stdscr, c_printscanbuf) == ERR)
  461. X        return( retval );
  462. X    va_start(args, fmt);
  463. X#ifdef NO_VSSCANF
  464. X    retval = PDC_vsscanf(c_printscanbuf, fmt, args);
  465. X#else
  466. X    retval = vsscanf(c_printscanbuf, fmt, args);
  467. X#endif
  468. X    va_end(args);
  469. X#endif
  470. X    return( retval );
  471. X}
  472. END_OF_FILE
  473.   if test 2142 -ne `wc -c <'portable/scanw.c'`; then
  474.     echo shar: \"'portable/scanw.c'\" unpacked with wrong size!
  475.   fi
  476.   # end of 'portable/scanw.c'
  477. fi
  478. if test -f 'portable/standend.c' -a "${1}" != "-c" ; then 
  479.   echo shar: Will not clobber existing file \"'portable/standend.c'\"
  480. else
  481.   echo shar: Extracting \"'portable/standend.c'\" \(2091 characters\)
  482.   sed "s/^X//" >'portable/standend.c' <<'END_OF_FILE'
  483. X#define    CURSES_LIBRARY    1
  484. X#include <curses.h>
  485. X#undef    standend
  486. X
  487. X#ifndef    NDEBUG
  488. Xchar *rcsid_standend = "$Header: c:/curses/portable/RCS/standend.c%v 2.0 1992/11/15 03:29:16 MH Rel $";
  489. X#endif
  490. X
  491. X
  492. X
  493. X
  494. X/*man-start*********************************************************************
  495. X
  496. X  standend()    - attribute manipulation
  497. X
  498. X  X/Open Description:
  499. X     These functions manipulate the current attributes of the named
  500. X     window.  These attributes can be any combination of A_STANDOUT,
  501. X     A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_UNDERLINE.
  502. X
  503. X     These constants are defined in <curses.h> and can be combined
  504. X     with the bitwise-OR operator (|).
  505. X
  506. X     The current attributes of a window are applied to all characters
  507. X     that are written into the window with waddch().  Attributes are
  508. X     a property of the character, and move with the character
  509. X     through any scrolling and insert/delete line/character operations.
  510. X     To the extent possible on the particular terminal, they will be
  511. X     displayed as the graphic rendition of characters put on the
  512. X     screen.
  513. X
  514. X     The attrset() function sets the current attributes of the given
  515. X     window to attrs.  The attroff() function turns off the named
  516. X     attributes without turning on or off any other attributes.  The
  517. X     attron() function turs on the named attriutes without affecting
  518. X     any others.  The standout function is the same as
  519. X     attron( A_STANDOUT ).  The standend() function is the same as
  520. X     attrset( 0 ); that is it turns off all attributes.
  521. X
  522. X     NOTE:  attroff(), attron() and attrset() are macros.
  523. X
  524. X  PDCurses Description:
  525. X     System V compatible color support is included.
  526. X     See <curses.h> for further details.
  527. X
  528. X  X/Open Return Value:
  529. X     These functions return OK on success and ERR on error.
  530. X
  531. X  PDCurses Errors:
  532. X     It is an error to call this function with a NULL window pointer.
  533. X
  534. X  Portability:
  535. X     PDCurses    int standend( void );
  536. X     X/Open Dec '88    int standend( void );
  537. X     BSD Curses    int standend( void );
  538. X     SYS V Curses    int standend( void );
  539. X
  540. X**man-end**********************************************************************/
  541. X
  542. Xint    standend(void)
  543. X{
  544. X    return( wattrset( stdscr, A_NORMAL ) );
  545. X}
  546. END_OF_FILE
  547.   if test 2091 -ne `wc -c <'portable/standend.c'`; then
  548.     echo shar: \"'portable/standend.c'\" unpacked with wrong size!
  549.   fi
  550.   # end of 'portable/standend.c'
  551. fi
  552. if test -f 'portable/standout.c' -a "${1}" != "-c" ; then 
  553.   echo shar: Will not clobber existing file \"'portable/standout.c'\"
  554. else
  555.   echo shar: Extracting \"'portable/standout.c'\" \(2093 characters\)
  556.   sed "s/^X//" >'portable/standout.c' <<'END_OF_FILE'
  557. X#define    CURSES_LIBRARY    1
  558. X#include <curses.h>
  559. X#undef    standout
  560. X
  561. X#ifndef    NDEBUG
  562. Xchar *rcsid_standout = "$Header: c:/curses/portable/RCS/standout.c%v 2.0 1992/11/15 03:29:16 MH Rel $";
  563. X#endif
  564. X
  565. X
  566. X
  567. X
  568. X/*man-start*********************************************************************
  569. X
  570. X  standout()    - attribute manipulation
  571. X
  572. X  X/Open Description:
  573. X     These functions manipulate the current attributes of the named
  574. X     window.  These attributes can be any combination of A_STANDOUT,
  575. X     A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_UNDERLINE.
  576. X
  577. X     These constants are defined in <curses.h> and can be combined
  578. X     with the bitwise-OR operator (|).
  579. X
  580. X     The current attributes of a window are applied to all characters
  581. X     that are written into the window with waddch().  Attributes are
  582. X     a property of the character, and move with the character
  583. X     through any scrolling and insert/delete line/character operations.
  584. X     To the extent possible on the particular terminal, they will be
  585. X     displayed as the graphic rendition of characters put on the
  586. X     screen.
  587. X
  588. X     The attrset() function sets the current attributes of the given
  589. X     window to attrs.  The attroff() function turns off the named
  590. X     attributes without turning on or off any other attributes.  The
  591. X     attron() function turs on the named attriutes without affecting
  592. X     any others.  The standout function is the same as
  593. X     attron( A_STANDOUT ).  The standend() function is the same as
  594. X     attrset( 0 ); that is it turns off all attributes.
  595. X
  596. X     NOTE:  attroff(), attron() and attrset() are macros.
  597. X
  598. X  PDCurses Description:
  599. X     System V compatible color support is included.
  600. X     See <curses.h> for further details.
  601. X
  602. X  X/Open Return Value:
  603. X     These functions return OK on success and ERR on error.
  604. X
  605. X  PDCurses Errors:
  606. X     It is an error to call this function with a NULL window pointer.
  607. X
  608. X  Portability:
  609. X     PDCurses    int standout( void );
  610. X     X/Open Dec '88    int standout( void );
  611. X     BSD Curses    int standout( void );
  612. X     SYS V Curses    int standout( void );
  613. X
  614. X**man-end**********************************************************************/
  615. X
  616. Xint    standout(void)
  617. X{
  618. X    return( wattrset( stdscr, A_STANDOUT ) );
  619. X}
  620. END_OF_FILE
  621.   if test 2093 -ne `wc -c <'portable/standout.c'`; then
  622.     echo shar: \"'portable/standout.c'\" unpacked with wrong size!
  623.   fi
  624.   # end of 'portable/standout.c'
  625. fi
  626. if test -f 'portable/typeahea.c' -a "${1}" != "-c" ; then 
  627.   echo shar: Will not clobber existing file \"'portable/typeahea.c'\"
  628. else
  629.   echo shar: Extracting \"'portable/typeahea.c'\" \(2127 characters\)
  630.   sed "s/^X//" >'portable/typeahea.c' <<'END_OF_FILE'
  631. X#define    CURSES_LIBRARY    1
  632. X#include <curses.h>
  633. X#undef    typeahead
  634. X
  635. X#ifndef NDEBUG
  636. Xchar *rcsid_typeahea = "$Header: c:/curses/portable/RCS/typeahea.c%v 2.0 1992/11/15 03:29:19 MH Rel $";
  637. X#endif
  638. X
  639. Xextern    short    c_pindex;        /* putter index            */
  640. Xextern    short    c_gindex;        /* getter index            */
  641. Xextern    short    c_ungind;        /* wungetch() push index    */
  642. Xextern    chtype    c_ungch[NUNGETCH];    /* array of ungotten chars    */
  643. Xextern    WINDOW*    _getch_win_;
  644. X
  645. X/*man-start*********************************************************************
  646. X
  647. X  typeahead()    - check for type-ahead
  648. X
  649. X  X/Open Description:
  650. X     The curses package does the "line-breakout optimisation" by
  651. X     looking for type-ahead periodically while updating the screen.
  652. X     If input is found, the current update will be postponed until
  653. X     refresh() or doupdate() are called again.  This allows faster
  654. X     response to commands typed in advance.  Normally, the input FILE
  655. X     pointer passed to newterm(), or stdin in the case when initscr()
  656. X     was called, will be used to do this type-ahead checking.  The
  657. X     typeahead() routine specified that the file descriptor fd is to
  658. X     be used to check for type-ahead instead.  If fd is -1, then no
  659. X     type-ahead checking will be done.
  660. X
  661. X  PDCurses Description:
  662. X     Some early versions of the library (1.5beta) may have had an
  663. X     improper interface declaration.  e.g. bool typeahead( void );
  664. X     rather than the X/Open specified bool typeahead( FILE* fd );.
  665. X
  666. X     FYI:  Under PDCurses, the passed file handle fd is ignored.
  667. X
  668. X  X/Open Return Value:
  669. X     The typeahead() routine returns TRUE if keyboard input is pending
  670. X     otherwise FALSE is returned.
  671. X
  672. X  Portability:
  673. X     PDCurses    bool typeahead( FILE* fd );
  674. X     SysV Curses    
  675. X     BSD Curses    
  676. X     X/Open Dec '88    bool typeahead( FILE* fd );
  677. X
  678. X**man-end**********************************************************************/
  679. X
  680. Xbool    typeahead( FILE* fd )
  681. X{
  682. X#ifdef    TC
  683. X#  pragma argsused
  684. X#endif
  685. X    if (c_ungind)
  686. X        return (TRUE);            /* ungotten char */
  687. X    if (c_pindex > c_gindex)
  688. X        return (TRUE);            /* buffered char */
  689. X    if (_cursvar.raw_inp)
  690. X        return((bool)PDC_check_bios_key());/* raw mode test */
  691. X
  692. X    return((bool)PDC_check_bios_key());    /* normal mode test */
  693. X}
  694. END_OF_FILE
  695.   if test 2127 -ne `wc -c <'portable/typeahea.c'`; then
  696.     echo shar: \"'portable/typeahea.c'\" unpacked with wrong size!
  697.   fi
  698.   # end of 'portable/typeahea.c'
  699. fi
  700. if test -f 'portable/wattroff.c' -a "${1}" != "-c" ; then 
  701.   echo shar: Will not clobber existing file \"'portable/wattroff.c'\"
  702. else
  703.   echo shar: Extracting \"'portable/wattroff.c'\" \(2243 characters\)
  704.   sed "s/^X//" >'portable/wattroff.c' <<'END_OF_FILE'
  705. X#define    CURSES_LIBRARY    1
  706. X#include <curses.h>
  707. X#undef    wattroff
  708. X
  709. X#ifndef    NDEBUG
  710. Xchar *rcsid_wattroff = "$Header: c:/curses/portable/RCS/wattroff.c%v 2.0 1992/11/15 03:29:21 MH Rel $";
  711. X#endif
  712. X
  713. X
  714. X
  715. X
  716. X/*man-start*********************************************************************
  717. X
  718. X  wattroff()    - attribute manipulation
  719. X
  720. X  X/Open Description:
  721. X     These functions manipulate the current attributes of the named
  722. X     window.  These attributes can be any combination of A_STANDOUT,
  723. X     A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_UNDERLINE.
  724. X
  725. X     These constants are defined in <curses.h> and can be combined
  726. X     with the bitwise-OR operator (|).
  727. X
  728. X     The current attributes of a window are applied to all characters
  729. X     that are written into the window with waddch().  Attributes are
  730. X     a property of the character, and move with the character
  731. X     through any scrolling and insert/delete line/character operations.
  732. X     To the extent possible on the particular terminal, they will be
  733. X     displayed as the graphic rendition of characters put on the
  734. X     screen.
  735. X
  736. X     The attrset() function sets the current attributes of the given
  737. X     window to attrs.  The attroff() function turns off the named
  738. X     attributes without turning on or off any other attributes.  The
  739. X     attron() function turs on the named attriutes without affecting
  740. X     any others.  The standout function is the same as
  741. X     attron( A_STANDOUT ).  The standend() function is the same as
  742. X     attrset( 0 ); that is it turns off all attributes.
  743. X
  744. X     NOTE:  attroff(), attron() and attrset() are macros.
  745. X
  746. X  PDCurses Description:
  747. X     System V compatible color support is included.
  748. X     See <curses.h> for further details.
  749. X
  750. X  X/Open Return Value:
  751. X     These functions return OK on success and ERR on error.
  752. X
  753. X  PDCurses Errors:
  754. X     It is an error to call this function with a NULL window pointer.
  755. X
  756. X  Portability:
  757. X     PDCurses    int wattroff( WINDOW* win, int attrs );
  758. X     X/Open Dec '88    int wattroff( WINDOW* win, int attrs );
  759. X     BSD Curses    int wattroff( WINDOW* win, int attrs );
  760. X     SYS V Curses    int wattroff( WINDOW* win, int attrs );
  761. X
  762. X**man-end**********************************************************************/
  763. X
  764. Xint    wattroff(WINDOW *win, int attrs)
  765. X{
  766. X
  767. X    if (win == (WINDOW *)NULL)
  768. X        return( ERR );
  769. X
  770. X    win->_attrs &= (~attrs & A_ATTRIBUTES);
  771. X    return( OK );
  772. X}
  773. END_OF_FILE
  774.   if test 2243 -ne `wc -c <'portable/wattroff.c'`; then
  775.     echo shar: \"'portable/wattroff.c'\" unpacked with wrong size!
  776.   fi
  777.   # end of 'portable/wattroff.c'
  778. fi
  779. if test -f 'portable/wattron.c' -a "${1}" != "-c" ; then 
  780.   echo shar: Will not clobber existing file \"'portable/wattron.c'\"
  781. else
  782.   echo shar: Extracting \"'portable/wattron.c'\" \(2232 characters\)
  783.   sed "s/^X//" >'portable/wattron.c' <<'END_OF_FILE'
  784. X#define    CURSES_LIBRARY    1
  785. X#include <curses.h>
  786. X#undef    wattron
  787. X
  788. X#ifndef    NDEBUG
  789. Xchar *rcsid_wattron = "$Header: c:/curses/portable/RCS/wattron.c%v 2.0 1992/11/15 03:29:22 MH Rel $";
  790. X#endif
  791. X
  792. X
  793. X
  794. X
  795. X/*man-start*********************************************************************
  796. X
  797. X  wattron()    - attribute manipulation
  798. X
  799. X  X/Open Description:
  800. X     These functions manipulate the current attributes of the named
  801. X     window.  These attributes can be any combination of A_STANDOUT,
  802. X     A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_UNDERLINE.
  803. X
  804. X     These constants are defined in <curses.h> and can be combined
  805. X     with the bitwise-OR operator (|).
  806. X
  807. X     The current attributes of a window are applied to all characters
  808. X     that are written into the window with waddch().  Attributes are
  809. X     a property of the character, and move with the character
  810. X     through any scrolling and insert/delete line/character operations.
  811. X     To the extent possible on the particular terminal, they will be
  812. X     displayed as the graphic rendition of characters put on the
  813. X     screen.
  814. X
  815. X     The attrset() function sets the current attributes of the given
  816. X     window to attrs.  The attroff() function turns off the named
  817. X     attributes without turning on or off any other attributes.  The
  818. X     attron() function turs on the named attriutes without affecting
  819. X     any others.  The standout function is the same as
  820. X     attron( A_STANDOUT ).  The standend() function is the same as
  821. X     attrset( 0 ); that is it turns off all attributes.
  822. X
  823. X     NOTE:  attroff(), attron() and attrset() are macros.
  824. X
  825. X  PDCurses Description:
  826. X     System V compatible color support is included.
  827. X     See <curses.h> for further details.
  828. X
  829. X  X/Open Return Value:
  830. X     These functions return OK on success and ERR on error.
  831. X
  832. X  PDCurses Errors:
  833. X     It is an error to call this function with a NULL window pointer.
  834. X
  835. X  Portability:
  836. X     PDCurses    int wattron( WINDOW* win, int attrs );
  837. X     X/Open Dec '88    int wattron( WINDOW* win, int attrs );
  838. X     BSD Curses    int wattron( WINDOW* win, int attrs );
  839. X     SYS V Curses    int wattron( WINDOW* win, int attrs );
  840. X
  841. X**man-end**********************************************************************/
  842. X
  843. Xint    wattron(WINDOW *win, int attrs)
  844. X{
  845. X
  846. X    if (win == (WINDOW *)NULL)
  847. X        return( ERR );
  848. X    win->_attrs |= (attrs & A_ATTRIBUTES);
  849. X    return( OK );
  850. X}
  851. END_OF_FILE
  852.   if test 2232 -ne `wc -c <'portable/wattron.c'`; then
  853.     echo shar: \"'portable/wattron.c'\" unpacked with wrong size!
  854.   fi
  855.   # end of 'portable/wattron.c'
  856. fi
  857. if test -f 'portable/wattrset.c' -a "${1}" != "-c" ; then 
  858.   echo shar: Will not clobber existing file \"'portable/wattrset.c'\"
  859. else
  860.   echo shar: Extracting \"'portable/wattrset.c'\" \(2238 characters\)
  861.   sed "s/^X//" >'portable/wattrset.c' <<'END_OF_FILE'
  862. X#define    CURSES_LIBRARY    1
  863. X#include <curses.h>
  864. X#undef    wattrset
  865. X
  866. X#ifndef    NDEBUG
  867. Xchar *rcsid_wattrset = "$Header: c:/curses/portable/RCS/wattrset.c%v 2.0 1992/11/15 03:29:23 MH Rel $";
  868. X#endif
  869. X
  870. X
  871. X
  872. X
  873. X/*man-start*********************************************************************
  874. X
  875. X  wattrset()    - attribute manipulation
  876. X
  877. X  X/Open Description:
  878. X     These functions manipulate the current attributes of the named
  879. X     window.  These attributes can be any combination of A_STANDOUT,
  880. X     A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_UNDERLINE.
  881. X
  882. X     These constants are defined in <curses.h> and can be combined
  883. X     with the bitwise-OR operator (|).
  884. X
  885. X     The current attributes of a window are applied to all characters
  886. X     that are written into the window with waddch().  Attributes are
  887. X     a property of the character, and move with the character
  888. X     through any scrolling and insert/delete line/character operations.
  889. X     To the extent possible on the particular terminal, they will be
  890. X     displayed as the graphic rendition of characters put on the
  891. X     screen.
  892. X
  893. X     The attrset() function sets the current attributes of the given
  894. X     window to attrs.  The attroff() function turns off the named
  895. X     attributes without turning on or off any other attributes.  The
  896. X     attron() function turs on the named attriutes without affecting
  897. X     any others.  The standout function is the same as
  898. X     attron( A_STANDOUT ).  The standend() function is the same as
  899. X     attrset( 0 ); that is it turns off all attributes.
  900. X
  901. X     NOTE:  attroff(), attron() and attrset() are macros.
  902. X
  903. X  PDCurses Description:
  904. X     System V compatible color support is included.
  905. X     See <curses.h> for further details.
  906. X
  907. X  X/Open Return Value:
  908. X     These functions return OK on success and ERR on error.
  909. X
  910. X  PDCurses Errors:
  911. X     It is an error to call this function with a NULL window pointer.
  912. X
  913. X  Portability:
  914. X     PDCurses    int wattrset( WINDOW* win, int attrs );
  915. X     X/Open Dec '88    int wattrset( WINDOW* win, int attrs );
  916. X     BSD Curses    int wattrset( WINDOW* win, int attrs );
  917. X     SYS V Curses    int wattrset( WINDOW* win, int attrs );
  918. X
  919. X**man-end**********************************************************************/
  920. X
  921. Xint    wattrset(WINDOW *win, int attrs)
  922. X{
  923. X
  924. X    if (win == (WINDOW *)NULL)
  925. X        return( ERR );
  926. X    win->_attrs = attrs & A_ATTRIBUTES;
  927. X    return( OK );
  928. X}
  929. END_OF_FILE
  930.   if test 2238 -ne `wc -c <'portable/wattrset.c'`; then
  931.     echo shar: \"'portable/wattrset.c'\" unpacked with wrong size!
  932.   fi
  933.   # end of 'portable/wattrset.c'
  934. fi
  935. if test -f 'portable/wdelch.c' -a "${1}" != "-c" ; then 
  936.   echo shar: Will not clobber existing file \"'portable/wdelch.c'\"
  937. else
  938.   echo shar: Extracting \"'portable/wdelch.c'\" \(2110 characters\)
  939.   sed "s/^X//" >'portable/wdelch.c' <<'END_OF_FILE'
  940. X#ifndef NO_MEMORY_H
  941. X#include <memory.h>
  942. X#endif
  943. X#define    CURSES_LIBRARY    1
  944. X#include <curses.h>
  945. X#undef    wdelch
  946. X
  947. X#ifndef    NDEBUG
  948. Xchar *rcsid_wdelch = "$Header: c:/curses/portable/RCS/wdelch.c%v 2.0 1992/11/15 03:29:23 MH Rel $";
  949. X#endif
  950. X
  951. X
  952. X
  953. X
  954. X/*man-start*********************************************************************
  955. X
  956. X  wdelch()    - remove character from window
  957. X
  958. X  X/Open Description:
  959. X     The character under the cursor in the window is deleted.  All
  960. X     characters to the right on the same line are moved to the left
  961. X     one position and the last character on the line is filled with
  962. X     a blank.  The cursor position does not change (after moving to
  963. X     y, x if coordinates are specified).
  964. X
  965. X     NOTE: delch(), mvdelch(), and mvwdelch() are macros.
  966. X
  967. X  PDCurses Description:
  968. X     Nothing additional.
  969. X
  970. X  X/Open Return Value:
  971. X     The wdelch() function returns OK on success and ERR on error.
  972. X
  973. X  X/Open Errors:
  974. X     No errors are defined for this function.
  975. X
  976. X  Portability:
  977. X     PDCurses    int wdelch( WINDOW* win );
  978. X     X/Open Dec '88    int wdelch( WINDOW* win );
  979. X     BSD Curses    int wdelch( WINDOW* win );
  980. X     SYS V Curses    int wdelch( WINDOW* win );
  981. X
  982. X**man-end**********************************************************************/
  983. X
  984. Xint    wdelch(WINDOW *win)
  985. X{
  986. X    int        y;
  987. X    int        x;
  988. X    int        maxx;
  989. X    chtype*        temp1;
  990. Xregister chtype*    dstp;
  991. Xregister chtype*    srcp;
  992. X
  993. X    if (win == (WINDOW *)NULL)
  994. X        return (ERR);
  995. X
  996. X    y    = win->_cury;
  997. X    x    = win->_curx;
  998. X    maxx    = win->_maxx - 1;
  999. X    temp1    = &win->_y[y][x];
  1000. X
  1001. X#if     defined(DOS) || defined(OS2)
  1002. X#  if    SMALL || MEDIUM
  1003. X/*    srcp = temp1 + sizeof(chtype); */
  1004. X    srcp = temp1 + 1;
  1005. X    dstp = temp1;
  1006. X    movedata(FP_SEG(srcp), FP_OFF(srcp),
  1007. X         FP_SEG(dstp), FP_OFF(dstp),
  1008. X         (maxx - x) * sizeof(chtype));
  1009. X#  else
  1010. X    /* Changed from memcpy to memmove. Should work with
  1011. X     * TC and MSC.
  1012. X     *    -- MH    920605
  1013. X     */
  1014. X/*    memmove( temp1, temp1 + sizeof(chtype), (maxx - x) * sizeof(chtype) );*/
  1015. X    memmove( temp1, temp1 + 1, (maxx - x) * sizeof(chtype) );
  1016. X#  endif
  1017. X#endif
  1018. X
  1019. X    win->_y[y][maxx] = win->_blank | win->_attrs;
  1020. X    win->_lastch[y] = maxx;
  1021. X
  1022. X    if ((win->_firstch[y] == _NO_CHANGE) ||
  1023. X        (win->_firstch[y] > x))
  1024. X    {
  1025. X        win->_firstch[y] = x;
  1026. X    }
  1027. X    return (OK);
  1028. X}
  1029. END_OF_FILE
  1030.   if test 2110 -ne `wc -c <'portable/wdelch.c'`; then
  1031.     echo shar: \"'portable/wdelch.c'\" unpacked with wrong size!
  1032.   fi
  1033.   # end of 'portable/wdelch.c'
  1034. fi
  1035. if test -f 'portable/wprintw.c' -a "${1}" != "-c" ; then 
  1036.   echo shar: Will not clobber existing file \"'portable/wprintw.c'\"
  1037. else
  1038.   echo shar: Extracting \"'portable/wprintw.c'\" \(2286 characters\)
  1039.   sed "s/^X//" >'portable/wprintw.c' <<'END_OF_FILE'
  1040. X#include <stdarg.h>
  1041. X#include <string.h>
  1042. X#define    CURSES_LIBRARY    1
  1043. X#include <curses.h>
  1044. X#undef    wprintw
  1045. X
  1046. X#ifndef NDEBUG
  1047. Xchar *rcsid_wprintw = "$Header: c:/curses/portable/RCS/wprintw.c%v 2.0 1992/11/15 03:29:33 MH Rel $";
  1048. X#endif
  1049. X
  1050. X
  1051. X
  1052. X
  1053. X
  1054. X/*man-start*********************************************************************
  1055. X
  1056. X  wprintw()    - formatted write to a window
  1057. X
  1058. X  X/Open Description:
  1059. X     The printw routine adds a string to the default window
  1060. X     starting at the current cursor position.  This routine causes
  1061. X     the string that would normally be output by printf to be
  1062. X     output by addstr.
  1063. X
  1064. X     The routine wprintw adds a string to the specified window
  1065. X     starting at the current cursor position.  This routine causes
  1066. X     the string that would normally be output by printf to be
  1067. X     output by waddstr.
  1068. X
  1069. X     The routine mvprintw adds a string to the default window
  1070. X     starting at the specified cursor position.  This routine
  1071. X     causes the string that would normally be output by printf to
  1072. X     be output by addstr.
  1073. X
  1074. X     The routine mvwprintw adds a string to the specified window
  1075. X     starting at the specified cursor position.  This routine
  1076. X     causes the string that would normally be output by printf to
  1077. X     be output by waddstr.
  1078. X
  1079. X     All these routines are analogous to printf.  It is advisable
  1080. X     to use the field width options of printf to avoid leaving
  1081. X     unwanted characters on the screen from earlier calls.
  1082. X
  1083. X  PDCurses Description:
  1084. X     The old Bjorn Larssen code for the 68K platform has been removed
  1085. X     from this module.
  1086. X
  1087. X  X/Open Return Value:
  1088. X     The printw() function returns OK on success and ERR on error.
  1089. X
  1090. X  X/Open Errors:
  1091. X     No errors are defined for this function.
  1092. X
  1093. X  Portability:
  1094. X     PDCurses    int wprintw( WINDOW* win, char *fmt, ... );
  1095. X     X/Open Dec '88    int wprintw( WINDOW* win, char *fmt, ... );
  1096. X     BSD Curses    int wprintw( WINDOW* win, char *fmt, ... );
  1097. X     SYS V Curses    int wprintw( WINDOW* win, char *fmt, ... );
  1098. X
  1099. X**man-end**********************************************************************/
  1100. X
  1101. Xint    wprintw(WINDOW * win, char *fmt,...)
  1102. X{
  1103. X    int    retval = ERR;
  1104. X    va_list args;
  1105. X
  1106. X    if (win == (WINDOW *)NULL)
  1107. X        return (retval);
  1108. X
  1109. X    va_start(args, fmt);
  1110. X    vsprintf(c_printscanbuf, fmt, args);
  1111. X    va_end(args);
  1112. X    if (waddstr(win, c_printscanbuf) == ERR)
  1113. X        return (retval);
  1114. X    retval = (strlen(c_printscanbuf));
  1115. X    return (retval);
  1116. X}
  1117. END_OF_FILE
  1118.   if test 2286 -ne `wc -c <'portable/wprintw.c'`; then
  1119.     echo shar: \"'portable/wprintw.c'\" unpacked with wrong size!
  1120.   fi
  1121.   # end of 'portable/wprintw.c'
  1122. fi
  1123. if test -f 'portable/wscanw.c' -a "${1}" != "-c" ; then 
  1124.   echo shar: Will not clobber existing file \"'portable/wscanw.c'\"
  1125. else
  1126.   echo shar: Extracting \"'portable/wscanw.c'\" \(2192 characters\)
  1127.   sed "s/^X//" >'portable/wscanw.c' <<'END_OF_FILE'
  1128. X#include <stdarg.h>
  1129. X#include <string.h>
  1130. X#define    CURSES_LIBRARY    1
  1131. X#include <curses.h>
  1132. X#undef    wscanw
  1133. X
  1134. X#ifndef    NDEBUG
  1135. Xchar *rcsid_wscanw = "$Header: c:/curses/portable/RCS/wscanw.c%v 2.0 1992/11/15 03:29:09 MH Rel $";
  1136. X#endif
  1137. X
  1138. X
  1139. X
  1140. X
  1141. X
  1142. X/*man-start*********************************************************************
  1143. X
  1144. X  wscanw()    - read formatted from window
  1145. X
  1146. X  X/Open Description:
  1147. X     These routines correspond to scanf.  The function scanw reads
  1148. X     input from the default window.  The function wscanw reads
  1149. X     input from the specified window.  The function mvscanw moves
  1150. X     the cursor to the specified position and then reads input from
  1151. X     the default window.  The function mvwscanw moves the cursor to
  1152. X     the specified position and then reads input from the specified
  1153. X     window.
  1154. X
  1155. X     For all the functions, the routine wgetstr is called to get a
  1156. X     string from the window, and the resulting line is used as
  1157. X     input for the scan.  All character interpretation is carried
  1158. X     out according to the scanf function rules.
  1159. X
  1160. X  PDCurses Description:
  1161. X     The old Bjorn Larssen code for the 68K platform has been removed
  1162. X     from this module.
  1163. X
  1164. X  X/Open Return Value:
  1165. X     Upon successful completion, the scanw, mvscanw, mvwscanw and
  1166. X     wscanw functions return the number of items successfully
  1167. X     matched.  On end-of-file, they return EOF.  Otherwise they
  1168. X     return ERR.
  1169. X
  1170. X  PDCurses Errors:
  1171. X     No errors.
  1172. X
  1173. X  Portability:
  1174. X     PDCurses    int wscanw( WINDOW*, char *fmt, ...);
  1175. X     X/Open Dec '88    int wscanw( WINDOW*, char *fmt, ...);
  1176. X     BSD Curses    int wscanw( WINDOW*, char *fmt, ...);
  1177. X     SYS V Curses    int wscanw( WINDOW*, char *fmt, ...);
  1178. X
  1179. X**man-end**********************************************************************/
  1180. X
  1181. Xint    wscanw(WINDOW * win, char *fmt, ...)
  1182. X{
  1183. X    va_list args;
  1184. X    int    retval = ERR;
  1185. X
  1186. X#if    !defined (HC)
  1187. X    if (win == (WINDOW *)NULL)
  1188. X        return (retval);
  1189. X
  1190. X    wrefresh(win);        /* set cursor position */
  1191. X
  1192. X    /*
  1193. X     * get string
  1194. X     */
  1195. X    c_printscanbuf[0] = '\0';  /* reset to empty string */
  1196. X    if (wgetstr(win, c_printscanbuf) == ERR)
  1197. X        return( retval );
  1198. X    va_start(args, fmt);
  1199. X#ifdef NO_VSSCANF
  1200. X    retval = PDC_vsscanf(c_printscanbuf, fmt, args);
  1201. X#else
  1202. X    retval = vsscanf(c_printscanbuf, fmt, args);
  1203. X#endif
  1204. X    va_end(args);
  1205. X#endif
  1206. X    return( retval );
  1207. X}
  1208. END_OF_FILE
  1209.   if test 2192 -ne `wc -c <'portable/wscanw.c'`; then
  1210.     echo shar: \"'portable/wscanw.c'\" unpacked with wrong size!
  1211.   fi
  1212.   # end of 'portable/wscanw.c'
  1213. fi
  1214. if test -f 'portable/wstanden.c' -a "${1}" != "-c" ; then 
  1215.   echo shar: Will not clobber existing file \"'portable/wstanden.c'\"
  1216. else
  1217.   echo shar: Extracting \"'portable/wstanden.c'\" \(2132 characters\)
  1218.   sed "s/^X//" >'portable/wstanden.c' <<'END_OF_FILE'
  1219. X#define    CURSES_LIBRARY    1
  1220. X#include <curses.h>
  1221. X#undef    wstandend
  1222. X
  1223. X#ifndef    NDEBUG
  1224. Xchar *rcsid_wstanden = "$Header: c:/curses/portable/RCS/wstanden.c%v 2.0 1992/11/15 03:29:30 MH Rel $";
  1225. X#endif
  1226. X
  1227. X
  1228. X
  1229. X
  1230. X/*man-start*********************************************************************
  1231. X
  1232. X  wstandend()    - attribute manipulation
  1233. X
  1234. X  X/Open Description:
  1235. X     These functions manipulate the current attributes of the named
  1236. X     window.  These attributes can be any combination of A_STANDOUT,
  1237. X     A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_UNDERLINE.
  1238. X
  1239. X     These constants are defined in <curses.h> and can be combined
  1240. X     with the bitwise-OR operator (|).
  1241. X
  1242. X     The current attributes of a window are applied to all characters
  1243. X     that are written into the window with waddch().  Attributes are
  1244. X     a property of the character, and move with the character
  1245. X     through any scrolling and insert/delete line/character operations.
  1246. X     To the extent possible on the particular terminal, they will be
  1247. X     displayed as the graphic rendition of characters put on the
  1248. X     screen.
  1249. X
  1250. X     The attrset() function sets the current attributes of the given
  1251. X     window to attrs.  The attroff() function turns off the named
  1252. X     attributes without turning on or off any other attributes.  The
  1253. X     attron() function turs on the named attriutes without affecting
  1254. X     any others.  The standout function is the same as
  1255. X     attron( A_STANDOUT ).  The standend() function is the same as
  1256. X     attrset( 0 ); that is it turns off all attributes.
  1257. X
  1258. X     NOTE:  attroff(), attron() and attrset() are macros.
  1259. X
  1260. X  PDCurses Description:
  1261. X     System V compatible color support is included.
  1262. X     See <curses.h> for further details.
  1263. X
  1264. X  X/Open Return Value:
  1265. X     These functions return OK on success and ERR on error.
  1266. X
  1267. X  PDCurses Errors:
  1268. X     It is an error to call this function with a NULL window pointer.
  1269. X
  1270. X  Portability:
  1271. X     PDCurses    int wstandend( WINDOW* win );
  1272. X     X/Open Dec '88    int wstandend( WINDOW* win );
  1273. X     BSD Curses    int wstandend( WINDOW* win );
  1274. X     SYS V Curses    int wstandend( WINDOW* win );
  1275. X
  1276. X**man-end**********************************************************************/
  1277. X
  1278. Xint    wstandend( WINDOW *win )
  1279. X{
  1280. X    return( wattrset( win, A_NORMAL ) );
  1281. X}
  1282. END_OF_FILE
  1283.   if test 2132 -ne `wc -c <'portable/wstanden.c'`; then
  1284.     echo shar: \"'portable/wstanden.c'\" unpacked with wrong size!
  1285.   fi
  1286.   # end of 'portable/wstanden.c'
  1287. fi
  1288. if test -f 'portable/wstandou.c' -a "${1}" != "-c" ; then 
  1289.   echo shar: Will not clobber existing file \"'portable/wstandou.c'\"
  1290. else
  1291.   echo shar: Extracting \"'portable/wstandou.c'\" \(2134 characters\)
  1292.   sed "s/^X//" >'portable/wstandou.c' <<'END_OF_FILE'
  1293. X#define    CURSES_LIBRARY    1
  1294. X#include <curses.h>
  1295. X#undef    wstandout
  1296. X
  1297. X#ifndef    NDEBUG
  1298. Xchar *rcsid_wstandou = "$Header: c:/curses/portable/RCS/wstandou.c%v 2.0 1992/11/15 03:29:30 MH Rel $";
  1299. X#endif
  1300. X
  1301. X
  1302. X
  1303. X
  1304. X/*man-start*********************************************************************
  1305. X
  1306. X  wstandout()    - attribute manipulation
  1307. X
  1308. X  X/Open Description:
  1309. X     These functions manipulate the current attributes of the named
  1310. X     window.  These attributes can be any combination of A_STANDOUT,
  1311. X     A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_UNDERLINE.
  1312. X
  1313. X     These constants are defined in <curses.h> and can be combined
  1314. X     with the bitwise-OR operator (|).
  1315. X
  1316. X     The current attributes of a window are applied to all characters
  1317. X     that are written into the window with waddch().  Attributes are
  1318. X     a property of the character, and move with the character
  1319. X     through any scrolling and insert/delete line/character operations.
  1320. X     To the extent possible on the particular terminal, they will be
  1321. X     displayed as the graphic rendition of characters put on the
  1322. X     screen.
  1323. X
  1324. X     The attrset() function sets the current attributes of the given
  1325. X     window to attrs.  The attroff() function turns off the named
  1326. X     attributes without turning on or off any other attributes.  The
  1327. X     attron() function turs on the named attriutes without affecting
  1328. X     any others.  The standout function is the same as
  1329. X     attron( A_STANDOUT ).  The standend() function is the same as
  1330. X     attrset( 0 ); that is it turns off all attributes.
  1331. X
  1332. X     NOTE:  attroff(), attron() and attrset() are macros.
  1333. X
  1334. X  PDCurses Description:
  1335. X     System V compatible color support is included.
  1336. X     See <curses.h> for further details.
  1337. X
  1338. X  X/Open Return Value:
  1339. X     These functions return OK on success and ERR on error.
  1340. X
  1341. X  PDCurses Errors:
  1342. X     It is an error to call this function with a NULL window pointer.
  1343. X
  1344. X  Portability:
  1345. X     PDCurses    int wstandout( WINDOW* win );
  1346. X     X/Open Dec '88    int wstandout( WINDOW* win );
  1347. X     BSD Curses    int wstandout( WINDOW* win );
  1348. X     SYS V Curses    int wstandout( WINDOW* win );
  1349. X
  1350. X**man-end**********************************************************************/
  1351. X
  1352. Xint    wstandout( WINDOW *win )
  1353. X{
  1354. X    return( wattrset( win, A_STANDOUT ) );
  1355. X}
  1356. END_OF_FILE
  1357.   if test 2134 -ne `wc -c <'portable/wstandou.c'`; then
  1358.     echo shar: \"'portable/wstandou.c'\" unpacked with wrong size!
  1359.   fi
  1360.   # end of 'portable/wstandou.c'
  1361. fi
  1362. if test -f 'private/_backchr.c' -a "${1}" != "-c" ; then 
  1363.   echo shar: Will not clobber existing file \"'private/_backchr.c'\"
  1364. else
  1365.   echo shar: Extracting \"'private/_backchr.c'\" \(2083 characters\)
  1366.   sed "s/^X//" >'private/_backchr.c' <<'END_OF_FILE'
  1367. X#define    CURSES_LIBRARY    1
  1368. X#include <curses.h>
  1369. X
  1370. X#ifndef NDEBUG
  1371. Xchar *rcsid__backchr = "$Header: c:/curses/private/RCS/_backchr.c%v 2.0 1992/11/15 03:24:15 MH Rel $";
  1372. X#endif
  1373. X
  1374. X
  1375. X
  1376. X
  1377. X/*man-start*********************************************************************
  1378. X
  1379. X  PDC_backchar()    - Visually erase character in window
  1380. X
  1381. X  PDCurses Description:
  1382. X     This is a private PDCurses function
  1383. X
  1384. X     This routine will visually erase a character.  It is called by
  1385. X     the PDCurses character I/O routines.
  1386. X
  1387. X  PDCurses Return Value:
  1388. X     This routine will return OK upon success and otherwise ERR will be
  1389. X     returned.
  1390. X
  1391. X  PDCurses Errors:
  1392. X     It is an error to pass a NULL WINDOW pointer.
  1393. X
  1394. X  Portability:
  1395. X     PDCurses    int    PDC_backchar( WINDOW* w, char* ch, int* len );
  1396. X
  1397. X**man-end**********************************************************************/
  1398. X
  1399. Xint    PDC_backchar(WINDOW *w, char *ch, int *len)
  1400. X{
  1401. X    int    nbs = 0;
  1402. X    int    x = w->_curx;
  1403. X    int    ts = w->_tabsize;
  1404. X    chtype*    s = &w->_y[w->_cury][x - 1];
  1405. X    char*    p = c_strbeg;
  1406. X    bool    save_raw_out = _cursvar.raw_out;
  1407. X
  1408. X
  1409. X    if (w == (WINDOW *)NULL)
  1410. X        return( ERR );
  1411. X
  1412. X    (*len)--;        /* Now we are zero relative */
  1413. X    (*len)--;        /* Now we are looking at the previous
  1414. X                 * character */
  1415. X    nbs++;
  1416. X    /*
  1417. X     * Determine number of characters to erase...
  1418. X     */
  1419. X    if ((ch[*len] < ' ') || (*s == 0x7f))    /* ctrl-char has size 2     */
  1420. X    {
  1421. X        nbs++;
  1422. X        (*len)--;
  1423. X    }
  1424. X
  1425. X    if (ch[*len] == '\t')    /* tabs are very special */
  1426. X    {
  1427. X        for (; p < ch; p++)
  1428. X        {
  1429. X            if (*p == '\t')
  1430. X                x = ((x / ts) + 1) * ts;
  1431. X            else
  1432. X            {
  1433. X                if ((*p < ' ') || (*p == 0x7f))
  1434. X                    x += 2;
  1435. X                else
  1436. X                    x++;
  1437. X            }
  1438. X            if (x >= w->_maxx)    /* go to next line? */
  1439. X                x = 0;
  1440. X        }
  1441. X        if (!(w->_curx))
  1442. X            nbs = w->_maxx - x;
  1443. X        else
  1444. X            nbs = w->_curx - x;
  1445. X    }
  1446. X    /*
  1447. X     * Erase the characters and update...
  1448. X     */
  1449. X    _cursvar.raw_out = FALSE;  /* ensure backspace handled in xlat mode */
  1450. X    while (nbs--)
  1451. X    {
  1452. X        if (w->_curx > 0)
  1453. X        {
  1454. X            waddstr(w, "\b \b");
  1455. X        }
  1456. X        else
  1457. X        if (w->_cury)
  1458. X        {
  1459. X            mvwaddch(w, w->_cury - 1, w->_maxx - 1, ' ');
  1460. X            wmove(w, w->_cury - 1, w->_maxx - 1);
  1461. X        }
  1462. X    }
  1463. X    ch[*len] = '\0';
  1464. X    _cursvar.raw_out = save_raw_out;
  1465. X    wrefresh(w);
  1466. X    return( OK );
  1467. X}
  1468. END_OF_FILE
  1469.   if test 2083 -ne `wc -c <'private/_backchr.c'`; then
  1470.     echo shar: \"'private/_backchr.c'\" unpacked with wrong size!
  1471.   fi
  1472.   # end of 'private/_backchr.c'
  1473. fi
  1474. if test -f 'private/_cattr.c' -a "${1}" != "-c" ; then 
  1475.   echo shar: Will not clobber existing file \"'private/_cattr.c'\"
  1476. else
  1477.   echo shar: Extracting \"'private/_cattr.c'\" \(2249 characters\)
  1478.   sed "s/^X//" >'private/_cattr.c' <<'END_OF_FILE'
  1479. X#define    CURSES_LIBRARY    1
  1480. X#include <curses.h>
  1481. X
  1482. X#ifndef NDEBUG
  1483. Xchar *rcsid__cattr = "$Header: c:/curses/private/RCS/_cattr.c%v 2.0 1992/11/15 03:24:41 MH Rel $";
  1484. X#endif
  1485. X
  1486. X
  1487. X
  1488. X
  1489. X/*man-start*********************************************************************
  1490. X
  1491. X  PDC_chg_attr_pair()    - Writes character and attribute to physical screen
  1492. X
  1493. X  PDCurses Description:
  1494. X     This is a private PDCurses function.
  1495. X
  1496. X     Writes a single character 'chr' with attribute 'attr' to the
  1497. X     current cursor location.
  1498. X
  1499. X     NOTE:    Though passed as 16 bit quantities, only the lower 8 bits
  1500. X         will be used to create a character/attribute pair.
  1501. X
  1502. X  PDCurses Return Value:
  1503. X     This function returns OK on success and ERR on error.
  1504. X
  1505. X  PDCurses Errors:
  1506. X     No errors are defined for this function under DOS.
  1507. X
  1508. X     An ERR may be returned under FLEXOS if s_copy() fails.  See the
  1509. X     Flexos Programmer's Reference Manual for details on the error.
  1510. X
  1511. X  Portability:
  1512. X     PDCurses    int PDC_chg_attr_pair( chtype chr, chtype attr );
  1513. X
  1514. X**man-end**********************************************************************/
  1515. X
  1516. Xint    PDC_chg_attr_pair(chtype chr, chtype attr)
  1517. X{
  1518. X    extern unsigned    char atrtab[MAX_ATRTAB];
  1519. X    chtype    phys_attr=chtype_attr(attr);
  1520. X
  1521. X#ifdef    FLEXOS
  1522. X    UBYTE    c = (UBYTE) chr;
  1523. X    UBYTE    a = (UBYTE) phys_attr;
  1524. X
  1525. X    drect.r_row = PDC_get_cur_row();
  1526. X    drect.r_col = PDC_get_cur_col();
  1527. X    drect.r_nrow = 1;
  1528. X    drect.r_ncol = 1;
  1529. X
  1530. X    sframe.fr_pl[0] = (UBYTE *) & c;
  1531. X    sframe.fr_pl[1] = (UBYTE *) & a;
  1532. X    sframe.fr_pl[2] = (UBYTE *) " ";
  1533. X    sframe.fr_nrow = 1;
  1534. X    sframe.fr_ncol = 1;
  1535. X    sframe.fr_use = 0x00;
  1536. X
  1537. X    srect.r_col = 0;
  1538. X    srect.r_row = 0;
  1539. X    srect.r_nrow = 1;
  1540. X    srect.r_ncol = 1;
  1541. X
  1542. X    retcode = s_copy(0x03, 0x01L, 0L, (far unsigned short *) &drect, (far unsigned short *) &sframe, (far unsigned short *) &srect);
  1543. X    return( (retcode < 0L) ? ERR : OK );
  1544. X#endif
  1545. X#ifdef    DOS
  1546. X    regs.h.ah = 0x09;
  1547. X    regs.h.al = chr & A_CHARTEXT;
  1548. X    regs.h.bh = _cursvar.video_page;
  1549. X    regs.h.bl = (phys_attr & A_ATTRIBUTES) >> 8;
  1550. X    regs.x.cx = 0x01;
  1551. X    int86(0x10, ®s, ®s);
  1552. X    return( OK );
  1553. X#endif
  1554. X#ifdef    OS2
  1555. X    USHORT curCol, curRow, cell;
  1556. X    
  1557. X    /* find the current cursor position */
  1558. X    VioGetCurPos((PUSHORT) &curRow, (PUSHORT) &curCol, 0);
  1559. X    cell = (chr & A_CHARTEXT) | (phys_attr & A_ATTRIBUTES);
  1560. X    VioWrtNCell((PBYTE)&cell,1,curRow,curCol,0);
  1561. X    return( OK );
  1562. X#endif
  1563. X}
  1564. END_OF_FILE
  1565.   if test 2249 -ne `wc -c <'private/_cattr.c'`; then
  1566.     echo shar: \"'private/_cattr.c'\" unpacked with wrong size!
  1567.   fi
  1568.   # end of 'private/_cattr.c'
  1569. fi
  1570. if test -f 'private/_sanity.c' -a "${1}" != "-c" ; then 
  1571.   echo shar: Will not clobber existing file \"'private/_sanity.c'\"
  1572. else
  1573.   echo shar: Extracting \"'private/_sanity.c'\" \(2107 characters\)
  1574.   sed "s/^X//" >'private/_sanity.c' <<'END_OF_FILE'
  1575. X#define    CURSES_LIBRARY    1
  1576. X#include <curses.h>
  1577. X
  1578. X#ifndef    NDEBUG
  1579. Xchar *rcsid__sanity = "$Header: c:/curses/private/RCS/_sanity.c%v 2.0 1992/11/15 03:24:32 MH Rel $";
  1580. X#endif
  1581. X
  1582. X
  1583. X
  1584. X
  1585. X/*man-start*********************************************************************
  1586. X
  1587. X  PDC_sanity_check() - A video adapter identification sanity check
  1588. X
  1589. X  PDCurses Description:
  1590. X     This is a private PDCurses routine.
  1591. X
  1592. X     This routine will force sane values for various control flags.
  1593. X
  1594. X  PDCurses Return Value:
  1595. X     This function returns OK on success and ERR on error.
  1596. X
  1597. X  PDCurses Errors:
  1598. X     No errors are defined for this function.
  1599. X
  1600. X  Portability:
  1601. X     PDCurses    int PDC_sanity_check( int adapter );
  1602. X
  1603. X**man-end**********************************************************************/
  1604. X
  1605. Xint    PDC_sanity_check(int adapter)
  1606. X{
  1607. X    int    fontsize = PDC_get_font();
  1608. X    int    rows     = PDC_get_rows();
  1609. X
  1610. X    switch (adapter)
  1611. X    {
  1612. X    case _EGACOLOR:
  1613. X    case _EGAMONO:
  1614. X        switch (rows)
  1615. X        {
  1616. X        case 25:    break;
  1617. X        case 43:    break;
  1618. X        default:
  1619. X            _cursvar.bogus_adapter = TRUE;
  1620. X            break;
  1621. X        }
  1622. X
  1623. X        switch (fontsize)
  1624. X        {
  1625. X        case _FONT8:    break;
  1626. X        case _FONT14:    break;
  1627. X        default:
  1628. X            _cursvar.bogus_adapter = TRUE;
  1629. X            break;
  1630. X        }
  1631. X        break;
  1632. X
  1633. X    case _VGACOLOR:
  1634. X    case _VGAMONO:
  1635. X
  1636. X/*                                                                  */
  1637. X/* lets be reasonably flexible with VGAs - they could be Super VGAs */
  1638. X/* capable of displaying any number of lines. MH 10-Jun-92          */
  1639. X/* This also applies to font size.            MH 16-Jun-92          */
  1640. X/*
  1641. X        switch (rows)
  1642. X        {
  1643. X        case 25:    break;
  1644. X        case 43:    break;
  1645. X        case 50:    break;
  1646. X        default:
  1647. X            _cursvar.bogus_adapter = TRUE;
  1648. X            break;
  1649. X        }
  1650. X
  1651. X        switch (fontsize)
  1652. X        {
  1653. X        case _FONT8:    break;
  1654. X        case _FONT14:    break;
  1655. X        case _FONT16:    break;
  1656. X        default:
  1657. X            _cursvar.bogus_adapter = TRUE;
  1658. X            break;
  1659. X        }
  1660. X*/
  1661. X        break;
  1662. X
  1663. X    case _CGA:
  1664. X    case _MDA:
  1665. X    case _MCGACOLOR:
  1666. X    case _MCGAMONO:
  1667. X        switch (rows)
  1668. X        {
  1669. X        case 25:    break;
  1670. X        default:
  1671. X            _cursvar.bogus_adapter = TRUE;
  1672. X            break;
  1673. X        }
  1674. X        break;
  1675. X
  1676. X    default:
  1677. X        _cursvar.bogus_adapter = TRUE;
  1678. X        break;
  1679. X    }
  1680. X    if (_cursvar.bogus_adapter)
  1681. X    {
  1682. X        _cursvar.sizeable    = FALSE;
  1683. X        _cursvar.direct_video    = FALSE;
  1684. X    }
  1685. X    return (adapter);
  1686. X}
  1687. END_OF_FILE
  1688.   if test 2107 -ne `wc -c <'private/_sanity.c'`; then
  1689.     echo shar: \"'private/_sanity.c'\" unpacked with wrong size!
  1690.   fi
  1691.   # end of 'private/_sanity.c'
  1692. fi
  1693. if test -f 'private/_scb.c' -a "${1}" != "-c" ; then 
  1694.   echo shar: Will not clobber existing file \"'private/_scb.c'\"
  1695. else
  1696.   echo shar: Extracting \"'private/_scb.c'\" \(2142 characters\)
  1697.   sed "s/^X//" >'private/_scb.c' <<'END_OF_FILE'
  1698. X#define    CURSES_LIBRARY    1
  1699. X#define NEEDS_OS2       1
  1700. X#include <curses.h>
  1701. X
  1702. X#ifndef    NDEBUG
  1703. Xchar *rcsid__scb = "$Header: c:/curses/private/RCS/_scb.c%v 2.0 1992/11/15 03:24:16 MH Rel $";
  1704. X#endif
  1705. X
  1706. X#ifdef OS2
  1707. X#  if defined (CURSES__32BIT__) || defined (CSET2)
  1708. X#     include <signal.h>
  1709. X#  else
  1710. X#     define INCL_DOSSIGNALS
  1711. X#     define INCL_NOCOMMON
  1712. X#     include <bsedos.h>
  1713. X#  endif
  1714. X#endif
  1715. X
  1716. X
  1717. X
  1718. X/*man-start*********************************************************************
  1719. X
  1720. X  PDC_set_ctrl_break()    - Enables/Disables the host OS BREAK key check.
  1721. X
  1722. X  PDCurses Description:
  1723. X     This is a private PDCurses routine.
  1724. X
  1725. X     Enables/Disables the host OS BREAK key check. This function toggles
  1726. X     the BREAK setting. If it was on, it turns itoff; if it was aff it turns
  1727. X     it on.
  1728. X
  1729. X  PDCurses Return Value:
  1730. X     This function returns OK on success and ERR on error.
  1731. X
  1732. X  PDCurses Errors:
  1733. X     No errors are defined for this function.
  1734. X
  1735. X  Portability:
  1736. X     PDCurses    int PDC_set_ctrl_break( bool setting );
  1737. X
  1738. X**man-end**********************************************************************/
  1739. X
  1740. Xint    PDC_set_ctrl_break(bool setting)
  1741. X{
  1742. X#ifdef    FLEXOS
  1743. X    retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
  1744. X    if (retcode < 0L)
  1745. X        return( ERR );
  1746. X
  1747. X    vir.vc_kbmode = ((vir.vc_kbmode & ~0x01) & (setting) ? 0x01 : 0x00);
  1748. X
  1749. X    retcode = s_set(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
  1750. X    return( (retcode < 0L) ? ERR : OK );
  1751. X#endif
  1752. X#ifdef    DOS
  1753. X    regs.h.ah = 0x33;
  1754. X    regs.h.al = 0x00;
  1755. X    regs.h.dl = (unsigned char) (setting ? 1 : 0);
  1756. X    int86(0x21, ®s, ®s);
  1757. X    return( OK );
  1758. X#endif
  1759. X#ifdef    OS2
  1760. X#  if defined (CURSES__32BIT__) || defined (CSET2)
  1761. X    if (setting) {
  1762. X        signal (SIGINT, SIG_DFL);
  1763. X        signal (SIGBREAK, SIG_DFL);
  1764. X    } else {
  1765. X        signal (SIGINT, SIG_IGN);
  1766. X        signal (SIGBREAK, SIG_IGN);
  1767. X        }
  1768. X    return( OK );
  1769. X#  else
  1770. X    PFNSIGHANDLER oldHandler;
  1771. X    USHORT oldAction, Action;
  1772. X
  1773. X    /* turn off control C checking */
  1774. X    if (setting)
  1775. X        Action = SIGA_KILL;
  1776. X    else
  1777. X        Action = SIGA_IGNORE;
  1778. X    DosSetSigHandler((PFNSIGHANDLER) NULL, &oldHandler, &oldAction,
  1779. X        Action, SIG_CTRLBREAK);
  1780. X    DosSetSigHandler((PFNSIGHANDLER) NULL, &oldHandler, &oldAction,
  1781. X        Action, SIG_CTRLC);
  1782. X    return( OK );
  1783. X#  endif    
  1784. X#endif
  1785. X}
  1786. END_OF_FILE
  1787.   if test 2142 -ne `wc -c <'private/_scb.c'`; then
  1788.     echo shar: \"'private/_scb.c'\" unpacked with wrong size!
  1789.   fi
  1790.   # end of 'private/_scb.c'
  1791. fi
  1792. if test -f 'tools/buildlrf.c' -a "${1}" != "-c" ; then 
  1793.   echo shar: Will not clobber existing file \"'tools/buildlrf.c'\"
  1794. else
  1795.   echo shar: Extracting \"'tools/buildlrf.c'\" \(353 characters\)
  1796.   sed "s/^X//" >'tools/buildlrf.c' <<'END_OF_FILE'
  1797. X#include <stdio.h>
  1798. X#include <stdlib.h>
  1799. X
  1800. Xint main(int argc,char *argv[])
  1801. X{
  1802. X FILE *fp;
  1803. X
  1804. X if (argc < 3)
  1805. X   {
  1806. X    fprintf(stderr,"Invalid number of parameters\n");
  1807. X    return(1);
  1808. X   }
  1809. X if ((fp = fopen(argv[2],"a")) == NULL)
  1810. X   {
  1811. X    fprintf(stderr,"Error opening %s\n",argv[2]);
  1812. X    return(1);
  1813. X   }
  1814. X fprintf(fp,"%s &\n",argv[1]);
  1815. X fclose(fp);
  1816. X return(0);
  1817. X}
  1818. END_OF_FILE
  1819.   if test 353 -ne `wc -c <'tools/buildlrf.c'`; then
  1820.     echo shar: \"'tools/buildlrf.c'\" unpacked with wrong size!
  1821.   fi
  1822.   # end of 'tools/buildlrf.c'
  1823. fi
  1824. echo shar: End of archive 7 \(of 11\).
  1825. cp /dev/null ark7isdone
  1826. MISSING=""
  1827. for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
  1828.     if test ! -f ark${I}isdone ; then
  1829.     MISSING="${MISSING} ${I}"
  1830.     fi
  1831. done
  1832. if test "${MISSING}" = "" ; then
  1833.     echo You have unpacked all 11 archives.
  1834.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1835. else
  1836.     echo You still must unpack the following archives:
  1837.     echo "        " ${MISSING}
  1838. fi
  1839. exit 0
  1840. exit 0 # Just in case...
  1841.