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

  1. Newsgroups: comp.sources.misc
  2. From: M.Hessling@gu.edu.au (Mark Hessling)
  3. Subject:  v33i089:  pdcurses - Public Domain curses library for DOS and OS/2 v2.0, Part09/11
  4. Message-ID: <1992Nov19.040811.8306@sparky.imd.sterling.com>
  5. X-Md4-Signature: ce62036a8f93f3c574f3886f91091d6c
  6. Date: Thu, 19 Nov 1992 04:08:11 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 89
  11. Archive-name: pdcurses/part09
  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/colorcon.c portable/def_shel.c portable/flash.c
  19. #   portable/idlok.c portable/intrflus.c portable/keypad.c
  20. #   portable/leaveok.c portable/paircont.c portable/savetty.c
  21. #   portable/set_term.c portable/touchwin.c portable/waddstr.c
  22. #   portable/wdeletel.c portable/winsertl.c portable/wmove.c
  23. #   portable/wrefresh.c private/_getcols.c private/_getcrsr.c
  24. #   private/_getfont.c private/_gotoxy.c private/_print.c
  25. #   private/_putc.c private/_putctty.c private/_scrclos.c
  26. #   private/_set8025.c private/_setscrn.c private/_splitpl.c
  27. # Wrapped by kent@sparky on Wed Nov 18 21:44:09 1992
  28. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  29. echo If this archive is complete, you will see the following message:
  30. echo '          "shar: End of archive 9 (of 11)."'
  31. if test -f 'portable/colorcon.c' -a "${1}" != "-c" ; then 
  32.   echo shar: Will not clobber existing file \"'portable/colorcon.c'\"
  33. else
  34.   echo shar: Extracting \"'portable/colorcon.c'\" \(1404 characters\)
  35.   sed "s/^X//" >'portable/colorcon.c' <<'END_OF_FILE'
  36. X#define    CURSES_LIBRARY    1
  37. X#include <curses.h>
  38. X#undef color_content
  39. X
  40. X#ifndef    NDEBUG
  41. Xchar *rcsid_colorcon = "$Header: c:/curses/portable/RCS/colorcon.c%v 2.0 1992/11/15 03:28:48 MH Rel $";
  42. X#endif
  43. X
  44. X
  45. X
  46. X
  47. X/*man-start*********************************************************************
  48. X
  49. X  color_content()    - Obtain color content information.
  50. X
  51. X  PDCurses Description:
  52. X
  53. X     This routine obtains the current color-content information of a given
  54. X     color.
  55. X     The routine uses four arguments: the color number, which must
  56. X     be a value between 0 and COLORS-1, and the addresses of three
  57. X     short integers for storing the obtained information of the color
  58. X     components red, green and blue. The function stores the current
  59. X     values at these adresses passed.
  60. X
  61. X     ***** This function doesn't do anything yet *****
  62. X
  63. X  PDCurses Return Value:
  64. X     This function returns ERR if the color is out of range otherwise
  65. X     it returns OK.
  66. X
  67. X  PDCurses Errors:
  68. X     N/A
  69. X
  70. X  Portability:
  71. X     PDCurses    int color_content( int color, short *red, short *green, short *blue);
  72. X     SYS V curses    int color_content( int color, short *red, short *green, short *blue);
  73. X
  74. X**man-end**********************************************************************/
  75. X
  76. X
  77. Xint color_content(int color, short *red, short *green, short *blue)
  78. X{
  79. X extern int COLORS;
  80. X
  81. X if (color >= COLORS -1 || color < 1)
  82. X    return(ERR);
  83. X/*
  84. X * This function doesn't do anything yet...
  85. X */
  86. X return(ERR);
  87. X}
  88. END_OF_FILE
  89.   if test 1404 -ne `wc -c <'portable/colorcon.c'`; then
  90.     echo shar: \"'portable/colorcon.c'\" unpacked with wrong size!
  91.   fi
  92.   # end of 'portable/colorcon.c'
  93. fi
  94. if test -f 'portable/def_shel.c' -a "${1}" != "-c" ; then 
  95.   echo shar: Will not clobber existing file \"'portable/def_shel.c'\"
  96. else
  97.   echo shar: Extracting \"'portable/def_shel.c'\" \(1612 characters\)
  98.   sed "s/^X//" >'portable/def_shel.c' <<'END_OF_FILE'
  99. X#ifndef NO_MEMORY_H
  100. X#include <memory.h>
  101. X#endif
  102. X#define    CURSES_LIBRARY    1
  103. X#include <curses.h>
  104. X#undef    def_shell_mode
  105. X
  106. X#ifndef    NDEBUG
  107. Xchar *rcsid_def_shel = "$Header: c:/curses/portable/RCS/def_shel.c%v 2.0 1992/11/15 03:28:49 MH Rel $";
  108. X#endif
  109. X
  110. X
  111. X
  112. X
  113. X/*man-start*********************************************************************
  114. X
  115. X  def_shell_mode()    - Save terminal mode
  116. X
  117. X  X/Open Description:
  118. X     Save the current terminal modes as the "program" (in CURSES) or
  119. X     "shell" (not in CURSES) state for use by the reset_prog_mode()
  120. X     and reset_shell_mode() functions.  This is done automatically by
  121. X     initscr().
  122. X
  123. X  PDCurses Description:
  124. X     PDCurses maintains a WINDOW* that contains the original user's
  125. X     screen upon startup.  This might be useful for returning the
  126. X     user's environment to its (near) original state.
  127. X
  128. X     This is unimplemented at this time.
  129. X
  130. X  X/Open Return Value:
  131. X     The def_shell_mode() function returns OK on success and ERR on error.
  132. X
  133. X  X/Open Errors:
  134. X     No errors are defined for this function.
  135. X
  136. X  Portability:
  137. X     PDCurses    int def_shell_mode( void );
  138. X     X/Open Dec '88    int def_shell_mode( void );
  139. X     BSD Curses
  140. X     SYS V Curses    int def_shell_mode( void );
  141. X
  142. X**man-end**********************************************************************/
  143. X
  144. Xint    def_shell_mode(void)
  145. X{
  146. X#ifdef    FLEXOS
  147. X    _flexos_8bitmode();
  148. X#endif
  149. X    c_sh_tty.been_set = TRUE;
  150. X#if     defined(DOS) || defined(OS2)
  151. X#  if    SMALL || MEDIUM
  152. X    movedata( FP_SEG(&_cursvar),        FP_OFF(&_cursvar),
  153. X          FP_SEG(&c_sh_tty.saved),    FP_OFF(&c_sh_tty.saved),
  154. X          sizeof(SCREEN) );
  155. X#  else
  156. X    memcpy(&c_sh_tty.saved, &_cursvar, sizeof(SCREEN));
  157. X#  endif
  158. X#endif
  159. X    return( OK );
  160. X}
  161. END_OF_FILE
  162.   if test 1612 -ne `wc -c <'portable/def_shel.c'`; then
  163.     echo shar: \"'portable/def_shel.c'\" unpacked with wrong size!
  164.   fi
  165.   # end of 'portable/def_shel.c'
  166. fi
  167. if test -f 'portable/flash.c' -a "${1}" != "-c" ; then 
  168.   echo shar: Will not clobber existing file \"'portable/flash.c'\"
  169. else
  170.   echo shar: Extracting \"'portable/flash.c'\" \(1447 characters\)
  171.   sed "s/^X//" >'portable/flash.c' <<'END_OF_FILE'
  172. X#define    CURSES_LIBRARY    1
  173. X#include <curses.h>
  174. X#undef    flash
  175. X
  176. X#ifndef    NDEBUG
  177. Xchar *rcsid_flash = "$Header: c:/curses/portable/RCS/flash.c%v 2.0 1992/11/15 03:28:52 MH Rel $";
  178. X#endif
  179. X
  180. X
  181. X
  182. X
  183. X/*man-start*********************************************************************
  184. X
  185. X  flash()    - generate audio-visual alarm
  186. X
  187. X  X/Open Description:
  188. X     This routine is used to signal the terminal user.  The beep()
  189. X     function will sound the audible bell on the terminal, if possible
  190. X     and if not, will flash the screen (visible bell), if possible.
  191. X     The flash() function will flash the screen, and if that is not
  192. X     possible, will sound the audible signal.  If neither signal is
  193. X     possible, nothing will happen.  Nearly all terminals have an
  194. X     audible signal (bell or beep), but only some can flash the screen.
  195. X
  196. X  X/Open Return Value:
  197. X     The beep() and flash() functions return OK on success and ERR on
  198. X     error.
  199. X
  200. X  X/Open Errors:
  201. X     No errors are defined for this function.
  202. X
  203. X  Portability:
  204. X     PDCurses    int flash( void );
  205. X     X/Open Dec '88    int flash( void );
  206. X     BSD Curses    int flash( void );
  207. X     SYS V Curses    int flash( void );
  208. X
  209. X**man-end**********************************************************************/
  210. X
  211. Xint    flash(void)
  212. X{
  213. X    extern unsigned char atrtab[MAX_ATRTAB];
  214. X    int    i;
  215. X
  216. X    PDC_scroll(0, 0, LINES - 1, COLS - 1, 0, (chtype)(atrtab[264] << 8));
  217. X    delay_output( 50 );
  218. X    PDC_scroll(0, 0, LINES - 1, COLS - 1, 0, (chtype)(atrtab[265] << 8));
  219. X    wrefresh(curscr);
  220. X    return( OK );
  221. X}
  222. END_OF_FILE
  223.   if test 1447 -ne `wc -c <'portable/flash.c'`; then
  224.     echo shar: \"'portable/flash.c'\" unpacked with wrong size!
  225.   fi
  226.   # end of 'portable/flash.c'
  227. fi
  228. if test -f 'portable/idlok.c' -a "${1}" != "-c" ; then 
  229.   echo shar: Will not clobber existing file \"'portable/idlok.c'\"
  230. else
  231.   echo shar: Extracting \"'portable/idlok.c'\" \(1550 characters\)
  232.   sed "s/^X//" >'portable/idlok.c' <<'END_OF_FILE'
  233. X#define    CURSES_LIBRARY    1
  234. X#include <curses.h>
  235. X#undef    idlok
  236. X
  237. X#ifndef    NDEBUG
  238. Xchar *rcsid_idlok = "$Header: c:/curses/portable/RCS/idlok.c%v 2.0 1992/11/15 03:28:55 MH Rel $";
  239. X#endif
  240. X
  241. X
  242. X
  243. X
  244. X/*man-start*********************************************************************
  245. X
  246. X  idlok()    - Enable use of Insert/Delete Line
  247. X
  248. X  X/Open Description:
  249. X     If enabeld (bf is TRUE), curses will use the insert/delete line
  250. X     feature of terminals so equipped.  If disabled, curses will not
  251. X     use this feature.  (The insert/delete character feature is always
  252. X     used.)  This option should be enabled only if the application
  253. X     needs insert/delete line; for example, for a screen editor.  It
  254. X     is disabled by default because insert/delete line tends to be
  255. X     visually annoying when used in applications where it isn't really
  256. X     needed.  If insert/delete line cannot be used, curses will redraw
  257. X     the changed portions of all lines.
  258. X
  259. X  PDCurses Description:
  260. X     This is provided for portability.  This may have some value for
  261. X     the FLEXOS platform, but there is no code in PDCurses at this
  262. X     time (910725) that takes advantage of this.
  263. X
  264. X  X/Open Return Value:
  265. X     The idlok() function returns OK on success and ERR on error.
  266. X
  267. X  X/Open Errors:
  268. X     No errors are defined for this function.
  269. X
  270. X  Portability:
  271. X     PDCurses    int idlok( WINDOW* win, bool bf );
  272. X     X/Open Dec '88    int idlok( WINDOW* win, bool bf );
  273. X     BSD Curses    
  274. X     SYS V Curses    
  275. X
  276. X**man-end**********************************************************************/
  277. X
  278. Xint    idlok( WINDOW *win, bool bf )
  279. X{
  280. X    win->_use_idl = bf;
  281. X    return( OK );
  282. X}
  283. END_OF_FILE
  284.   if test 1550 -ne `wc -c <'portable/idlok.c'`; then
  285.     echo shar: \"'portable/idlok.c'\" unpacked with wrong size!
  286.   fi
  287.   # end of 'portable/idlok.c'
  288. fi
  289. if test -f 'portable/intrflus.c' -a "${1}" != "-c" ; then 
  290.   echo shar: Will not clobber existing file \"'portable/intrflus.c'\"
  291. else
  292.   echo shar: Extracting \"'portable/intrflus.c'\" \(1488 characters\)
  293.   sed "s/^X//" >'portable/intrflus.c' <<'END_OF_FILE'
  294. X#define    CURSES_LIBRARY    1
  295. X#include <curses.h>
  296. X#undef    intrflush
  297. X
  298. X#ifndef    NDEBUG
  299. Xchar *rcsid_intrflus = "$Header: c:/curses/portable/RCS/intrflus.c%v 2.0 1992/11/15 03:28:57 MH Rel $";
  300. X#endif
  301. X
  302. X
  303. X
  304. X
  305. X/*man-start*********************************************************************
  306. X
  307. X  intrflush()    - enable flush on interrupt
  308. X
  309. X  X/Open Description:
  310. X     If this option is enabled (bf is TRUE), and an interrupt is
  311. X     pressed on the keyboard (INTR, BREAK, or QUIT) all output in
  312. X     the terminal driver queue will be flushed, giving the effect
  313. X     of faster response to the interrupt but causing curses to have
  314. X     the wrong idea of what is on the screen.  Disabling the option
  315. X     prevents the flush.  The default for the option is inherited
  316. X     from the terminal driver settings.  The window argument is
  317. X     ignored.
  318. X
  319. X  PDCurses Description:
  320. X     No additional functionality.
  321. X
  322. X  X/Open Return Value:
  323. X     The intrflush() function returns OK on success and ERR on error.
  324. X
  325. X  X/Open Errors:
  326. X     No errors are defined for this function.
  327. X
  328. X  Portability:
  329. X     PDCurses    int intrflush( WINDOW* win, bool bf );
  330. X     X/Open Dec '88    int intrflush( WINDOW* win, bool bf );
  331. X     BSD Curses    
  332. X     SYS V Curses    
  333. X
  334. X**man-end**********************************************************************/
  335. X
  336. Xint    intrflush( WINDOW *win, bool bf )
  337. X{
  338. X#ifdef    TC
  339. X#  pragma argsused
  340. X#endif
  341. X    int    y;
  342. X    int    maxy;
  343. X
  344. X    if (win == (WINDOW *)NULL)
  345. X        return( ERR );
  346. X
  347. X    maxy = win->_maxy - 1;
  348. X
  349. X    for (y = 0; y <= maxy; y++)
  350. X    {
  351. X        win->_firstch[y] = _NO_CHANGE;
  352. X    }
  353. X    return( OK );
  354. X}
  355. END_OF_FILE
  356.   if test 1488 -ne `wc -c <'portable/intrflus.c'`; then
  357.     echo shar: \"'portable/intrflus.c'\" unpacked with wrong size!
  358.   fi
  359.   # end of 'portable/intrflus.c'
  360. fi
  361. if test -f 'portable/keypad.c' -a "${1}" != "-c" ; then 
  362.   echo shar: Will not clobber existing file \"'portable/keypad.c'\"
  363. else
  364.   echo shar: Extracting \"'portable/keypad.c'\" \(1551 characters\)
  365.   sed "s/^X//" >'portable/keypad.c' <<'END_OF_FILE'
  366. X#define    CURSES_LIBRARY    1
  367. X#include <curses.h>
  368. X#undef    keypad
  369. X
  370. X#ifndef    NDEBUG
  371. Xchar *rcsid_keypad = "$Header: c:/curses/portable/RCS/keypad.c%v 2.0 1992/11/15 03:28:58 MH Rel $";
  372. X#endif
  373. X
  374. X
  375. X
  376. X
  377. X/*man-start*********************************************************************
  378. X
  379. X  keypad()    - enable keypad
  380. X
  381. X  X/Open Description:
  382. X     This function changes the keypad option of the user's terminal.
  383. X     If enabled (bf is TRUE), the user can press a function key (such
  384. X     as the left arrow key) and getch() will return a single value
  385. X     that represents the KEY_LEFT function key.  (See Section 11.3.3,
  386. X     Input Values.)  If disabled, curses will not treat function keys
  387. X     as special keys and the program has to interpret the escape
  388. X     sequences itself.  If the keypad is enabled, the terminal keypad
  389. X     is turned on before input begins.
  390. X
  391. X  PDCurses Description:
  392. X     In the above text, substitute the following string:
  393. X         "escape sequences"    ->    "scan codes"
  394. X         "Section 11.3.3"    ->    "curses.h" or "intro.man"
  395. X
  396. X     This routine is also provided as a macro.
  397. X
  398. X  X/Open Return Value:
  399. X     The keypad() function returns OK on success and ERR on error.
  400. X
  401. X  X/Open Errors:
  402. X     No errors are defined for this function.
  403. X
  404. X  Portability:
  405. X     PDCurses    int keypad( WINDOW* win, bool bf );
  406. X     X/Open Dec '88    int keypad( WINDOW* win, bool bf );
  407. X     BSD Curses    int keypad( WINDOW* win, bool bf );
  408. X     SYS V Curses    int keypad( WINDOW* win, bool bf );
  409. X
  410. X**man-end**********************************************************************/
  411. X
  412. Xint    keypad( WINDOW *win, bool bf )
  413. X{
  414. X    win->_use_keypad = bf;
  415. X    return( OK );
  416. X}
  417. END_OF_FILE
  418.   if test 1551 -ne `wc -c <'portable/keypad.c'`; then
  419.     echo shar: \"'portable/keypad.c'\" unpacked with wrong size!
  420.   fi
  421.   # end of 'portable/keypad.c'
  422. fi
  423. if test -f 'portable/leaveok.c' -a "${1}" != "-c" ; then 
  424.   echo shar: Will not clobber existing file \"'portable/leaveok.c'\"
  425. else
  426.   echo shar: Extracting \"'portable/leaveok.c'\" \(1429 characters\)
  427.   sed "s/^X//" >'portable/leaveok.c' <<'END_OF_FILE'
  428. X#define    CURSES_LIBRARY    1
  429. X#include <curses.h>
  430. X#undef    leaveok
  431. X
  432. X#ifndef    NDEBUG
  433. Xchar *rcsid_leaveok = "$Header: c:/curses/portable/RCS/leaveok.c%v 2.0 1992/11/15 03:28:59 MH Rel $";
  434. X#endif
  435. X
  436. X
  437. X
  438. X
  439. X/*man-start*********************************************************************
  440. X
  441. X  leaveok()    - enable non-tracking cursor
  442. X
  443. X  X/Open Description:
  444. X     Normally, the hardware cursor is left at the location of the
  445. X     window being refreshed.  This option allows the cursor to be
  446. X     left whereever the update happens to leave it.  It is useful
  447. X     for applications where the cursor is not used, since it reduces
  448. X     the need for cursor motions.  If possible, the cursor is made
  449. X     invisible when this option is enabled.
  450. X
  451. X  PDCurses Description:
  452. X     Though not explicitly stated, the cursor will be made visible
  453. X     again, if leaveok() is passed a FALSE value.
  454. X             (Frotz:911226 Comments?)
  455. X
  456. X  X/Open Return Value:
  457. X     The leaveok() function returns OK on success and ERR on error.
  458. X
  459. X  X/Open Errors:
  460. X     No errors are defined for this function.
  461. X
  462. X  Portability:
  463. X     PDCurses    int leaveok( WINDOW* win, bool bf );
  464. X     X/Open Dec '88    int leaveok( WINDOW* win, bool bf );
  465. X     BSD Curses    int leaveok( WINDOW* win, bool bf );
  466. X     SYS V Curses    int leaveok( WINDOW* win, bool bf );
  467. X
  468. X**man-end**********************************************************************/
  469. X
  470. Xint    leaveok( WINDOW *win, bool bf )
  471. X{
  472. X    if  ((win->_leave = bf) != 0)    cursoff();
  473. X    else                curson();
  474. X    return( OK );
  475. X}
  476. END_OF_FILE
  477.   if test 1429 -ne `wc -c <'portable/leaveok.c'`; then
  478.     echo shar: \"'portable/leaveok.c'\" unpacked with wrong size!
  479.   fi
  480.   # end of 'portable/leaveok.c'
  481. fi
  482. if test -f 'portable/paircont.c' -a "${1}" != "-c" ; then 
  483.   echo shar: Will not clobber existing file \"'portable/paircont.c'\"
  484. else
  485.   echo shar: Extracting \"'portable/paircont.c'\" \(1566 characters\)
  486.   sed "s/^X//" >'portable/paircont.c' <<'END_OF_FILE'
  487. X#define    CURSES_LIBRARY    1
  488. X#include <curses.h>
  489. X#undef pair_content
  490. X
  491. X#ifndef    NDEBUG
  492. Xchar *rcsid_paircont = "$Header: c:/curses/portable/RCS/paircont.c%v 2.0 1992/11/15 03:29:07 MH Rel $";
  493. X#endif
  494. X
  495. X
  496. X
  497. X
  498. X/*man-start*********************************************************************
  499. X
  500. X  pair_content()    - Obtain color-pair information.
  501. X
  502. X  PDCurses Description:
  503. X
  504. X     This routine is used to determine what the colors of a given color-pair
  505. X     consist of.
  506. X
  507. X     The routine uses three arguments: the colorpair number which
  508. X     must be a value between 1 and COLOR_PAIRS-1 and the adresses of
  509. X     two shorts for storing the obtained color components of foreground
  510. X     and background. The function will store the current values at these
  511. X     addresses passed. The values will be between 0 and COLORS-1.
  512. X
  513. X  PDCurses Return Value:
  514. X     This function returns OK on success and ERR on error.
  515. X
  516. X  PDCurses Errors:
  517. X     It is an error to call this function with a colorpair outside of the
  518. X     range specified above.
  519. X
  520. X  Portability:
  521. X     PDCurses    int pair_content( int colorpair, short *foreground, short *background);
  522. X     SYS V Curses    int pair_content( int colorpair, short *foreground, short *background);
  523. X
  524. X**man-end**********************************************************************/
  525. X
  526. X
  527. Xint pair_content(int colorpair,short *foreground,short *background)
  528. X{
  529. X extern int COLOR_PAIRS;
  530. X extern unsigned char atrtab[MAX_ATRTAB];
  531. X
  532. X if (colorpair >= COLOR_PAIRS || colorpair < 1)
  533. X    return(ERR);
  534. X
  535. X *foreground = (short)(atrtab[colorpair] & 0x0F);
  536. X *background = (short)((atrtab[colorpair] & 0xF0)>>4);
  537. X return(OK);
  538. X}
  539. END_OF_FILE
  540.   if test 1566 -ne `wc -c <'portable/paircont.c'`; then
  541.     echo shar: \"'portable/paircont.c'\" unpacked with wrong size!
  542.   fi
  543.   # end of 'portable/paircont.c'
  544. fi
  545. if test -f 'portable/savetty.c' -a "${1}" != "-c" ; then 
  546.   echo shar: Will not clobber existing file \"'portable/savetty.c'\"
  547. else
  548.   echo shar: Extracting \"'portable/savetty.c'\" \(1540 characters\)
  549.   sed "s/^X//" >'portable/savetty.c' <<'END_OF_FILE'
  550. X#ifndef NO_MEMORY_H
  551. X#include <memory.h>
  552. X#endif
  553. X#define    CURSES_LIBRARY    1
  554. X#include <curses.h>
  555. X#undef    savetty
  556. X
  557. X#ifndef NDEBUG
  558. Xchar *rcsid_savetty = "$Header: c:/curses/portable/RCS/savetty.c%v 2.0 1992/11/15 03:29:13 MH Rel $";
  559. X#endif
  560. X
  561. X
  562. X
  563. X
  564. X/*man-start*********************************************************************
  565. X
  566. X  savetty()    - save/restore terminal modes
  567. X
  568. X  X/Open Description:
  569. X     These routines save and restore the state of the terminal modes.
  570. X     The savetty() function saves the current state in a buffer and
  571. X     resetty() restores the state to what it was at the last call to
  572. X     savetty().
  573. X
  574. X  PDCurses Description:
  575. X     FYI: It is very unclear whether this is a duplication of the
  576. X     reset_prog_mode() and reset_shell_mode() functions or whether
  577. X     this is a backing store type of operation.  At this time, they
  578. X     are implemented similar to the reset_*_mode() routines.
  579. X
  580. X  X/Open Return Value:
  581. X     The savetty() function returns OK upon success otherwise ERR is
  582. X     returned.
  583. X
  584. X  Portability:
  585. X     PDCurses    int savetty( void );
  586. X     X/Open Dec '88    int savetty( void );
  587. X     SysV Curses    int savetty( void );
  588. X     BSD Curses    int savetty( void );
  589. X
  590. X**man-end**********************************************************************/
  591. X
  592. Xint    savetty(void)
  593. X{
  594. X    c_save_tty.been_set = TRUE;
  595. X#if     defined(DOS) || defined(OS2)
  596. X#  if    SMALL || MEDIUM
  597. X    movedata( FP_SEG(&_cursvar),        FP_OFF(&_cursvar),
  598. X          FP_SEG(&c_save_tty.saved),    FP_OFF(&c_save_tty.saved),
  599. X          sizeof(SCREEN) );
  600. X#  else
  601. X    memcpy(&c_save_tty.saved, &_cursvar, sizeof(SCREEN));
  602. X#  endif
  603. X#endif
  604. X    return( OK );
  605. X}
  606. END_OF_FILE
  607.   if test 1540 -ne `wc -c <'portable/savetty.c'`; then
  608.     echo shar: \"'portable/savetty.c'\" unpacked with wrong size!
  609.   fi
  610.   # end of 'portable/savetty.c'
  611. fi
  612. if test -f 'portable/set_term.c' -a "${1}" != "-c" ; then 
  613.   echo shar: Will not clobber existing file \"'portable/set_term.c'\"
  614. else
  615.   echo shar: Extracting \"'portable/set_term.c'\" \(1600 characters\)
  616.   sed "s/^X//" >'portable/set_term.c' <<'END_OF_FILE'
  617. X#define    CURSES_LIBRARY    1
  618. X#include <curses.h>
  619. X#undef    set_term
  620. X
  621. X#ifndef    NDEBUG
  622. Xchar *rcsid_set_term = "$Header: c:/curses/portable/RCS/set_term.c%v 2.0 1992/11/15 03:29:15 MH Rel $";
  623. X#endif
  624. X
  625. X#if    EMALLOC
  626. Xvoid*    emalloc( size_t );
  627. Xvoid*    ecalloc( size_t, size_t );
  628. Xvoid    efree( void* );
  629. X#endif
  630. X
  631. X
  632. X
  633. X
  634. X
  635. X/*man-start*********************************************************************
  636. X
  637. X  set_term()    - switch between terminals
  638. X
  639. X  X/Open Description:
  640. X     This function is used to switch between different terminals.
  641. X     The screen reference 'new' becomes the new current terminal.
  642. X     The previous terminal is returned by the routine.  This is the
  643. X     only routine which manipulates SCREEN pointers; all other routines
  644. X     affect only the current terminal.
  645. X
  646. X  PDCurses Description:
  647. X     FYI: Dual monitor support is not quite complete.  Nothing will
  648. X     happen if you try to call this routine.
  649. X
  650. X  X/Open Return Value:
  651. X     The set_term() function returns a pointer to the previous
  652. X     SCREEN structure on success otherwise a NULL pointer is
  653. X     returned.
  654. X
  655. X  X/Open Errors:
  656. X     No errors are defined for this function.
  657. X
  658. X  PDCurses Errors:
  659. X     It is an error to call this routine at this time.
  660. X     It is an error to pass a NULL SCREEN pointer.
  661. X
  662. X  Portability:
  663. X     PDCurses    SCREEN* set_term( SCREEN* new );
  664. X     X/Open Dec '88    SCREEN* set_term( SCREEN* new );
  665. X     BSD Curses    
  666. X     SYS V Curses    SCREEN* set_term( SCREEN* new );
  667. X
  668. X**man-end**********************************************************************/
  669. X
  670. XSCREEN*    set_term( SCREEN *new )
  671. X{
  672. X#ifdef    TC
  673. X#  pragma argsused
  674. X#endif
  675. X    return( &_cursvar );  /* We only have one screen supported right now */
  676. X}
  677. END_OF_FILE
  678.   if test 1600 -ne `wc -c <'portable/set_term.c'`; then
  679.     echo shar: \"'portable/set_term.c'\" unpacked with wrong size!
  680.   fi
  681.   # end of 'portable/set_term.c'
  682. fi
  683. if test -f 'portable/touchwin.c' -a "${1}" != "-c" ; then 
  684.   echo shar: Will not clobber existing file \"'portable/touchwin.c'\"
  685. else
  686.   echo shar: Extracting \"'portable/touchwin.c'\" \(1458 characters\)
  687.   sed "s/^X//" >'portable/touchwin.c' <<'END_OF_FILE'
  688. X#define    CURSES_LIBRARY    1
  689. X#include <curses.h>
  690. X#undef    touchwin
  691. X
  692. X#ifndef    NDEBUG
  693. Xchar *rcsid_touchwin = "$Header: c:/curses/portable/RCS/touchwin.c%v 2.0 1992/11/15 03:29:18 MH Rel $";
  694. X#endif
  695. X
  696. X
  697. X
  698. X
  699. X/*man-start*********************************************************************
  700. X
  701. X  touchwin()    - touch window
  702. X
  703. X  X/Open Description:
  704. X     Throw away all optimisation information about which parts of the
  705. X     window have been touched, by pretending that the entire window has
  706. X     been drawn on.  This is sometimes necessary when using overlapping
  707. X     windows, since a change to one window will affect the other window,
  708. X     but the records of which lines have been changed in the other
  709. X     window will not reflect the change.
  710. X
  711. X  PDCurses Description:
  712. X     No additional functionality in the PDCurses library.
  713. X
  714. X  X/Open Return Value:
  715. X     The touchwin() function returns OK on success and ERR on error.
  716. X
  717. X  PDCurses Errors:
  718. X     It is an error to pass a NULL window.
  719. X
  720. X  Portability:
  721. X     PDCurses    int touchwin( WINDOW* win );
  722. X     SysV Curses    int touchwin( WINDOW* win );
  723. X     BSD Curses    int touchwin( WINDOW* win );
  724. X     X/Open Dec '88    int touchwin( WINDOW* win );
  725. X
  726. X**man-end**********************************************************************/
  727. X
  728. Xint    touchwin(WINDOW *win)
  729. X{
  730. X    int    y;
  731. X    int    maxy;
  732. X    int    maxx;
  733. X
  734. X    if (win == (WINDOW *)NULL)
  735. X        return( ERR );
  736. X
  737. X    maxy = win->_maxy - 1;
  738. X    maxx = win->_maxx - 1;
  739. X
  740. X    for (y = 0; y <= maxy; y++)
  741. X    {
  742. X        win->_firstch[y] = 0;
  743. X        win->_lastch[y] = maxx;
  744. X    }
  745. X    return( OK );
  746. X}
  747. END_OF_FILE
  748.   if test 1458 -ne `wc -c <'portable/touchwin.c'`; then
  749.     echo shar: \"'portable/touchwin.c'\" unpacked with wrong size!
  750.   fi
  751.   # end of 'portable/touchwin.c'
  752. fi
  753. if test -f 'portable/waddstr.c' -a "${1}" != "-c" ; then 
  754.   echo shar: Will not clobber existing file \"'portable/waddstr.c'\"
  755. else
  756.   echo shar: Extracting \"'portable/waddstr.c'\" \(1517 characters\)
  757.   sed "s/^X//" >'portable/waddstr.c' <<'END_OF_FILE'
  758. X#define    CURSES_LIBRARY    1
  759. X#include <curses.h>
  760. X#undef    waddstr
  761. X
  762. X#ifndef    NDEBUG
  763. Xchar *rcsid_waddstr = "$Header: c:/curses/portable/RCS/waddstr.c%v 2.0 1992/11/15 03:29:21 MH Rel $";
  764. X#endif
  765. X
  766. X
  767. X
  768. X
  769. X/*man-start*********************************************************************
  770. X
  771. X  waddstr()    - add string to window
  772. X
  773. X  X/Open Description:
  774. X     These routines write all the characters of the null-terminated
  775. X     string str on the given window.  The functionality is equivalent
  776. X     to calling waddch() once for each character in the string.
  777. X
  778. X     NOTE:  addstr(), mvaddstr(), and mvwaddstr() are macros.
  779. X
  780. X  PDCurses Description:
  781. X     The *raw*() routines output 8 bit values.  These contrast to their
  782. X     normal counterparts which output 7 bit values and convert control
  783. X     character to the ^X notation.
  784. X
  785. X     str is a standard 8 bit character string WITHOUT embedded attributes.
  786. X
  787. X  X/Open Return Value:
  788. X     The waddstr() function returns OK on success and ERR on error.
  789. X
  790. X  PDCurses Errors:
  791. X     It is an error to call this function with a NULL window pointer.
  792. X
  793. X  Portability:
  794. X     PDCurses    int waddstr( WINDOW* win, char* str );
  795. X     X/Open Dec '88    int waddstr( WINDOW* win, char* str );
  796. X     BSD Curses    int waddstr( WINDOW* win, char* str );
  797. X     SYS V Curses    int waddstr( WINDOW* win, char* str );
  798. X
  799. X**man-end**********************************************************************/
  800. X
  801. Xint    waddstr(WINDOW *win, char *str)
  802. X{
  803. X    if (win == (WINDOW *)NULL)
  804. X        return( ERR );
  805. X
  806. X    while (*str)
  807. X    {
  808. X        if (waddch(win, *str++) == ERR)
  809. X        {
  810. X            return( ERR );
  811. X        }
  812. X    }
  813. X    return( OK );
  814. X}
  815. END_OF_FILE
  816.   if test 1517 -ne `wc -c <'portable/waddstr.c'`; then
  817.     echo shar: \"'portable/waddstr.c'\" unpacked with wrong size!
  818.   fi
  819.   # end of 'portable/waddstr.c'
  820. fi
  821. if test -f 'portable/wdeletel.c' -a "${1}" != "-c" ; then 
  822.   echo shar: Will not clobber existing file \"'portable/wdeletel.c'\"
  823. else
  824.   echo shar: Extracting \"'portable/wdeletel.c'\" \(1601 characters\)
  825.   sed "s/^X//" >'portable/wdeletel.c' <<'END_OF_FILE'
  826. X#define    CURSES_LIBRARY    1
  827. X#include <curses.h>
  828. X#undef    wdeleteln
  829. X
  830. X#ifndef    NDEBUG
  831. Xchar *rcsid_wdeletel = "$Header: c:/curses/portable/RCS/wdeletel.c%v 2.0 1992/11/15 03:29:06 MH Rel $";
  832. X#endif
  833. X
  834. X
  835. X
  836. X
  837. X/*man-start*********************************************************************
  838. X
  839. X  wdeleteln()    - remove line from window
  840. X
  841. X  X/Open Description:
  842. X     The line under the cursor in the window is deleted.  All
  843. X     lines below the current line are moved up one line.  The
  844. X     bottom line of the window is cleared.  The cursor position
  845. X     does not change.
  846. X
  847. X     NOTE: deleteln() is a macro.
  848. X
  849. X  PDCurses Description:
  850. X     No additional functionality.
  851. X
  852. X  X/Open Return Value:
  853. X     The wdeleteln() function returns OK on success and ERR on error.
  854. X
  855. X  PDCurses Errors:
  856. X     It is an error to pass a NULL window pointer to this routine.
  857. X
  858. X  Portability:
  859. X     PDCurses    int wdeleteln( WINDOW* win );
  860. X     X/Open Dec '88    int wdeleteln( WINDOW* win );
  861. X     BSD Curses    int wdeleteln( WINDOW* win );
  862. X     SYS V Curses    int wdeleteln( WINDOW* win );
  863. X
  864. X**man-end**********************************************************************/
  865. X
  866. Xint    wdeleteln(WINDOW *win)
  867. X{
  868. Xstatic    chtype    blank;
  869. X    chtype*    end;
  870. X    chtype*    temp;
  871. X    int    y;
  872. X
  873. X    if (win == (WINDOW *)NULL)
  874. X        return( ERR );
  875. X
  876. X    blank    = win->_blank | win->_attrs;
  877. X    temp    = win->_y[win->_cury];
  878. X
  879. X    for (y = win->_cury; y < win->_bmarg; y++)
  880. X    {
  881. X        win->_y[y]     = win->_y[y + 1];
  882. X        win->_firstch[y] = 0;
  883. X        win->_lastch[y] = win->_maxx - 1;
  884. X    }
  885. X
  886. X    win->_firstch[y]        = 0;
  887. X    win->_lastch[y]        = win->_maxx - 1;
  888. X    win->_y[win->_bmarg]    = temp;
  889. X
  890. X    for (end = &(temp[win->_maxx - 1]); temp <= end;)
  891. X    {
  892. X        *temp++ = blank;
  893. X    }
  894. X    return( OK );
  895. X}
  896. END_OF_FILE
  897.   if test 1601 -ne `wc -c <'portable/wdeletel.c'`; then
  898.     echo shar: \"'portable/wdeletel.c'\" unpacked with wrong size!
  899.   fi
  900.   # end of 'portable/wdeletel.c'
  901. fi
  902. if test -f 'portable/winsertl.c' -a "${1}" != "-c" ; then 
  903.   echo shar: Will not clobber existing file \"'portable/winsertl.c'\"
  904. else
  905.   echo shar: Extracting \"'portable/winsertl.c'\" \(1554 characters\)
  906.   sed "s/^X//" >'portable/winsertl.c' <<'END_OF_FILE'
  907. X#define    CURSES_LIBRARY    1
  908. X#include <curses.h>
  909. X#undef    winsert
  910. X
  911. X#ifndef    NDEBUG
  912. Xchar *rcsid_winsertl = "$Header: c:/curses/portable/RCS/winsertl.c%v 2.0 1992/11/15 03:29:09 MH Rel $";
  913. X#endif
  914. X
  915. X
  916. X
  917. X
  918. X/*man-start*********************************************************************
  919. X
  920. X  winsert()    - Insert line
  921. X
  922. X  X/Open Description:
  923. X     A blank line is inserted above the current line and the bottom
  924. X     line is lost.
  925. X
  926. X     NOTE: insertln() is a macro.
  927. X
  928. X  PDCurses Description:
  929. X     The mv[w]insertln() routines have been added to the X/Open
  930. X     interface specification as a convienience.
  931. X
  932. X  X/Open Return Value:
  933. X     These functions return OK on success and ERR on error.
  934. X
  935. X  PDCurses Errors:
  936. X     It is an error to call this function with a NULL window pointer.
  937. X
  938. X  Portability:
  939. X     PDCurses    int winsertln( WINDOW* win );
  940. X     X/Open Dec '88    int winsertln( WINDOW* win );
  941. X     BSD Curses    int winsertln( WINDOW* win );
  942. X     SYS V Curses    int winsertln( WINDOW* win );
  943. X
  944. X
  945. X**man-end**********************************************************************/
  946. X
  947. Xint    winsertln(WINDOW *win)
  948. X{
  949. X    chtype    blank;
  950. X    chtype*    temp;
  951. X    chtype*    end;
  952. X    short    y;
  953. X
  954. X    if (win == (WINDOW *)NULL)
  955. X        return( ERR );
  956. X
  957. X    blank    = win->_blank | win->_attrs;
  958. X    temp    = win->_y[win->_bmarg];
  959. X
  960. X    for (y = win->_bmarg; y > win->_cury; y--)
  961. X    {
  962. X        win->_y[y]     = win->_y[y - 1];
  963. X        win->_firstch[y] = 0;
  964. X        win->_lastch[y] = win->_maxx - 1;
  965. X    }
  966. X
  967. X    win->_y[win->_cury] = temp;
  968. X
  969. X    for (end = &temp[win->_maxx - 1]; temp <= end; temp++)
  970. X    {
  971. X        *temp = blank;
  972. X    }
  973. X
  974. X    win->_firstch[win->_cury] = 0;
  975. X    win->_lastch[win->_cury] = win->_maxx - 1;
  976. X
  977. X    return( OK );
  978. X}
  979. END_OF_FILE
  980.   if test 1554 -ne `wc -c <'portable/winsertl.c'`; then
  981.     echo shar: \"'portable/winsertl.c'\" unpacked with wrong size!
  982.   fi
  983.   # end of 'portable/winsertl.c'
  984. fi
  985. if test -f 'portable/wmove.c' -a "${1}" != "-c" ; then 
  986.   echo shar: Will not clobber existing file \"'portable/wmove.c'\"
  987. else
  988.   echo shar: Extracting \"'portable/wmove.c'\" \(1553 characters\)
  989.   sed "s/^X//" >'portable/wmove.c' <<'END_OF_FILE'
  990. X#define    CURSES_LIBRARY    1
  991. X#include <curses.h>
  992. X#undef    wmove
  993. X
  994. X#ifndef    NDEBUG
  995. Xchar *rcsid_wmove = "$Header: c:/curses/portable/RCS/wmove.c%v 2.0 1992/11/15 03:29:27 MH Rel $";
  996. X#endif
  997. X
  998. X
  999. X
  1000. X
  1001. X/*man-start*********************************************************************
  1002. X
  1003. X  wmove()    - Move cursor in window
  1004. X
  1005. X  X/Open Description:
  1006. X     The cursor associated with the window is moved to the given
  1007. X     location.  This does not move the physical cursor of the
  1008. X     terminal until refresh() is called.  The position specified is
  1009. X     relative to the upper left corner of the window, which is (0,0).
  1010. X
  1011. X     NOTE: move() is a macro.
  1012. X
  1013. X  PDCurses Description:
  1014. X     There may be additional [window oriented] move routines associated
  1015. X     with other sections of the curses library.  See those sections for
  1016. X     details.
  1017. X
  1018. X  X/Open Return Value:
  1019. X     These functions return OK on success and ERR on error.
  1020. X
  1021. X  PDCurses Errors:
  1022. X     It is an error to call this function with a NULL window pointer.
  1023. X
  1024. X  Portability:
  1025. X     PDCurses    int wmove( WINDOW* win, int y, int x );
  1026. X     X/Open Dec '88    int wmove( WINDOW* win, int y, int x );
  1027. X     BSD Curses    int wmove( WINDOW* win, int y, int x );
  1028. X     SYS V Curses    int wmove( WINDOW* win, int y, int x );
  1029. X
  1030. X**man-end**********************************************************************/
  1031. X
  1032. Xint    wmove(WINDOW *win, int y, int x)
  1033. X{
  1034. X    if (win == (WINDOW *)NULL)
  1035. X        return( ERR );
  1036. X
  1037. X    if ((x < 0) ||
  1038. X        (y < 0) ||
  1039. X        (x >= win->_maxx) ||
  1040. X        (y >= win->_maxy) ||
  1041. X        (y < win->_tmarg) ||
  1042. X        (y > win->_bmarg))
  1043. X    {
  1044. X        return( ERR );
  1045. X    }
  1046. X    win->_curx = x;
  1047. X    win->_cury = y;
  1048. X    return( OK );
  1049. X}
  1050. END_OF_FILE
  1051.   if test 1553 -ne `wc -c <'portable/wmove.c'`; then
  1052.     echo shar: \"'portable/wmove.c'\" unpacked with wrong size!
  1053.   fi
  1054.   # end of 'portable/wmove.c'
  1055. fi
  1056. if test -f 'portable/wrefresh.c' -a "${1}" != "-c" ; then 
  1057.   echo shar: Will not clobber existing file \"'portable/wrefresh.c'\"
  1058. else
  1059.   echo shar: Extracting \"'portable/wrefresh.c'\" \(1445 characters\)
  1060.   sed "s/^X//" >'portable/wrefresh.c' <<'END_OF_FILE'
  1061. X#define    CURSES_LIBRARY    1
  1062. X#include <curses.h>
  1063. X#undef wrefresh
  1064. X
  1065. X#ifndef    NDEBUG
  1066. Xchar *rcsid_wrefresh = "$Header: c:/curses/portable/RCS/wrefresh.c%v 2.0 1992/11/15 03:29:28 MH Rel $";
  1067. X#endif
  1068. X
  1069. X
  1070. X
  1071. X
  1072. X/*man-start*********************************************************************
  1073. X
  1074. X  wrefresh()    - refresh window
  1075. X
  1076. X  X/Open Description:
  1077. X     The routine wrefresh copies the named window to the physical
  1078. X     terminal screen, taking into account what is already there in
  1079. X     order to optimize cursor movement.
  1080. X
  1081. X     The routine refresh does the same, using stdscr as a default
  1082. X     screen.
  1083. X
  1084. X     These routines must be called to get any output on the
  1085. X     terminal, as other routines only manipulate data structures.
  1086. X
  1087. X     Unless leaveok has been enabled, the physical cursor of the
  1088. X     terminal is left at the location of the window's cursor.
  1089. X
  1090. X  X/Open Return Value:
  1091. X     The wrefresh() function returns OK on success and ERR on error.
  1092. X
  1093. X  X/Open Errors:
  1094. X     No errors are defined for this function.
  1095. X
  1096. X  Portability:
  1097. X     PDCurses    int wrefresh( WINDOW* win );
  1098. X     X/Open Dec '88    int wrefresh( WINDOW* win );
  1099. X     BSD Curses    int wrefresh( WINDOW* win );
  1100. X     SYS V Curses    int wrefresh( WINDOW* win );
  1101. X
  1102. X**man-end**********************************************************************/
  1103. X
  1104. Xint    wrefresh(WINDOW *win)
  1105. X{
  1106. X    if (win == (WINDOW *)NULL)    return( ERR );
  1107. X    if (win->_flags & _PAD)    return( ERR );
  1108. X
  1109. X    if (win == curscr)
  1110. X        curscr->_clear = TRUE;
  1111. X    else    
  1112. X        wnoutrefresh(win);
  1113. X    doupdate();
  1114. X    return( OK );
  1115. X}
  1116. END_OF_FILE
  1117.   if test 1445 -ne `wc -c <'portable/wrefresh.c'`; then
  1118.     echo shar: \"'portable/wrefresh.c'\" unpacked with wrong size!
  1119.   fi
  1120.   # end of 'portable/wrefresh.c'
  1121. fi
  1122. if test -f 'private/_getcols.c' -a "${1}" != "-c" ; then 
  1123.   echo shar: Will not clobber existing file \"'private/_getcols.c'\"
  1124. else
  1125.   echo shar: Extracting \"'private/_getcols.c'\" \(1587 characters\)
  1126.   sed "s/^X//" >'private/_getcols.c' <<'END_OF_FILE'
  1127. X#define    CURSES_LIBRARY    1
  1128. X#include <curses.h>
  1129. X
  1130. X#ifndef    NDEBUG
  1131. Xchar *rcsid__getcols = "$Header: c:/curses/private/RCS/_getcols.c%v 2.0 1992/11/15 03:24:24 MH Rel $";
  1132. X#endif
  1133. X
  1134. X
  1135. X
  1136. X
  1137. X/*man-start*********************************************************************
  1138. X
  1139. X  PDC_get_columns()    - return width of screen/viewport.
  1140. X
  1141. X  PDCurses Description:
  1142. X     This is a private PDCurses function
  1143. X
  1144. X     This function will return the width of the current screen.
  1145. X
  1146. X  PDCurses Return Value:
  1147. X     This routine will return OK upon success and otherwise ERR will be
  1148. X     returned.
  1149. X
  1150. X  PDCurses Errors:
  1151. X     There are no defined errors for this routine.
  1152. X
  1153. X  Portability:
  1154. X     PDCurses    int    PDC_get_columns( void );
  1155. X
  1156. X**man-end**********************************************************************/
  1157. X
  1158. Xint    PDC_get_columns(void)
  1159. X{
  1160. X#ifdef    FLEXOS
  1161. X    return( vir.vc_size.rs_ncols );
  1162. X#endif
  1163. X#ifdef    DOS
  1164. X/*    short far*    CRT_COLS;*/
  1165. X    int        cols;
  1166. X    char *env_cols;
  1167. X
  1168. X/*    CRT_COLS = (short far *) 0x044aL;*/
  1169. X/*    cols = *CRT_COLS;*/
  1170. X
  1171. X/* use the value from COLS environment variable, if set. MH 10-Jun-92 */
  1172. X/* and use the minimum of COLS and return from int10h    MH 18-Jun-92 */
  1173. X    regs.h.ah = 0x0f;
  1174. X    int86(0x10, ®s, ®s);
  1175. X    cols = (int)regs.h.ah;
  1176. X    env_cols = (char *)getenv("COLS");
  1177. X    if (env_cols != (char *)NULL)
  1178. X    {
  1179. X        cols = min(atoi(env_cols),cols);
  1180. X    }
  1181. X    return(cols);
  1182. X#endif
  1183. X#ifdef    OS2
  1184. X    VIOMODEINFO modeInfo;
  1185. X    int cols;
  1186. X    char *env_cols;
  1187. X
  1188. X    modeInfo.cb = sizeof(modeInfo);
  1189. X    VioGetMode(&modeInfo, 0);
  1190. X    cols = modeInfo.col;
  1191. X    env_cols = (char *)getenv("COLS");
  1192. X    if (env_cols != (char *)NULL)
  1193. X    {
  1194. X        cols = min(atoi(env_cols),cols);
  1195. X    }
  1196. X    return(cols);
  1197. X#endif
  1198. X}
  1199. END_OF_FILE
  1200.   if test 1587 -ne `wc -c <'private/_getcols.c'`; then
  1201.     echo shar: \"'private/_getcols.c'\" unpacked with wrong size!
  1202.   fi
  1203.   # end of 'private/_getcols.c'
  1204. fi
  1205. if test -f 'private/_getcrsr.c' -a "${1}" != "-c" ; then 
  1206.   echo shar: Will not clobber existing file \"'private/_getcrsr.c'\"
  1207. else
  1208.   echo shar: Extracting \"'private/_getcrsr.c'\" \(1407 characters\)
  1209.   sed "s/^X//" >'private/_getcrsr.c' <<'END_OF_FILE'
  1210. X#define    CURSES_LIBRARY    1
  1211. X#include <curses.h>
  1212. X
  1213. X#ifndef    NDEBUG
  1214. Xchar *rcsid__getcrsr = "$Header: c:/curses/private/RCS/_getcrsr.c%v 2.0 1992/11/15 03:24:25 MH Rel $";
  1215. X#endif
  1216. X
  1217. X
  1218. X
  1219. X
  1220. X/*man-start*********************************************************************
  1221. X
  1222. X  PDC_get_cursor_mode()    - Get the cursor start and stop scan lines.
  1223. X
  1224. X  PDCurses Description:
  1225. X     Gets the cursor type to begin in scan line startrow and end in
  1226. X     scan line endrow.  Both values should be 0-31.
  1227. X
  1228. X  PDCurses Return Value:
  1229. X     This function returns OK on success and ERR on error.
  1230. X
  1231. X  PDCurses Errors:
  1232. X     No errors are defined for this function.
  1233. X
  1234. X  Portability:
  1235. X     PDCurses    int PDC_get_cursor_mode( void );
  1236. X
  1237. X**man-end**********************************************************************/
  1238. X
  1239. Xint    PDC_get_cursor_mode(void)
  1240. X{
  1241. X#ifdef    FLEXOS
  1242. X    /*
  1243. X     * Under FLEXOS, this routine returns 1 if the cursor is on and 0 if
  1244. X     * the cursor is off...
  1245. X     */
  1246. X    s_getfield(T_VIRCON, VC_MODE, STDOUT, (far BYTE *) & vir,
  1247. X        sizeof(vir.vc_mode));
  1248. X
  1249. X    if (vir.vc_mode & VCWM_CURSOR)
  1250. X        return (TRUE);
  1251. X    else
  1252. X        return (FALSE);
  1253. X#endif
  1254. X#ifdef    DOS
  1255. X    short far*    CURSOR_MODE;
  1256. X    short        cmode;
  1257. X
  1258. X    CURSOR_MODE = (short far *) 0x0460L;
  1259. X    cmode = *CURSOR_MODE;
  1260. X    return (cmode);
  1261. X#endif
  1262. X#ifdef    OS2
  1263. X    VIOCURSORINFO cursorInfo;
  1264. X    short        cmode;
  1265. X
  1266. X    VioGetCurType (&cursorInfo, 0);
  1267. X/* I am not sure about this JGB */
  1268. X    cmode = ((cursorInfo.yStart << 8) | (cursorInfo.cEnd));
  1269. X    return(cmode);
  1270. X#endif
  1271. X}
  1272. END_OF_FILE
  1273.   if test 1407 -ne `wc -c <'private/_getcrsr.c'`; then
  1274.     echo shar: \"'private/_getcrsr.c'\" unpacked with wrong size!
  1275.   fi
  1276.   # end of 'private/_getcrsr.c'
  1277. fi
  1278. if test -f 'private/_getfont.c' -a "${1}" != "-c" ; then 
  1279.   echo shar: Will not clobber existing file \"'private/_getfont.c'\"
  1280. else
  1281.   echo shar: Extracting \"'private/_getfont.c'\" \(1621 characters\)
  1282.   sed "s/^X//" >'private/_getfont.c' <<'END_OF_FILE'
  1283. X#define    CURSES_LIBRARY    1
  1284. X#include <curses.h>
  1285. X
  1286. X#ifndef    NDEBUG
  1287. Xchar *rcsid__getfont = "$Header: c:/curses/private/RCS/_getfont.c%v 2.0 1992/11/15 03:24:25 MH Rel $";
  1288. X#endif
  1289. X
  1290. X
  1291. X
  1292. X
  1293. X/*man-start*********************************************************************
  1294. X
  1295. X  PDC_get_font()    - Get the current font size
  1296. X
  1297. X  PDCurses Description:
  1298. X     This is a private PDCurses routine.
  1299. X
  1300. X     This function returns the current font size.  This function only
  1301. X     works if the #define FAST_VIDEO is true.
  1302. X
  1303. X  PDCurses Return Value:
  1304. X     This function returns OK on success and ERR on error.
  1305. X
  1306. X  PDCurses Errors:
  1307. X     An ERR will be returned if FAST_VIDEO is not true.
  1308. X
  1309. X  Portability:
  1310. X     PDCurses    int PDC_get_font( void );
  1311. X
  1312. X**man-end**********************************************************************/
  1313. X
  1314. Xint    PDC_get_font(void)
  1315. X{
  1316. X#if    defined (DOS) && defined (FAST_VIDEO)
  1317. X    int    retval;
  1318. X    short far *POINTS;
  1319. X
  1320. X    POINTS = (short far *) 0x0485L;
  1321. X    retval = *POINTS;
  1322. X    if ((retval == 0) && (_cursvar.adapter == _MDS_GENIUS))
  1323. X    {
  1324. X        retval = _FONT15; /* Assume the MDS Genius is in 66 line mode. */
  1325. X    }
  1326. X    switch (_cursvar.adapter)
  1327. X    {
  1328. X    case _EGACOLOR:
  1329. X    case _EGAMONO:
  1330. X        switch (retval)
  1331. X        {
  1332. X        case _FONT8:
  1333. X        case _FONT14:
  1334. X            break;
  1335. X        default:
  1336. X            retval = _FONT14;
  1337. X        }
  1338. X        break;
  1339. X
  1340. X    case _VGACOLOR:
  1341. X    case _VGAMONO:
  1342. X        switch (retval)
  1343. X        {
  1344. X        case _FONT8:
  1345. X        case _FONT14:
  1346. X        case _FONT16:
  1347. X            break;
  1348. X        default:
  1349. X            break;
  1350. X        }
  1351. X        break;
  1352. X    default:
  1353. X        break;
  1354. X    }
  1355. X    return( retval );
  1356. X#endif
  1357. X#ifdef OS2
  1358. X    VIOMODEINFO modeInfo;
  1359. X        modeInfo.cb = sizeof(modeInfo);
  1360. X        /* set most parameters of modeInfo */
  1361. X    VioGetMode(&modeInfo, 0);
  1362. X        return ( modeInfo.vres / modeInfo.row);
  1363. X#endif
  1364. X}
  1365. END_OF_FILE
  1366.   if test 1621 -ne `wc -c <'private/_getfont.c'`; then
  1367.     echo shar: \"'private/_getfont.c'\" unpacked with wrong size!
  1368.   fi
  1369.   # end of 'private/_getfont.c'
  1370. fi
  1371. if test -f 'private/_gotoxy.c' -a "${1}" != "-c" ; then 
  1372.   echo shar: Will not clobber existing file \"'private/_gotoxy.c'\"
  1373. else
  1374.   echo shar: Extracting \"'private/_gotoxy.c'\" \(1459 characters\)
  1375.   sed "s/^X//" >'private/_gotoxy.c' <<'END_OF_FILE'
  1376. X#define    CURSES_LIBRARY    1
  1377. X#include <curses.h>
  1378. X
  1379. X#ifndef    NDEBUG
  1380. Xchar *rcsid__gotoxy = "$Header: c:/curses/private/RCS/_gotoxy.c%v 2.0 1992/11/15 03:24:27 MH Rel $";
  1381. X#endif
  1382. X
  1383. X
  1384. X
  1385. X
  1386. X/*man-start*********************************************************************
  1387. X
  1388. X  PDC_gotoxy()    - position hardware cursor at (x, y)
  1389. X
  1390. X  PDCurses Description:
  1391. X     This is a private PDCurses routine.
  1392. X
  1393. X     Moves the physical cursor to the desired address on the
  1394. X     screen. We don't optimize here -- on a PC, it takes more time
  1395. X     to optimize than to do things directly.
  1396. X
  1397. X  PDCurses Return Value:
  1398. X     This function returns OK on success and ERR on error.
  1399. X
  1400. X  PDCurses Errors:
  1401. X     No errors are defined for this function.
  1402. X
  1403. X  Portability:
  1404. X     PDCurses    int PDC_gotoxy( int row, int col );
  1405. X
  1406. X**man-end**********************************************************************/
  1407. X
  1408. Xint    PDC_gotoxy(int row, int col)
  1409. X{
  1410. X    if ((_cursvar.cursrow == row) && (_cursvar.curscol == col))
  1411. X        return( OK );
  1412. X
  1413. X#ifdef    FLEXOS
  1414. X    retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
  1415. X    if (retcode < 0L)
  1416. X        return( ERR );
  1417. X    vir.vc_cursor.pos_row = row;
  1418. X    vir.vc_cursor.pos_col = col;
  1419. X    retcode = s_set(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
  1420. X    return( (retcode < 0L) ? ERR : OK );
  1421. X#endif
  1422. X#ifdef    DOS
  1423. X    regs.h.ah = 0x02;
  1424. X    regs.h.bh = _cursvar.video_page;
  1425. X    regs.h.dh = (unsigned char) row;
  1426. X    regs.h.dl = (unsigned char) col;
  1427. X    int86(0x10, ®s, ®s);
  1428. X    return( OK );
  1429. X#endif
  1430. X#ifdef    OS2
  1431. X    VioSetCurPos (row, col, 0);
  1432. X#endif
  1433. X}
  1434. END_OF_FILE
  1435.   if test 1459 -ne `wc -c <'private/_gotoxy.c'`; then
  1436.     echo shar: \"'private/_gotoxy.c'\" unpacked with wrong size!
  1437.   fi
  1438.   # end of 'private/_gotoxy.c'
  1439. fi
  1440. if test -f 'private/_print.c' -a "${1}" != "-c" ; then 
  1441.   echo shar: Will not clobber existing file \"'private/_print.c'\"
  1442. else
  1443.   echo shar: Extracting \"'private/_print.c'\" \(1628 characters\)
  1444.   sed "s/^X//" >'private/_print.c' <<'END_OF_FILE'
  1445. X#define    CURSES_LIBRARY    1
  1446. X#define NEEDS_OS2       1
  1447. X#include <curses.h>
  1448. X
  1449. X#ifndef    NDEBUG
  1450. Xchar *rcsid__print = "$Header: c:/curses/private/RCS/_print.c%v 2.0 1992/11/15 03:24:33 MH Rel $";
  1451. X#endif
  1452. X
  1453. X#ifdef OS2
  1454. X#  if !defined (CURSES__32BIT__) && !defined(CSET2) && !defined(MSC)
  1455. X#define INCL_DOS
  1456. X#include <bsedos.h>
  1457. X#endif
  1458. Xchar Printer[]="LPT1:";
  1459. X#endif
  1460. X
  1461. X
  1462. X/*man-start*********************************************************************
  1463. X
  1464. X  PDC_print()    - Provides primitive access to the BIOS printer functions
  1465. X
  1466. X  PDCurses Description:
  1467. X     This is a private PDCurses routine.
  1468. X
  1469. X     Implements write/init/read printer services at the BIOS level.
  1470. X
  1471. X     This provides the basic support that PDCurses needs to dump the
  1472. X     contents of windows or pads to the printer attached to the BIOS
  1473. X     printer port.
  1474. X
  1475. X  PDCurses Return Value:
  1476. X     See the BIOS INT 0x17 specifications.
  1477. X
  1478. X  PDCurses Errors:
  1479. X     See the BIOS INT 0x17 specifications.
  1480. X
  1481. X  Portability:
  1482. X     PDCurses    int PDC_print( int cmd, int byte, int port );
  1483. X
  1484. X**man-end**********************************************************************/
  1485. X
  1486. Xint    PDC_print(int cmd, int byte, int port)
  1487. X{
  1488. X#ifdef    FLEXOS
  1489. X    return( OK );
  1490. X#endif
  1491. X#ifdef    DOS
  1492. X    int    status = 0;
  1493. X
  1494. X    regs.h.ah = (unsigned char)cmd;
  1495. X    regs.h.al = (unsigned char)byte;
  1496. X    regs.x.dx = (unsigned int)port;
  1497. X    int86(0x17, ®s, ®s);
  1498. X    status = regs.h.ah;
  1499. X    return (status);
  1500. X#endif
  1501. X#ifdef    OS2
  1502. X#  if !defined (CURSES__32BIT__) && !defined(CSET2)
  1503. X    HFILE Lpt;
  1504. X    USHORT Action;
  1505. X    USHORT NoWritten;
  1506. X    if (DosOpen((PSZ)Printer, &Lpt, &Action, 0,0,0,0,0) != 0)
  1507. X        return(ERR);
  1508. X    DosWrite(Lpt,&byte,1,&NoWritten);
  1509. X    DosClose(Lpt);
  1510. X    return(NoWritten == 1);
  1511. X#  endif    
  1512. X#endif
  1513. X}
  1514. END_OF_FILE
  1515.   if test 1628 -ne `wc -c <'private/_print.c'`; then
  1516.     echo shar: \"'private/_print.c'\" unpacked with wrong size!
  1517.   fi
  1518.   # end of 'private/_print.c'
  1519. fi
  1520. if test -f 'private/_putc.c' -a "${1}" != "-c" ; then 
  1521.   echo shar: Will not clobber existing file \"'private/_putc.c'\"
  1522. else
  1523.   echo shar: Extracting \"'private/_putc.c'\" \(1528 characters\)
  1524.   sed "s/^X//" >'private/_putc.c' <<'END_OF_FILE'
  1525. X#define    CURSES_LIBRARY    1
  1526. X#include <curses.h>
  1527. X
  1528. X#ifndef    NDEBUG
  1529. Xchar *rcsid__putc = "$Header: c:/curses/private/RCS/_putc.c%v 2.0 1992/11/15 03:24:30 MH Rel $";
  1530. X#endif
  1531. X
  1532. X
  1533. X
  1534. X
  1535. X/*man-start*********************************************************************
  1536. X
  1537. X  PDC_putc()    - Output a character in the current attribute.
  1538. X
  1539. X  PDCurses Description:
  1540. X     This is a private PDCurses routine.
  1541. X
  1542. X     Outputs character 'chr' to screen in tty fashion. If a colour
  1543. X     mode is active, the character is written with colour 'colour'.
  1544. X
  1545. X  PDCurses Return Value:
  1546. X     This function returns OK on success and ERR on error.
  1547. X
  1548. X  PDCurses Errors:
  1549. X     No errors are defined for this function.
  1550. X
  1551. X  Portability:
  1552. X     PDCurses    int PDC_putc( chtype character, chtype color );
  1553. X
  1554. X**man-end**********************************************************************/
  1555. X
  1556. Xint    PDC_putc( chtype character, chtype color )
  1557. X{
  1558. X#ifdef    FLEXOS
  1559. X    int    x = color;
  1560. X    retcode = s_write(0x00, 0x01L, (_far char *) &character, 1L, 0);
  1561. X    return( (retcode < 0L) ? ERR : OK );
  1562. X#endif
  1563. X#ifdef    DOS
  1564. X    regs.h.ah = 0x0a;    /* Avoid screen wrap.  Don't advance cursor. */
  1565. X    regs.h.al = (unsigned char) (character & A_CHARTEXT);
  1566. X    regs.h.bh = _cursvar.video_page;
  1567. X    regs.h.bl = (unsigned char) ((color & A_ATTRIBUTES) >> 8);
  1568. X    regs.x.cx = 0;
  1569. X    int86(0x10, ®s, ®s);
  1570. X    return( OK );
  1571. X#endif
  1572. X#ifdef    OS2
  1573. X    int curRow = PDC_get_cur_row ();
  1574. X    int curCol = PDC_get_cur_col ();
  1575. X
  1576. X    VioWrtTTY ((PCH)&character, 1, 0);
  1577. X    VioWrtNAttr ((PBYTE)&color, 1, (USHORT)curRow, (USHORT)curCol, 0);
  1578. X    PDC_gotoxy (curRow, curCol);
  1579. X    return( OK );
  1580. X#endif
  1581. X}
  1582. END_OF_FILE
  1583.   if test 1528 -ne `wc -c <'private/_putc.c'`; then
  1584.     echo shar: \"'private/_putc.c'\" unpacked with wrong size!
  1585.   fi
  1586.   # end of 'private/_putc.c'
  1587. fi
  1588. if test -f 'private/_putctty.c' -a "${1}" != "-c" ; then 
  1589.   echo shar: Will not clobber existing file \"'private/_putctty.c'\"
  1590. else
  1591.   echo shar: Extracting \"'private/_putctty.c'\" \(1596 characters\)
  1592.   sed "s/^X//" >'private/_putctty.c' <<'END_OF_FILE'
  1593. X#define    CURSES_LIBRARY    1
  1594. X#include <curses.h>
  1595. X
  1596. X#ifndef    NDEBUG
  1597. Xchar *rcsid__putctty = "$Header: c:/curses/private/RCS/_putctty.c%v 2.0 1992/11/15 03:24:30 MH Rel $";
  1598. X#endif
  1599. X
  1600. X
  1601. X
  1602. X
  1603. X/*man-start*********************************************************************
  1604. X
  1605. X  PDC_putctty()    - Output a character and attribute in TTY fashion.
  1606. X
  1607. X  PDCurses Description:
  1608. X     This is a private PDCurses routine.
  1609. X
  1610. X     Outputs character 'chr' to screen in tty fashion. If a colour
  1611. X     mode is active, the character is written with colour 'colour'.
  1612. X
  1613. X     This function moves the physical cursor after writing so the
  1614. X     screen will scroll if necessary.
  1615. X
  1616. X  PDCurses Return Value:
  1617. X     This function returns OK on success and ERR on error.
  1618. X
  1619. X  PDCurses Errors:
  1620. X     No errors are defined for this function.
  1621. X
  1622. X  Portability:
  1623. X     PDCurses    int PDC_putctty( chtype character, chtype color );
  1624. X
  1625. X**man-end**********************************************************************/
  1626. X
  1627. Xint    PDC_putctty( chtype character, chtype color )
  1628. X{
  1629. X#ifdef    FLEXOS
  1630. X    int    x = color;
  1631. X    retcode = s_write(0x00, 0x01L, (_far char *) &character, 1L, 0);
  1632. X    return( (retcode < 0L) ? ERR : OK );
  1633. X#endif
  1634. X#ifdef    DOS
  1635. X    regs.h.ah = 0x0e;    /* Write in TTY fashion, advance cursor. */
  1636. X    regs.h.al = (unsigned char) (character & A_CHARTEXT);
  1637. X    regs.h.bh = _cursvar.video_page;
  1638. X    regs.h.bl = (unsigned char) ((color & A_ATTRIBUTES) >> 8);
  1639. X    int86(0x10, ®s, ®s);
  1640. X    return( OK );
  1641. X#endif
  1642. X#ifdef    OS2
  1643. X    int curRow = PDC_get_cur_row ();
  1644. X    int curCol = PDC_get_cur_col ();
  1645. X
  1646. X    VioWrtTTY ((PCH)&character, 1, 0);
  1647. X    VioWrtNAttr ((PBYTE)&color, 1, (USHORT)curRow, (USHORT)curCol, 0);
  1648. X    return( OK );
  1649. X#endif
  1650. X}
  1651. END_OF_FILE
  1652.   if test 1596 -ne `wc -c <'private/_putctty.c'`; then
  1653.     echo shar: \"'private/_putctty.c'\" unpacked with wrong size!
  1654.   fi
  1655.   # end of 'private/_putctty.c'
  1656. fi
  1657. if test -f 'private/_scrclos.c' -a "${1}" != "-c" ; then 
  1658.   echo shar: Will not clobber existing file \"'private/_scrclos.c'\"
  1659. else
  1660.   echo shar: Extracting \"'private/_scrclos.c'\" \(1414 characters\)
  1661.   sed "s/^X//" >'private/_scrclos.c' <<'END_OF_FILE'
  1662. X#define    CURSES_LIBRARY    1
  1663. X#include <curses.h>
  1664. X
  1665. X#ifndef    NDEBUG
  1666. Xchar *rcsid__scrclos = "$Header: c:/curses/private/RCS/_scrclos.c%v 2.0 1992/11/15 03:24:33 MH Rel $";
  1667. X#endif
  1668. X
  1669. X
  1670. X
  1671. X
  1672. X/*man-start*********************************************************************
  1673. X
  1674. X  PDC_scr_close()    - Internal low-level binding to close the physical screen
  1675. X
  1676. X  PDCurses Description:
  1677. X     This function provides a low-level binding for the Flexos
  1678. X     platform which must close the screen before writing to it.
  1679. X     This is a nop for the DOS platform.
  1680. X
  1681. X     This function is provided in order to reset the FlexOS 16 bit
  1682. X     character set for input rather than the limited input
  1683. X     character set associated with the VT52.
  1684. X
  1685. X  PDCurses Return Value:
  1686. X     This function returns OK on success, otherwise an ERR is returned.
  1687. X
  1688. X  PDCurses Errors:
  1689. X     The DOS platform will never fail.  The Flexos platform may fail
  1690. X     depending on the ability to close the current virtual console in
  1691. X     8 (as opposed to 16) bit mode.
  1692. X
  1693. X  Portability:
  1694. X     PDCurses    int    PDC_scr_close( void );
  1695. X
  1696. X**man-end**********************************************************************/
  1697. X
  1698. Xint    PDC_scr_close(void)
  1699. X{
  1700. X#ifdef    FLEXOS
  1701. X    _flexos_8bitmode();
  1702. X    vir.vc_kbmode = kbmode;
  1703. X    vir.vc_smode = smode;
  1704. X    vir.vc_mode = cmode;
  1705. X    retcode = s_set(T_VIRCON, 1L, (char *) &vir, (long) sizeof(vir));
  1706. X    if  (retcode < 0L)
  1707. X        return( ERR );
  1708. X    return( OK );
  1709. X#endif
  1710. X#if    defined (DOS) || defined (OS2)
  1711. X    return( OK );
  1712. X#endif
  1713. X}
  1714. END_OF_FILE
  1715.   if test 1414 -ne `wc -c <'private/_scrclos.c'`; then
  1716.     echo shar: \"'private/_scrclos.c'\" unpacked with wrong size!
  1717.   fi
  1718.   # end of 'private/_scrclos.c'
  1719. fi
  1720. if test -f 'private/_set8025.c' -a "${1}" != "-c" ; then 
  1721.   echo shar: Will not clobber existing file \"'private/_set8025.c'\"
  1722. else
  1723.   echo shar: Extracting \"'private/_set8025.c'\" \(1469 characters\)
  1724.   sed "s/^X//" >'private/_set8025.c' <<'END_OF_FILE'
  1725. X#define    CURSES_LIBRARY    1
  1726. X#include <curses.h>
  1727. X
  1728. X#ifndef NDEBUG
  1729. Xchar *rcsid__set8025 = "$Header: c:/curses/private/RCS/_set8025.c%v 2.0 1992/11/15 03:24:35 MH Rel $";
  1730. X#endif
  1731. X
  1732. X
  1733. X
  1734. X
  1735. X/*man-start*********************************************************************
  1736. X
  1737. X  PDC_set_80x25()    - force a known screen state: 80x25 text mode.
  1738. X
  1739. X  PDCurses Description:
  1740. X     This is a private PDCurses function.
  1741. X
  1742. X     Forces the appropriate 80x25 alpha mode given the display adapter.
  1743. X
  1744. X     Since we currently do not support changing the virtual console size,
  1745. X     this routine is a NOP under Flexos.
  1746. X
  1747. X  PDCurses Return Value:
  1748. X     This function returns OK upon success otherwise ERR is returned.
  1749. X
  1750. X  PDCurses Errors:
  1751. X     No errors are defined for this routine.
  1752. X
  1753. X  Portability:
  1754. X     PDCurses    int    PDC_set_80x25( void );
  1755. X
  1756. X**man-end**********************************************************************/
  1757. X
  1758. Xint    PDC_set_80x25(void)
  1759. X{
  1760. X#ifdef    FLEXOS
  1761. X    return( OK );
  1762. X#endif
  1763. X#ifdef    DOS
  1764. X    switch (_cursvar.adapter)
  1765. X    {
  1766. X    case _CGA:
  1767. X    case _EGACOLOR:
  1768. X    case _EGAMONO:
  1769. X    case _VGACOLOR:
  1770. X    case _VGAMONO:
  1771. X    case _MCGACOLOR:
  1772. X    case _MCGAMONO:
  1773. X        regs.h.ah = 0x00;
  1774. X        regs.h.al = 0x03;
  1775. X        int86(0x10, ®s, ®s);
  1776. X        break;
  1777. X    case _MDA:
  1778. X        regs.h.ah = 0x00;
  1779. X        regs.h.al = 0x07;
  1780. X        int86(0x10, ®s, ®s);
  1781. X    default:
  1782. X        break;
  1783. X    }
  1784. X    return( OK );
  1785. X#endif
  1786. X#ifdef    OS2
  1787. X    VIOMODEINFO modeInfo;
  1788. X
  1789. X    modeInfo.cb = sizeof(modeInfo);
  1790. X    /* set most parameters of modeInfo */
  1791. X    VioGetMode(&modeInfo, 0);
  1792. X    modeInfo.fbType = 1;
  1793. X    VioSetMode(&modeInfo, 0);
  1794. X#endif
  1795. X}
  1796. END_OF_FILE
  1797.   if test 1469 -ne `wc -c <'private/_set8025.c'`; then
  1798.     echo shar: \"'private/_set8025.c'\" unpacked with wrong size!
  1799.   fi
  1800.   # end of 'private/_set8025.c'
  1801. fi
  1802. if test -f 'private/_setscrn.c' -a "${1}" != "-c" ; then 
  1803.   echo shar: Will not clobber existing file \"'private/_setscrn.c'\"
  1804. else
  1805.   echo shar: Extracting \"'private/_setscrn.c'\" \(1444 characters\)
  1806.   sed "s/^X//" >'private/_setscrn.c' <<'END_OF_FILE'
  1807. X#define    CURSES_LIBRARY    1
  1808. X#include <curses.h>
  1809. X
  1810. X#ifndef    NDEBUG
  1811. Xchar *rcsid__setscrn = "$Header: c:/curses/private/RCS/_setscrn.c%v 2.0 1992/11/15 03:24:37 MH Rel $";
  1812. X#endif
  1813. X
  1814. X
  1815. X
  1816. X
  1817. X/*man-start*********************************************************************
  1818. X
  1819. X  PDC_set_scrn_mode()    - Set BIOS Video Mode
  1820. X
  1821. X  PDCurses Description:
  1822. X     Sets the BIOS Video Mode Number ONLY if it is different from
  1823. X     the current video mode.  This routine is for DOS systems only.
  1824. X
  1825. X  PDCurses Return Value:
  1826. X     This function returns OK on success and ERR on error.
  1827. X
  1828. X  PDCurses Errors:
  1829. X     No errors are defined for this function.
  1830. X
  1831. X  Portability:
  1832. X     PDCurses    int PDC_set_scrn_mode( int new_mode );
  1833. X
  1834. X**man-end**********************************************************************/
  1835. X
  1836. X#ifdef     OS2
  1837. Xint    PDC_set_scrn_mode(VIOMODEINFO new_mode)
  1838. X#else
  1839. Xint    PDC_set_scrn_mode(int new_mode)
  1840. X#endif
  1841. X{
  1842. X#ifdef    FLEXOS
  1843. X    return( OK );
  1844. X#endif
  1845. X#ifdef    DOS
  1846. X    int    cur;
  1847. X
  1848. X    cur = (int) PDC_get_scrn_mode();
  1849. X    if (cur != new_mode)
  1850. X    {
  1851. X        regs.h.ah = 0x00;
  1852. X        regs.h.al = (char) new_mode;
  1853. X        int86(0x10, ®s, ®s);
  1854. X    }
  1855. X    _cursvar.font = PDC_get_font();
  1856. X    _cursvar.scrnmode = new_mode;
  1857. X    LINES = PDC_get_rows();
  1858. X    COLS = PDC_get_columns();
  1859. X    return( OK );
  1860. X#endif
  1861. X#ifdef    OS2
  1862. X        if (VioSetMode (&new_mode, 0) != 0)
  1863. X        {
  1864. X      _cursvar.font = PDC_get_font();
  1865. X      _cursvar.scrnmode = new_mode;
  1866. X      LINES = PDC_get_rows();
  1867. X      COLS = PDC_get_columns();
  1868. X      return( OK );
  1869. X        }
  1870. X    else
  1871. X      return (ERR);
  1872. X#endif
  1873. X}
  1874. END_OF_FILE
  1875.   if test 1444 -ne `wc -c <'private/_setscrn.c'`; then
  1876.     echo shar: \"'private/_setscrn.c'\" unpacked with wrong size!
  1877.   fi
  1878.   # end of 'private/_setscrn.c'
  1879. fi
  1880. if test -f 'private/_splitpl.c' -a "${1}" != "-c" ; then 
  1881.   echo shar: Will not clobber existing file \"'private/_splitpl.c'\"
  1882. else
  1883.   echo shar: Extracting \"'private/_splitpl.c'\" \(1546 characters\)
  1884.   sed "s/^X//" >'private/_splitpl.c' <<'END_OF_FILE'
  1885. X#define    CURSES_LIBRARY    1
  1886. X#include <curses.h>
  1887. X
  1888. X#ifndef    NDEBUG
  1889. Xchar *rcsid__splitpl = "$Header: c:/curses/private/RCS/_splitpl.c%v 2.0 1992/11/15 03:24:41 MH Rel $";
  1890. X#endif
  1891. X
  1892. X
  1893. X
  1894. X#ifdef    FLEXOS
  1895. X/*man-start*********************************************************************
  1896. X
  1897. X  _flexos_split_plane()    - splits a char/attr plane into separate planes
  1898. X
  1899. X  PDCurses Description:
  1900. X     This is a private PDCurses function.
  1901. X
  1902. X     This routine is used only be the Flexos platform.
  1903. X
  1904. X     This routine will separate the character/attributes plane into
  1905. X     a separate character and attribute plane.
  1906. X
  1907. X  PDCurses Return Value:
  1908. X     This function returns OK upon success otherwise ERR is returned.
  1909. X
  1910. X  PDCurses Errors:
  1911. X     It is an error to pass a NULL WINDOW pointer.
  1912. X     It is also an error if the starting x or y coordinate exceeds the
  1913. X     passed window boundaries.
  1914. X
  1915. X  Portability:
  1916. X     PDCurses    int    _flexos_split_plane( WINDOW* w,
  1917. X                     char* chr, char* attr,
  1918. X                     int sy, int sx,
  1919. X                     int ey, int ex );
  1920. X
  1921. X**man-end**********************************************************************/
  1922. X
  1923. Xint    _flexos_split_plane(WINDOW* w,char* chr,char* attr,int sy,int sx,int ey,int ex)
  1924. X{
  1925. X    int    l;
  1926. X    int    c;
  1927. X
  1928. X    if (w == (WINDOW *)NULL)        return( ERR );
  1929. X    if (sy > w->_maxy)    return( ERR );
  1930. X    if (sx > w->_maxx)    return( ERR );
  1931. X    if (ey > w->_maxy)    ey = w->_maxy - 1;
  1932. X    if (ex > w->_maxx)    ex = w->_maxx - 1;
  1933. X
  1934. X    for (l = sy; l <= ey; l++)
  1935. X    {
  1936. X        for (c = sx; c <= ex; c++)
  1937. X        {
  1938. X            *chr  = (char)(w->_y[l][c] & CHR_MSK);
  1939. X            *attr = (char)(w->_y[l][c] & ATR_MSK) >> 8;
  1940. X            chr++;
  1941. X            attr++;
  1942. X        }
  1943. X    }
  1944. X    return( OK );
  1945. X}
  1946. X#endif
  1947. END_OF_FILE
  1948.   if test 1546 -ne `wc -c <'private/_splitpl.c'`; then
  1949.     echo shar: \"'private/_splitpl.c'\" unpacked with wrong size!
  1950.   fi
  1951.   # end of 'private/_splitpl.c'
  1952. fi
  1953. echo shar: End of archive 9 \(of 11\).
  1954. cp /dev/null ark9isdone
  1955. MISSING=""
  1956. for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
  1957.     if test ! -f ark${I}isdone ; then
  1958.     MISSING="${MISSING} ${I}"
  1959.     fi
  1960. done
  1961. if test "${MISSING}" = "" ; then
  1962.     echo You have unpacked all 11 archives.
  1963.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1964. else
  1965.     echo You still must unpack the following archives:
  1966.     echo "        " ${MISSING}
  1967. fi
  1968. exit 0
  1969. exit 0 # Just in case...
  1970.