home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / CSCAP321.ZIP / READ.ME < prev    next >
Encoding:
Text File  |  1990-12-20  |  99.9 KB  |  2,616 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                              C-scape 3.2 read.me
  9.  
  10.         Copyright (c) 1990, Oakland Group, Inc.  All rights reserved.
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20. CONTENTS:
  21.  
  22. 1:  INTRODUCTION
  23.  
  24. 2:  EXAMPLE PROGRAMS
  25.     2.1: cscape
  26.     2.2: demofm
  27.     2.3: demomous
  28.     2.4: demofram
  29.     2.5: demoslug
  30.     2.6: demosled
  31.     2.7: demofsav
  32.     2.8: demoflod
  33.     2.9: demohelp
  34.     2.10: demotty
  35.     2.11: demomode
  36.     2.12: graphics demo programs
  37.     2.13: the C-scape demo
  38.  
  39. 3:  WHAT'S BEEN FIXED
  40.  
  41. 4:  WHAT'S NEW
  42.  
  43. 5:  WHAT'S IMPROVED IN THIS RELEASE
  44.  
  45. 6:  NEW FEATURES
  46.  
  47. 7:  UPGRADING YOUR CODE
  48.     7.1:  auxiliary functions
  49.     7.2:  kb_Idle
  50.     7.3:  ted_funcs
  51.     7.4:  num_fexit
  52.     7.5:  sled_Remap
  53.     7.6:  topping seds
  54.     7.7:  _arg macros
  55.  
  56. 8:  NEW SLED FUNCTIONS
  57.  
  58. 9:  NAMING SEDS
  59.  
  60. 10:  THE NEW FEXIT
  61.  
  62. 11:  USER-DEFINED SCANCODES
  63.  
  64. 12:  NEW BOB FEATURES
  65.     12.1:  Dependent bobs
  66.     12.2:  Independent bobs
  67.  
  68. 13:  NEW AUXILIARY FUNCTION INFORMATION
  69.  
  70. 14:  HIGHLIGHTING FIELD CHARACTERS
  71.  
  72. 15:  KB_IDLE
  73.     15.1:  Converting your old code
  74.  
  75. 16:  OAKLAND DEBUGGING AID
  76.  
  77. 17:  MEMORY USE AND THE SIZE OF EXECUTABLES
  78.  
  79. 18:  A FEW OAKLAND CODE CONVENTIONS
  80.     18.1:  OGLOBAL and OEXTERN
  81.     18.2:  static and OSTATIC
  82.     18.3:  FNULL
  83.  
  84. 19:  ERROR CODES
  85.  
  86. 20:  OAKLAND GROUP BBS
  87.  
  88. 21:  FORTHCOMING FROM OAKLAND
  89.  
  90. 22:  UPDATES TO THE MANUAL
  91.     22.1:  Updates To The 3.1 Manual
  92.     22.2:  Updates To The 3.0 Manual
  93.     22.3:  Updates To The 3.0 Manual Addendum
  94.  
  95. 23:  ERRATA FOR THE MANUAL
  96.     23.1:  Errata For The 3.1 Manual
  97.     23.2:  Errata For The 3.0 Manual
  98.     23.3:  Errata For The 3.0 Manual Addendum
  99.  
  100.  
  101.  
  102. 1:  INTRODUCTION
  103.  
  104.     Thank you for purchasing C-scape 3.2!
  105.  
  106.     This document is the READ.ME for C-scape.  It updates and supplements the
  107.     C-scape Manual and Function Reference.  This document contains information
  108.     essential to using C-scape.
  109.  
  110.     Please see your distribution media for INSTALL.TXT.  INSTALL.TXT describes
  111.     installation, compiling and linking for your particular operating system.
  112.  
  113.     For important information on using C-scape with graphics, consult the file
  114.     GRAPHICS.TXT on your distribution media (DOS version and Apollo UNIX
  115.     version, only).
  116.  
  117. 2:  EXAMPLE PROGRAMS
  118.  
  119.     The following programs are included on your distribution media.  They
  120.     demonstrate the use of various parts of C-scape.
  121.  
  122.     We hope that these programs will help you get to know C-scape better, that
  123.     you tinker with them, and that you will use them as a code source from
  124.     which you can cut and paste to your own C-scape application.
  125.  
  126.     Please refer to the installation document INSTALL.TXT to find out where
  127.     these programs reside on your particular distribution.  See that same
  128.     document for instructions on compilation and linking.
  129.  
  130. 2.1: cscape
  131.  
  132.     CSCAPE.C is a simple data entry screen.  It is the "hello, world" of
  133.     C-scape.
  134.  
  135. 2.2: demofm
  136.  
  137.     DEMOFM.C is a sample program that demonstrates one of the recommended ways
  138.     of handling a framer menuing system that is driven by both the mouse and
  139.     the keyboard.  It demonstrates the detection of mouse double-clicks and
  140.     button1-,  2-, or 3-down events.
  141.  
  142.     This example is one of the most important and powerful.  The control
  143.     construct illustrated is one that employs quick-keys and framer menuing
  144.     system selections to pass command message values to a controlling loop.
  145.     Look & Feel uses this same mechanism.
  146.  
  147. 2.3: demomous
  148.  
  149.     DEMOMOUS.C demonstrates the use of the mouse with C-scape.  If you have not
  150.     installed a mouse driver, DEMOMOUS displays a message to that effect.
  151.  
  152. 2.4: demofram
  153.  
  154.     DEMOFRAM.C demonstrates the framer menuing system.  Press any key to get
  155.     started.  Press Escape from the top menu to leave.  Press F1 to get help on
  156.     any item in the menu.  Makes use of the DEMOFRAM.HLP help file.
  157.  
  158. 2.5: demoslug
  159.  
  160.     DEMOSLUG.C demonstrates the slug menuing system.  A popup window asks you
  161.     if you wish to create a horizontal or vertical menuing system.  Press
  162.     Escape from the top-most menu to leave.
  163.  
  164. 2.6: demosled
  165.  
  166.     DEMOSLED.C demonstrates how to create a screen from several smaller
  167.     screens.  It includes a scrolling, resizing list (sled), a notepad text
  168.     editor (ted), and mouse support.  It stores and retrieves data from the
  169.     ASCII file DEMOSLED.DAT.  Press Escape to leave the program.
  170.  
  171. 2.7: demofsav
  172.  
  173.     DEMOFSAV.C demonstrates saving a screen to a screen file.  The screen
  174.     "test" is saved to a file called "test.lnf". Use DEMOFLOD to load the saved
  175.     screen file.
  176.  
  177. 2.8: demoflod
  178.  
  179.     DEMOFLOD.C demonstrates loading a screen from a screen file.   It loads the
  180.     "test" screen from the "test.lnf" screen file.  You must create this screen
  181.     file by running DEMOFSAV or with Look & Feel.
  182.  
  183. 2.9: demohelp
  184.  
  185.     DEMOHELP.C is data entry screen that uses the C-scape help system to
  186.     provide context sensitive help.  Press F1 to get help.  DEMOHELP.HLP is the
  187.     accompanying help text file.
  188.  
  189. 2.10: demotty
  190.  
  191.     DEMOTTY.C is an example of using a character map window to display text in
  192.     a TTY-like fashion.  Consult the comment preface to this program for
  193.     pertinent information about cmap windows.
  194.  
  195. 2.11: demomode
  196.  
  197.     DEMOMODE.C is a small utility program for determining and changing the
  198.     video mode on an IBM PC or compatible.  Compile and link DEMOMODE.C and
  199.     then type "demomode -h" on the command line for instructions.
  200.  
  201. 2.12: graphics demo programs
  202.  
  203.     These programs are DEMOGRAF.C, DEMODRAW.C, DEMOGRAB.C, DEMOCLOK.C,
  204.     DEMOSWAP.C, and DEMOPCX.C.  For more information on these programs, consult
  205.     the file GRAPHICS.TXT on your distribution media (DOS version and Apollo
  206.     UNIX version, only).
  207.  
  208. 2.13: the C-scape demo
  209.  
  210.     The C-scape demo program appears in the distribution separate from the
  211.     example programs.  It provides examples of various parts of the library,
  212.     including windowing, menuing, graphics, idle functions, and mouse support.
  213.  
  214. 3:  WHAT'S BEEN FIXED
  215.  
  216.      Please note that this is not a comprehensive list of the bugs we've
  217.      fixed.  It mentions the more salient fixes to 3.1 that appear in 3.2.
  218.  
  219.      -   sdouble_fexit now makes valid use of the scratchpad.
  220.  
  221.      -   sfloat_funcs now properly validates the value of data entries that
  222.          occur at the boundary of the validation range.
  223.  
  224.      -   double_funcs now employs the space key, the "e" key, and Backspace and
  225.          Delete in accordance with the Function Reference description.
  226.  
  227.      -   hex_funcs now have a calculator-style entry and employ the space key
  228.          to clear the field.
  229.  
  230.      -   long_funcs no longer truncate the entry after the first comma when
  231.          using the "," format command.
  232.  
  233.      -   The behavior of the numeric formatting has been changed in an UPWARD
  234.          INCOMPATIBLE manner.
  235.  
  236.          Fixed decimal formatting invoked through placing a digit 1-9 in a
  237.          field's format string has been rewritten.  Now, the position of an
  238.          existing decimal point is preserved and the number of digits to the
  239.          right of the decimal point is affected by the format string.  If there
  240.          are more digits to the right of the decimal point than are specified
  241.          in the format string, then the extra digits are used to round the last
  242.          specified digit and the extra digits are discarded.  If there are less
  243.          digits to the right of the decimal point, then the number is padded
  244.          with 0's to the specified number of digits.
  245.  
  246.      -   Attribute changes can now be effected on the trailing '\n' of a
  247.          menu_Printf statement.
  248.  
  249.      -   Problems with failing _fexits when scrolling with the mouse have been
  250.          remedied.
  251.  
  252.      -   You can now move from the last field of an embedded sed into the next
  253.          field in the parent sed when pressing ENTER without exiting the parent
  254.          sed.  The exception is if the embedded sed uses menu_funcs or
  255.          gmenu_funcs.  Selecting an item from an embedded menu exits the
  256.          nesting parent sed(s) so that the choice may come out of sed_Go.
  257.  
  258.      -   ted_LeftWord now works correctly.
  259.  
  260.      -   We fixed a bug in the sfile_ code that would render a screen in a file
  261.          unreadable if the screen contain over 1000 characters of text.  The
  262.          sfile_ code routines automatically repair previously damaged files.
  263.  
  264.      -   You can now call sed_Repaint to repaint a sled or to repaint a sed
  265.          that nests a sled.  You no longer need to additionally call
  266.          sled_Repaint.  This also solves the problem wherein an embedded sled
  267.          with space between the column fields would allow the parent sed to
  268.          bleed through when painted.
  269.  
  270.          Note that you must call sed_Repaint after you load a sled with
  271.          sled_SetColVar and before you call sed_Go.  If you do not do this, the
  272.          sled will appear to have trash in its fields until you enter the sled
  273.          and do something which scrolls the sled.  If you call sed_Repaint
  274.          before you _Go, things will be fine.
  275.  
  276.      -   tm_Now, tm_Copy and tm_Zero, routines in TMNOW.C, have been rewritten
  277.          and no longer refer to the globals tm_result and result.  This stops
  278.          them from generating undefined error variables when they are used
  279.          apart from the other Tm_ modules.
  280.  
  281.      -   Mouse handlers now return the mouse code MOU_NOFIELD when the mouse is
  282.          clicked over a sed but not in a field (as is documented in the
  283.          manual).
  284.  
  285.      -   Field formatting now occurs before field validation in field fexit
  286.          functions.
  287.  
  288.      -   The record position of the first active field is now correctly set for
  289.          the case in which you add fields to a sed that was opened with an
  290.          empty menu.
  291.  
  292.      -   The help system now strips the '\n' from border titles.
  293.  
  294.      -   Framers now use the help system in the manner described in the manual.
  295.  
  296.      -   We fixed the values of some pseudo-scancodes (like BOB_ codes, for
  297.          example) that conflicted with DOS keyboard scancodes.
  298.  
  299.      -   Video modes 0 and 1 now work on a CGA display.
  300.  
  301.      -   We have fixed problems with the handling of names for deleted fields.
  302.  
  303.      -   Black and white PCX files now load correctly on a multi-plane display.
  304.  
  305.      -   We have fixed some problems involving the painting of children and of
  306.          shadows; and with the color of the cursor in graphics mode.
  307.  
  308. 4:  WHAT'S NEW
  309.  
  310.     These are library features added to version 3.2 from 3.1:
  311.  
  312.      -   There are several new auxiliary messages.  See the section on NEW
  313.          AUXILIARY FUNCTION INFORMATION for a detailed discussion of this
  314.          topic.
  315.  
  316.      -   kb_Idle has been changed in an UPWARD INCOMPATIBLE manner.  See the
  317.          section on KB_IDLE for more information.
  318.  
  319.      -   Each menu of a slug menuing system now has sedmou_GreedyTrack as its
  320.          default mouse handler.  slug_fkey now has a check for MOU_CLICK.
  321.  
  322.      -   HELP_KEY is a new scancode we have defined for use on systems that
  323.          have a dedicated help key.  (FN1 still works to call the help system.)
  324.  
  325.      -   C-scape now supports the keys FN11 and FN12.
  326.  
  327.      -   C-scape's source code now uses ANSI-C style function declarations.
  328.          This makes it possible to use C-scape with new C and C++ compilers.
  329.          (For UNIX we have added a "de-ANSI-fy" option to our unarchiving
  330.          utility, which converts the source back to K&R style C.)
  331.  
  332.      -   menu_Printf now uses either varargs (older C) or stdargs (ANSI) to run
  333.          on platforms such as the DG Aviion, Sun 4, and other RISC systems that
  334.          do not use a stack-based parameter passing mechanism.
  335.  
  336.      -   The OS/2 version now supports the use of multiple threads.  Refer to
  337.          the OS/2 section of the DOS version of INSTALL.TXT.
  338.  
  339.      -   C-scape has a new border, bd_mouse2, which has the same functionality
  340.          as bd_mouse, along with a horizontal scroll bar.
  341.  
  342.      -   The ocountry_struct now contains two additional pieces of information,
  343.          both of which are strings that appear for end users.  The first is
  344.          ocountry.errmsg, which contains the error message that a field
  345.          function displays when it fails; by default, this string is "Invalid
  346.          Entry".  The second is ocountry.helpxrefmsg, which appears at the
  347.          bottom of cross-referenced help windows; by default, this is "Press
  348.          Esc to leave help, Backspace for previous help screen".
  349.  
  350.          You can change either of these by setting the structure member equal
  351.          to a new value.  For instance, to change the error message for San
  352.          Bernardino, placing the following piece of code into your application:
  353.  
  354.              ocountry.errmsg = "Sorry, dude, no way.";
  355.  
  356.  
  357.      -   The pop_ functions now use a new structure, popparms_struct (defined
  358.          in POPDECL.H).  This structure has four elements:
  359.  
  360.              int shadow;
  361.              byte shadowattr;
  362.              int height;
  363.              int width;
  364.  
  365.  
  366.          The shadow element is an int that declares the size of the popup's
  367.          shadow; shadowattr sets the color of the popup when a shadow is cast
  368.          on it; height and width set the default values for the popup windows.
  369.          The default shadow is 0 characters wide; its default shadow color is
  370.          0x08 (grey on black); its default height is 10; and its default width
  371.          is 20.
  372.  
  373.          You can change any of these values by setting the structure member
  374.          equal to a new value.  For instance, to change the default shadow size
  375.          of popups, place the following piece of code into your application:
  376.  
  377.              popparms.shadow = 1;   /* gives the popup a 1 char shadow */
  378.  
  379.  
  380.      -   You can now have a cursor in cmap window.  See DEMOTTY.C for more
  381.          information.
  382.  
  383.      -   The numeric field functions no longer call senter or sexit in the
  384.          fexit function.  This means that the value in the field is not written
  385.          out to the variable until sexit is called for all the fields as
  386.          control leaves the sed.  This allows you to use spc_Abort with numeric
  387.          field functions.  Note that this is an UPWARD INCOMPATIBILITY if your
  388.          code assumes that variables contain correct information as soon as
  389.          control leaves each field.  If you wish numeric field functions to
  390.          operate as they did in C-scape 3.1 (updating the field variable during
  391.          fexit), then define DOSEXIT and recompile FNHEX.C, FNSFLOAT.C, and
  392.          FNSTDVAL.C.
  393.  
  394.      -   win_Grab is a new function for use with PMAP windows.  It saves the
  395.          portion of the video display that corresponds to the window into the
  396.          window's PMAP.   See section 2.3 of GRAPHICS.TXT and refer to the
  397.          demograb.c example on your distribution media (DOS version and Apollo
  398.          UNIX version, only).
  399.  
  400.      -   You can now have multiple Display Managers and switch between graphics
  401.          and text modes.  See section 2.5 of GRAPHICS.TXT.  Also, refer to the
  402.          example demoswap.c that is provided on your distribution media (DOS
  403.          only).
  404.  
  405.      -   seds can now be named.  sed_SetName, sed_GetName, and sed_Find are new
  406.          functions.  See the section NAMING SEDS in this document.
  407.  
  408.      -   You can now highlight one of the first 16 characters of a field and
  409.          use that character for menu selection searches.  This involves several
  410.          new functions and a new menu_Printf command ("@fh").  See the section
  411.          HIGHLIGHTING FIELD CHARACTERS in this document.
  412.  
  413.      -   For increased flexibility, we have removed the sed_Top call in the
  414.          mouse handlers.  If you click on an occluded window (sed) it is not
  415.          brought automatically to the top.  If you wish to top the window (sed)
  416.          then attach the aux_Top auxiliary function to that sed or call sed_Top
  417.          in your own auxiliary function (when it receives the WINA_STARTGO
  418.          message).
  419.  
  420.      -   aux_Top is a library auxiliary function that tops a window when it
  421.          receives the WINA_STARTGO message.
  422.  
  423.      -   pop_Edit, pop_Menu, pop_Prompt, and pop_View are now mouse-sensitive.
  424.          Press the Escape key or click the mouse outside the popup to remove
  425.          the pop up.  The mouse handler is sedmou_GreedyTrack.  Any border
  426.          attached to these popups now has the BD_MOVE feature.  (Note that
  427.          pop_Message and pop_Text are not mouse-sensitive because these popups
  428.          are only painted to the display.  They have no fields to which to pass
  429.          control and so sed_Go is never called on them).
  430.  
  431.      -   bob_funcs now allow you to attach independent, as well as dependent,
  432.          bobs.  See the section on NEW BOB FEATURES of this document for
  433.          details.
  434.  
  435.      -   Independent bobs now move when their parents are moved.  See the
  436.          section on NEW BOB FEATURES for more information.
  437.  
  438.      -   The default row, column, height and width specifiers for the popups
  439.          have been fixed so that you do not get a little tiny sed.
  440.  
  441.      -   We have re-written the mouse handlers and restructured our Greedy
  442.          mechanism.
  443.  
  444.          NOTE:  If you have a screen that needs Greedy mouse action and that
  445.          screen has children (embedded screens) then the ultimate ancestor must
  446.          have the Greedy handler (sedmou_GreedyTrack or sedmou_GreedyClick) and
  447.          the children (however nested) must each have a non-Greedy handler
  448.          (sedmou_Track or sedmou_Click).
  449.  
  450.          The exception to this is slug_funcs.  Every slug screen gets a Greedy
  451.          handler.  slug_Open handles this automatically, but if you want to
  452.          create a slug yourself (by coding or in Look & Feel), make sure that
  453.          it all has a Greedy handler.
  454.  
  455.      -   The framer menuing system mouse handler, sedmou_Track, now operates in
  456.          click and drag mode; and is SAA compliant.
  457.  
  458.      -   We now have two new mouse handlers, winmou_GreedyTrack and
  459.          winmou_Track, which allow use of the mouse on windows other than seds,
  460.          such as pmap and cmap windows.  (winmou_GreedyTrack is a greedy mouse
  461.          handler for dialogue boxes.)  To attach either to a window, use the
  462.          new function win_SetMouse, which behaves identically to sed_SetMouse:
  463.  
  464.              win_SetMouse(win, winmou_Track);
  465.  
  466.          For more information on use of winmou_Track, see the file DEMOWRLD.C
  467.          in the C-scape demo program.
  468.  
  469. 5:  WHAT'S IMPROVED IN THIS RELEASE
  470.  
  471.     These are some of the changes in C-scape 3.2 that have made it more
  472.     efficient than 3.1:
  473.  
  474.      -   You can now call sed_Repaint on a sled.  It is no longer necessary to
  475.          explicitly call sled_Repaint on either a standalone sled or one
  476.          embedded in a sed.  When a sled in involved, sed_Repaint includes the
  477.          functionality that was previously only in sled_Repaint.
  478.  
  479.      -   Changing attributes in a menu_Printf now allocates a text block whose
  480.          size is tailored to fit the text to which the attribute pertains.  It
  481.          no longer allocates the full default minimum block size if it does not
  482.          need to.
  483.  
  484.      -   ted_funcs no longer use the sed's generic data pointer as a pointer to
  485.          the cut buffer.  They now use the field's second data pointer.  Note:
  486.          this is an UPWARD INCOMPATIBILITY.
  487.  
  488.      -   The default minimum size of a text block in the text buffer has been
  489.          reduced from 200 bytes to 22 bytes.  The growth strategy for text
  490.          blocks has been changed to be more efficient.
  491.  
  492.      -   The built-in mouse handler for the framer menuing system,
  493.          sedmou_Framer, is now SAA compliant.
  494.  
  495.      -   Text editing is more efficient.
  496.  
  497.      -   sled_Remap now returns an int instead of a boolean.  SED_MOVED,
  498.          SED_INVALID, and SED_STUCK are the possible return values, instead of
  499.          TRUE and FALSE (as it used to).  This routine returns SED_MOVED if it
  500.          is successful (where it used to return TRUE); SED_INVALID if the user
  501.          has entered invalid data and the current field's fexit fails (where it
  502.          used to return FALSE); and finally, it returns SED_STUCK if it is
  503.          unable to scroll the sled (where it used to return FALSE).  Note: this
  504.          is an UPWARD INCOMPATIBILITY.
  505.  
  506.      -   sled_SetColVar and sled_InsertRows are more error-resistant.
  507.  
  508.      -   sled_SetColVar now returns a boolean value indicative of whether or
  509.          not it was successful.  (The most likely cause of failure would be the
  510.          lack of memory to expand the sled column data array.)
  511.  
  512. 6:  NEW FEATURES
  513.  
  514.      In addition to the functions listed below, please consult the following
  515.      additional sections in this document.  They contain new functions not
  516.      described here:.
  517.  
  518.  
  519.  
  520.          Section to consult               functions new to C-scape 3.2
  521.  
  522.  
  523.  
  524.          HIGHLIGHTING FIELD               sed_SetHiColors
  525.          CHARACTERS                       sed_GetHiRegAttr
  526.                                           sed_GetHiSelAttr
  527.                                           sed_SetFieldHiChar
  528.  
  529.          NAMING SLEDS                     sed_SetName
  530.                                           sed_GetName
  531.                                           sed_Find
  532.  
  533.          NEW SLED FUNCTIONS               sled_GetCol
  534.  
  535.          (separate document,              disp_GetCurrent
  536.          GRAPHICS.TXT)                    disp_SetCurrent
  537.                                           win_Grab
  538.  
  539.          (DEMOTTY.C, example program)     cmwin_GetResize
  540.                                           cmwin_SetResize
  541.  
  542.      These functions are new to this C-scape release, 3.2:
  543.  
  544.      kb_CheckWait is a function called in C-scape field functions.
  545.  
  546.          boolean kb_CheckWait(wait)
  547.              unsigned wait;  /* 100'ths of sec to timeout before returning */
  548.  
  549.  
  550.      kb_CheckWait returns TRUE if a key or mouse event is ready; FALSE,
  551.      otherwise.  A return value of TRUE means that the next call to kb_Read
  552.      returns immediately.
  553.  
  554.      The wait parameter specifies how long kb_CheckWait waits for an event.  If
  555.      the wait is 0, it returns immediately after checking; this is equivalent
  556.      to calling kb_Check.  If wait is greater than 0, it keeps checking until
  557.      wait hundredths of a second have elapsed.  If wait is -1, it keeps
  558.      checking until an event is ready.
  559.  
  560.      kb_Stuff is a function that stuffs a scancode representing a keyboard or
  561.      mouse event in an event stash.   The stash can only hold one event.  If
  562.      you call this function repeatedly, only the last scancode stuffed is in
  563.      the stash.  kb_Stuff is used so that the next time that kb_Read or
  564.      kb_Check is called, the scancode that was stuffed into the stash is the
  565.      scancode that is immediately returned.  kb_Stuff is equivalent to the old
  566.      sed_SetMouseCode, but its name is more accurate.  It has the following
  567.      prototype:
  568.  
  569.           void kb_Stuff(int scancode);
  570.  
  571.  
  572.      There are two new bob_ functions in the library:  bob_IsParentMove reports
  573.      whether or not a bob is set to be moved when its parent is moved.
  574.      bob_SetParentMove sets whether or not a bob is moved when its parent is
  575.      moved.
  576.  
  577.           boolean bob_IsParentMove(bob)
  578.               bob_type bob;   /* TRUE if moves with parent; FALSE, if not */
  579.  
  580.           void bob_SetParentMove(bob, move)
  581.               bob_type bob;
  582.               boolean move;   /* TRUE sets to move with parent; FALSE, not */
  583.  
  584.  
  585.     C-scape has several new field functions that are not listed in the manual.
  586.     These are click_funcs, radio_funcs, and togint_funcs.
  587.  
  588.      field func        var type      description
  589.  
  590.      click_funcs       boolean *     Treats the field as a menu choice.
  591.                                      Supports grid movement among fields.
  592.                                      Pressing the first letter of a field or
  593.                                      Enter selects that choice and exits the
  594.                                      sed.
  595.  
  596.      radio_funcs       boolean *     Allows for the exclusive selection of one
  597.                                      field from a group of fields, each of
  598.                                      which has the same field name.  Requires
  599.                                      at least one writeable position.
  600.  
  601.      togint_funcs      int *         Allows the user to cycle through a list of
  602.                                      choices by pressing the space bar.  The
  603.                                      field's second data pointer contains
  604.                                      choice definitions.  Copies the number of
  605.                                      the final choice into the field's
  606.                                      variable.
  607.  
  608.      The menu_Printf code for click_funcs should be the same as that for
  609.      menu_funcs.  The menu_Printf code for togint_funcs should be the same as
  610.      that for toggle_funcs.
  611.  
  612.      Here is an example of radio_funcs in use:
  613.  
  614.        boolean choco, vanilla, cherry;
  615.  
  616.        /* . . . */
  617.  
  618.        menu_Printf(menu, "@f{flavor}[# chocolate]\n", &choco, &radio_funcs);
  619.        menu_Printf(menu, "@f{flavor}[# vanilla  ]\n", &vanilla, &radio_funcs);
  620.        menu_Printf(menu, "@f{flavor}[# cherry   ]\n", &cherry, &radio_funcs);
  621.  
  622.  
  623.  
  624.      The following functions were included in the previous release, but not
  625.      documented.   They are presented here.
  626.  
  627.      nowrite_funcs is a new field function:
  628.  
  629.           OGLOBAL field_funcs_struct nowrite_funcs = {
  630.               stdNoCur_fenter,
  631.               std_fexit,
  632.               menu_fkey,
  633.               string_senter,
  634.               FNULL,  VAR_STRING
  635.           };
  636.  
  637.      This field function treats a field with an attached string variable as a
  638.      menu choice.  It supports grid movement among fields and is identical to
  639.      menu_funcs except it uses string_senter.  The text of the menu choice is
  640.      determined by the contents of the field's string variable.  Hence, it can
  641.      be changed at run-time but the user may not edit the field.  Upon exit the
  642.      value of the field is not written back to the variable, but the baton
  643.      value is equal to (field number + 1).
  644.  
  645.  
  646.      disp_MapMono:
  647.  
  648.          VOID disp_MapMono(mono)
  649.              boolean mono;
  650.  
  651.      If mono is TRUE this maps colors for mono displays.  Higher values are
  652.      generalized as lighter than lower values, with the range being from 0-7
  653.      (8-F are modulo-ed, but bolding and blinking are preserved) therefore:
  654.  
  655.          fore < back (e.g. 0x31) maps to 0x70
  656.          fore > back (e.g. 0x25) maps to 0x07
  657.  
  658.  
  659.      disp_ReInit:
  660.  
  661.          boolean disp_ReInit(dmode)
  662.              dmode_fptr dmode;
  663.  
  664.  
  665.      This routine installs a new display manager without closing down the
  666.      window manager.  It restores the mode that existed prior to disp_Init,
  667.      changes the display mode, and repaints the display.  You can use it to
  668.      change from 25-line text mode to EGA 43-line text mode (or VGA 50-line
  669.      text mode) and back:
  670.  
  671.          disp_Init(def_ModeText, FNULL);
  672.          /* ... */
  673.          disp_ReInit(pc_ModeEGA43);
  674.          /* ... */
  675.          disp_ReInit(def_ModeText);
  676.  
  677.  
  678.      Do not use this to change from text mode to graphics mode.  See the
  679.      example program DEMOSWAP.C for that.
  680.  
  681.  
  682.      ufunc_Open:
  683.  
  684.          bob_type ufunc_Open(ufunc, idata)
  685.              ufunc_fptr ufunc;
  686.              int idata;
  687.  
  688.  
  689.      This function creates a bob from a user function.  Returns the bob if
  690.      successful; NULL if not.  The idata argument is a value that is passed to
  691.      the user function upon invocation.  Look & Feel uses this construction in
  692.      its generated code for framers and slugs.  See the chapter "NEW BOB
  693.      FEATURES" in this document for more information about bobs.
  694.  
  695.  
  696.      sed_GetCurrFieldData:
  697.  
  698.          VOID *sed_GetCurrFieldData(sed, datano);
  699.              sed_type sed;
  700.              int datano;
  701.  
  702.  
  703.      Similar to sed_GetFieldData except that it refers to the current field.
  704.  
  705.  
  706.      sed_IsFieldName:
  707.  
  708.          boolean sed_IsFieldName(sed, fld, name)
  709.              sed_type sed;
  710.              int fieldno;
  711.              char *name;
  712.  
  713.      This function checks if field 'fld' in sed 'sed' has the name 'name'.  If
  714.      the so, the function returns TRUE; otherwise, FALSE.
  715.  
  716.  
  717.      sed_SetVarValue and sed_SetNameVarValue:
  718.  
  719.          boolean sed_SetVarValue(sed, fieldno, value)
  720.              sed_type sed;
  721.              int fieldno;
  722.              VOID *value;
  723.  
  724.          boolean sed_SetNameVarValue(sed, name, value)
  725.              sed_type sed;
  726.              char *name;
  727.              VOID *value;
  728.  
  729.      sed_SetVarValue copies data into the field variable according to its
  730.      number.  It places the value 'value' in field number 'fieldno'.
  731.  
  732.      sed_SetNameVarValue copies data into the field variable. This function is
  733.      useful when you wish to set the value of a field that has a name but where
  734.      you don't know its variable (such as when you load screens from an
  735.      sfile).  sed_SetNameVarValue sets the variable of the field named name
  736.      equal to the value value.
  737.  
  738.  
  739.  
  740. 7:  UPGRADING YOUR CODE
  741.  
  742.     If you are upgrading from C-scape 3.1 to C-scape 3.2, be aware that the new
  743.     version contains several changes that are UPWARDLY INCOMPATIBLE.  This
  744.     section explains how to update your code to run with the new version.  Make
  745.     sure you completely replace ALL the C-scape header files and that you
  746.     compile ALL your application's code with the new version.
  747.  
  748. 7.1:  auxiliary functions
  749.  
  750.     Make sure your auxiliary functions return the value 1 for the default
  751.     case.  Some of the new messages interpret a return value of 0 (zero) as
  752.     equivalent to failure and perform an undesired action.  For example,
  753.     returning 0 from a WINA_MOVE message prevents the window from being moved.
  754.  
  755.     The old SED_FENTER message is now treated as a SED_PREFENTER message.  The
  756.     old SED_FEXIT message is now treated as a SED_POSTFEXIT message.  We have
  757.     defined SED_FENTER to be SED_PREFENTER and SED_FEXIT to be SED_POSTFEXIT,
  758.     so your existing code should compile without modification.  See the section
  759.     "NEW AUXILIARY FUNCTION INFORMATION" for more information.
  760.  
  761. 7.2:  kb_Idle
  762.  
  763.     You must make a minor change to your keyboard idle functions.  See the
  764.     section on KB_IDLE for a detailed discussion of this issue.
  765.  
  766. 7.3:  ted_funcs
  767.  
  768.     ted_funcs no longer use the sed's generic data pointer as a pointer to the
  769.     cut buffer.  They now use the field's second data pointer.
  770.  
  771.     When you define the virtual field for your ted, you must ensure that it has
  772.     at least two data pointers.  Do this with menu_Printf's "d" operator.  For
  773.     instance:
  774.  
  775.     menu_Printf(menu, "@fd2[]", buffer, &ted_funcs, "This is a prompt string.",
  776.         NULL);
  777.  
  778.  
  779. 7.4:  num_fexit
  780.  
  781.     The numeric field functions no longer call senter or sexit in the fexit
  782.     function.  This means that the value in the field is not written out to the
  783.     variable until sexit is called for all the fields as control leaves the
  784.     sed.  This allows you to use spc_Abort with numeric field functions.
  785.     However, your code may no longer work if it assumes that variables contain
  786.     correct information as soon as control leaves each field.
  787.  
  788.     If you need to perform this action, use the following in an auxiliary
  789.     function:
  790.  
  791.         case SED_POSTFEXIT:
  792.             sed_DoFieldSexit(sed, sed_GetFieldNo(sed));
  793.             break;
  794.  
  795.  
  796.     This copies the record data to the field variable.
  797.  
  798. 7.5:  sled_Remap
  799.  
  800.     sled_Remap now returns SED_MOVED, SED_STUCK, or SED_INVALID instead of TRUE
  801.     or FALSE.  C-scape 3.1 code that tests the return value of sled_Remap, such
  802.     as:
  803.  
  804.         if (sled_Remap(sled, 1)) {
  805.             /* ... */
  806.  
  807.  
  808.     is wrong.   For C-scape 3.2, you should update it to be:
  809.  
  810.         if (sled_Remap(sled, 1) == SED_MOVED) {
  811.             /* ... */
  812.  
  813.  
  814. 7.6:  topping seds
  815.  
  816.     The function sed_Top is no longer in the mouse handlers.  To top a window
  817.     (move it in front of others), attach the aux_Top auxiliary function to it
  818.     or call sed_Top in your own auxiliary function (which tops it when it
  819.     receives the WINA_STARTGO message).
  820.  
  821. 7.7:  _arg macros
  822.  
  823.     C-scape 3.2 no longer uses the _arg macros in its header files to turn off
  824.     function prototyping.  Instead, we convert our code from ANSI-style C to
  825.     K&R-style C using the -d flag in the unark utility.  If you need to use the
  826.     _arg macros include the file argmacro.h.
  827.  
  828. 8:  NEW SLED FUNCTIONS
  829.  
  830.     You must include SLED.H to use any of the sled functions.
  831.  
  832.     Please note that the header file SLEDWIN.H is now named SLED.H.  If in your
  833.     older code you had included BOBSLED.H for sled function use then you need
  834.     make no changes--BOBSLED.H includes SLED.H.  If you had explicitly used
  835.     SLEDWIN.H then change the references to SLED.H.
  836.  
  837.     New routines have been added to the library to allow the protection and
  838.     marking of rows and columns in sleds (Scrolling List EDitors).  Protection
  839.     and marking can be done independently of each other.  Every attempt has
  840.     been made to keep the sled functions as close as possible to their field
  841.     counterparts.
  842.  
  843.     Note:  In the following discussion, row refers to row in a sled's column
  844.     array, not in the field grid.
  845.  
  846.     Any row or column can be protected using the appropriate function calls.
  847.     Any changes to a row or column's protection status take effect the next
  848.     time sled_Remap, sled_Repaint, or sed_Repaint is called.  If you protect
  849.     the current row or column without moving out of it IMMEDIATELY afterward,
  850.     you will still be able to edit the field; once you exit, however, you will
  851.     not be able to return.  You must include SLEDPROT.H to use any of the sled
  852.     protection functions.
  853.  
  854.     Marking can be added to a sled by using the sled_Mark and sled_Attr
  855.     routines.  As with protection, changes take effect the next time
  856.     sled_Remap, sed_Repaint, or sled_Repaint are called.  All rows and columns
  857.     will be marked with the same regular and selected attributes.  The
  858.     attribute can be changed or inspected with sled_SetMarkAttr and
  859.     sled_GetMarkAttr.  The attributes are uninitialized, so you should call
  860.     sled_SetMarkAttr before you mark anything.  Both protecting and marking can
  861.     be done to any sled row or column, whether it is currently displayed or
  862.     not.
  863.  
  864.     Here are brief descriptions of functions for these purposes.
  865.  
  866.     sled_GetMarkAttr returns the current marking colors by placing them in the
  867.     variables regular and selected:
  868.  
  869.          void sled_GetMarkAttr(sed, regular, selected);
  870.              sed_type     sed;
  871.              byte    *regular;
  872.              byte    *selected;
  873.  
  874.  
  875.     sled_SetMarkAttr sets the sled's marking colors to the values in regular
  876.     and selected:
  877.  
  878.          void sled_SetMarkAttr(sed, regular, selected);
  879.              sed_type sed;
  880.              byte regular;
  881.              byte selected;
  882.  
  883.  
  884.     The sled_IsMarked routines use the following routines to check the mark
  885.     status of a row or column:
  886.  
  887.          boolean sled_IsMarkedRow(sed, row);
  888.              sed_type sed;
  889.              int row;
  890.  
  891.          boolean sled_IsMarkedCol(sed, col);
  892.              sed_type sed;
  893.              int col;
  894.  
  895.  
  896.     The sled_Mark routines (actually function macros) mark or unmark a row or
  897.     column in a sled:
  898.  
  899.          void sled_MarkCol(sed, col);
  900.              sed_type sed;
  901.              int col;
  902.  
  903.          void sled_UnMarkCol(sed, col);
  904.              sed_type sed;
  905.              int col;
  906.  
  907.          void sled_MarkRow(sed, row);
  908.              sed_type sed;
  909.              int row;
  910.  
  911.          void sled_UnMarkRow(sed, row);
  912.              sed_type sed;
  913.              int row;
  914.  
  915.  
  916.     The following functions allow you to protect a sled row or column and check
  917.     the protected status of a sled row or column.  You must include SLEDPROT.H
  918.     to use any of the sled protection functions:
  919.  
  920.          #include <sledprot.h> /* must include for these */
  921.  
  922.          void sled_ProtectRow(sed, row);
  923.              sed_type sed;
  924.              int row;
  925.  
  926.          void sled_ProtectCol(sed, col);
  927.              sed_type sed;
  928.              int col;
  929.  
  930.          boolean sled_IsProtectedRow(sed, row);
  931.              sed_type sed;
  932.              int row;
  933.  
  934.          boolean sled_IsProtectedCol(sed, col);
  935.              sed_type sed;
  936.              int col;
  937.  
  938.  
  939.     The two routines, sled_PageUp and sled_PageDown, have been added to ease
  940.     scrolling within a sled that has fixed rows at its top.  Each remaps a sled
  941.     up or down by the number of scrollable rows in it:
  942.  
  943.          int sled_PageUp(sled);
  944.              sed_type sled;
  945.  
  946.          int sled_PageDown(sled);
  947.              sed_type sled;
  948.  
  949.     Like sled_Remap, these functions return SED_MOVED, SED_STUCK, or
  950.     SED_INVALID.
  951.  
  952.     The following routine has been added for consistency with sled_GetRow and
  953.     returns the sled's current column number:
  954.  
  955.          int sled_GetCol(sled);
  956.              sed_type sled;
  957.  
  958.  
  959. 9:  NAMING SEDS
  960.  
  961.     You can now name seds.  This is analogous to the ability to name fields.
  962.  
  963.     sed_SetName names a sed.  Use NULL for name to remove a window's name.
  964.     (Note: sed_SetName returns an integer denoting a handle for the name of the
  965.     object.  This handle is an entry in an internal system list and is not
  966.     otherwise needed by the C-scape user.)
  967.  
  968.          int sed_SetName(sed, name)
  969.              sed_type sed;
  970.              char *name;
  971.  
  972.  
  973.     sed_GetName returns a pointer to the given sed's name.
  974.  
  975.          char *sed_GetName(sed)
  976.              sed_type sed;
  977.  
  978.  
  979.     sed_Find finds a sed by its name.
  980.  
  981.          sed_type sed_Find(name)
  982.              char *name;
  983.  
  984.  
  985.     sed_Find returns a pointer to the named sed, if found; NULL, otherwise.
  986.     You can assign more that one sed the same name but sed_Find returns a
  987.     pointer to only one of them.  If the name is not unique, it returns a sed
  988.     with the specified name, but not necessarily any particular one.
  989.  
  990.     When you name seds, their names go into an internal symbol list.  This list
  991.     is not closed by disp_Close or sed_Close.  If you want to release the
  992.     storage that this list uses, call the new function oak_Close after calling
  993.     disp_Close.  In most cases, you do not need to call oak_Close.  It has the
  994.     following prototype:
  995.  
  996.           void oak_Close(void);
  997.  
  998.  
  999. 10:  THE NEW FEXIT
  1000.  
  1001.     C-scape 3.2 has a new version of the fexit function.
  1002.  
  1003.     Previously, any fexit that performed validation would contain code similar
  1004.     to the following:
  1005.  
  1006.          if (!valid_String( /* ... */ ) {
  1007.  
  1008.              tone();
  1009.              sed_BorderPrompt(sed, fnstring_errmsg);
  1010.  
  1011.              /* wait for a keystroke */
  1012.              while (!kb_Check()) {
  1013.                  ;
  1014.              sed_BorderPrompt(sed, sed_GetCurrFieldData(sed, 0));
  1015.              return(FALSE);
  1016.              }
  1017.          }
  1018.  
  1019.     When the user enters an invalid value into a field, this code sends the
  1020.     user an error message and then sits in a loop, waiting for a keystroke.
  1021.     This method works but has two drawbacks: it wastes CPU time on
  1022.     multi-tasking operating systems and it limits options for programming a
  1023.     custom error response.
  1024.  
  1025.     To address these problems, C-scape now has been changed in two ways.
  1026.     First, the fexit behaves differently.  When it receives an invalid entry,
  1027.     it calls the following piece of code:
  1028.  
  1029.          if (!valid_String( /* ... */ ) {
  1030.              kb_Stuff(sed, KEY_INVALID);
  1031.              return(FALSE);
  1032.          }
  1033.  
  1034.  
  1035.     kb_Stuff pushes a keystroke back onto the buffer.  Because fexit returns
  1036.     FALSE, control stays in the field and the pending scancode (KEY_INVALID)
  1037.     gets grabbed by the function special_key within that field's fkey
  1038.     function.  (special_key is a standard part of every field function's fkey.)
  1039.  
  1040.     Here we see the second change to C-scape.  special_key has a new case for
  1041.     KEY_INVALID:
  1042.  
  1043.          case KEY_INVALID:
  1044.              /* The validation in fexit failed: tell the user */
  1045.              tone();
  1046.              sed_BorderPrompt(sed, ocountry.errmsg);
  1047.  
  1048.              /* wait for a keystroke */
  1049.              kb_CheckWait(-1);
  1050.  
  1051.              sed_BorderPrompt(sed, sed_GetCurrFieldData(sed, 0));
  1052.              break;
  1053.  
  1054.  
  1055.     kb_CheckWait waits for a keystroke without removing it from the keyboard
  1056.     buffer (unlike kb_Check, which returns immediately, whether or not there is
  1057.     a keystroke).  Note that kb_CheckWait takes an argument, which is the
  1058.     amount of time it waits for a keystroke in milliseconds.  The argument of
  1059.     -1 makes it wait until a key is pressed.
  1060.  
  1061.     This scheme allows for customization without manipulation of field
  1062.     functions.  You need only write a new special function based on
  1063.     special_key.  You need only change your code if you have already rewritten
  1064.     new the field functions to perform customization.
  1065.  
  1066.     Also note that the numeric field functions no longer call senter or sexit
  1067.     in the fexit function.  This means that the value in the field is not
  1068.     written out to the variable until sexit is called for all the fields as
  1069.     control leaves the sed.  This allows you to use spc_Abort with numeric
  1070.     field functions.  However, your code may no longer work if it assumes that
  1071.     variables contain correct information as soon as control leaves each field.
  1072.  
  1073. 11:  USER-DEFINED SCANCODES
  1074.  
  1075.     C-scape now provides a new method of customizing behavior: user-defined
  1076.     scancodes.  You can define up to 256 of your own scancodes, all of which
  1077.     must have the form KEY_USER(N), where N is an integer between 0 and 255.
  1078.  
  1079.     To create a new scancode, perform #define with the same form:
  1080.  
  1081.          #define MY_CODE KEY_USER(22)
  1082.  
  1083.     This piece of code creates the custom scancode MY_CODE.  You can pass your
  1084.     scancode into the keyboard buffer with a call to kb_Stuff:
  1085.  
  1086.          kb_Stuff(MY_CODE);
  1087.  
  1088.     This action ends up passing MY_CODE to the next function that seeks a
  1089.     scancode, such as a special function.
  1090.  
  1091.     For an example of this type of action, see the above section (THE NEW
  1092.     FEXIT) and its use of KEY_INVALID.  For instance, you can use your own
  1093.     scancode with validation, where your custom code causes a KEY_INVALID-like
  1094.     response with whatever additions you like.
  1095.  
  1096. 12:  NEW BOB FEATURES
  1097.  
  1098.     bob_funcs now support independent, as well as dependent, bobs.  There are
  1099.     two new bob functions: bob_IsParentMove and bob_SetParentMove.
  1100.  
  1101.     The information below on DEPENDENT bobs is to clarify the presentation of
  1102.     this subject in the manual.  The only new material is a description of a
  1103.     fix to a problem with the ENTER key.
  1104.  
  1105.     To review, the principal difference between dependent and independent bobs
  1106.     is that dependent bobs are automatically painted when their parent is
  1107.     painted and clipped within the edges of their parent.  By contrast,
  1108.     independent bobs must be painted explicitly and can appear outside of their
  1109.     parent's edges.  Control passes automatically into a dependent bob;
  1110.     independent bobs act as popups that appear when a user presses Enter or
  1111.     clicks the mouse on the bob_funcs field.
  1112.  
  1113.     The information below on INDEPENDENT bobs is new.
  1114.  
  1115.     12.1:  Dependent bobs
  1116.  
  1117.     Dependent bobs are painted when the parent is painted and are clipped
  1118.     within the parent window.  By default, they move with the parent.  When you
  1119.     enter the bob_funcs field, control passes immediately to it.
  1120.  
  1121.     To make a dependent bob from a sed, attach the library special function
  1122.     spc_Embed to it and call the sed_CreateBob function with the BOB_DEPENDENT
  1123.     flag.  If you do not give the child sed spc_Embed, then the UP, DOWN, TAB
  1124.     (to go right a field) and SHFT_TAB (go left) keys will only move you within
  1125.     the bob and not let you move into the parent.
  1126.  
  1127.     Here is a summary of the effect of certain events in the embedded sed
  1128.     (dependent bob) with spc_Embed attached:
  1129.  
  1130.     ESC                   Exits the bob and all ancestors.   The sed_Go that
  1131.                           was called on the ultimate ancestor returns 0.
  1132.  
  1133.     ENTER                 Moves to the next field in the bob.  If the current
  1134.                           field is the last field in the bob, then control is
  1135.                           passed to the field in the parent sed below the
  1136.                           bob_funcs field.  If there is no field below in the
  1137.                           parent sed, then control stays in the bob.
  1138.  
  1139.                           Note:  menu_funcs and gmenu_funcs fields in a bob act
  1140.                           differently.  In fields with these functions, ENTER
  1141.                           exits the bob and all ancestors.  The sed_Go called
  1142.                           on the ultimate ancestor returns the value of the
  1143.                           baton set by menu_funcs or gmenu_funcs.  See the
  1144.                           Function Reference for more information on these
  1145.                           field functions.
  1146.  
  1147.     UP, DOWN, TAB,        Passes control to the field above, below, to the
  1148.     SHFT_TAB              right, or to the left, respectively.  If the field to
  1149.                           move to is in the parent sed, control goes there.  If
  1150.                           there is no field to move to, control remains in the
  1151.                           field.
  1152.  
  1153.     mouse                 Moves freely between fields in the bob and in
  1154.                           parent(s).
  1155.  
  1156.                           Note:  You must use a non-Greedy mouse handler on a
  1157.                           dependent bob.
  1158.  
  1159.  
  1160.  
  1161.     12.2:  Independent bobs
  1162.  
  1163.     Independent bobs are not painted when the parent is painted, but are
  1164.     painted separately.  They are not clipped within the parent window.   Note:
  1165.     They now move with the parent.  The position of the bob can be set
  1166.     independent of the position of the bob_funcs field.
  1167.  
  1168.     When you enter the bob_funcs field, control does not immediately pass to
  1169.     the bob.  bob_fkey waits for the ENTER key or the mouse click before
  1170.     activating the bob.  If the bob is a sed, then the sed is painted to the
  1171.     display and run.  When the sed is exited, it leaves the display.
  1172.  
  1173.     Independent bobs can be made from seds or from user functions.  This
  1174.     feature means that attaching a user function (ufunc) to a field employs the
  1175.     same mechanism as attaching a a sed to a field.  Making a bob from a user
  1176.     function (as opposed to a sed) gives you a function button (since selecting
  1177.     the field executes the function).
  1178.  
  1179.     When you make an independent bob from a sed use the sed_CreateBob function
  1180.     with the BOB_INDEPENDENT  flag.  Do not attach the library special function
  1181.     spc_Embed to that sed, in contrast to dependent bobs.
  1182.  
  1183.     Here is a summary of the effect of certain events in the attached sed
  1184.     (independent bob).   It is assumed that spc_Embed is not attached to the
  1185.     bob.
  1186.  
  1187.     ESC                Exits the bob, removing it from the screen.  Control
  1188.                        returns to the bob_funcs field in the parent.
  1189.  
  1190.     ENTER              Moves to the next field in the bob.  If the current
  1191.                        field is the last field in the bob, control remains in
  1192.                        the bob.  If there is no field below in the parent sed,
  1193.                        then control returns to the bob_funcs field in the
  1194.                        parent sed.
  1195.  
  1196.                        Note:  menu_funcs and gmenu_funcs fields in a bob act
  1197.                        differently.  For fields with these functions, ENTER
  1198.                        exits the bob and all ancestors.  The sed_Go that was
  1199.                        called on the ultimate ancestor returns the value of the
  1200.                        baton set by menu_funcs or gmenu_funcs.  See the
  1201.                        Function Reference for more information on these
  1202.                        functions.
  1203.  
  1204.     UP, DOWN, TAB,     Moves to a field above, below, to the right, or to the
  1205.     SHFT_TAB           left, respectively.  Movement is restricted to the bob.
  1206.                        If there is no field to which to move, then it remains
  1207.                        in the current field.
  1208.  
  1209.     mouse              Moves freely among the fields in the bob.
  1210.  
  1211.                        Note:  You must use a Greedy mouse handler on the bob:
  1212.                        sedmou_GreedyClick or sedmou_GreedyTrack.   If you are
  1213.                        using a Greedy handler, then the first click outside the
  1214.                        bob dismisses the bob and returns control to the parent
  1215.                        seds bob field.
  1216.  
  1217.  
  1218.  
  1219.     When you make an independent bob from a user function, use ufunc_Open:
  1220.  
  1221.              bob_type ufunc_Open(ufunc, idata)
  1222.                  ufunc_fptr ufunc;
  1223.                  int idata;
  1224.  
  1225.  
  1226.     ufunc_Open creates a bob from a user function.  It returns the bob if it is
  1227.     successful and NULL if it fails.  When invoked, the user function receives
  1228.     idata value as its second argument.
  1229.  
  1230.     If a user function returns 0, control remains in the bob_funcs field in the
  1231.     parent sed.  Any other value exits the sed and be returned from sed_Go.
  1232.  
  1233. 13:  NEW AUXILIARY FUNCTION INFORMATION
  1234.  
  1235.     Auxiliary functions are now part of the object instead of the sed.  This
  1236.     means that non-sed windows can use auxiliary functions.  Messages operate
  1237.     either at the object level (AUX_ messages, such as AUX_START), the window
  1238.     level (WINA_ messages, such as WINA_MOVE), or at the sed level (SED_
  1239.     messages, such as SED_PREFEXIT).  Each level has new messages:
  1240.  
  1241.             sed messages              SED_PREFENTER
  1242.                                       SED_POSTFENTER
  1243.                                       SED_PREFEXIT
  1244.                                       SED_POSTFEXIT
  1245.  
  1246.             window messages           WINA_STARTGO
  1247.                                       WINA_ENDGO
  1248.                                       WINA_GO
  1249.                                       WINA_MOVE
  1250.                                       WINA_RESIZE
  1251.                                       WINA_BORDERCLICK
  1252.  
  1253.             object messages           AUX_START
  1254.                                       AUX_END
  1255.                                       AUX_GETVALUE
  1256.  
  1257.     You can also define your own messages with the AUX_USER macro (see below).
  1258.  
  1259.     These messages are sent by C-scape to an object's auxiliary function, if
  1260.     present.
  1261.  
  1262.     The SED_PRE and POSTFENTER messages are sent before and after the fenter
  1263.     function is called for each field.  The old SED_FENTER message is now
  1264.     treated as a SED_PREFENTER message.
  1265.  
  1266.     The SED_PRE and POSTFEXIT messages are sent before and after the fexit
  1267.     function is called for each field.  The old SED_FEXIT message is now
  1268.     treated as a SED_POSTFEXIT message.
  1269.  
  1270.     The WINA_STARTGO message is sent whenever a window is activated, before
  1271.     control is passed to it (or, for a sed, any of the fields).  The following
  1272.     things can make a window active:
  1273.  
  1274.         -calling win_Go (or sed_Go)
  1275.         -passing control to it with the mouse
  1276.         -passing control to it with sed_SetNextWin
  1277.  
  1278.     The WINA_ENDGO message is sent whenever control leaves a window.  This
  1279.     occurs in the ways stated above.
  1280.  
  1281.     When you call win_Go on a non-sed window (i.e., a cmwin or pmwin), win_Go
  1282.     sends a WINA_GO message to a window.  The code for this message should
  1283.     handle input to the window (as does a C-scape fkey function).  For example:
  1284.  
  1285.     int aux_Hoohah(win_type win, int msg, VOID *indata, VOID *outdata)
  1286.     {
  1287.         boolean quit = FALSE;
  1288.         int baton = 0;
  1289.  
  1290.         switch(msg) {
  1291.         case WINA_GO:
  1292.             while (!quit) {
  1293.                 kb_Read();
  1294.                 /* do stuff here ... */
  1295.             }
  1296.             return(baton);
  1297.         /* ... */
  1298.  
  1299.  
  1300.     The return value of the auxiliary function is returned from win_Go (just as
  1301.     a baton value is returned from sed_Go).  Refer to the example program
  1302.     DEMOTTY.C for more information.
  1303.  
  1304.     The three WINA_ messages, WINA_MOVE, WINA_RESIZE, and WINA_BORDERCLICK, are
  1305.     sent when a window is moved, resized, or has its border clicked,
  1306.     respectively.  Note: Each of these messages has indata.
  1307.  
  1308.     For WINA_BORDERCLICK, the indata is a mev_struct (Mouse EVent STRUCTure).
  1309.     It is declared as follows:
  1310.  
  1311.         mev_struct *mevp;
  1312.         mevp = (mev_struct *)indata;
  1313.  
  1314.     The mev_struct contains information about a mouse event being sent to the
  1315.     border.  You can get information about a mev_struct with the various mev_
  1316.     macros available.  Consult the file mevdecl.h for more information on these
  1317.     macros, such as mev_GetRow or mev_GetCol.
  1318.  
  1319.     For WINA_MOVE and WINA_RESIZE, the indata is an "opoint", which is a data
  1320.     type used by the Oakland Windowing Library (OWL).  An opoint (Oakland
  1321.     POINT) describes the position of a point in pixel coordinates.  It contains
  1322.     the two elements:
  1323.  
  1324.         x      the horizontal position of the point, relative to the display
  1325.  
  1326.         y      the vertical position of the point, relative to the display
  1327.  
  1328.     These values are in opcoords, an Oakland data type.  An opcoord is an int
  1329.     that we use to describe signed pixel coordinates.
  1330.  
  1331.     The structure is defined as follows:
  1332.  
  1333.  
  1334.        typedef struct {
  1335.            opcoord x;
  1336.            opcoord y;
  1337.        } opoint;
  1338.  
  1339.  
  1340.     For WINA_MOVE, the indata is the position of the upper-left corner of the
  1341.     screen, relative to the display, in pixels; for WINA_RESIZE, it is the new
  1342.     height and width in pixels.
  1343.  
  1344.     The AUX_START message is sent when you call sed_SetAux.
  1345.  
  1346.     The AUX_END message is sent when you call sed_Close or, when you call
  1347.     sed_SetAux to attach another, new auxiliary function to a sed.   In the
  1348.     latter case the AUX_END message is sent to the existing auxiliary function
  1349.     and then the new function is attached and it gets a AUX_START message.
  1350.  
  1351.     AUX_GETVALUE is a message used by the forthcoming C-cell product.
  1352.  
  1353.     If you wish to define your own auxiliary messages, use the macro
  1354.     AUX_USER().  This macro takes an integer and supplies a unique auxiliary
  1355.     message value.  For instance:
  1356.  
  1357.            #define MY_MESSAGE          AUX_USER(0)
  1358.            #define MY_OTHER_MESSAGE    AUX_USER(1)
  1359.  
  1360. 14:  HIGHLIGHTING FIELD CHARACTERS
  1361.  
  1362.     C-scape now lets you highlight any character in a field.  C-scape first
  1363.     searches the field for a highlighted; if the field has no highlighted
  1364.     character, it performs a search based on the field's first alphanumeric
  1365.     character.  The field functions for creating selection fields are
  1366.     check_funcs, click_funcs, framer_funcs, gmenu_funcs, list_funcs,
  1367.     mark_funcs, menu_funcs, and slug_funcs.
  1368.  
  1369.     You can highlight one of the first 16 characters of a field by giving it
  1370.     special regular and selected attributes.
  1371.  
  1372.     To set the highlighted character of a field, use menu_Printf's new 'h'
  1373.     operator.  The "@fh" command takes an integer value, starting with 0
  1374.     (zero).  For example, a menu_Printf in which a highlighted character is set
  1375.     might be:
  1376.  
  1377.         menu_Printf(menu, "@fh1[Explode]", filename, &framer_funcs);
  1378.  
  1379.  
  1380.     In this case, the highlighted character is the second character in the
  1381.     field, "x".
  1382.  
  1383.     To set the highlighted character for the selection items from a list_funcs
  1384.     list, place an "@" immediately before the character you wish to highlight.
  1385.     For instance, if your choices are blue, black, and brown, the string in
  1386.     menu_Printf should be: "@blue,b@lack,b@rown".
  1387.  
  1388.     To set or the change a field's highlighted character after opening the
  1389.     field's sed, you can use the sed_SetFieldHiChar function (see below).
  1390.  
  1391.     For framer and slug menu systems, you can set a menu item's highlighted
  1392.     character in the frame_def or slug_list definition structure.  To do this,
  1393.     place the "@" character before the character in the text of the menu choice
  1394.     you wish to designate as the highlighted character.
  1395.  
  1396.     For example, a fragment from a framer definition for a HELP menu:
  1397.  
  1398.          /* ... */
  1399.  
  1400.          {         "@HELP",           NULL,             12 },
  1401.          {         "A @Lot",          help_alot,         0 },
  1402.          {         "A @Bit",          help_abit,         0 },
  1403.          {         FRAME_END                               },
  1404.  
  1405.          /* ... */
  1406.  
  1407.     This definition designates "H" as the highlighted character the "HELP" menu
  1408.     and "L" as the highlighted character for the "A Lot" choice; "B" for the "A
  1409.     Bit" choice.
  1410.  
  1411.  
  1412.  
  1413.     sed_SetHiColors sets the highlighted character attributes.
  1414.  
  1415.          void sed_SetHiColors(sed, hreg, hsel)
  1416.              sed_type sed;
  1417.              byte hreg;  /* HiChar attr when field is not current */
  1418.              byte hsel;  /* HiChar attr when field is current */
  1419.  
  1420.  
  1421.     msys_SetHiColors sets the highlighted character attributes for all the seds
  1422.     within a framer or slug menuing system.
  1423.  
  1424.          void msys_SetHiColors(sed, hreg, hsel)
  1425.              sed_type sed;
  1426.              byte hreg;  /* HiChar attr when field is not current */
  1427.              byte hsel;  /* HiChar attr when field is current */
  1428.  
  1429.  
  1430.     sed_SetHiColors sets the regular and selected attributes of the highlighted
  1431.     character 'character' for the fields of a sed.
  1432.  
  1433.     sed_SetHiColors does not automatically update the display.   You must call
  1434.     one of the _Update or _Repaint functions to see the effect.
  1435.  
  1436.     sed_SetFieldHiChar selects or changes a highlighted character.
  1437.  
  1438.          void sed_SetFieldHiChar(sed, fldno, pos)
  1439.              sed_type sed;
  1440.              int fldno;  /* field number of field to affect */
  1441.              int pos;    /* position in merge of HiChar character */
  1442.  
  1443.  
  1444.     sed_SetFieldHiChar highlights a particular character in a field.  The field
  1445.     is specified by its field number (0 indexed).  The highlighted character is
  1446.     specified by an integer denoting the position of the character in the
  1447.     field's merge.   0 is the first character of a field's merge.  The
  1448.     highlighted character may be one of the first 16 characters in a field,
  1449.     where values in the range 0 to 15 may enable a highlighted character.  Use
  1450.     a value less than 0 to disable highlighting.
  1451.  
  1452.     This function does not automatically update the display.   You must call
  1453.     one of sed _Update or _Repaint functions to see the effect immediately.
  1454.  
  1455.     sed_GetHiRegAttr returns the highlighted character's regular attribute.
  1456.  
  1457.          byte sed_GetHiRegAttr(sed)
  1458.              sed_type sed;
  1459.  
  1460.  
  1461.     sed_GetHiSelAttr gets the highlighted character's selected attribute.
  1462.  
  1463.          byte sed_GetHiSelAttr(sed)
  1464.              sed_type sed;
  1465.  
  1466.  
  1467.     NOTE: You cannot both mark a field and highlight characters in it.
  1468.  
  1469. 15:  KB_IDLE
  1470.  
  1471.     C-scape 3.2 has a new version of kb_Idle, that is UPWARD INCOMPATIBLE with
  1472.     kb_Idle from previous versions.  This section of this document completely
  1473.     replaces the discussion of kb_Idle in Section 18.3.1 of the C-scape 3.1
  1474.     manual and in Section 15.3.1 of the C-scape 3.0 manual.
  1475.  
  1476.     kb_Idle attaches a user-supplied function to the OWL keyboard handler.
  1477.     Whenever kb_Read or kb_Check are called, they call the user function
  1478.     repeatedly while waiting for a key to be pressed.  This function can
  1479.     provide limited "background" processing while waiting for keystrokes.
  1480.  
  1481.     The user-supplied function receives a message (which is an integer) and a
  1482.     wait parameter (which is an unsigned integer); it returns an integer.  It
  1483.     has the following form:
  1484.  
  1485.        #include "scancode.h"
  1486.  
  1487.        int idle_Func(msg, wait)
  1488.            int msg;
  1489.            unsigned wait;
  1490.        /*
  1491.            Standard Idle user-function.
  1492.        */
  1493.        {
  1494.            switch(msg) {
  1495.            case IDLE_START:
  1496.                /* ... */
  1497.                break;
  1498.            case IDLE_READ: /* called by kb_Read */
  1499.            case IDLE_CHECK:    /* called by kb_Check */
  1500.                /* ... */
  1501.                break;
  1502.            case IDLE_STOP:
  1503.                /* ... */
  1504.                break;
  1505.            }
  1506.            return(KEY_NONE);
  1507.        }
  1508.  
  1509.     The message passed to the idle function has one of the following values:
  1510.  
  1511.     IDLE_START        Passed to the idle function when it is first attached to
  1512.                       kb_Read.  The idle function should initialize any data it
  1513.                       uses when it receives this message.
  1514.  
  1515.     IDLE_READ         Passed to the idle function when it is called from
  1516.                       kb_Read.  The idle function should carry out its intended
  1517.                       work when it receives this message.
  1518.  
  1519.     IDLE_CHECK        Passed to the idle function when it is called from
  1520.                       kb_Check.  The idle function should carry out its
  1521.                       intended work when it receives this message.
  1522.  
  1523.     IDLE_STOP         Passed to the idle function when it is disconnected from
  1524.                       kb_Read.  The idle function should close down data it
  1525.                       uses when it receives this message.
  1526.  
  1527.     The function's wait parameter is useful on a small number of unusual
  1528.     platforms supported by Oakland Group; it is not relevant on most systems
  1529.     and can be ignored.
  1530.  
  1531.     kb_Idle returns a scancode value (an integer), which kb_Read receives.
  1532.     This value is returned from kb_Read unless it's KEY_NONE; KEY_NONE keeps
  1533.     control in kb_Read, which continues to wait for a keystroke (and calls the
  1534.     idle function in the mean time).  If the idle function returns a value
  1535.     other than KEY_NONE, kb_Read gets it and passes it on as if it were a
  1536.     regular scancode.
  1537.  
  1538.     You can use the return value of an idle function to inform your program of
  1539.     various events.  For example, if your idle function processes data between
  1540.     keystrokes, you can send a message to your program telling it that the data
  1541.     processing is completed:
  1542.  
  1543.        #include "kbidle.h"
  1544.  
  1545.        int idle_Slack(msg, wait)
  1546.        /* ... */
  1547.  
  1548.            case IDLE_CHECK:
  1549.            case IDLE_READ:
  1550.                /* test if our data is ready */
  1551.                if (dataisready()) {
  1552.                    /* it is, signal our program */
  1553.                    return(KEY_USER(0));
  1554.                }
  1555.                else {
  1556.                    /* it isn't, proceed normally */
  1557.                    return(KEY_NONE);
  1558.                }
  1559.             /* ... */
  1560.  
  1561.     With this construction, processing continues until finished, at which point
  1562.     the idle function exits.
  1563.  
  1564.     Calling kb_Idle with a FNULL argument or a new idle function sends an
  1565.     IDLE_STOP message to the current idle function and disconnects it from the
  1566.     kb_Read function.  The use of FNULL is new to C-scape version 3.1; see
  1567.     Section 16.3 of this document for more information.
  1568.  
  1569.     You can use the standard idle function, idle_Clock, supplied in the runtime
  1570.     libraries, to place a running time clock at the bottom of the display:
  1571.  
  1572.  
  1573.            kb_Idle(idle_Clock);
  1574.  
  1575.     You must initialize the device interface with disp_Init before using
  1576.     kb_Idle.  You must also include kbidle.h in the code where you call your
  1577.     idle function.
  1578.  
  1579.     Because it is called repeatedly, an idle function should be simple and
  1580.     fast.  A slow idle function could affect your program's performance.  On
  1581.     operating systems that support multi-tasking, such as OS/2, it does not
  1582.     make sense to use kb_Idle.  You should instead set up a real background
  1583.     process using the methods provided by the operating system.
  1584.  
  1585. 15.1:  CONVERTING YOUR OLD CODE
  1586.  
  1587.     To convert your old idle function to a new idle function, do the following
  1588.     things:
  1589.  
  1590.     (1) make it return an int (instead of a void)
  1591.  
  1592.     (2) add a return statement in which it returns KEY_NONE
  1593.  
  1594.     (3) change the message IDLE_RUN to both IDLE_CHECK and IDLE_READ, so that:
  1595.  
  1596.        case IDLE_RUN:
  1597.            /* ... */
  1598.  
  1599.     becomes
  1600.  
  1601.        case IDLE_READ:
  1602.        case IDLE_CHECK:
  1603.  
  1604.     That's all you need to do.
  1605.  
  1606. 16:  OAKLAND DEBUGGING AID
  1607.  
  1608.     This is not an example program but rather a debugging aid.
  1609.  
  1610.     To help in tracking down memory problems we have included a file called
  1611.     OAKMEMOK.C with the program examples.  The functions contained in
  1612.     OAKMEMOK.C replace the library memory handling routines used by C-scape.
  1613.     The C-scape library memory allocation routines are simple shells around
  1614.     calls to the C run time library allocators.  OAKMEMOK.C has some additional
  1615.     functionality:
  1616.  
  1617.      -   it places a guard byte before and after each block at the time of
  1618.          allocation;
  1619.  
  1620.      -   it keeps a linked list of each block that is allocated, with a tag
  1621.          that identifies which C-scape object has been allocated or freed; and,
  1622.  
  1623.      -   it checks the integrity of the guard bytes for each block of memory in
  1624.          the linked list whenever an allocation is made.
  1625.  
  1626.     To test memory allocation errors, use the function alloc_test.  The
  1627.     allocation routines use this function to perform the check of the linked
  1628.     list of memory blocks.  This function takes two arguments: a prompt and a
  1629.     mode.  alloc_test returns 0 if the heap is OK.  If one of the blocks has
  1630.     had its guard bytes overwritten then it returns the tag value of the bad
  1631.     block (which matches the block number of the corrupted block from the
  1632.     report).  Here is alloc_test:
  1633.  
  1634.         int alloc_test(char *msg, int mode)
  1635.  
  1636.     The msg variable holds a string.  When alloc_test prints a listing or dump,
  1637.     it prints this string, which allows you to determine the source of the bug
  1638.     from the calls to alloc_test.
  1639.  
  1640.     The value of mode determines the verbosity of the report:
  1641.  
  1642.     0   silent
  1643.     1   print summaries
  1644.     2   print dump list - the entire list of blocks and tags
  1645.  
  1646.     If there is a memory fault, alloc_test returns a value that
  1647.  
  1648.     alloc_test uses printf to print information.
  1649.  
  1650.     When the allocation routines call alloc_test, they pass a NULL msg and a
  1651.     mode 0.  If a bad block is detected, the allocation routine prints an error
  1652.     message noting the bad block's tag.  Again, printf prints the output.
  1653.  
  1654.     To use this routine, compile and link OAKMEMOK.C with your application.
  1655.     You must include the header DEBUG.H.
  1656.  
  1657.     (DOS users: if you are compiling under Microsoft, remember to pass the /NOE
  1658.     switch to the linker, so that references to the memory allocation routines
  1659.     are resolved by the functions in the OAKMEMOK.OBJ module, not the library.)
  1660.  
  1661.     If OAKMEMOK.OBJ is linked with your C-scape application code, every
  1662.     allocation automatically performs a check on the list of memory blocks and
  1663.     prints an error message if the check fails.
  1664.  
  1665.     To pinpoint the location(s) of your application's memory violations
  1666.     (usually caused by a bad pointer), you may need multiple calls to
  1667.     alloc_test.  Place calls to the function throughout the code, which will
  1668.     help you localize the error.  You may wish to compile the C-scape source
  1669.     modules pertinent to the error with the compiler debug switch set and then
  1670.     link these with your application--this will allow you to use a debugger to
  1671.     trace into the library and locate any memory that is being trashed there.
  1672.     You can use this method to track memory errors as in any code.
  1673.  
  1674.     Since alloc_test and other routines in OAKMEMOK.C use printf to perform
  1675.     output you can redirect this to an error output file by the DOS command
  1676.     line:
  1677.  
  1678.          myprogrm >myprogrm.err
  1679.  
  1680.     These routines will uncover most memory problems, but are fallible; if a
  1681.     memory block's contents have been damaged, but its guard bytes are intact,
  1682.     alloc_test will not detect a problem.  Despite this, OAKMEMOK.C is very
  1683.     useful for tracking down most memory errors.
  1684.  
  1685. 17:  MEMORY USE AND THE SIZE OF EXECUTABLES
  1686.  
  1687.     C-scape and OWL are powerful libraries that do entail overhead.  The most
  1688.     simple C-scape application for DOS uses about 100K bytes, which comprises a
  1689.     kernel of windowing code.  As rough guide to a larger DOS application, you
  1690.     might consider the 370K bytes of Look & Feel (LNF).  LNF, by necessity,
  1691.     includes all the C-scape library functionality plus its LNF specific-code.
  1692.  
  1693.     While the base executable size is large, as your application grows the
  1694.     amount of C-scape code linked does not increase proportionally.  Most
  1695.     modules contain only one external function.  Also, the library uses
  1696.     function pointers to avoid linking unnecessary code.
  1697.  
  1698.     We understand that you may decide to use overlay linkage for large
  1699.     applications under DOS.  Nevertheless, we did not design C-scape or OWL for
  1700.     overlays and do not support this.  If you wish to use overlays, consider
  1701.     overlaying your application code (not the library code).  If you are using
  1702.     overlays and have questions, contact technical support for the manufacturer
  1703.     of your overlay compiler or linker.
  1704.  
  1705.     There are a few steps you can make to reduce your executable size.  If you
  1706.     know you are running only on particular display hardware (say, 80x25 text
  1707.     monochrome) then use pc_Mode7, not def_ModeText.  def_ModeText links in
  1708.     several drivers and choose among them at runtime.  Do not use a background
  1709.     window class if you do not need one.  The buffer allocated to store the
  1710.     entire screen is considerable, especially in graphics modes.  If you have
  1711.     many screens, you may wish to use screen files.  The library sfile code
  1712.     linked to your application may exceed what you save in your application
  1713.     code if you have only a few screens, however.  Close screens when you are
  1714.     finished with them and re-create them as necessary to use minimize memory
  1715.     use.
  1716.  
  1717.     We free what we allocate.  If you wish to examine the allocations made by
  1718.     the library you can use alloc_test to list the heap usage.  (See the
  1719.     section called OAKLAND DEBUGGING AID in this document).
  1720.  
  1721.     The most common routines in the library that make allocations are
  1722.     disp_Init, _Open calls, menu_Printf, sed_SetBorder, sed_SetTB, sed_Alloc,
  1723.     sed_InsertRows, running a ted or a sled, pop_ calls, and sfile_ routines.
  1724.  
  1725.     To roughly determine how much memory a sed will occupy, customize and run
  1726.     the following program:
  1727.  
  1728.     #include <stdio.h>
  1729.     #include <cscape.h>
  1730.     #include <sedwinod.h>
  1731.  
  1732.     #define NUMBEROFFIELDS 22 /* change this to the correct number of fields */
  1733.  
  1734.     void main() {
  1735.         printf("%d", sizeof(sed_xd) + sizeof(sedwin_od)
  1736.             + sizeof(struct menu_struct) +
  1737.             (NUMBEROFFIELDS * sizeof(struct field_struct)));
  1738.     }
  1739.  
  1740.     If you need the exact amount of memory used by a particular sed, determine
  1741.     it empirically.  You can do this by linking OAKMEMOK.C into your code and
  1742.     using alloc_test (with its verbosity level set to 2) before and after
  1743.     creating the sed, redirecting output to a file.  Compare the heap dumps and
  1744.     the amounts of memory used by the sed.
  1745.  
  1746.     If you anticipate nearing the limit of available memory, you should
  1747.     allocate a stash at the beginning of your application and free it when you
  1748.     need space to back out of an out-of-memory situation.  In addition, if you
  1749.     want an out-of-memory sed, allocate it at the start of the application and
  1750.     only repaint it as necessary.
  1751.  
  1752.     (DOS users: we do not supply a huge memory model version of the libraries.
  1753.     You can probably compile a huge model library without too much difficulty,
  1754.     but we are not able to support your efforts at this time.  We have a
  1755.     version of C-scape for the Phar Lap DOS|Extender and a version available
  1756.     for Rational Systems' DOS 16/M Extender, which allows you to use more than
  1757.     the standard 640K and compile in 386 protected mode.)
  1758.  
  1759. 18:  A FEW OAKLAND CODE CONVENTIONS
  1760.  
  1761.     The following are some code conventions we use to insure code portability.
  1762.     While not required for DOS and OS/2, we suggest you incorporate such
  1763.     conventions into your C-scape application code for ease of porting to other
  1764.     operating systems.
  1765.  
  1766. 18.1:  OGLOBAL and OEXTERN
  1767.  
  1768.     OGLOBAL is an Oakland storage-class specifier that is used in the
  1769.     definition of global data.  For example, to define a global variable called
  1770.     myint we write:
  1771.  
  1772.         OGLOBAL int myint;
  1773.  
  1774.         /* ... */
  1775.  
  1776.         myint = 5;
  1777.  
  1778.  
  1779.     If this definition occurs in one module and you wish to refer to the global
  1780.     data item in another module, then the other module must contain an external
  1781.     declaration.  For example:
  1782.  
  1783.         OEXTERN int myint;
  1784.  
  1785.         /* ... */
  1786.  
  1787.         if (myint == 5) {
  1788.             /* ... */
  1789.         }
  1790.  
  1791.  
  1792.     C-scape source makes extensive use of the OGLOBAL specifier in the .C files
  1793.     of C-scape and OWL, most notably before the definition of a particular
  1794.     field function's field_funcs_struct.
  1795.  
  1796.     Under most operating systems, DOS and OS/2 included, this OGLOBAL is
  1797.     defined by our headers to expand nothing; OEXTERN, expands to extern.
  1798.     However, the compilers of some operating systems, like VAX/VMS VAX C,
  1799.     require the definition of global data to use the keyword globaldef; and the
  1800.     external declaration, globalref.  Under such systems, the OGLOBAL and
  1801.     OEXTERN macros are defined in our headers to expand appropriately.
  1802.  
  1803. 18.2:  static and OSTATIC
  1804.  
  1805.     static is a C language storage-class specifier used in the definition of
  1806.     data and functions.
  1807.  
  1808.     Some functions we wish to be public so that we can refer to them across
  1809.     modules.  Other functions we wish to be private; known only with in the
  1810.     module in which they are defined.  Private functions are defined as
  1811.     static.  The scope of a static function extends from the point of its
  1812.     definition in the source module to the end of the module.
  1813.  
  1814.     Because of the scope of static functions, we frequently declare the
  1815.     functions at the head of a module so that we may refer to the functions at
  1816.     any point in the source module, regardless of where they are defined.
  1817.  
  1818.     OSTATIC is an Oakland specifier that is used in the declaration of a static
  1819.     function.  Under most operating systems, the OSTATIC macro is defined to
  1820.     expand the static keyword.  The compilers of other systems may not allow
  1821.     the use  of the static keyword in a function declaration (only in its
  1822.     definition).  In this latter instance, OSTATIC expands to nothing.
  1823.  
  1824.     For example:
  1825.  
  1826.         /*
  1827.             ONE MODULE
  1828.         */
  1829.  
  1830.         OSTATIC int my_PrivateFunc(void);
  1831.  
  1832.         int my_PublicFunc(void)
  1833.         {
  1834.             return(my_PrivateFunc());
  1835.         }
  1836.  
  1837.         static int my_PrivateFunc(void)
  1838.         {
  1839.             return(5);
  1840.         }
  1841.  
  1842.  
  1843.         /*
  1844.             ANOTHER MODULE
  1845.         */
  1846.  
  1847.         extern int my_PublicFunc(void);
  1848.  
  1849.         int myint;
  1850.  
  1851.         /* ... */
  1852.  
  1853.         myint = my_PublicFunc();
  1854.  
  1855.  
  1856. 18.3:  FNULL
  1857.  
  1858.     C-scape 3.2 library code now makes a distinction between a data pointer and
  1859.     a function pointer.  If you need to specify a null function pointer you
  1860.     should use FNULL instead of NULL.  Though Microsoft C, Turbo C, and most
  1861.     compilers for DOS, UNIX, and OS/2 don't require this distinction, compilers
  1862.     for other systems may.  You should do this for the sake of code
  1863.     portability.
  1864.  
  1865.     For example, where you used to write:
  1866.  
  1867.          disp_Init(def_ModeText, NULL);
  1868.  
  1869.     you should now write:
  1870.  
  1871.          disp_Init(def_ModeText, FNULL);
  1872.  
  1873.  
  1874.     Other pointers affected by this change include null pointers in references
  1875.     to borders, mouse handlers, user supplied functions, class functions,
  1876.     explode functions, auxiliary functions, special functions, and the
  1877.     component functions of field_funcs.
  1878.  
  1879.     Below is a summary of the functions or structures mentioned in the C-scape
  1880.     3.0 and 3.1 Manual Function References and in the C-scape 3.0 Manual
  1881.     Addendum that are affected by this:
  1882.  
  1883.          Those that deal with borders:
  1884.  
  1885.               - frame_Open
  1886.               - slug_Open
  1887.               - pop_View, _Edit, _Prompt, _Menu, _Message, _Text
  1888.               - the hx_struct or hv_struct that help_Init receives
  1889.  
  1890.          with mouse handlers:
  1891.  
  1892.               - sed_SetMouse
  1893.  
  1894.          user supplied functions:
  1895.  
  1896.               - kb_Idle
  1897.               - the slug_def structure that you pass to slug_Open
  1898.               - the frame_def structure that you pass to frame_Open
  1899.               - ufunc_Open
  1900.  
  1901.          class functions:
  1902.  
  1903.               - disp_Init
  1904.  
  1905.          explode functions:
  1906.  
  1907.               - sed_SetExplode
  1908.  
  1909.          auxiliary functions
  1910.  
  1911.               - sed_SetAux
  1912.  
  1913.          special functions:
  1914.  
  1915.               - sed_SetSpecial
  1916.               - sled_Open
  1917.  
  1918.          field_funcs component functions:
  1919.  
  1920.               - _senter
  1921.               - _sexit
  1922.               - _fenter
  1923.               - _fkey
  1924.               - _fexit
  1925.  
  1926.          In addition, the list of fsyminit_structs necessary for use with
  1927.          screen files is affected by this change.
  1928.  
  1929.          The fsyminit_struct has three members.  The first is a string, the
  1930.          second a function pointer, and the third a data pointer.  The type
  1931.          casts used for the last two members, as discussed in the manual, are
  1932.          (VOID_FPTR) and (VOID *).  Likewise, FNULL and NULL should be used
  1933.          when you wish to initialize these last two members of an
  1934.          fsyminit_struct list entry to a null value.
  1935.  
  1936. 19:  ERROR CODES
  1937.  
  1938.     Error codes and messages are listed at the back of the C-scape Manual
  1939.     Function Reference.
  1940.  
  1941.     Codes you are unable to locate in the manual may be identified by
  1942.     consulting the source files CSERROR.H and OAKERROR.H.
  1943.  
  1944. 20:  OAKLAND GROUP BBS
  1945.  
  1946.     Our BBS supports color ANSI screens.  Here is basic information to use it:
  1947.  
  1948.          BBS Phone Number:        (206) 236-6485
  1949.  
  1950.          Baud Rates               300, 1200 and 2400
  1951.  
  1952.          Line Protocol:           8  data bits
  1953.                                   1  stop bit
  1954.                                   No parity
  1955.  
  1956.          Download Protocols:      ASCII
  1957.                                   KERMIT
  1958.                                   XMODEM
  1959.                                   XMODEM-CRC
  1960.                                   YMODEM
  1961.                                   YMODEM/BATCH
  1962.                                   ZMODEM
  1963.  
  1964.  
  1965.  
  1966.     We encourage all to use the bulletin board as a forum by which to share
  1967.     C-scape ideas, comments and code.  If you have a problem and cannot solve
  1968.     it with the methods described above, call Oakland Group technical support.
  1969.     For more information on technical support, see the pamphlet "Oakland Group
  1970.     Technical Support and Training," which is part of the C-scape package.
  1971.  
  1972. 21:  FORTHCOMING FROM OAKLAND
  1973.  
  1974.     As adjuncts to the C-scape Manual, two additional Oakland publications are
  1975.     mentioned in its Introduction.  Note that The Oakland Advanced Programming
  1976.     Guide and The C-scape Cookbook are both still under development.  The same
  1977.     is true of all references to C-Spot and C-Cell software.  All registered
  1978.     users of C-scape will be automatically notified when each of these items
  1979.     becomes available.
  1980.  
  1981. 22:  UPDATES TO THE MANUAL
  1982.  
  1983.     In addition to this section, please consult the following sections of this
  1984.     document for updates to the manual:
  1985.  
  1986.          NEW FEATURES
  1987.  
  1988.          NEW SLED FUNCTIONS
  1989.  
  1990.          NAMING SEDS
  1991.  
  1992.          THE NEW FEXIT
  1993.  
  1994.          USER-DEFINED SCANCODES
  1995.  
  1996.          NEW BOB FEATURES
  1997.  
  1998.          HIGHLIGHTING FIELD CHARACTERS
  1999.  
  2000. 22.1:  Updates To The 3.1 Manual
  2001.  
  2002.      -   Screen files now require that you include object class functions in
  2003.          the fsyminit_struct symbol table.  If you use seds, sleds and user
  2004.          functions and generated the screen files yourself, then you must add
  2005.          the following entries to your symbol table:
  2006.  
  2007.              { FSYM_CLASS },
  2008.              { "sedwin_Class",   (VOID_FPTR)sedwin_Class,    NULL },
  2009.              { "sledwin_Class,   (VOID_FPTR)sledwin_Class,   NULL }.
  2010.              { "ufunc_Class",    (VOID_FPTR)ufunc_Class,     NULL },
  2011.  
  2012.  
  2013.          Always include the entry of the delimiter "{ FSYM_CLASS }".
  2014.  
  2015.          If you purchased Look & Feel, it will automatically generate the
  2016.          fsyminit_struct symbol table for your screens and include the above
  2017.          classes appropriately.
  2018.  
  2019.      -   hex_funcs do not use a validation string.
  2020.  
  2021.      -   money_funcs and cmoney_funcs require at least 4 writeable positions.
  2022.  
  2023.      -   The use of menu_Printf (on a sed that you have already opened),
  2024.          sed_DeleteRows, sed_InsertRows, sed_DeleteField, sed_MoveField, or
  2025.          sed_SetTB can change the size of a sed's menu.  Borders with scroll
  2026.          lights or a scroll bar that reflect the menu size do not automatically
  2027.          update themselves.  To update the border, send it a scroll message.
  2028.          This does scroll the sed, but rather adjusts the border to the altered
  2029.          menu size.  Use this function:
  2030.  
  2031.               /* note that you give this function the sed as the 1st argument
  2032.               */
  2033.               bord_Do(sed, BDM_SCROLL, NULL, NULL);
  2034.  
  2035.  
  2036. 22.2:  Updates To The 3.0 Manual
  2037.  
  2038.      -   The C-scape Manual Addendum is the principal update to the C-scape 3.0
  2039.          Manual.
  2040.  
  2041.      -   The integer values in the slug and framer menu definition structure
  2042.          should be positive and NON-ZERO (i.e., > 0).
  2043.  
  2044.      -   The border bd_exp no longer exists.  You can get the same results by
  2045.          using:
  2046.  
  2047.              sed_SetBorder(sed, bd_1);
  2048.              sed_SetExplode(sed, exp_std);
  2049.  
  2050.  
  2051.      -   Embedded seds must use spc_Embed to operate properly.
  2052.  
  2053.      -   The inner workings of sleds differ from their description in the
  2054.          manual (section 10.3.1).  Namely, spc_Sled does all the work of
  2055.          maintaining the sled.  The parent sed's field function, sled_funcs,
  2056.          does no sled work.  In fact, sled_funcs has been internally defined to
  2057.          be bob_funcs.  Because of these changes, sleds can also operate
  2058.          without being embedded.  To create an independent sled, after opening
  2059.          the sled with sled_Open, simply call sed_Repaint or sled_Repaint and
  2060.          sled_Go.  Refer to the source file spcsled.c for more information.
  2061.  
  2062.      -   hex_funcs do not use a validation string.
  2063.  
  2064.      -   money_funcs and cmoney_funcs require at least 4 writeable positions.
  2065.  
  2066.      -   Field formatting has a new command, c.  This command removes ALL
  2067.          whitespace from the field's record.
  2068.  
  2069.      -   The valid_String command code prefix {n}, for limiting the validation
  2070.          to the first n characters of the string, is valid for values of 0
  2071.          through 9.  A new command {s}, tells string validation to ignore ALL
  2072.          whitespace when making it's comparisons.  Example:  "{s}Hello" would
  2073.          validate "H e ll o ".
  2074.  
  2075.      -   The sed_Clear function no longer exists.
  2076.  
  2077.      -   The use of menu_Printf (on a sed that you have already opened),
  2078.          sed_DeleteRows, sed_InsertRows, sed_DeleteField, sed_MoveField, or
  2079.          sed_SetTB can change the size of a sed's menu.  Borders with scroll
  2080.          lights or a scroll bar that reflect the menu size do not automatically
  2081.          update themselves.  To update the border, send it a scroll message.
  2082.          This does scroll the sed, but rather adjusts the border to the altered
  2083.          menu size.  Use this function:
  2084.  
  2085.               /* note that you give this function the sed as the 1st argument
  2086.               */
  2087.               bord_Do(sed, BDM_SCROLL, NULL, NULL);
  2088.  
  2089.  
  2090. 22.3:  Updates To The 3.0 Manual Addendum
  2091.  
  2092.      -   Screen files now require that you include object class functions in
  2093.          the fsyminit_struct symbol table.  You must add the following entries
  2094.          to your symbol table:
  2095.  
  2096.              { FSYM_CLASS },
  2097.              { "sedwin_Class",   (VOID_FPTR)sedwin_Class,    NULL },
  2098.              { "sledwin_Class,   (VOID_FPTR)sledwin_Class,   NULL }.
  2099.              { "ufunc_Class",    (VOID_FPTR)ufunc_Class,     NULL },
  2100.  
  2101.  
  2102.          Always include the entry of the delimiter "{ FSYM_CLASS }".  If you
  2103.          are using seds you need the sedwin_Class entry.  If you are using
  2104.          sleds then include the sledwin_Class entry.  If you are using slugs or
  2105.          framers include the ufunc_Class entry.
  2106.  
  2107.          If you purchased Look & Feel, Look & Feel will automatically generate
  2108.          the fsyminit_struct symbol table for your screens and include the
  2109.          above classes as appropriate.
  2110.  
  2111.      -   For code portability you should use FNULL as the second member of a
  2112.          fsyminit_struct, instead of NULL, if you need to specify a null
  2113.          function pointer.  A null third member, the data pointer, may be
  2114.          specified with NULL.  This is to insure compatibility with compilers
  2115.          that differentiate between data and function pointers.
  2116.  
  2117.      -   There is yet another border feature that you can enable with the
  2118.          sed_SetBorderFeature call:  BD_TOP.  Enabling this allows you to bring
  2119.          the window to the foreground by clicking the mouse on the border.
  2120.  
  2121. 23:  ERRATA FOR THE MANUAL
  2122.  
  2123. 23.1:  Errata For The 3.1 Manual
  2124.  
  2125.     The following are mistakes in the C-scape Manual and Function Reference.
  2126.  
  2127.        15    The last line of code on the page should use the attribute 0x70,
  2128.              not 0x07.  It should read:
  2129.  
  2130.                  menu_Printf(menu, "Before:Normal @a[%d] After:Reverse", 0x70);
  2131.  
  2132.  
  2133.        33    In the first sentence of the third paragraph "fields" should be
  2134.              "field":
  2135.  
  2136.                  The actual length of a field can be up to MAX_FIELD_LEN (1000)
  2137.                  characters long.
  2138.  
  2139.  
  2140.        45    At the top of the page the code fragment containing menu_Printf
  2141.              lack some needed quotes.  It should read:
  2142.  
  2143.                  menu_Printf(menu, "@f[%s]\n", NULL, &menu_funcs, p);
  2144.  
  2145.  
  2146.        52    The following should be added to the spc_Tone example:
  2147.  
  2148.                  #include <stdio.h>
  2149.                  #include <cscape.h>
  2150.                  #include <scancode.h>   /*  for F10 definition  */
  2151.  
  2152.  
  2153.        58    The last line of the code for the my_senter function should read:
  2154.  
  2155.                  sed_SetRecord(sed, sed_GetScratchPad(sed), fieldno);
  2156.  
  2157.  
  2158.        59    The last sentence of the third paragraph should omit "open,":
  2159.  
  2160.                  This saves the time it takes to close and reopen the sed.
  2161.  
  2162.  
  2163.        59    In section 5.13, Auxiliary Functions, the next to last sentence of
  2164.              the 2nd paragraph "before... Fenter" is duplicated.  It should
  2165.              read:
  2166.  
  2167.                  ...before each field's fenter functions, and after each field's
  2168.                  fexit function.
  2169.  
  2170.              Not:
  2171.  
  2172.                  ...before each field's fenter functions, and before each
  2173.                  field's fenter function.
  2174.  
  2175.  
  2176.        60    The aux_Standard code fragment has misplaced and missing
  2177.              semicolons. It should read:
  2178.  
  2179.                  int aux_Standard(sed, msg, indata, outdata)
  2180.                      sed_type sed;
  2181.                      int msg;
  2182.                      VOID *indata, *outdata;
  2183.                  {
  2184.                      switch(msg) {
  2185.                      case SED_PRESENTER:
  2186.                          /*  ...  */
  2187.                      }
  2188.                          return(TRUE);
  2189.                  }
  2190.  
  2191.  
  2192.        61    In the code fragment replace "MYMSG" with "MYSG_RESET".  It should
  2193.              read:
  2194.  
  2195.                  sed_DoAux(sed, MYMSG_RESET, NULL, NULL);
  2196.  
  2197.  
  2198.        63    The code example at the top of the page has a line which reads:
  2199.  
  2200.                  sed_MarkField(sed, fldno, reg, sel);
  2201.  
  2202.  
  2203.              The line should be:
  2204.  
  2205.                     sed_MarkField(sed, fldno, sel, sel);
  2206.  
  2207.  
  2208.              Also, "return(TRUE);" should be inserted between the last two
  2209.              closing curly braces.
  2210.  
  2211.        64    The line after this comment:
  2212.  
  2213.                  /* set value of field 1 (an integer, note cast) */
  2214.  
  2215.  
  2216.              should read:
  2217.  
  2218.                  *( (int *) sed_GetVar(sed, 1) ) = 22;
  2219.  
  2220.  
  2221.        66    sed_UnProtectField should be included in the see ref in the third
  2222.              sentence:
  2223.  
  2224.                  See sed_ProtectField, sed_IsProtectedField, and
  2225.                  sed_UnProtectField.
  2226.  
  2227.  
  2228.       158    The spc_Embed has a null case BOB_UP that falls thru to the UP
  2229.              case; BOB_DOWN falls thru to DOWN.  The cases for LEFT and RIGHT
  2230.              should be cases for SHFT_TAB and TAB, respectively.  Also the null
  2231.              cases BOB_LEFT and BOB_RIGHT fall thru to SHFT_TAB and TAB,
  2232.              respectively.  See the SPCEMBED.C source file in the C-scape
  2233.              library.
  2234.  
  2235.       160    The bob_fkey code given in the manual differs from the current
  2236.              implementation.  Please refer to the C-scape library source file
  2237.              FNBOB.C, instead.
  2238.  
  2239.       162    The first sentence beneath the diagram should read:
  2240.  
  2241.                  If you passed sed three to sed_GetAncestor it would return sed
  2242.                  two.
  2243.  
  2244.  
  2245.       176    The return statement of MyTed_fexit should be:
  2246.  
  2247.                  return(std_fexit(sed));
  2248.  
  2249.  
  2250.       180    The reference in the example MyTed_sexit to ted_RewindTB should be
  2251.              a reference to sed_RewindTB.
  2252.  
  2253.   184-185    The example code MyTed_fkey requires
  2254.  
  2255.                  #include <ctype.h>
  2256.  
  2257.  
  2258.              for the call to isprint in the default case of the switch
  2259.              statement.
  2260.  
  2261.       190    The return statement of MyTed_fexit should be:
  2262.  
  2263.                  return(std_fexit(sed));
  2264.  
  2265.  
  2266.       235    bd_bar does not support a title.
  2267.  
  2268.       244    In the last sentence on the page the reference to paragraph 1
  2269.              should be to paragraph 2.
  2270.  
  2271.      A-17    disp_GetMapEntry is described incorrectly.  It should read:
  2272.  
  2273.                  SYNOPSIS
  2274.  
  2275.                  VOID disp_GetMapEntry(index, bg, fg);
  2276.  
  2277.                  byte index;         /* index into the attribute map */
  2278.                  opixval *bg;            /* pointer to background color */
  2279.                  opixval *fg;            /* pointer to foreground color */
  2280.  
  2281.                  EXAMPLE
  2282.  
  2283.                  opixval fore, back;
  2284.  
  2285.                  disp_GetMapEntry(0x07, &back, &fore);
  2286.  
  2287.  
  2288.      A-21    The cmwin_Class description mentions "disp_Open", it should mention
  2289.              "disp_Init".
  2290.  
  2291.      A-24    The arguments for disp_SetMapEntry are:
  2292.  
  2293.                  byte index;
  2294.                  opixval back;
  2295.                  opixval fore;
  2296.  
  2297.  
  2298.      A-67    The line
  2299.  
  2300.                  sed_SetPosition(sed, disp_GetHeight() - 1, 0);
  2301.  
  2302.              should be
  2303.  
  2304.                  sed_SetPosition(timesed, disp_GetHeight() - 1, 0);
  2305.  
  2306.  
  2307.      A-79    In the table of menu_Printf commands the @ quote is used not
  2308.              only to quote "@", but "#" and "]".
  2309.  
  2310.                  @@, @#, @]
  2311.  
  2312.  
  2313.    A-89 -    You need to #include <pcmode.h> when using any of the pc_
  2314.      A-92    functions.
  2315.  
  2316.     A-101    pop_Text automatically paints the popup to the display. You do not
  2317.              have to explicitly call sed_Repaint.
  2318.  
  2319.     A-279    The example for sed_UnMarkField should include a call to
  2320.              sed_UpdateField(sed, 2) after the call to sed_MarkField.
  2321.  
  2322.     A-297    The synopsis to sled_SetColVar is missing the beginning line:
  2323.  
  2324.                  #include <sled.h>
  2325.  
  2326.  
  2327.   A-375 -    In all the examples for Tm_ functions any struct Tm call argument
  2328.     A-388    should be passed by reference, not value.
  2329.  
  2330.     A-377    In the example for tm_Adjust the call argument "date" should be
  2331.              "&date".
  2332.  
  2333.     A-380    The function name in the synopsis should be tm_DayOfWeek, not
  2334.              tm_FirstDay.
  2335.  
  2336.     A-396    The synopsis should read:
  2337.  
  2338.                  valid_String(string, vstr)
  2339.  
  2340.  
  2341.              not
  2342.  
  2343.                   valid_String(num, vstr)
  2344.  
  2345.  
  2346.       B-5    The variable type of bob_funcs is VOID.
  2347.  
  2348.      B-10    date_funcs require the inclusion of the your compiler's TIME.H
  2349.              file.
  2350.  
  2351.      B-15    The variable type of framer_funcs is VOID.  The VARSIZE member is
  2352.              missing from the field_funcs structure given in the Function
  2353.              Reference.  It is should be included as the last member of the
  2354.              structure and be 0.
  2355.  
  2356.      B-16    The variable type of gmenu_funcs is VOID.
  2357.  
  2358.      B-17    hex_funcs does not support validation.
  2359.  
  2360.      B-22    The variable type of menu_funcs is VOID.
  2361.  
  2362.      B-33    There are no sled_funcs.
  2363.  
  2364.      B-35    The variable type of slug_funcs is VOID.
  2365.  
  2366.      B-39    time_funcs require the inclusion of the your compiler's TIME.H
  2367.              file.
  2368.  
  2369. 23.2:  Errata For The 3.0 Manual
  2370.  
  2371.     The following are mistakes in the C-scape Manual and Function Reference.
  2372.  
  2373.         3    The current release does not include an ANSI terminal driver.
  2374.  
  2375.        15    The first line of code at the top of the page should use the
  2376.              attribute 0x70, not 0x07.  It should read:
  2377.  
  2378.                  menu_Printf(menu, "Before:Normal @a[%d] After:Reverse", 0x70);
  2379.  
  2380.  
  2381.        30    In the first sentence of the third paragraph "fields" should be
  2382.              "field":
  2383.  
  2384.                  The actual length of a field can be up to MAX_FIELD_LEN (1000)
  2385.                  characters long.
  2386.  
  2387.  
  2388.        40    At the top of the page the code fragment containing menu_Printf
  2389.              lack some needed quotes.  It should read:
  2390.  
  2391.                  menu_Printf(menu, "@f[%s]\n", NULL, &menu_funcs, p);
  2392.  
  2393.  
  2394.        47    The following should be added to the spc_Tone example:
  2395.  
  2396.                  #include <stdio.h>
  2397.                  #include <cscape.h>
  2398.                  #include <scancode.h>   /*  for F10 definition  */
  2399.  
  2400.  
  2401.        51    The last line of the code for the my_senter function should read:
  2402.  
  2403.                  sed_SetRecord(sed, sed_GetScratchPad(sed), fieldno);
  2404.  
  2405.  
  2406.        52    The last sentence of the third paragraph should omit "open,":
  2407.  
  2408.                  This saves the time it takes to close and reopen the sed.
  2409.  
  2410.  
  2411.        54    sed_UnProtectField should be included in the see ref in the third
  2412.              sentence:
  2413.  
  2414.                  See sed_ProtectField, sed_IsProtectedField, and
  2415.                  sed_UnProtectField.
  2416.  
  2417.  
  2418.        90    spc_Embed should refer to section 10.1.1.
  2419.  
  2420.       116    (5) the integer value used in the slug definition structure should
  2421.              be a positive, NON-ZERO value.
  2422.  
  2423.       117    The type cast in the call to slug_Go should be a (VOID *), not a
  2424.              (char *).
  2425.  
  2426.       117    The data type of sdata in the example user function should be (VOID
  2427.              *), not (char *).
  2428.  
  2429.       118    (3) the integer value used in the frame definition structure should
  2430.              be a positive, NON-ZERO value.
  2431.  
  2432.       127    The spc_Embed has a null case BOB_UP that falls thru to the UP
  2433.              case; BOB_DOWN falls thru to DOWN.  The cases for LEFT and RIGHT
  2434.              should be cases for SHFT_TAB and TAB, respectively.  Also the null
  2435.              cases BOB_LEFT and BOB_RIGHT fall thru to SHFT_TAB and TAB,
  2436.              respectively.  See the SPCEMBED.C source file in the C-scape
  2437.              library.
  2438.  
  2439.       128    spc_Embed uses TABs not arrows.
  2440.  
  2441.   128-129    The bob_fkey code given in the manual differs from the current
  2442.              implementation.  Please refer to the C-scape library source file
  2443.              FNBOB.C, instead.
  2444.  
  2445.   142-143    In the example code pertaining to creating a sed with a ted field
  2446.              there should be a call to explicitly set the sed size (to ensure
  2447.              that the ted area is non-zero).  Use sed_SetHeight(sed) and
  2448.              sed_SetWidth(sed) before the sed_Repaint(sed) call;
  2449.  
  2450.       144    The return statement of MyTed_fexit should be:
  2451.  
  2452.                  return(std_fexit(sed));
  2453.  
  2454.  
  2455.       147    The reference in the example MyTed_sexit to ted_RewindTB should be
  2456.              a reference to sed_RewindTB.
  2457.  
  2458.   151-152    The example code MyTed_fkey requires
  2459.  
  2460.                  #include <ctype.h>
  2461.  
  2462.  
  2463.              for the call to isprint in the default case of the switch
  2464.              statement.
  2465.  
  2466.       156    The return statement of MyTed_fexit should be:
  2467.  
  2468.                  return(std_fexit(sed));
  2469.  
  2470.  
  2471.       157    The example should read:
  2472.  
  2473.                  case DEL:
  2474.                      if (ted_GetMark(sed) == TED_NOMARK) {
  2475.                          /* Delete the marked region (if there is one) */
  2476.                          ted_BlockDelete(sed);
  2477.                      }
  2478.                      else {
  2479.                          /* Delete a character */
  2480.                          ted_DeleteChar(sed);
  2481.                      }
  2482.                      break;
  2483.  
  2484.  
  2485.       159    The example should read:
  2486.  
  2487.                  case ALT_S:
  2488.                      /* ... */
  2489.                          if (ted_Search(sed, search, TED_FORWARD |
  2490.                  TED_AFTER)) {
  2491.                          sed_BorderPrompt(sed, FNULL);
  2492.                      }
  2493.  
  2494.  
  2495.       168    bd_bar does not support a title.
  2496.  
  2497.      A-15    disp_GetMapEntry is described incorrectly.  It should read:
  2498.  
  2499.                  SYNOPSIS
  2500.  
  2501.                  VOID disp_GetMapEntry(index, bg, fg);
  2502.  
  2503.                  byte index;         /* index into the attribute map */
  2504.                  opixval *bg;            /* pointer to background color */
  2505.                  opixval *fg;            /* pointer to foreground color */
  2506.  
  2507.                  EXAMPLE
  2508.  
  2509.                  opixval fore, back;
  2510.  
  2511.                  disp_GetMapEntry(0x07, &back, &fore);
  2512.  
  2513.  
  2514.      A-19    The cmwin_Class description mentions "disp_Open", it should mention
  2515.              "disp_Init".
  2516.  
  2517.      A-21    The arguments for disp_SetMapEntry are:
  2518.  
  2519.                  byte index;
  2520.                  opixval back;
  2521.                  opixval fore;
  2522.  
  2523.  
  2524.      A-63    The line
  2525.  
  2526.                  sed_SetPosition(sed, disp_GetHeight() - 1, 0);
  2527.  
  2528.              should be
  2529.  
  2530.                  sed_SetPosition(timesed, disp_GetHeight() - 1, 0);
  2531.  
  2532.  
  2533.      A-75    In the table of menu_Printf commands the @ quote is used not
  2534.              only to quote "@", but "#" and "]".
  2535.  
  2536.                  @@, @#, @]
  2537.  
  2538.  
  2539.    A-85 -    You need to #include <pcmode.h> when using any of the pc_
  2540.      A-88    functions.
  2541.  
  2542.      A-97    pop_Text automatically paints the popup to the display. You do not
  2543.              have to explicitly call sed_Repaint.
  2544.  
  2545.     A-103    sed_Clear no longer exists.
  2546.  
  2547.     A-263    The example for sed_MarkField should include a call to
  2548.              sed_UpdateField(sed, 2) after the call to sed_MarkField.
  2549.  
  2550.     A-297    The synopsis to sled_SetColVar is missing the beginning line:
  2551.  
  2552.                  #include <sled.h>
  2553.  
  2554.  
  2555.   A-355 -    In all the examples for Tm_ functions any struct Tm call argument
  2556.     A-368    should be passed by reference, not value.
  2557.  
  2558.     A-360    The function name in the synopsis should be tm_DayOfWeek, not
  2559.              tm_FirstDay.
  2560.  
  2561.     A-376    The synopsis should read:
  2562.  
  2563.                  valid_String(string, vstr)
  2564.  
  2565.              not
  2566.  
  2567.                  valid_String(num, vstr)
  2568.  
  2569.  
  2570.       B-5    The variable type of bob_funcs is VOID.
  2571.  
  2572.      B-11    date_funcs require the inclusion of the your compiler's TIME.H
  2573.              file.
  2574.  
  2575.      B-15    The variable type of framer_funcs is VOID.  The VARSIZE member is
  2576.              missing from the field_funcs structure given in the Function
  2577.              Reference.  It is should be included as the last member of the
  2578.              structure and be 0.
  2579.  
  2580.      B-16    The variable type of gmenu_funcs is VOID.
  2581.  
  2582.      B-17    hex_funcs does not support validation.
  2583.  
  2584.      B-22    The variable type of menu_funcs is VOID.
  2585.  
  2586.      B-33    There are no sled_funcs.
  2587.  
  2588.      B-35    The variable type of slug_funcs is VOID.
  2589.  
  2590.      B-39    time_funcs require the inclusion of the your compiler's TIME.H
  2591.              file.
  2592.  
  2593. 23.3:  Errata For The 3.0 Manual Addendum
  2594.  
  2595.         3    In section 5.13, Auxiliary Functions, the next to last sentence of
  2596.              the 2nd paragraph "before... Fenter" is duplicated.  It should
  2597.              read:
  2598.  
  2599.                  ...before each field's fenter functions, and after each field's
  2600.                  fexit function.
  2601.  
  2602.              Not:
  2603.  
  2604.                  ...before each field's fenter functions, and before each
  2605.                  field's fenter function.
  2606.  
  2607.  
  2608.         7    The code example at the top of the page has a line which reads:
  2609.  
  2610.                  sed_MarkField(sed, fldno, reg, sel);
  2611.  
  2612.              The line should be:
  2613.  
  2614.                  sed_MarkField(sed, fldno, sel, sel);
  2615.  
  2616.