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

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