home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Guide / c-cplusplus-interactive-guide.iso / c_ref / csource4 / 298_01 / curses.doc < prev    next >
Encoding:
Text File  |  1988-08-17  |  56.4 KB  |  1,473 lines

  1.  
  2.  
  3.    
  4.                        The PC Curses Library 
  5.  
  6.  
  7.  
  8.       (C) Copyright 1987,1988 Jeffrey S. Dean. All Rights Reserved. 
  9.  
  10.  
  11.                     PC CURSES LICENSE AGREEMENT      
  12.    
  13.    The PC Curses Library Package is a copyrighted software 
  14.    package that is being distributed as shareware.  It is NOT in 
  15.    the public domain. By using or distributing this package, you 
  16.    agree to the conditions presented below: 
  17.  
  18.    (1) You may use the PC Curses Library for your own personal 
  19.    use; if you find it useful, you are requested to pay a $20 
  20.    registration fee.  If you are using PC Curses in a 
  21.    commercial, professional, or governmental organization, you 
  22.    are granted a limited license, valid for thirty days, to use 
  23.    this package for evaluation purposes only; if you continue to 
  24.    use this package, you must pay the registration fee.  The 
  25.    registration fee entitles you to use the PC Curses library on 
  26.    one machine.  It also includes one free upgrade. 
  27.  
  28.    (2) Source code is available to registered users only.  
  29.    Source code is also copyrighted, and may NOT be freely copied 
  30.    or distributed.  The price of the source distribution is $20; 
  31.    in addition to the source modules, it include makefiles (as 
  32.    well as a version of the "make" program and other utilities). 
  33.    
  34.    (3) The PC Curses Library (except source) may be freely 
  35.    distributed and copied inside the U.S.; however, you may not 
  36.    charge anything for the distribution.  The distribution must 
  37.    include everything in the original distribution, including 
  38.    this agreement.  You may not distribute this system with any 
  39.    modifications (this includes documentation as well as 
  40.    programs); additions must be placed in separate files and 
  41.    must be clearly marked as such. 
  42.    
  43.    (4) If any part of the PC Curses Library is used in a 
  44.    program, system, or service that is distributed to machines 
  45.    other than the one originally licensed, there is a nominal 
  46.    fee (in addition to the registration fee) and a simple 
  47.    licensing agreement that must be completed.   This fee may be 
  48.    waived if the program or system is distributed as shareware 
  49.    or by a non-profit organization (but the licensing agreement 
  50.    must still be completed).  There are no royalties. 
  51.  
  52.  
  53.    (5) DISCLAIMER OF WARRANTY: THE PC CURSES PACKAGE IS SOLD "AS 
  54.    IS" AND WITHOUT ANY WARRANTIES, EXPRESS OR IMPLIED, AS TO 
  55.    PERFORMANCE OR MERCHANTABILITY.  BECAUSE OF THE DIVERSITY OF 
  56.    CONDITIONS UNDER WHICH THIS PACKAGE MAY BE USED, NO WARRANTY 
  57.    OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED.  THE USER IS 
  58.    ADVISED TO TEST THE PACKAGE THOROUGHLY BEFORE RELYING ON IT.  
  59.    THE USER MUST ASSUME FULL RISK AS TO THE RESULTS AND 
  60.    PERFORMANCE OF USING THE PACKAGE.  ANY LIABILITY OF THE 
  61.    AUTHOR OR DISTRIBUTOR WILL BE LIMITED EXCLUSIVELY TO PRODUCT 
  62.    REPLACEMENT.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 
  63.    DAMAGES ARISING FROM THE USE OR INABILITY TO USE THIS 
  64.    PACKAGE.       
  65.        
  66.  
  67.                          Ordering PC Curses 
  68.    
  69.    PC Curses complete evaluation system . . .  $5  
  70.    PC Curses registration . . . . . . . . . .  $20
  71.  
  72.    The following items are available only to registered users:
  73.  
  74.    PC Curses source code . . . . . . . . . . . $20
  75.    PC Curses redistribution license . . . . .  $20
  76.  
  77.    When ordering source code, please specify the compiler 
  78.    (Microsoft or Turbo) and version you are using. 
  79.  
  80.    All payments must be in U.S. dollars.  For orders outside the 
  81.    U.S., please add an extra $15 per order.  (The evaluation 
  82.    system is not available outside the U.S.) 
  83.  
  84.    Send orders and other correspondence to:
  85.    
  86.                Jeff Dean
  87.                710 Chimalus
  88.                Palo Alto, CA  94306 
  89.    
  90.     
  91.                          Table of Contents
  92.    
  93.    Introduction 
  94.    Programmers Notes 
  95.    Standard Curses Functions
  96.    Terminfo Curses Functions
  97.    Even Newer Curses Functions
  98.    Special PC Curses Functions
  99.    Special PC-Specific Functions
  100.    Tracing in PC Curses 
  101.    What's Different
  102.    Version History 
  103.     
  104.  
  105. INTRODUCTION 
  106.  
  107.  
  108.    PC Curses is a C Library designed to provide compatibility   
  109.    with the Unix curses package.  It was written for applications 
  110.    running on IBM PC compatible computers developed under 
  111.    Microsoft C or Turbo C. 
  112.  
  113.    The Unix curses package was originally developed at the 
  114.    University of California at Berkeley as a screen management 
  115.    and windowing package, providing various tools for creating 
  116.    and manipulating windows.  Its key strength is the ability to 
  117.    deal with many different types of terminals at any line speed 
  118.    in a semi-optimized fashion.  For many years, it was the only 
  119.    generally available package that provided windowing 
  120.    capabilities in the Unix environment. 
  121.    
  122.    PC Curses was produced to aid in porting programs from MS-DOS 
  123.    to Unix, though it is also useful in writing MS-DOS software 
  124.    that may need to be ported to Unix. The PC environment is 
  125.    drastically different from Unix, so while this package is 
  126.    meant to be functionally similar to the Unix one, there are a 
  127.    few small differences externally (but many differences 
  128.    internally). 
  129.    
  130.    This package is much simpler that the Unix version.  Because 
  131.    of the nature of the PC environment, there is no need for 
  132.    anything like cursor motion optimization.  Because of the 
  133.    high screen bandwidth, little effort is spent trying to 
  134.    optimize screen output.  Because the PC has features not 
  135.    always available in other environments, additional routines 
  136.    (not in the original curses package) are provided. 
  137.  
  138.    The PC Curses code was developed independently, without 
  139.    reference to the Unix source code.  This documentation is 
  140.    based on experience with the curses package, on Ken Arnold's 
  141.    paper "Screen Updating and Cursor Movement Optimization: A 
  142.    Library Package," and on the Unix System V curses 
  143.    documentation. 
  144.  
  145.    Arnold's paper (or the newer System V documentation) should 
  146.    be considered required reading in order to understand how 
  147.    this system works.  The documentation included here 
  148.    summarizes some of the relevant information, and points out 
  149.    differences between the Unix version and the PC version. 
  150.                 
  151.    Note that there are two major versions of curses.  The 
  152.    original, produced some time ago at UC Berkeley, used the 
  153.    termcap database.  More recently, the termcap (or termlib) 
  154.    database has been recast into the terminfo database, for 
  155.    efficiency and extensions.  A new version of curses was 
  156.    written to take advantage of this system.  PC Curses derives 
  157.    primarily from the earlier version, with some features of the 
  158.    later version added.  In this documentation, the newer 
  159.    version is referred to as "terminfo curses"; elsewhere, you 
  160.    may hear it referred to as "System V curses." 
  161.  
  162.    Please let us know what you think of this package; any 
  163.    feedback, positive or negative, is appreciated.  If you have 
  164.    any suggestions, problems, or code you would like to see 
  165.    included in the distribution, please contact us.  We are 
  166.    planning to continue to improve and expand this package,  
  167.    adding subroutines, utilities, and anything else that would 
  168.    prove generally useful to curses programmers. 
  169.  
  170.  
  171. PROGRAMMERS NOTES 
  172.  
  173.    The basic "unit" of manipulation in curses is a window.  
  174.    Windows are dynamically allocated structures, and are passed 
  175.    around by pointer. Windows represent a rectangular region on 
  176.    the terminal screen. 
  177.  
  178.    The windows are, in a sense, buffered.  There are a variety 
  179.    of operations for writing windows, but no changes visibly 
  180.    take place until a wrefresh() command is issued.  At this 
  181.    point, all the changes are written to the physical screen. 
  182.  
  183.    There are two special windows in the system, created on 
  184.    startup.  One is the current screen (curscr), and represents 
  185.    the information that is presently on the screen.  The other 
  186.    is the standard screen (stdscr), which is to windows what 
  187.    stdout is to buffered output.  It is a window that represents 
  188.    the whole screen, and when a refresh is done, the contents of 
  189.    this window will be written to the physical screen.  For 
  190.    simple applications, stdscr may be the only window that a 
  191.    programmer needs.
  192.  
  193.    For more information, refer to one of the standard Unix 
  194.    curses documents and/or the curses.h include file for the PC 
  195.    Curses package. 
  196.  
  197.  
  198. STANDARD CURSES FUNCTIONS 
  199.  
  200.    This section describes functions that are part of the 
  201.    original termcap curses package.  The functions preceded by 
  202.    'mv' are macros (except for mv*printw) that move to the 
  203.    specified location first, and if that move is legal (see 
  204.    move()), then the function is performed.  The following 
  205.    definitions are assumed: 
  206.  
  207.            WINDOW *win; 
  208.            int y,x; 
  209.            CHTYPE ch; 
  210.  
  211. ------------------------------
  212.  addch(ch) 
  213.  waddch(win,ch) 
  214.  mvaddch(y,x,ch) 
  215.  mvwaddch(win,y,x,ch) 
  216. ------------------------------
  217.     
  218.    Adds the character to the screen at the current position, 
  219.    replacing whatever was there.  The current position is moved 
  220.    to the position after the character; returns ERR if the 
  221.    cursor cannot be moved to that position (e.g., at the end of 
  222.    a window and scrolling is not allowed). 
  223.  
  224.    Several characters are handled specially: a tab is expanded, 
  225.    assuming tabstops every 8 characters from the window's left 
  226.    edge; a newline causes the rest of the line to be cleared, 
  227.    and the current position to be moved down one line (and over 
  228.    to the left edge if newline translation (see nl and nonl) is 
  229.    on); a return causes the current position to be moved back to 
  230.    the left edge; a backspace causes the current position to be 
  231.    moved left one character (unless at the left edge). 
  232.  
  233.    Adding a character to a window will cause the cursor to move 
  234.    down to the next line under one of two conditions: if the 
  235.    character is the newline character, or if there is not enough 
  236.    room on the line for the character (wrap).   If scrolling is 
  237.    enabled (see scrollok) and if adding the character would 
  238.    cause the cursor to move past the last line of the window (or 
  239.    past the the last line of the scrolling region -- see 
  240.    setscrreg), then the window will scroll.  The scrolling is 
  241.    done logically (on the window) as well as physically (on the 
  242.    screen).  This means that wrefresh will be called, resulting 
  243.    in a full screen update. 
  244.    
  245.    PC Curses only: No conversions are done on the characters 
  246.    other than those mentioned above.  Thus, control characters 
  247.    and characters out the Ascii range will be displayed as the 
  248.    appropriate graphics character. 
  249.    
  250.    Note: Adding the characters "\r\n" (return, newline) to the 
  251.    end of a line will clear the entire line, since the return 
  252.    moves to the beginning of the line and newline clears to the 
  253.    end of the line. 
  254.  
  255. ------------------------------
  256.  addstr(str) 
  257.  waddstr(win,str) 
  258.  mvaddstr(y,x,str) 
  259.  mvwaddstr(win,y,x,str) 
  260.     char *str; 
  261. ------------------------------
  262.  
  263.    Adds the string to the window at the current position, 
  264.    using waddch. 
  265.  
  266. ------------------------------
  267.  box(win,vert,hor) 
  268.     CHTYPE vert, hor; 
  269. ------------------------------
  270.  
  271.    Draws a box around the window, using 'vert' as the vertical 
  272.    line character and 'hor' as the horizontal line character.  
  273.    Note that the box is drawn INSIDE the window, which means 
  274.    that it can be overwritten, just like anything else inside 
  275.    the window.  Also note that the current attribute for the 
  276.    window has no effect on the box characters; if you want a box 
  277.    with attributes, they must be OR'ed with the box characters. 
  278.  
  279.    PC Curses only: curses.h defines four constants convenient for 
  280.    drawing boxes: S_HOR, S_VERT, D_HOR, D_VERT, representing the 
  281.    single and double line horizontal and vertical line-drawing 
  282.    characters.  The box routine will automatically figure out 
  283.    the right corner pieces for any combination of these 
  284.    characters; it also tries to "guess" the right attribute. 
  285.  
  286. ------------------------------
  287.  clear() 
  288.  wclear(win) 
  289. ------------------------------
  290.  
  291.    Equivalent to werase(win) followed by clearok(win). 
  292.  
  293.    PC Curses only: All routines that clear any part of the 
  294.    screen (e.g., clear, erase, deleteln, insertln, delch, 
  295.    clrtoeol, clrtobot, etc.) use the current attribute setting.  
  296.    This means that a window can be "filled in" with an attribute 
  297.    (e.g., reverse video, or some color if on a color monitor) 
  298.    and that attribute will be preserved.  There is no way to do 
  299.    this in the standard version of curses. 
  300.  
  301. ------------------------------
  302.  clearok(win,flag) 
  303.     int flag; 
  304. ------------------------------
  305.  
  306.    Sets/clears the "clear window" flag (works only on windows 
  307.    that cover the full screen).  When a (full screen) window is 
  308.    refreshed, if the flag is TRUE, the screen is cleared first, 
  309.    and then the window is redrawn.  This can be useful if the 
  310.    screen is trashed by another program. 
  311.    
  312.    If the flag is set to TRUE on curscr, then the next call to 
  313.    refresh (for any window) will cause the screen to be cleared 
  314.    before redrawing the specified window. 
  315.  
  316. ------------------------------
  317.  clrtobot() 
  318.  wclrtobot(win) 
  319. ------------------------------
  320.  
  321.    Clears the window from the current position to the end. 
  322.  
  323.    Note: This implementation leaves the current position 
  324.    unchanged; some implementations do not.  If compatibility is 
  325.    a concern, do not make any assumptions about the cursor 
  326.    position after the completion of this operation. 
  327.  
  328. ------------------------------
  329.  clrtoeol() 
  330.  wclrtoeol(win) 
  331. ------------------------------
  332.  
  333.    Clears the window from the current position to the end of the 
  334.    line. 
  335.  
  336. ------------------------------
  337.  crmode() 
  338.  nocrmode() 
  339.  cbreak() 
  340.  nocbreak() 
  341. ------------------------------
  342.  
  343.    Macros for setting/clearing tty cbreak mode. 
  344.  
  345.    Note: crmode() and nocrmode() are from termcap curses.  
  346.    cbreak() and nocbreak() are from terminfo curses.  There is 
  347.    no difference between these pairs, aside from name. 
  348.  
  349.    PC Curses only: A "read" done in cbreak mode is approximated 
  350.    with the MS-DOS "filtered" read, which reads one character 
  351.    and processes some control characters (such as <ctrl-C>).  
  352.    See getch(). 
  353.  
  354. ------------------------------
  355.  delch() 
  356.  wdelch(win) 
  357.  mvwdelch(win,y,x) 
  358. ------------------------------
  359.  
  360.    Deleted the character at the current position.  Everything to 
  361.    the right is moved over one position, and the rightmost 
  362.    column becomes blank. 
  363.  
  364. ------------------------------
  365.  deleteln() 
  366.  wdeleteln(win)  
  367. ------------------------------
  368.  
  369.    Deletes the current entire current line.  Everything below is 
  370.    scrolled up, and the last line of the window becomes blank.  
  371.    The current coordinates remain unchanged. 
  372.  
  373. ------------------------------
  374.  delwin(win)  
  375. ------------------------------
  376.  
  377.    Deletes the specified window, freeing up associated space in 
  378.    memory. Has no effect on the screen (i.e., it does not clear 
  379.    the window from the screen). 
  380.  
  381. ------------------------------
  382.  echo() 
  383.  noecho() 
  384. ------------------------------
  385.    
  386.    Macros for settting/clearing tty echo mode. 
  387.  
  388.    PC Curses only: A "read" in echo mode is approximated by 
  389.    using unechoed MS-DOS reads, and then echoing the character 
  390.    if echo mode is set.  Echoing is done using waddch(); if 
  391.    waddch() returns ERR, then the read will also return ERR.  
  392.    See getch(). 
  393.  
  394. ------------------------------
  395.  endwin() 
  396. ------------------------------
  397.    
  398.    The curses termination routine.  This routine should be 
  399.    called before exiting the program.  It can also be used
  400.    before a temporary exit, such as a shell escape; to
  401.    continue afterwards, invoke wrefresh() or doupdate().
  402.  
  403.    Note: The "temporary exit" capability is an unfortunate
  404.    change added in Sys V.  Older versions of Curses used
  405.    endwin() to free up windows (among other things), but this
  406.    is not possible with the new definition.  Currently, the
  407.    only way to free up space associated with a window is via
  408.    delwin().
  409.  
  410. ------------------------------
  411.  erase() 
  412.  werase(win)  
  413. ------------------------------
  414.  
  415.    Changes the contents of the specified window to all blanks.  
  416.    The current position is reset to the origin. 
  417.  
  418. ------------------------------
  419. int 
  420.  getch() 
  421.  wgetch(win) 
  422.  mvgetch(y,x) 
  423.  mvwgetch(win,y,x) 
  424. ------------------------------
  425.    
  426.    Input character from terminal.  The result depends on the 
  427.    "tty mode" (see raw(), crmod(), and echo() functions) and 
  428.    keypad translation (see the keypad() function). Normally, 
  429.    returns the character input.  If echo is set, writes the 
  430.    character in the specified window; if the character cannot be 
  431.    written (see waddch()), then ERR is returned.
  432.    
  433.    Note: These functions return ints (not chars). 
  434.  
  435.    Note: The C library also has a getch() function. These two 
  436.    functions are similar but not identical.  In particular, like 
  437.    all other curses routines, getch() will not work before 
  438.    initscr() is called.  When using the curses  library, you 
  439.    will get the curses version, not the library version. 
  440.  
  441.    PC Curses only: This routine attempts to emulate the Unix-
  442.    style input by using different MS-DOS input routines, 
  443.    depending on the tty mode. The default modes here may be non-
  444.    standard, so be sure to set the tty modes exactly as you 
  445.    would like them.
  446.    
  447. ------------------------------
  448.  getstr(buf) 
  449.  wgetstr(win,buf) 
  450.  mvgetstr(y,x,buf) 
  451.  mvwgetstr(win,y,x,buf) 
  452.     char *buf; 
  453. ------------------------------
  454.    
  455.    Gets a line from the terminal and places it in the argument, 
  456.    which is assumed to be large enough.  Works by repeatedly 
  457.    calling wgetch until an ERR or a newline is received; in the 
  458.    former case, ERR is returned; in the latter case, the newline 
  459.    is stripped off.  The erase character and the line kill 
  460.    character are handled, allowing basic line editing (see 
  461.    erasechar() and killchar()).
  462.    
  463.    Note: This function is generally used with echoing enabled. 
  464.                                              
  465. ------------------------------
  466.  gettmode() 
  467. ------------------------------
  468.  
  469.    PC Curses only: This function is a no-op. 
  470.  
  471. ------------------------------
  472.  getyx(win,y,x)  
  473. ------------------------------
  474.  
  475.    Sets (y, x) to the current coordinates.  This is a macro, so 
  476.    it is not necessary for the arguments to be pointers. 
  477.  
  478. ------------------------------
  479.  inch() 
  480.  winch(win) 
  481.  mvinch(y,x) 
  482.  mvwinch(win,y,x) 
  483. ------------------------------
  484.    
  485.    Returns the character at the current position. 
  486.  
  487.    Note: These functions are implemented according to the new 
  488.    (terminfo) version of curses; this means that they are 
  489.    somewhat incompatible with the old (termcap) version.  They 
  490.    return a character which is OR'ed with its attributes (the 
  491.    old versions return a character without its attributes).  The 
  492.    constants A_ATTRIBUTES and A_CHARTEXT can be AND'ed with the 
  493.    character to extract the component parts.  
  494.  
  495.    PC Curses only: For the convenience of termcap curses users, 
  496.    the macro wcinch() is defined to work like the old winch().  
  497.    The variant forms (cinch, mvcinch, and mvwcinch) are also 
  498.    defined. 
  499.  
  500. ------------------------------
  501.  initscr() 
  502. ------------------------------
  503.    
  504.    The curses initialization routine.  This routine must be 
  505.    called before any other routine in the curses package. 
  506.    
  507.    Note: initscr() returns stdscr.  NULL is returned on error, 
  508.    which generally means that there was not enough space (i.e., 
  509.    malloc failed). 
  510.    
  511.    IMPORTANT: The error return condition should always be 
  512.    checked.  Performing window operations after initscr fails is 
  513.    certain to cause problems. 
  514.  
  515. ------------------------------
  516.  insch(ch) 
  517.  winsch(win, ch) 
  518.  mvinsch(y,x,ch) 
  519. ------------------------------
  520.  
  521.    Inserts the character at the current position.  Remaining 
  522.    characters on the line are moved right one position.  The 
  523.    character at the rightmost edge of the window will be lost. 
  524.  
  525. ------------------------------
  526.  insertln() 
  527.  winsertln(win) 
  528. ------------------------------
  529.  
  530.    Inserts a blank line above the current line.  Everything 
  531.    below is scrolled down, and the last line of the window is 
  532.    lost.  The current coordinates remain unchanged. 
  533.    
  534. ------------------------------
  535.  leaveok(win,flag) 
  536.     int flag; 
  537. ------------------------------
  538.  
  539.    Sets the "leave cursor alone" flag.  The flag is meant to 
  540.    indicate whether the cursor is being used in a window. When 
  541.    FALSE (the default setting), the cursor will be moved to the 
  542.    current position whenever the window is refreshed (i.e., the 
  543.    cursor is being used).  When TRUE, the action of the cursor 
  544.    is, in general, unpredictable; in the PC Curses 
  545.    implementation, the result is that the cursor is turned off 
  546.    while inside the window. 
  547.    
  548. ------------------------------
  549.  longname() 
  550. ------------------------------
  551.    
  552.    PC Curses only: A dummy function, macro-defined to "ibm-pc". 
  553.  
  554. ------------------------------
  555.  mvcur(lasty, lastx, newy, newx) 
  556.     int lasty, lastx, newy, newx; 
  557. ------------------------------
  558.  
  559.    Moves the cursor from (lasty, lastx) to (newy, newx), 
  560.    bypassing wrefresh.  
  561.    
  562.    PC Curses only: The reason for requiring the present 
  563.    coordinates as well as the intended ones is to allow for 
  564.    cursor motion optimization. Since there is no need for this 
  565.    type of optimization in the PC environment, the first two 
  566.    coordinates are ignored. 
  567.  
  568. ------------------------------
  569.  mvwin(win,y,x)  
  570. ------------------------------
  571.  
  572.    Changes the location of the window so that the upper left 
  573.    hand corner is at the specified position.  If the window 
  574.    cannot be moved to that position, then the original position 
  575.    is left unchanged, and ERR is returned.
  576.    
  577.    Note: This routine does not remove the window from its 
  578.    current position on the screen, nor does it redisplay the 
  579.    window in the new position.  All it does is change the 
  580.    coordinates that are stored in the window structure. 
  581.    
  582. ------------------------------
  583. WINDOW *
  584.  newwin(lines,cols,begin_y,begin_x) 
  585.     int lines, cols, begin_y, begin_x; 
  586. ------------------------------
  587.  
  588.    Creates a new window, with the specified number of lines and 
  589.    columns, starting at the specified position.  If any of the 
  590.    parameters are zero, they are set to a default value: lines 
  591.    to the maximum number of lines, cols to the maximum number of 
  592.    cols, begin_y and begin_x to zero.  Thus, newwin(0, 0, 0, 0) 
  593.    will create a full-screen window. 
  594.    
  595.    PC Curses only: returns NULL if window cannot be allocated 
  596.    (out of space) or if the window will not fit on the screen.
  597.    
  598.    IMPORTANT: The error return condition should be checked. 
  599.    Performing window operations on a nonexistent window is 
  600.    certain to cause problems.
  601.  
  602. ------------------------------
  603.  nl() 
  604.  nonl() 
  605. ------------------------------
  606.    
  607.    Enable/disable newline translation.  On input, a carriage 
  608.    return is normally translated to a newline; on output, a 
  609.    newline is normally translated to a carriage return/linefeed 
  610.    sequence.  nonl() disables this translation. 
  611.  
  612.    PC Curses only: The setting of this translation flag has no 
  613.    effect on refresh optimization.  However, for greatest 
  614.    compatibility with Unix curses, nonl() is recommended. 
  615.  
  616. ------------------------------
  617.  overlay(from_win, to_win) 
  618.  overwrite(from_win, to_win) 
  619.     WINDOW *from_win, *to_win; 
  620. ------------------------------
  621.    
  622.    Overlay and overwrite copy the contents of one window to 
  623.    another.  The copy is started at (0,0) in both windows, and 
  624.    is independent of physical screen location.  The only 
  625.    difference between overlay and overwrite is that the former 
  626.    does not copy blanks while the latter does. 
  627.    
  628.    If the windows are of different sizes, the copying is limited 
  629.    to the size of the smaller window. 
  630.     
  631. ------------------------------
  632.  printw(fmt,arg1,arg2,...) 
  633.  wprintw(win,fmt,arg1,arg2,...) 
  634.  mvprintw(y,x,fmt,arg1,arg2,...) 
  635.  mvwprintw(win,y,x,fmt,arg1,arg2,...) 
  636.     char *fmt; 
  637. ------------------------------
  638.    
  639.    Perform printf-style output on a window.  Uses waddstr to 
  640.    write to the window and returns the result. 
  641.  
  642.    PC Curses only: The formatted string is temporarily stored in 
  643.    a local buffer, which is currently set to BUFSIZ (512) bytes.  
  644.    It is the caller's responsibility to make sure that no 
  645.    overflow occurs. 
  646.  
  647. ------------------------------
  648.  raw() 
  649.  noraw() 
  650. ------------------------------
  651.  
  652.    Macros for enabling/disabling tty raw mode. 
  653.    
  654.    PC Curses only: A "read" done in raw mode is approximated 
  655.    with the MS-DOS "unfiltered" read, which means that control 
  656.    characters (such as <ctrl-C>) are not processed.  See 
  657.    getch(). 
  658.  
  659. ------------------------------
  660.  refresh() 
  661.  wrefresh(win) 
  662. ------------------------------
  663.  
  664.    Screen updating in curses is done asychronously. Changes made 
  665.    to a window have no effect on the physical screen until a 
  666.    refresh function is called.  The refresh is optimized: only 
  667.    changed parts of a window are examined and compared to what 
  668.    is currently on the screen; the screen is written only when 
  669.    there is a discrepancy. 
  670.  
  671. ------------------------------
  672.  resetty() 
  673.  savetty() 
  674. ------------------------------
  675.  
  676.    Macros for restoring and saving current tty modes. 
  677.  
  678.    PC Curses only: These functions are currently no-ops. 
  679.  
  680. ------------------------------
  681.  scanw(fmt,arg1,arg2,...) 
  682.  wscanw(win,fmt,arg1,arg2,...) 
  683.  mvscanw(y,x,fmt,arg1,arg2,...) 
  684.  mvwscanw(win,y,x,fmt,arg1,arg2,...)  
  685.    char *fmt; 
  686. ------------------------------
  687.  
  688.    Performs scanf-style input through a window.  Uses wgetstr() 
  689.    to get input, then uses vsscanf() to process the input. 
  690.  
  691.    PC Curses only: The input string is temporarily stored in a 
  692.    local 128 byte buffer.  No overflow checking is done. 
  693.    
  694.    PC Curses only: These functions depend on vsscanf(), a 
  695.    standard C library routine.  At the current time, Microsoft C 
  696.    does not provide this routine. 
  697.    
  698. ------------------------------
  699.  scroll(win) 
  700. ------------------------------
  701.  
  702.    Scrolls the specified window up one line.  The scrolling is 
  703.    done both logically (in the window) and physically (on the 
  704.    screen). This routine in invoked internally by waddch() when 
  705.    trying to move down past the last line in a scrollable 
  706.    window. 
  707.  
  708.    Note: The termcap and terminfo definitions of this function 
  709.    appear somewhat different, so rely on the above definition. 
  710.    The original curses documentation states that this routine is 
  711.    not normally invoked by the user; this advice still appears 
  712.    reasonable.  The same effect can be achieved by using 
  713.    waddch() to add a newline while on the last line of a window. 
  714.    
  715.    Note: Scrolling is generally faster for windows that are full 
  716.    width and/or full length.  This is true of both PC and Unix 
  717.    implementations, although for different reasons. 
  718.     
  719. ------------------------------
  720.  scrollok(win,flag) 
  721.     int flag; 
  722. ------------------------------
  723.  
  724.    Sets the scroll flag for the specified window.  When adding a 
  725.    character to a window would cause that character to go off 
  726.    the bottom edge of the window, the window will be scrolled if 
  727.    the scroll flag is set to TRUE.  If the flag is set to FALSE 
  728.    (the default condition), the cursor remains on the last line. 
  729.  
  730. ------------------------------
  731.  setterm(name) 
  732. ------------------------------
  733.  
  734.    PC Curses only: This function is a no-op. 
  735.  
  736. ------------------------------
  737.  standend() 
  738.  wstandend(win) 
  739. ------------------------------
  740.  
  741.    Turns off all attributes for the specified window.  See the 
  742.    "attr" functions for more general versions of these routines. 
  743.  
  744. ------------------------------
  745.  standout() 
  746.  wstandout(win) 
  747. ------------------------------
  748.  
  749.    Sets standout mode, causing all subsequent characters added 
  750.    to the window to be highlighted (defined in curses.h to be 
  751.    inverse video mode).  Attributes "stay" with a character, 
  752.    through scrolling, insertion, deletion, etc.  See the "attr" 
  753.    functions for more general versions of these routines. 
  754.    
  755. ------------------------------
  756. WINDOW *
  757.  subwin(win,lines,cols,begin_y,begin_x) 
  758.     int lines, cols, begin_y, begin_x; 
  759. ------------------------------
  760.  
  761.    Creates a new window; the last four arguments are identical 
  762.    to those of newwin().  However, this new sub-window shares 
  763.    the internal character map with the window specified as the 
  764.    first argument.  Any changes made to the sub-window will 
  765.    affect the parent, and any changes to the parent in the 
  766.    shared region will affect the sub-window (it may be necessary 
  767.    to use touchwin() for the changes in one window to be seen in 
  768.    the other). 
  769.  
  770.    Note that begin_y and begin_x are relative to the whole 
  771.    screen, not to the specified window.  Also note that the 
  772.    parent window should not be deleted (with delwin()) if the 
  773.    sub-window is still to be used. 
  774.  
  775.    PC Curses only: Like newwin(), failure to create a new window 
  776.    will result in a NULL return value.  NULL is also returned if 
  777.    the last four arguments do not actually form a sub-window of 
  778.    the specified window. 
  779.    
  780. ------------------------------
  781.  touchwin(win) 
  782. ------------------------------
  783.  
  784.    Normal screen updating is optimized so that only changed 
  785.    regions are examined when updating.  touchwin() modifies a 
  786.    window so that on the next refresh, the entire window is 
  787.    examined.  This is useful when a window may have been 
  788.    overwritten (e.g., by another window).
  789.    
  790.    When working with overlapped windows, if a window does not 
  791.    appear correctly on the screen, touching and refreshing it 
  792.    may solve the problem. 
  793.     
  794. ------------------------------
  795.  tstp() 
  796. ------------------------------
  797.  
  798.    PC Curses only: This function is a no-op. 
  799.  
  800. ------------------------------
  801. char *
  802.  unctrl(ch) 
  803. ------------------------------
  804.  
  805.    Returns a string representation of a control character.  The 
  806.    string consists of a caret ("^") followed by the upper case 
  807.    representation of the control character. 
  808.  
  809.    PC Curses only:  [1] If the argument to unctrl is not a 
  810.    control character, then the result string will consist of the 
  811.    argument character (unchanged).  [2] The result string is a 
  812.    static buffer, and will be overwritten by subsequent calls. 
  813.    [3] The Delete character (Ascii 127, not the delete key) is 
  814.    considered to be a control character, and is mapped to "^?".  
  815.    [4] There is no <unctrl.h> include file. 
  816.  
  817.  
  818. TERMINFO CURSES FUNCTIONS 
  819.  
  820.    The original version of curses was written for use with the 
  821.    termcap database.  When the termcap database facility was 
  822.    rewritten to improve performance and extend capability, a new 
  823.    version of curses was written to accompany it.  This terminfo 
  824.    version of curses provides a number of new functions and 
  825.    changes (or refines) the semantics of some of the old 
  826.    functions.  The new functions currently supported are 
  827.    described below; a more complete implementation (with the 
  828.    exception of the multiple terminal capability) is planned. 
  829.    The functions that have been changed or refined are still 
  830.    listed in the previous section. 
  831.  
  832. ------------------------------
  833.  attrset(attrs) 
  834.  wattrset(win,attrs) 
  835.  attroff(attrs) 
  836.  wattroff(win, attrs) 
  837.  attron(attrs) 
  838.  wattron(win,attrs) 
  839.     int attrs; 
  840. ------------------------------
  841.  
  842.    These functions set the current attribute of the specified 
  843.    window. Attributes defined in the curses.h file are: 
  844.  
  845.         A_REVERSE       reverse video 
  846.         A_UNDERLINE     underlined text 
  847.         A_BOLD          bold 
  848.         A_BLINK         blinking mode 
  849.         A_STANDOUT      currently defined as A_REVERSE 
  850.         A_DIM           currently defined as A_NORMAL 
  851.  
  852.    These definitions are for a monochrome system.  Color is not 
  853.    part of the standard Unix curses package, but color attribute 
  854.    definitions for PC Curses can be found in the curses.h 
  855.    include file. 
  856.    
  857.    When a character is written to a window, it is written 
  858.    with the current set of attributes.  wattron and wattroff can 
  859.    be used to turn on and off attributes; attrset can be used to 
  860.    set the attributes to any desired state. 
  861.  
  862.    standout() is the same as attron(A_STANDOUT).  standend() is 
  863.    the same as attrset(A_NORMAL). 
  864.  
  865.    PC Curses only: [1] All the modes correspond to standard PC 
  866.    attributes, with the exception of zero (A_NONE), which PC 
  867.    Curses maps to mean "normal" mode (A_NORMAL).  [2] The 
  868.    current attributes are used when clearing any portion of a 
  869.    window.  [3] The functions attrget() and wattrget(win) have 
  870.    been added to provide a way to get the current window 
  871.    attributes. 
  872.  
  873. ------------------------------
  874.  beep() 
  875. ------------------------------
  876.  
  877.    Beeps. 
  878.  
  879. ------------------------------
  880.  doupdate() 
  881. ------------------------------
  882.    
  883.    Maps an internally maintained virtual screen onto the actual 
  884.    screen.  See the description of wnoutrefresh() below. 
  885.  
  886. ------------------------------
  887.  erasechar() 
  888. ------------------------------
  889.  
  890.    Returns the current erase character. 
  891.  
  892.    PC Curses only: The current version of this is macro-defined 
  893.    to be backspace.  The only PC Curses routine that uses this 
  894.    macro is getstr().  The value can be changed by redefining 
  895.    the macro in curses.h and recompiling (or avoiding) getstr(). 
  896.  
  897. ------------------------------
  898.  flash() 
  899. ------------------------------
  900.    
  901.    Flashes the screen. 
  902.  
  903. ------------------------------
  904.  flushinp()
  905. ------------------------------
  906.    
  907.    Flushes the input stream, throwing away any characters that 
  908.    have been typed but not yet read. 
  909.    
  910. ------------------------------
  911.  idlok(win,flag) 
  912.     int flag; 
  913. ------------------------------
  914.  
  915.    PC Curses only: This function is a no-op. 
  916.  
  917. ------------------------------
  918.  keypad(win,flag) 
  919.     int flag; 
  920. ------------------------------
  921.    
  922.    Sets/clears the keypad translation flag.  If the flag is set, 
  923.    getch() translates function keys (which may actually be more 
  924.    than one character) into predefined integer values (see 
  925.    below). 
  926.    
  927.    PC Curses only: When keypad translation is on, special keys 
  928.    that are in the list below are translated.  For handling of 
  929.    "Alt shifted" keys, see the discussion of meta().  
  930.    
  931.    The PC Curses implementation is different, and more reliable, 
  932.    than Unix curses. When a function key prefix character is 
  933.    received, Unix curses waits for up to one second for the next 
  934.    character in the function key sequence; if it does not 
  935.    receive the key, it returns with the prefix character.  As a 
  936.    result, keypad translation in the Unix environment may appear 
  937.    "jerky," and timing delays may even cause a function key to 
  938.    go unrecognized. In the PC environment, the prefix character 
  939.    is unique, and whenever it is seen, the rest of the function 
  940.    key sequence is already there.  This results in a much 
  941.    "smoother" implementation. 
  942.  
  943.    Translation values: 
  944.  
  945.            KEY_BREAK    0x101            -- unused in PC Curses 
  946.            KEY_DOWN     0x102            -- DOWN ARROW 
  947.            KEY_UP       0x103            -- UP ARROW 
  948.            KEY_LEFT     0x104            -- LEFT ARROW 
  949.            KEY_RIGHT    0x105            -- RIGHT ARROW 
  950.            KEY_HOME     0x106            -- HOME KEY 
  951.            KEY_F0       0x108            -- dummy value 
  952.            KEY_F(x)     (KEY_F0+(x))     -- FUNCTION KEYS 
  953.            KEY_DL       0x148            -- unused in PC Curses 
  954.            KEY_IL       0x149            -- unused in PC Curses 
  955.            KEY_DC       0x14a            -- DELETE KEY 
  956.            KEY_IC       0x14b            -- INSERT KEY 
  957.            KEY_EIC      0x14c            -- unused in PC Curses 
  958.            KEY_CLEAR    0x14d            -- unused in PC Curses 
  959.            KEY_EOS      0x14e            -- unused in PC Curses 
  960.            KEY_EOL      0x14f            -- unused in PC Curses 
  961.            KEY_SF       0x150            -- unused in PC Curses 
  962.            KEY_SR       0x151            -- unused in PC Curses 
  963.            KEY_NPAGE    0x152            -- PAGE DOWN KEY 
  964.            KEY_PPAGE    0x153            -- PAGE UP KEY 
  965.            KEY_STAB     0x154            -- unused in PC Curses 
  966.            KEY_CTAB     0x155            -- unused in PC Curses 
  967.            KEY_CATAB    0x156            -- unused in PC Curses 
  968.            KEY_ENTER    0x157            -- unused in PC Curses 
  969.            KEY_SRESET   0x158            -- unused in PC Curses 
  970.            KEY_RESET    0x159            -- unused in PC Curses 
  971.            KEY_PRINT    0x15a            -- unused in PC Curses 
  972.            KEY_LL       0x15b
  973.  
  974.    PC Curses only: The following definitions have been added for 
  975.    the PC environment:
  976.  
  977.            KEY_END      KEY_LL           -- END KEY
  978.  
  979.            KEY_sF(x)    (KEY_F(10)+x)    -- SHIFTED FUNCTION KEYS 
  980.            KEY_cF(x)    (KEY_SF(10)+x)   -- CONTROL FUNCTION KEYS 
  981.            KEY_aF(x)    (KEY_CF(10)+x)   -- ALT FUNCTION KEYS 
  982.  
  983.            KEY_cNPAGE   0x180            -- CTRL-PGDN
  984.            KEY_cPPAGE   0x181            -- CTRL-PGUP
  985.            KEY_cHOME    0x182            -- CTRL-HOME
  986.            KEY_cEND     0x183            -- CTRL-END
  987.            KEY_cLEFT    0x184            -- CTRL-LEFTARROW
  988.            KEY_cRIGHT   0x185            -- CTRL-RIGHTARROW
  989.            KEY_cPRTSC   0x186            -- CTRL-PRTSC
  990.            KEY_BTAB     0x187            -- SHIFTED (REVERSE) TAB
  991.  
  992.    Any PC function keys which are not defined above will
  993.    return the appropriate two character extended code instead.
  994.  
  995. ------------------------------
  996.  killchar() 
  997. ------------------------------
  998.  
  999.    Returns the current line kill character. 
  1000.  
  1001.    PC Curses only: The current version of this is macro-defined 
  1002.    to be Control-U.  The only PC Curses routine that uses this 
  1003.    macro is getstr().  The value can be changed by redefining 
  1004.    the macro in curses.h and recompiling (or avoiding) getstr(). 
  1005.  
  1006. ------------------------------
  1007.  meta(win, flag) 
  1008.     int flag 
  1009. ------------------------------
  1010.  
  1011.    Provides eight bit input through the specified window. 
  1012.  
  1013.    PC Curses only: When input is done through a window with meta 
  1014.    mode on, the 'Alt' key is treated like a meta key, and so 
  1015.    extended character codes involving the Alt key get turned 
  1016.    into the appropriate characters with the meta (parity) bit 
  1017.    set.  [Note that the Alt key cannot be used in combination 
  1018.    with the control key.]  When meta mode is off, the extended 
  1019.    character codes get passed through untranslated. 
  1020.  
  1021.    Note: Unlike Unix curses, PC Curses always provides 8 bit 
  1022.    character input, regardless of meta().
  1023.  
  1024. ------------------------------
  1025. WINDOW *
  1026.  newpad(lines,cols) 
  1027.     int lines, cols;
  1028. ------------------------------
  1029.    
  1030.    A pad is similar to a window, with two differences.  First, a 
  1031.    pad may be of any size; it is not bounded by the size of the 
  1032.    screen.  Second, any part of the pad may be displayed on any 
  1033.    part of the screen; the origin is not specified when the pad 
  1034.    is created. 
  1035.    
  1036.    The structure of a pad is identical to the structure of a 
  1037.    window.  The two may be used interchangeably, except when 
  1038.    refreshing.  Since there is no fixed relationship between the 
  1039.    pad and the screen, the relationship must be specified when 
  1040.    refreshing.  This is done with the special refresh functions 
  1041.    prefresh() and pnoutrefresh(); wrefresh() or wnoutrefresh() 
  1042.    should not be called with a pad as an argument. 
  1043.    
  1044.    All of the other standard curses functions can be applied to 
  1045.    pads.  The only difference is that certain functions which 
  1046.    automatically refresh a window (e.g., getch, addch) will not 
  1047.    refresh the pad.
  1048.    
  1049.    PC Curses only: Returns if NULL pad cannot be allocated. 
  1050.     
  1051. ------------------------------
  1052.  nodelay(win, flag) 
  1053.     int flag; 
  1054. ------------------------------
  1055.  
  1056.    Sets/clears nodelay mode.  When nodelay mode is not set, 
  1057.    getch() will not return until a character has been input.  
  1058.    When nodelay mode is set, getch() will always return 
  1059.    immediately.  If there was input present, it will return the 
  1060.    character; otherwise, it will return -1.
  1061.  
  1062. ------------------------------
  1063.  pnoutrefresh(pad, pminy, pminx, sminy, sminx, smaxy, smaxx) 
  1064.  prefresh(    pad, pminy, pminx, sminy, sminx, smaxy, smaxx) 
  1065.     WINDOW *pad; int pminy, pminx, sminy, sminx, smaxy, smaxx; 
  1066. ------------------------------
  1067.    
  1068.    Refreshes a pad (corresponds to wnoutrefresh or wrefresh for 
  1069.    a window).  A rectangular area of the pad, starting with the 
  1070.    upper left corner specified by (pminy,pminx) is mapped to a 
  1071.    rectangular area on the screen, specified by the upper left 
  1072.    corner (sminy,sminx) and the lower right corner 
  1073.    (smaxy,smaxx).  The lower right corner is implicit. 
  1074.    
  1075.    See newpad() for a description of pads. 
  1076.  
  1077.    PC Curses only: Returns ERR on failure.  Failure occurs if 
  1078.    the argument is not a pad, or if either of the rectangular 
  1079.    areas exceeds the bounds of the associated object.
  1080.    
  1081. ------------------------------
  1082.  setscrreg(top,bot) 
  1083.  wsetscrreg(win,top,bot) 
  1084.     int top, bot; 
  1085. ------------------------------
  1086.    
  1087.    Defines a scrolling region inside a window.  The top line of 
  1088.    the scrolling region is set to "top" and the bottom line is 
  1089.    set to "bot".  These values are relative to the window.  If 
  1090.    scrolling for the window is enabled, the window will be 
  1091.    scrolled when adding a character would cause the cursor to 
  1092.    move past the bottom line of the region.  
  1093.    
  1094.    Scrolling occurs when adding a character to the last line of 
  1095.    a region, and when that character is a newline, or that 
  1096.    character would go past the end of the line.  This means that 
  1097.    the only routine which scrolls the screen is waddch(), or any 
  1098.    other routine that calls it (waddstr(), wgetch(), etc.). 
  1099.  
  1100.    A window with no scrolling region is equivalent to a window 
  1101.    whose scrolling region is the entire window.  Thus, scrolling 
  1102.    regions allow the creation of a window-like region within a 
  1103.    window.  
  1104.    
  1105.    PC Curses only: Returns ERR if the specified scrolling region 
  1106.    is out of range.  The scrolling region can be disabled by 
  1107.    setting both top and bottom values to zero. 
  1108.  
  1109. ------------------------------
  1110.  wnoutrefresh(win) 
  1111. ------------------------------
  1112.       
  1113.    The pair of functions (wnoutrefresh, doupdate) provide 
  1114.    similar  functionality to the single function wrefresh().  
  1115.    Wnoutrefresh() writes the specified argument onto an 
  1116.    internally maintained virtual window, representing what 
  1117.    should be on the screen.  Unlike wrefresh(), nothing is 
  1118.    actually written on the screen.  Doupdate() does the actual 
  1119.    update, making the screen look like the virtual screen. 
  1120.    
  1121.    These functions are most useful when updating several 
  1122.    (possibly overlapping) windows.  With wrefresh(), some 
  1123.    unnecessary drawing might be done in this case.  By calling 
  1124.    wnoutrefresh() for each window, then doupdate() at the end, 
  1125.    redundant screen updates would be eliminated.
  1126.    
  1127.    PC Curses only: Wrefresh() is equivalent to wnoutrefresh() 
  1128.    followed by doupdate().  For efficiency reasons, wrefresh has 
  1129.    not been written exactly this way (although it acts exactly 
  1130.    like it was implemented this way).  Unless the power of 
  1131.    wnoutrefresh is needed, wrefresh is a better choice.  
  1132.  
  1133.  
  1134. EVEN NEWER CURSES FUNCTIONS 
  1135.  
  1136.    The curses package has continued to evolve.  The latest 
  1137.    version of AT&T Sytem V release 3 Unix added several new 
  1138.    capabilities to curses.  The newer capabilities supported by 
  1139.    PC Curses are described below.  Also, see the curses.h 
  1140.    include file for the line graphics characters now supported 
  1141.    by System V.3. 
  1142.    
  1143. ------------------------------
  1144.  copywin(swin,dwin,sminy,sminx,dminy,dminx,dmaxy,dmaxx,overlay) 
  1145.     WINDOW *swin,dwin; 
  1146.     int sminy, sminx, dminy, dminx, dmaxy, dmaxx, overlay; 
  1147. ------------------------------
  1148.  
  1149.    Copies a rectangular region from the source window (swin) to 
  1150.    the destination window (dwin).  The starting point in the 
  1151.    source window is specified by (sminy,sminx).  The data is 
  1152.    copied to the region in the destination window specified by 
  1153.    the upper left corner (dminy,dminx) and the lower right 
  1154.    corner (dmaxy,dmaxx).  If overlay is non-zero, copying is 
  1155.    done only to character positions that are blank. 
  1156.  
  1157.    PC Curses only: In the current implementation, overlay() and 
  1158.    overwrite() are macros which invoke copywin(). 
  1159.  
  1160.    Note: copywin() is a quick and convenient way of saving the 
  1161.    contents of a window (or part of a window) in another window. 
  1162.    
  1163. ------------------------------
  1164.  curs_set(mode) 
  1165.    int mode; 
  1166. ------------------------------
  1167.  
  1168.    Low level curses function, not normally used directly.  Sets 
  1169.    the cursor, depending on the mode argument.  Currently, only 
  1170.    modes 0 (invisible) and 1 (visible) are supported.  This 
  1171.    routine is used internally by the screen update routines, 
  1172.    which look at the leaveok() flag to determine if the cursor 
  1173.    should be made invisible. 
  1174.    
  1175. ------------------------------
  1176.  getbegyx(win,y,x) 
  1177.  getmaxyx(win,y,x) 
  1178. ------------------------------
  1179.  
  1180.    Macros similar to getyx().  getbegyx() gets the beginning 
  1181.    coordinates of the window (corresponding to the last two 
  1182.    parameters passed to newwin).  getmaxyx() gets the size 
  1183.    parameters of the window (corresponding to the first two 
  1184.    parameters passed to newwin). 
  1185.  
  1186. ------------------------------
  1187.  vwprintw(win,fmt,ap) 
  1188.  vwscanw(win,fmt,ap) 
  1189.    char *fmt; 
  1190.    va_alist ap;     
  1191. ------------------------------
  1192.  
  1193.    vwprintw() is the varargs (variable argument) version of 
  1194.    wprintw().  wscanw() is the varargs version of wscanw().  See 
  1195.    the Unix (or PC Compiler) manual section for more information 
  1196.    on varargs. 
  1197.  
  1198.  
  1199.  
  1200. SPECIAL PC CURSES FUNCTIONS 
  1201.    
  1202.    The following functions are additions to the normal curses 
  1203.    package. They are provided for programming convenience.  
  1204.    These functions are coded on top of curses and are designed 
  1205.    to be source-code compatible with Unix curses.    
  1206.    
  1207.    These routines are experimental, and subject to change. 
  1208.  
  1209. ------------------------------
  1210.  drawbox(win, vert, hor, begin_y, begin_x, end_y, end_x) 
  1211.     CHTYPE vert, hor; int begin_y, begin_x, end_y, end_x; 
  1212. ------------------------------
  1213.    
  1214.    Generalized version of box().  Draws a box anywhere in the 
  1215.    specified window.  The box is specified by the "begin" and 
  1216.    "end" coordinates.  If both coordinates specify the same 
  1217.    point, or if the coordinates are out of range, nothing is 
  1218.    drawn.  See box() for a further discussion of how boxes are 
  1219.    drawn. 
  1220.  
  1221.            box(win, vert, hor) is equivalent to 
  1222.            drawbox(win, vert, hor, 0, 0, 0, 0) 
  1223.  
  1224. ------------------------------
  1225. WINDOW *
  1226.  shadowwin(win, shadow) 
  1227.     WINDOW *win,*shadow;   
  1228. ------------------------------
  1229.  
  1230.    Creates a "shadow" of a window.  A window's shadow is the 
  1231.    part of the current screen that is replaced when the window 
  1232.    is displayed.  The concept of shadows is useful when dealing 
  1233.    with pop-up windows, which need to appear and disappear 
  1234.    without permanently disturbing what is on the screen. 
  1235.    
  1236.    The first argument is the window whose shadow is to be taken.  
  1237.    The second argument is the shadow window, which will hold the 
  1238.    shadow.  If the second argument is NULL, a new window is 
  1239.    allocated for the shadow.  The routine returns the shadow 
  1240.    window, or NULL on error.  Possible errors are inability to 
  1241.    allocate a window, or if the window and its shadow are not 
  1242.    the same size. 
  1243.  
  1244.    A shadow is no different than any other window.  All the 
  1245.    standard routines for dealing with windows can be applied, 
  1246.    though generally only a small number of routines are really 
  1247.    appropriate. 
  1248.  
  1249.    To pop-up a window, save its shadow with this function before 
  1250.    displaying the pop-up window on the screen (unless this is 
  1251.    the first time the pop-up is displayed, it will probably be 
  1252.    necessary to invoke touchwin on the pop-up).  To remove the 
  1253.    pop-up window, redisplay the shadow with wrefresh(), thereby 
  1254.    restoring the previous contents of the screen. 
  1255.  
  1256. SPECIAL PC-SPECIFIC FUNCTIONS
  1257.  
  1258.    The following functions are PC specific functions, and have 
  1259.    may have no meaning on other systems. 
  1260.  
  1261. ------------------------------
  1262.  pc_uptype(flag) 
  1263.     int flag; 
  1264. ------------------------------
  1265.  
  1266.    Sets the screen update method.  Legal values for "flag" are 
  1267.    T_BIOS for bios updates, and T_DIRECT for direct video memory 
  1268.    updated.  Note that in either case, any screen driver is 
  1269.    bypassed; thus, an ansi screen driver (e.g., ANSI.SYS) is not 
  1270.    required for applications written with this library. 
  1271.    
  1272.    The default method is T_BIOS updating, which is compatible 
  1273.    across a much wider range of machines.  It also reduces or 
  1274.    eliminates flicker on certain types of monitors.  However, it 
  1275.    is significantly slower than direct video memory updates.  
  1276.    Setting the update method to T_DIRECT forces direct updates. 
  1277.      
  1278.    pc_uptype() attempts to automatically figure out the address 
  1279.    of video memory.  The current algorithm for this is 
  1280.    experimental.  To provide a backup in case of failure, 
  1281.    pc_uptype() can be called with flag set to the segment 
  1282.    address of video memory.  This feature may go away in the 
  1283.    future. 
  1284.  
  1285.    This function is experimental, and is subject to change. 
  1286.  
  1287. TRACING IN PC CURSES 
  1288.    
  1289.    PC Curses has a built-in tracing facility.  The libraries 
  1290.    "sdcurses" and "ldcurses" are the debugging/tracing versions 
  1291.    of the curses, corresponding to the standard libraries 
  1292.    "scurses" and "lcurses". 
  1293.  
  1294.    The tracing facility records most function calls and 
  1295.    parameters in a log file.  Since high frequency functions, 
  1296.    such as waddch() and wmove() are logged, tracing tends to 
  1297.    slow down things considerably.  It also causes the log to 
  1298.    grow very rapidly.  To prevent the log file from growing too 
  1299.    large, it is cleared out each time the program is run. 
  1300.    
  1301.    Why is tracing useful?  Tracing is a simple way of seeing 
  1302.    what your program is doing.  It is easy to use and does not 
  1303.    require the source code to be available.  Tracing is most 
  1304.    commonly used to track down program bugs.  It is also useful 
  1305.    for analyzing performance, since it provides a picture of 
  1306.    which routines are invoked (and some idea of what they are 
  1307.    doing). 
  1308.  
  1309.    To create a traced version of your program, link with one of 
  1310.    the tracing libraries instead of the regular curses 
  1311.    libraries.  To start tracing, create a file named "trace.log" 
  1312.    in the directory in which the program runs.  When you exit 
  1313.    your program, the output will be in trace.log.  Note that the 
  1314.    log file is closed by a call to endwin(); if the call to 
  1315.    endwin() is omitted, the log file may be truncated.
  1316.    
  1317.    In looking at trace.log, pay special attention to messages 
  1318.    flagged by two exclamation marks "!!".  These indicate an 
  1319.    error condition (note that not all error conditions are 
  1320.    fatal). 
  1321.  
  1322.    For finer control of tracing, the functions traceon() and 
  1323.    traceoff() can be used.  The "trace.log" file must still be 
  1324.    set up as described above (if it does not exist, these 
  1325.    functions will have no effect).  Since tracing can be quite 
  1326.    slow, judicious use of these functions will result in 
  1327.    considerable speedup as well as a much smaller trace.log 
  1328.    file. 
  1329.  
  1330.    While most versions of curses provide tracing facilities, 
  1331.    they all differ in implementation.  This description of 
  1332.    tracing should be considered specific to PC Curses. 
  1333.  
  1334.    
  1335. ------------------------------
  1336.  traceon() 
  1337.  traceoff() 
  1338. ------------------------------
  1339.    
  1340.    Turns tracing on and off.  Tracing is initialized by 
  1341.    initscr().  The file "trace.log" must exist in the starting 
  1342.    directory when initscr() is called; if not, these functions 
  1343.    have no effect.  These functions also have no effect before 
  1344.    initscr() is called.
  1345.    
  1346.    When tracing is initialized, a warning message is printed out 
  1347.    on the screen, to warn that things may be very slow. 
  1348.  
  1349. ------------------------------
  1350.  traceclose() 
  1351. ------------------------------
  1352.    
  1353.    Closes the trace log file.  This forces any output that might 
  1354.    be buffered out to the log file.  This routine is normally 
  1355.    called by endwin().  Subsequent tracing will cause the file 
  1356.    to be reopened automatically. 
  1357.    
  1358. ------------------------------
  1359.  tracedump(win, flag) 
  1360.     int flag; 
  1361. ------------------------------
  1362.    
  1363.    Dumps the window to the trace log file.  If flag is 0, only 
  1364.    the window parameters are dumped; if flag is non-zero, the 
  1365.    entire character map of the window is also dumped.
  1366.  
  1367. ------------------------------
  1368.  traceprint(fmt,arg1,arg2,...) 
  1369.     char *fmt; 
  1370. ------------------------------
  1371.    
  1372.    Performs printf-style output to the trace log file.  This is 
  1373.    the routine that is used internally to log all function 
  1374.    calls.  It can be used to log your own information in the 
  1375.    trace log file. 
  1376.  
  1377.  
  1378.    WHAT'S DIFFERENT? 
  1379.  
  1380.    The current version of PC Curses contains most of the 
  1381.    functions from the Unix termcap and terminfo versions of 
  1382.    curses.  There are two groups of functions that are not 
  1383.    included: 
  1384.    
  1385.        multiple terminal functions - will not be supported. 
  1386.    
  1387.        terminfo level functions - unlikely to be supported 
  1388.    
  1389.  
  1390. VERSION HISTORY 
  1391.  
  1392.    The important changes between versions of PC Curses are 
  1393.    described below; there may be other fixes, enhancements, and 
  1394.    additions not mentioned. 
  1395.  
  1396.  
  1397.    Version 0.8 (9/88)
  1398.  
  1399.    - Microsoft C library built with version 5.0, using /Ox
  1400.    - Turbo C library built with version 1.5
  1401.    - added vwprintw() and vwscanw()
  1402.    - added wscanw() and related functions (Turbo C only)
  1403.    - added copywin()
  1404.    - added getbegyx() and getmaxyx() macros
  1405.    - added support for medium model in low.asm
  1406.    - added the "ACS_" line graphics definitions to curses.h
  1407.    - changed all void functions to return OK
  1408.    - replaced definition KEY_sTAB with KEY_BTAB
  1409.    - fixed problem caused when using nodelay() without keypad()
  1410.    - fixed problem in getstr() caused when deleting characters
  1411.    - fixed problem with missing screen update after clearok()
  1412.    - fixed pad functions to properly check screen size
  1413.    - fixed problem which allowed addch() to move past last column
  1414.  
  1415.    Version 0.7 (9/87)
  1416.  
  1417.    - added support for Turbo C
  1418.    - added function prototypes to curses.h
  1419.    - fixed problem with incorrect calculation of subwindow offsets
  1420.    
  1421.    Version 0.6 (6/87)
  1422.  
  1423.    - fixed problem with subwindows
  1424.    - fixed problems that occurred only on some PCs:
  1425.        - stack overflow
  1426.        - disappearing screen after program termination
  1427.    - rewrote several low level functions in assembly
  1428.  
  1429.    Version 0.5 (5/87)
  1430.  
  1431.    - fixed incorrect handling of clearok()
  1432.    - defined A_CHARTEXT (instead of A_CHARSET)
  1433.    - changed initscr() to return stdscr
  1434.    
  1435.    Version 0.4 (3/87) 
  1436.  
  1437.    - Added pads.
  1438.    - Added tracing.
  1439.    - Added scrolling regions.
  1440.    - Added meta character translation (using the Alt key).
  1441.    - Added shadow windows for pop-up support.
  1442.    - Added #ifdef's to allow custom versions.
  1443.    - Added support for color attributes.
  1444.    - Fixed addch to physically scroll windows.
  1445.    - Fixed the case sensitivity problem in the assembly module.
  1446.    - Fixed problem with deallocation of scrolled windows.
  1447.    - Removed the PC-specific scrolling functions. 
  1448.  
  1449.    Version 0.3 (2/87)
  1450.  
  1451.    - Added terminfo-style screen updating (wnoutrefresh and doupdate).
  1452.    - Added unctrl() for handling control characters.
  1453.    - Fixed getstr to handle erase and kill characters.
  1454.  
  1455.    Version 0.2 (1/87)
  1456.  
  1457.    - Added leaveok(), so that cursor can be turned off.
  1458.    - Added sub-windows.
  1459.    - Modified screen clearing code to use current attribute.
  1460.  
  1461.    Version 0.1 (1/87)
  1462.  
  1463.    - Added unix.h for porting programs to Unix.
  1464.    - Added support for direct screen updates.
  1465.    - Added keypad() and function key recognition to wgetch().
  1466.    - Recoded critical routines in assembly.
  1467.    - Made internal names start with underscore (unless static).
  1468.  
  1469.    Version 0.0 (12/86)
  1470.  
  1471.    - First release of PC Curses.
  1472.  
  1473.