home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sources / misc / 4092 < prev    next >
Encoding:
Text File  |  1992-11-18  |  54.9 KB  |  1,847 lines

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